Révision 1001
tmp/org.txm.links.rcp/src/org/txm/links/rcp/handlers/SendSelectionToQueryable.java (revision 1001) | ||
---|---|---|
29 | 29 |
|
30 | 30 |
import org.eclipse.core.commands.ExecutionEvent; |
31 | 31 |
import org.eclipse.core.commands.ExecutionException; |
32 |
import org.eclipse.jface.viewers.ISelection; |
|
32 | 33 |
import org.eclipse.jface.viewers.IStructuredSelection; |
33 | 34 |
import org.eclipse.ui.handlers.HandlerUtil; |
34 | 35 |
import org.txm.core.preferences.TXMPreferences; |
... | ... | |
49 | 50 |
|
50 | 51 |
/** |
51 | 52 |
* Creates the query. |
52 |
* @param selection
|
|
53 |
* @param isel
|
|
53 | 54 |
* @return |
54 | 55 |
*/ |
55 |
public abstract String createQuery(ExecutionEvent event, IStructuredSelection selection);
|
|
56 |
public abstract String createQuery(ExecutionEvent event, ISelection isel);
|
|
56 | 57 |
|
57 | 58 |
/** |
58 | 59 |
* Creates the queries. |
... | ... | |
60 | 61 |
* @param selection |
61 | 62 |
* @return |
62 | 63 |
*/ |
63 |
public String createQueries(ExecutionEvent event, IStructuredSelection selection) {
|
|
64 |
public String createQueries(ExecutionEvent event, ISelection selection) { |
|
64 | 65 |
return this.createQuery(event, selection); |
65 | 66 |
} |
66 | 67 |
|
67 | 68 |
@Override |
68 | 69 |
public Object execute(ExecutionEvent event) throws ExecutionException { |
69 | 70 |
|
70 |
IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event); |
|
71 |
if (selection != null) { |
|
71 |
ISelection isel = HandlerUtil.getCurrentSelection(event); |
|
72 |
|
|
73 |
// IStructuredSelection selection = (IStructuredSelection) isel; |
|
74 |
// if (selection != null) { |
|
72 | 75 |
|
73 |
String query = this.createQuery(event, selection);
|
|
76 |
String query = this.createQuery(event, isel);
|
|
74 | 77 |
String queries = null; |
75 | 78 |
if (query == null) { |
76 |
queries = this.createQueries(event, selection);
|
|
79 |
queries = this.createQueries(event, isel);
|
|
77 | 80 |
} |
78 | 81 |
|
79 | 82 |
if(query.isEmpty() && queries.isEmpty()) { |
... | ... | |
89 | 92 |
|
90 | 93 |
BaseAbstractHandler.executeSendToCommand(event.getCommand().getId(), uuid); |
91 | 94 |
|
92 |
} |
|
93 |
else { |
|
94 |
this.logCanNotCompute(selection); |
|
95 |
} |
|
95 |
// }
|
|
96 |
// else {
|
|
97 |
// this.logCanNotCompute(selection);
|
|
98 |
// }
|
|
96 | 99 |
return null; |
97 | 100 |
} |
98 | 101 |
|
tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/handlers/SendProgressionTo.java (revision 1001) | ||
---|---|---|
28 | 28 |
package org.txm.progression.rcp.handlers; |
29 | 29 |
|
30 | 30 |
import org.eclipse.core.commands.ExecutionEvent; |
31 |
import org.eclipse.jface.viewers.ISelection; |
|
31 | 32 |
import org.eclipse.jface.viewers.IStructuredSelection; |
33 |
import org.eclipse.jface.viewers.StructuredSelection; |
|
32 | 34 |
import org.txm.links.rcp.handlers.SendSelectionToQueryable; |
33 | 35 |
import org.txm.progression.core.chartsengine.base.ProgressionChartCreator; |
34 | 36 |
import org.txm.progression.core.functions.Progression; |
... | ... | |
43 | 45 |
|
44 | 46 |
|
45 | 47 |
@Override |
46 |
public String createQuery(ExecutionEvent event, IStructuredSelection selection) { |
|
47 |
String query; |
|
48 |
Progression progression = (Progression) this.getActiveEditorResult(event); |
|
49 |
// gets the progression queries from the current selected chart series |
|
50 |
query = progression.getQueriesString(((ProgressionChartCreator)progression.getChartCreator()).getSelectedSeries(progression.getChart())); |
|
48 |
public String createQuery(ExecutionEvent event, ISelection selection) { |
|
49 |
|
|
50 |
String query = null; |
|
51 |
if (selection instanceof StructuredSelection) { |
|
52 |
StructuredSelection sselection = (StructuredSelection)selection; |
|
53 |
Progression progression = (Progression) this.getActiveEditorResult(event); |
|
54 |
// gets the progression queries from the current selected chart series |
|
55 |
query = progression.getQueriesString(((ProgressionChartCreator)progression.getChartCreator()).getSelectedSeries(progression.getChart())); |
|
56 |
} |
|
51 | 57 |
return query; |
52 | 58 |
} |
53 | 59 |
|
tmp/org.txm.analec.rcp/build.properties (revision 1001) | ||
---|---|---|
1 |
#Fri Jul 06 10:25:02 CEST 2018 |
|
2 |
bin.includes=META-INF/,.,plugin.xml,icons/,src/org/txm/macro/,OSGI-INF/l10n/bundle.properties |
|
3 |
output..=bin/ |
|
4 |
source..=src/ |
|
1 |
bin.includes = META-INF/,\ |
|
2 |
.,\ |
|
3 |
OSGI-INF/,\ |
|
4 |
plugin.xml,\ |
|
5 |
icons/,\ |
|
6 |
libs/ |
|
7 |
qualifier=svn |
|
8 |
output..=bin/ |
|
9 |
jars.compile.order = . |
|
10 |
source.. = src/ |
tmp/org.txm.referencer.rcp/src/org/txm/referencer/rcp/handlers/SendReferencerTo.java (revision 1001) | ||
---|---|---|
28 | 28 |
package org.txm.referencer.rcp.handlers; |
29 | 29 |
|
30 | 30 |
import org.eclipse.core.commands.ExecutionEvent; |
31 |
import org.eclipse.jface.viewers.ISelection; |
|
31 | 32 |
import org.eclipse.jface.viewers.IStructuredSelection; |
33 |
import org.eclipse.jface.viewers.StructuredSelection; |
|
32 | 34 |
import org.txm.links.rcp.handlers.SendSelectionToQueryable; |
33 | 35 |
import org.txm.referencer.core.functions.Referencer; |
34 | 36 |
|
... | ... | |
42 | 44 |
|
43 | 45 |
|
44 | 46 |
@Override |
45 |
public String createQuery(ExecutionEvent event, IStructuredSelection selection) { |
|
46 |
return ((Referencer) this.getActiveEditorResult(event)).createQuery(selection.toList()); |
|
47 |
public String createQuery(ExecutionEvent event, ISelection selection) { |
|
48 |
if (selection instanceof StructuredSelection) { |
|
49 |
StructuredSelection sselection = (StructuredSelection)selection; |
|
50 |
return ((Referencer) this.getActiveEditorResult(event)).createQuery(sselection.toList()); |
|
51 |
} |
|
52 |
return null; |
|
47 | 53 |
} |
48 | 54 |
|
49 | 55 |
|
tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/SendEditionTo.java (revision 1001) | ||
---|---|---|
28 | 28 |
package org.txm.edition.rcp.handlers; |
29 | 29 |
|
30 | 30 |
import org.eclipse.core.commands.ExecutionEvent; |
31 |
import org.eclipse.jface.viewers.IStructuredSelection;
|
|
31 |
import org.eclipse.jface.viewers.ISelection; |
|
32 | 32 |
import org.txm.core.results.TXMResult; |
33 | 33 |
import org.txm.links.rcp.handlers.SendSelectionToQueryable; |
34 | 34 |
import org.txm.rcp.editors.IEditionEditor; |
... | ... | |
44 | 44 |
public class SendEditionTo extends SendSelectionToQueryable { |
45 | 45 |
|
46 | 46 |
@Override |
47 |
public String createQuery(ExecutionEvent event, IStructuredSelection selection) { |
|
47 |
public String createQuery(ExecutionEvent event, ISelection selection) { |
|
48 |
|
|
48 | 49 |
IEditionEditor editor = (IEditionEditor) this.getActiveEditor(event); |
49 | 50 |
String query = ((IEditionEditor)editor).getTextSelection(); |
50 | 51 |
query = query.replaceAll("\n", "").trim(); |
tmp/org.txm.internalview.rcp/src/org/txm/internalview/rcp/handlers/SendInternalViewTo.java (revision 1001) | ||
---|---|---|
28 | 28 |
package org.txm.internalview.rcp.handlers; |
29 | 29 |
|
30 | 30 |
import org.eclipse.core.commands.ExecutionEvent; |
31 |
import org.eclipse.jface.viewers.ISelection; |
|
31 | 32 |
import org.eclipse.jface.viewers.IStructuredSelection; |
33 |
import org.eclipse.jface.viewers.StructuredSelection; |
|
32 | 34 |
import org.eclipse.ui.handlers.HandlerUtil; |
33 | 35 |
import org.txm.internalview.rcp.editors.InternalViewEditor; |
34 | 36 |
import org.txm.links.rcp.handlers.SendSelectionToQueryable; |
... | ... | |
43 | 45 |
|
44 | 46 |
|
45 | 47 |
@Override |
46 |
public String createQuery(ExecutionEvent event, IStructuredSelection selection) { |
|
47 |
return ((InternalViewEditor) HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getActivePart()).createQuery(); |
|
48 |
public String createQuery(ExecutionEvent event, ISelection selection) { |
|
49 |
if (selection instanceof StructuredSelection) { |
|
50 |
StructuredSelection sselection = (StructuredSelection)selection; |
|
51 |
return ((InternalViewEditor) HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getActivePart()).createQuery(); |
|
52 |
} |
|
53 |
return null; |
|
48 | 54 |
} |
49 | 55 |
|
50 | 56 |
|
tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendIndexTo.java (revision 1001) | ||
---|---|---|
28 | 28 |
package org.txm.index.rcp.handlers; |
29 | 29 |
|
30 | 30 |
import org.eclipse.core.commands.ExecutionEvent; |
31 |
import org.eclipse.jface.viewers.ISelection; |
|
31 | 32 |
import org.eclipse.jface.viewers.IStructuredSelection; |
33 |
import org.eclipse.jface.viewers.StructuredSelection; |
|
32 | 34 |
import org.eclipse.ui.handlers.HandlerUtil; |
33 | 35 |
import org.txm.core.results.TXMResult; |
34 | 36 |
import org.txm.index.core.functions.Index; |
... | ... | |
47 | 49 |
|
48 | 50 |
|
49 | 51 |
@Override |
50 |
public String createQuery(ExecutionEvent event, IStructuredSelection selection) { |
|
51 |
return Index.createQuery(selection.toList()); |
|
52 |
public String createQuery(ExecutionEvent event, ISelection selection) { |
|
53 |
if (selection instanceof StructuredSelection) { |
|
54 |
StructuredSelection sselection = (StructuredSelection)selection; |
|
55 |
return Index.createQuery(sselection.toList()); |
|
56 |
} |
|
57 |
return null; |
|
52 | 58 |
} |
53 | 59 |
|
54 | 60 |
@Override |
55 |
public String createQueries(ExecutionEvent event, IStructuredSelection selection) { |
|
56 |
return Query.queriesToString(Index.createQueries(selection.toList())); |
|
61 |
public String createQueries(ExecutionEvent event, ISelection selection) { |
|
62 |
if (selection instanceof StructuredSelection) { |
|
63 |
StructuredSelection sselection = (StructuredSelection)selection; |
|
64 |
return Query.queriesToString(Index.createQueries(sselection.toList())); |
|
65 |
} |
|
66 |
return null; |
|
57 | 67 |
} |
58 | 68 |
|
59 |
|
|
60 | 69 |
|
70 |
|
|
61 | 71 |
@Override |
62 | 72 |
public TXMResult getResultParent(ExecutionEvent event) { |
63 | 73 |
TXMEditor editor = (TXMEditor) HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getActivePart(); |
tmp/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/commands/RecodeCorpus.java (revision 1001) | ||
---|---|---|
113 | 113 |
params.getKeyValueParameters().put(ImportKeys.UPDATECORPUS, "true"); |
114 | 114 |
|
115 | 115 |
monitor.setTaskName("Updating corpus"); |
116 |
File scriptDir = new File(txmhome, "scripts/import");
|
|
116 |
File scriptDir = new File(txmhome, "scripts/groovy/user/org/txm/scripts/importer/xtz");
|
|
117 | 117 |
File script = new File(scriptDir, "xtzLoader.groovy"); |
118 | 118 |
System.out.println("Updating corpus "+corpus+" using "+params.paramFile); |
119 | 119 |
JobHandler ret = ExecuteImportScript.executeScript(script.getAbsolutePath(), params); |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/UpdateCorpus.java (revision 1001) | ||
---|---|---|
49 | 49 |
params.getKeyValueParameters().put(ImportKeys.DEBUG, Log.getLevel().intValue() < Level.WARNING.intValue()); // need debug for experimental stuff |
50 | 50 |
params.getKeyValueParameters().put(ImportKeys.UPDATECORPUS, "true"); |
51 | 51 |
|
52 |
File scriptDir = new File(txmhome, "scripts/import");
|
|
52 |
File scriptDir = new File(txmhome, "scripts/groovy/user/org/txm/scripts/importer/xtz");
|
|
53 | 53 |
File script = new File(scriptDir, "xtzLoader.groovy"); |
54 | 54 |
System.out.println("Updating corpus "+corpus+" using "+params.paramFile); |
55 | 55 |
JobHandler ret = ExecuteImportScript.executeScript(script.getAbsolutePath(), params); |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java (revision 1001) | ||
---|---|---|
383 | 383 |
protected void notifyExtensions(final String step) { |
384 | 384 |
if (!step.startsWith("notify")) return; //$NON-NLS-1$ |
385 | 385 |
|
386 |
ArrayList<TXMEditorExtension<T>> errors = new ArrayList<TXMEditorExtension<T>>(); |
|
386 | 387 |
for (final TXMEditorExtension<T> ext : extensions) { |
387 | 388 |
// ISafeRunnable runnable = new ISafeRunnable() { |
388 | 389 |
// @Override |
... | ... | |
400 | 401 |
} else { |
401 | 402 |
ext.notify(step); |
402 | 403 |
} |
403 |
} catch(Exception e) { |
|
404 |
} catch(Throwable e) { |
|
405 |
errors.add(ext); |
|
404 | 406 |
e.printStackTrace(); |
405 | 407 |
} |
406 | 408 |
// } |
407 | 409 |
// }; |
408 | 410 |
// SafeRunner.run(runnable); |
409 | 411 |
} |
412 |
extensions.removeAll(errors); |
|
410 | 413 |
} |
411 | 414 |
|
412 | 415 |
/** |
tmp/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/handlers/SendCooccurrenceTo.java (revision 1001) | ||
---|---|---|
28 | 28 |
package org.txm.cooccurrence.rcp.handlers; |
29 | 29 |
|
30 | 30 |
import org.eclipse.core.commands.ExecutionEvent; |
31 |
import org.eclipse.jface.viewers.ISelection; |
|
31 | 32 |
import org.eclipse.jface.viewers.IStructuredSelection; |
33 |
import org.eclipse.jface.viewers.StructuredSelection; |
|
32 | 34 |
import org.txm.cooccurrence.core.functions.Cooccurrence; |
33 | 35 |
import org.txm.links.rcp.handlers.SendSelectionToQueryable; |
34 | 36 |
|
... | ... | |
40 | 42 |
*/ |
41 | 43 |
public class SendCooccurrenceTo extends SendSelectionToQueryable { |
42 | 44 |
|
43 |
|
|
44 | 45 |
@Override |
45 |
public String createQuery(ExecutionEvent event, IStructuredSelection selection) { |
|
46 |
return ((Cooccurrence) this.getActiveEditorResult(event)).createQuery(selection.toList()); |
|
46 |
public String createQuery(ExecutionEvent event, ISelection selection) { |
|
47 |
if (selection instanceof StructuredSelection) { |
|
48 |
StructuredSelection sselection = (StructuredSelection)selection; |
|
49 |
return ((Cooccurrence) this.getActiveEditorResult(event)).createQuery(sselection.toList()); |
|
50 |
} |
|
51 |
return null; |
|
47 | 52 |
} |
48 |
|
|
49 |
|
|
50 |
|
|
51 | 53 |
} |
tmp/org.txm.tigersearch.rcp/groovy/org/txm/scripts/importer/tigersearch/TSImport.groovy (revision 1001) | ||
---|---|---|
94 | 94 |
File tigerDir = new File(binaryDirectory, "tiger"); |
95 | 95 |
tigerDir.mkdir(); |
96 | 96 |
|
97 |
|
|
98 | 97 |
File logprop = new File(tigerDir, "tigersearch.logprop"); |
99 | 98 |
|
100 | 99 |
logprop.withWriter("UTF-8") { writer -> |
Formats disponibles : Unified diff