Révision 260
tmp/org.txm.chartsengine.raster.rcp/META-INF/MANIFEST.MF (revision 260) | ||
---|---|---|
1 | 1 |
Manifest-Version: 1.0 |
2 | 2 |
Bundle-ManifestVersion: 2 |
3 |
Bundle-Name: Raster Image Charts Engine Editors
|
|
3 |
Bundle-Name: Raster Image Charts Engine RCP
|
|
4 | 4 |
Bundle-SymbolicName: org.txm.chartsengine.raster.rcp;singleton:=true |
5 | 5 |
Bundle-Version: 1.0.0.qualifier |
6 | 6 |
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 |
7 | 7 |
Require-Bundle: org.txm.core, |
8 | 8 |
org.txm.chartsengine.rcp;bundle-version="1.0.0";visibility:=reexport, |
9 | 9 |
org.txm.rcp;bundle-version="0.7.8" |
10 |
Bundle-Vendor: TXM
|
|
10 |
Bundle-Vendor: Textometrie.org
|
|
11 | 11 |
Export-Package: org.txm.chartsengine.raster.rcp, |
12 | 12 |
org.txm.chartsengine.raster.rcp.swt |
tmp/org.txm.chartsengine.rcp/plugin.xml (revision 260) | ||
---|---|---|
16 | 16 |
point="org.eclipse.ui.bindings"> |
17 | 17 |
<key |
18 | 18 |
commandId="ResetChartView" |
19 |
contextId="org.eclipse.ui.contexts.window"
|
|
19 |
contextId="org.txm.chartsengine.rcp.editors.ChartEditorPart"
|
|
20 | 20 |
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" |
21 | 21 |
sequence="M1+R"> |
22 | 22 |
</key> |
23 | 23 |
<key |
24 | 24 |
commandId="ExportChartEditorView" |
25 |
contextId="org.eclipse.ui.contexts.window"
|
|
25 |
contextId="org.txm.chartsengine.rcp.editors.ChartEditorPart"
|
|
26 | 26 |
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" |
27 | 27 |
sequence="M1+E"> |
28 | 28 |
</key> |
29 | 29 |
<key |
30 | 30 |
commandId="CopyChartViewToClipboard" |
31 |
contextId="org.eclipse.ui.contexts.window"
|
|
31 |
contextId="org.txm.chartsengine.rcp.editors.ChartEditorPart"
|
|
32 | 32 |
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" |
33 | 33 |
sequence="M1+C"> |
34 | 34 |
</key> |
... | ... | |
181 | 181 |
</with> |
182 | 182 |
</definition> |
183 | 183 |
</extension> |
184 |
<extension |
|
185 |
point="org.eclipse.ui.contexts"> |
|
186 |
<context |
|
187 |
id="org.txm.chartsengine.rcp.editors.ChartEditorPart" |
|
188 |
name="Chart editor context"> |
|
189 |
</context> |
|
190 |
</extension> |
|
184 | 191 |
|
185 | 192 |
</plugin> |
tmp/org.txm.chartsengine.rcp/META-INF/MANIFEST.MF (revision 260) | ||
---|---|---|
1 | 1 |
Manifest-Version: 1.0 |
2 | 2 |
Bundle-ManifestVersion: 2 |
3 |
Bundle-Name: Charts Engine Editors Core
|
|
3 |
Bundle-Name: Charts Engine RCP Core
|
|
4 | 4 |
Bundle-SymbolicName: org.txm.chartsengine.rcp;singleton:=true |
5 | 5 |
Bundle-Version: 1.0.0.qualifier |
6 | 6 |
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 |
... | ... | |
19 | 19 |
org.txm.chartsengine.rcp.messages, |
20 | 20 |
org.txm.chartsengine.rcp.preferences, |
21 | 21 |
org.txm.chartsengine.rcp.swt |
22 |
Bundle-Vendor: TXM |
|
22 |
Bundle-Vendor: Textometrie.org |
tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/messages/SWTComponentsProviderMessages.java (revision 260) | ||
---|---|---|
1 | 1 |
package org.txm.chartsengine.rcp.messages; |
2 | 2 |
|
3 | 3 |
import org.eclipse.osgi.util.NLS; |
4 |
import org.txm.core.messages.TXMCoreMessages;
|
|
4 |
import org.txm.utils.messages.Utf8NLS;
|
|
5 | 5 |
|
6 | 6 |
public class SWTComponentsProviderMessages extends NLS { |
7 | 7 |
|
... | ... | |
42 | 42 |
|
43 | 43 |
static { |
44 | 44 |
// initialize resource bundle |
45 |
TXMCoreMessages.initializeMessages(BUNDLE_NAME, SWTComponentsProviderMessages.class);
|
|
45 |
Utf8NLS.initializeMessages(BUNDLE_NAME, SWTComponentsProviderMessages.class);
|
|
46 | 46 |
} |
47 | 47 |
|
48 | 48 |
private SWTComponentsProviderMessages() { |
tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/editors/ChartEditorPart.java (revision 260) | ||
---|---|---|
18 | 18 |
import org.eclipse.ui.IPartListener; |
19 | 19 |
import org.eclipse.ui.IWorkbenchPart; |
20 | 20 |
import org.eclipse.ui.PlatformUI; |
21 |
import org.eclipse.ui.contexts.IContextService; |
|
21 | 22 |
import org.eclipse.ui.part.EditorPart; |
22 | 23 |
import org.eclipse.ui.part.MultiPageEditorPart; |
23 | 24 |
import org.txm.chartsengine.core.ChartsEngine; |
... | ... | |
235 | 236 |
GridData gd = new GridData(GridData.FILL_BOTH); |
236 | 237 |
gd.grabExcessVerticalSpace = true; |
237 | 238 |
gd.grabExcessHorizontalSpace = true; |
238 |
gd.horizontalSpan = 2; |
|
239 |
gd.horizontalSpan = 2; // 2 for match the command parameters toolbar AND the chart toolbar
|
|
239 | 240 |
chartComposite.setLayoutData(gd); |
240 | 241 |
|
241 | 242 |
// FIXME: open dialog box message if the composite doesn't contain any chart (typically when the charts engine doesn't contain chart creator for the specified result data type) |
... | ... | |
255 | 256 |
|
256 | 257 |
// registers user entries event call back extensions |
257 | 258 |
this.registerEventCallBackExtensions(); |
259 |
|
|
260 |
//FIXME: test to contribute to menu only in some context |
|
261 |
// create chart editor part context |
|
262 |
// IContextService contextService = (IContextService)getSite().getService(IContextService.class); |
|
263 |
// contextService.activateContext(ChartEditorPart.class.getName()); |
|
264 |
// // create chart composite context |
|
265 |
// contextService.activateContext(this.chartComposite.getClass().getName()); |
|
266 |
|
|
267 |
//FIXME: description test |
|
268 |
//this.setContentDescription("details"); |
|
269 |
//this.setContentDescription(this.getResultData().getDetails()); |
|
258 | 270 |
} |
259 | 271 |
|
260 | 272 |
|
... | ... | |
439 | 451 |
monitor.setTaskName("Loading"); |
440 | 452 |
loadChart(resetView, clearChartItemsSelection); |
441 | 453 |
|
442 |
// refresh the tree node |
|
454 |
// FIXME: refresh the tree node
|
|
443 | 455 |
// getSite().getShell().getDisplay().syncExec(new Runnable() { |
444 | 456 |
// @Override |
445 | 457 |
// public void run() { |
446 |
refreshCorporaView();
|
|
458 |
refresh(); |
|
447 | 459 |
// } |
448 | 460 |
// }); |
449 | 461 |
|
tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/IChartComponent.java (revision 260) | ||
---|---|---|
6 | 6 |
|
7 | 7 |
/** |
8 | 8 |
* Chart component interface. |
9 |
* A compoment dedicated to render chart, from a file, from a AWT object, etc.
|
|
9 |
* A component dedicated to render chart, from a file, from an AWT object, etc.
|
|
10 | 10 |
* @author sjacquot |
11 | 11 |
* |
12 | 12 |
*/ |
tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/swt/ChartComposite.java (revision 260) | ||
---|---|---|
90 | 90 |
// MenuItem deleteItem = new MenuItem(menu, SWT.NONE); |
91 | 91 |
// deleteItem.setText("Delete"); |
92 | 92 |
// |
93 |
// sub-menu for selected items |
|
93 | 94 |
Menu newMenu = new Menu(menu); |
94 | 95 |
chartEntityLabelItem.setMenu(newMenu); |
95 | 96 |
|
tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/swt/AdvancedChartEditorToolBar.java (revision 260) | ||
---|---|---|
40 | 40 |
// GridData data = new GridData(); |
41 | 41 |
// data.horizontalSpan = 3; |
42 | 42 |
// this.setLayoutData(data); |
43 |
// new ToolItem(this, SWT.SEPARATOR); |
|
43 |
|
|
44 |
//new ToolItem(this, SWT.SEPARATOR); |
|
44 | 45 |
|
45 | 46 |
final ToolItem showTitle = new ToolItem(this, SWT.CHECK); |
46 | 47 |
//showTitle.setText(SWTComponentsProviderMessages.SWTChartsComponentProvider_SHOW_HIDE_TITLE); |
... | ... | |
164 | 165 |
|
165 | 166 |
// Accessing the source must be done outside the Job |
166 | 167 |
if(e.getSource() == showTitle) { |
167 |
TXMPreferences.putLocalBoolean(chartEditorPart.getResultData(), ChartsEnginePreferences.SHOW_TITLE,showTitle.getSelection()); |
|
168 |
TXMPreferences.putLocalBoolean(chartEditorPart.getResultData(), ChartsEnginePreferences.SHOW_TITLE, showTitle.getSelection());
|
|
168 | 169 |
} |
169 | 170 |
else if(e.getSource() == showLegend) { |
170 | 171 |
TXMPreferences.putLocalBoolean(chartEditorPart.getResultData(), ChartsEnginePreferences.SHOW_LEGEND, showLegend.getSelection()); |
tmp/org.txm.chartsengine.r.core/META-INF/MANIFEST.MF (revision 260) | ||
---|---|---|
14 | 14 |
org.txm.chartsengine.r.core.preferences, |
15 | 15 |
org.txm.chartsengine.r.core.themes, |
16 | 16 |
org.txm.stat.engine.r |
17 |
Bundle-Vendor: TXM |
|
17 |
Bundle-Vendor: Textometrie.org |
tmp/org.txm.chartsengine.r.core/src/org/txm/chartsengine/r/core/RChartsEngine.java (revision 260) | ||
---|---|---|
10 | 10 |
import org.txm.stat.engine.r.RWorkspaceRenderer; |
11 | 11 |
import org.txm.statsengine.core.StatException; |
12 | 12 |
import org.txm.statsengine.r.core.RWorkspace; |
13 |
import org.txm.statsengine.r.core.RWorkspaceException; |
|
13 |
import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
|
|
14 | 14 |
import org.txm.utils.logger.Log; |
15 | 15 |
|
16 | 16 |
|
tmp/org.txm.chartsengine.r.core/src/org/txm/stat/engine/r/RWorkspaceRenderer.java (revision 260) | ||
---|---|---|
36 | 36 |
import org.rosuda.REngine.REXP; |
37 | 37 |
import org.rosuda.REngine.REXPMismatchException; |
38 | 38 |
import org.txm.chartsengine.core.ChartsEngine; |
39 |
import org.txm.core.messages.TXMCoreMessages; |
|
40 | 39 |
import org.txm.statsengine.core.StatException; |
41 | 40 |
import org.txm.statsengine.r.core.RWorkspace; |
42 |
import org.txm.statsengine.r.core.RWorkspaceException; |
|
41 |
import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
|
|
43 | 42 |
import org.txm.statsengine.r.core.messages.RCoreMessages; |
44 | 43 |
import org.txm.utils.OSDetector; |
45 | 44 |
import org.txm.utils.logger.Log; |
... | ... | |
108 | 107 |
return; |
109 | 108 |
} |
110 | 109 |
if (!file.canWrite()) { |
111 |
System.out.println(TXMCoreMessages.LS_0+file+" cannot be written "); //$NON-NLS-1$
|
|
110 |
System.out.println("Error: "+ file +" cannot be written "); //$NON-NLS-1$ //$NON-NLS-2$
|
|
112 | 111 |
} |
113 | 112 |
String devicename = device.getName(); |
114 | 113 |
|
tmp/org.txm.cooccurrence.core/META-INF/MANIFEST.MF (revision 260) | ||
---|---|---|
14 | 14 |
org.txm.cooccurrence.core.functions.comparators, |
15 | 15 |
org.txm.cooccurrence.core.messages, |
16 | 16 |
org.txm.cooccurrence.core.preferences |
17 |
Bundle-Vendor: Textometrie.org |
tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/messages/CooccurrenceCoreMessages.java (revision 260) | ||
---|---|---|
1 | 1 |
package org.txm.cooccurrence.core.messages; |
2 | 2 |
|
3 | 3 |
import org.eclipse.osgi.util.NLS; |
4 |
import org.txm.core.messages.TXMCoreMessages;
|
|
4 |
import org.txm.utils.messages.Utf8NLS;
|
|
5 | 5 |
|
6 | 6 |
public class CooccurrenceCoreMessages extends NLS { |
7 | 7 |
|
... | ... | |
39 | 39 |
|
40 | 40 |
static { |
41 | 41 |
// initialize resource bundle |
42 |
TXMCoreMessages.initializeMessages(BUNDLE_NAME, CooccurrenceCoreMessages.class);
|
|
42 |
Utf8NLS.initializeMessages(BUNDLE_NAME, CooccurrenceCoreMessages.class);
|
|
43 | 43 |
} |
44 | 44 |
|
45 | 45 |
private CooccurrenceCoreMessages() { |
tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java (revision 260) | ||
---|---|---|
64 | 64 |
import org.txm.specificities.core.functions.SpecificitesResult; |
65 | 65 |
import org.txm.statsengine.core.StatException; |
66 | 66 |
import org.txm.statsengine.r.core.RWorkspace; |
67 |
import org.txm.statsengine.r.core.RWorkspaceException; |
|
67 |
import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
|
|
68 | 68 |
import org.txm.utils.logger.Log; |
69 | 69 |
|
70 | 70 |
// TODO: Auto-generated Javadoc |
... | ... | |
673 | 673 |
return false; |
674 | 674 |
} |
675 | 675 |
} |
676 |
corpus.addResult(voc); |
|
677 | 676 |
} |
678 | 677 |
if (Thread.interrupted()) return false; // stop if interrupted by user |
679 | 678 |
|
... | ... | |
1653 | 1652 |
} |
1654 | 1653 |
|
1655 | 1654 |
|
1656 |
/** |
|
1657 |
* Gets the name. |
|
1658 |
* |
|
1659 |
* @return the name |
|
1660 |
*/ |
|
1655 |
@Override |
|
1661 | 1656 |
public String getName() { |
1662 |
return this.getSimpleName();
|
|
1657 |
return this.corpus.getSimpleName() + ": " + this.getSimpleName(); //$NON-NLS-1$
|
|
1663 | 1658 |
} |
1664 | 1659 |
|
1665 | 1660 |
|
tmp/org.txm.chartsengine.svgbatik.rcp/plugin.xml (revision 260) | ||
---|---|---|
9 | 9 |
name="SVG Batik SWT Charts Components Provider"> |
10 | 10 |
</SWTChartsComponentsProvider> |
11 | 11 |
</extension> |
12 |
<extension |
|
13 |
point="org.eclipse.ui.contexts"> |
|
14 |
<context |
|
15 |
id="org.txm.chartsengine.svgbatik.rcp.swt.SVGComposite" |
|
16 |
name="SVG Batik composite context"> |
|
17 |
</context> |
|
18 |
</extension> |
|
19 |
<extension |
|
20 |
point="org.eclipse.core.expressions.definitions"> |
|
21 |
<definition |
|
22 |
id="SVGBatikCompositeIsActiveContext"> |
|
23 |
<with |
|
24 |
variable="activeContexts"> |
|
25 |
<iterate |
|
26 |
ifEmpty="false" |
|
27 |
operator="or"> |
|
28 |
<equals |
|
29 |
value="org.txm.chartsengine.svgbatik.rcp.swt.SVGComposite"> |
|
30 |
</equals> |
|
31 |
</iterate> |
|
32 |
</with> |
|
33 |
</definition> |
|
34 |
</extension> |
|
12 | 35 |
|
13 | 36 |
</plugin> |
tmp/org.txm.chartsengine.svgbatik.rcp/META-INF/MANIFEST.MF (revision 260) | ||
---|---|---|
1 | 1 |
Manifest-Version: 1.0 |
2 | 2 |
Bundle-ManifestVersion: 2 |
3 |
Bundle-Name: SVG Batik Charts Engine Editors
|
|
3 |
Bundle-Name: SVG Batik Charts Engine RCP
|
|
4 | 4 |
Bundle-SymbolicName: org.txm.chartsengine.svgbatik.rcp;singleton:=true |
5 | 5 |
Bundle-Version: 1.0.0.qualifier |
6 | 6 |
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 |
7 | 7 |
Require-Bundle: org.txm.libs.itext;bundle-version="2.1.5", |
8 |
Batik;bundle-version="0.0.0";visibility:=reexport, |
|
9 | 8 |
org.txm.chartsengine.rcp;bundle-version="1.0.0";visibility:=reexport, |
10 | 9 |
org.txm.core;bundle-version="0.7.0", |
11 |
org.txm.rcp;bundle-version="0.7.8" |
|
10 |
org.txm.rcp;bundle-version="0.7.8", |
|
11 |
org.eclipse.core.expressions;bundle-version="3.4.600", |
|
12 |
org.txm.libs.batik;bundle-version="0.0.0" |
|
12 | 13 |
Export-Package: org.txm.chartsengine.svgbatik.rcp, |
13 | 14 |
org.txm.chartsengine.svgbatik.rcp.swing, |
14 | 15 |
org.txm.chartsengine.svgbatik.rcp.swt |
15 |
Bundle-Vendor: TXM |
|
16 |
Bundle-Vendor: Textometrie.org |
tmp/org.txm.chartsengine.svgbatik.rcp/src/org/txm/chartsengine/svgbatik/rcp/SVGSWTChartsComponentsProvider.java (revision 260) | ||
---|---|---|
49 | 49 |
|
50 | 50 |
|
51 | 51 |
|
52 |
// @Override |
|
53 |
// public ChartEditorPart createChartEditor(String editorInputName, TXMResult resultData, String preferencesNode, String chartType) { |
|
54 |
// ChartEditorPart editor = new ChartEditorPart(this, editorInputName, resultData, preferencesNode, chartType, this.getChartsEngine().getChartCreator(resultData.getClass(), chartType).createChartFile(resultData, preferencesNode)); |
|
55 |
// |
|
56 |
// // sets and updates the local preferences node qualifier from the result data |
|
57 |
// editor.getEditorInput().syncLocalPreferencesNode(); |
|
58 |
// |
|
59 |
// return editor; |
|
60 |
// } |
|
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
|
65 | 52 |
@Override |
66 | 53 |
public boolean createChart(ChartsEngine chartsEngine, ChartEditorInput chartEditorInput, ITXMResult result, String preferencesNode, String chartType) { |
67 | 54 |
ChartCreator chartCreator = chartsEngine.getChartCreator(result.getClass(), chartType); |
... | ... | |
76 | 63 |
return false; |
77 | 64 |
} |
78 | 65 |
|
79 |
// /** |
|
80 |
// * Create a <code>SVGGraphicEditorPart</code> from specified file. |
|
81 |
// * @param editorName the editor namer |
|
82 |
// * @param titleImage the image drawn in editor title |
|
83 |
// * @param file the SVG file |
|
84 |
// * @return |
|
85 |
// */ |
|
86 |
// public ChartEditorPart createSVGGraphicEditorPart(String editorName, File file, TXMResult resultData, String preferencesNodeQualifier, String chartType) { |
|
87 |
// |
|
88 |
// ___SVGChartEditorPart editorPart = new ___SVGChartEditorPart(this, file, editorName, resultData, preferencesNodeQualifier, chartType); |
|
89 |
// |
|
90 |
// return editorPart; |
|
91 |
// } |
|
92 | 66 |
|
93 |
|
|
94 | 67 |
@Override |
95 | 68 |
public ChartComposite createComposite(ChartEditorPart chartEditor, Composite parent) { |
96 | 69 |
return SVGSWTChartsComponentsProvider.createCompositeStatic(chartEditor, parent); |
tmp/org.txm.chartsengine.svgbatik.rcp/src/org/txm/chartsengine/svgbatik/rcp/swing/SVGPanel.java (revision 260) | ||
---|---|---|
94 | 94 |
public SVGPanel(ChartEditorPart editor, Frame frame) { |
95 | 95 |
super(new BorderLayout()); |
96 | 96 |
|
97 |
this.editor = editor; |
|
98 |
|
|
99 | 97 |
this.svgCanvas = new JSVGCanvas(null, true, false); |
100 | 98 |
this.add("Center", svgCanvas); //$NON-NLS-1$ |
101 | 99 |
|
... | ... | |
211 | 209 |
// add default chart key listener |
212 | 210 |
this.addKeyListener(new ChartKeyListener(SWTChartsComponentsProvider.getCurrent(), this, 10.5)); |
213 | 211 |
|
212 |
this.setChartEditor(editor); |
|
214 | 213 |
|
214 |
|
|
215 | 215 |
} |
216 | 216 |
|
217 | 217 |
|
tmp/org.txm.chartsengine.r.rcp/META-INF/MANIFEST.MF (revision 260) | ||
---|---|---|
1 | 1 |
Manifest-Version: 1.0 |
2 | 2 |
Bundle-ManifestVersion: 2 |
3 |
Bundle-Name: R RCP |
|
3 |
Bundle-Name: R Charts Engine RCP
|
|
4 | 4 |
Bundle-SymbolicName: org.txm.chartsengine.r.rcp;singleton:=true |
5 | 5 |
Bundle-Version: 1.0.0.qualifier |
6 | 6 |
Bundle-RequiredExecutionEnvironment: JavaSE-1.7 |
7 | 7 |
Require-Bundle: org.txm.chartsengine.rcp;bundle-version="1.0.0";visibility:=reexport, |
8 | 8 |
org.txm.rcp;bundle-version="0.7.8", |
9 | 9 |
org.txm.chartsengine.r.core;bundle-version="1.0.0";visibility:=reexport |
10 |
Bundle-Vendor: TXM
|
|
10 |
Bundle-Vendor: Textometrie.org
|
|
11 | 11 |
Import-Package: org.txm.chartsengine.rcp.messages |
tmp/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/handlers/ComputeCooccurrences.java (revision 260) | ||
---|---|---|
32 | 32 |
|
33 | 33 |
import org.eclipse.core.commands.ExecutionEvent; |
34 | 34 |
import org.eclipse.core.commands.ExecutionException; |
35 |
import org.eclipse.jface.viewers.IStructuredSelection; |
|
36 | 35 |
import org.eclipse.ui.IWorkbenchPage; |
37 | 36 |
import org.eclipse.ui.IWorkbenchWindow; |
38 |
import org.eclipse.ui.handlers.HandlerUtil; |
|
39 | 37 |
import org.txm.Toolbox; |
40 | 38 |
import org.txm.cooccurrence.core.functions.Cooccurrence; |
41 | 39 |
import org.txm.cooccurrence.core.preferences.CooccurrencePreferences; |
... | ... | |
53 | 51 |
import org.txm.searchengine.cqp.corpus.StructuralUnit; |
54 | 52 |
import org.txm.searchengine.cqp.corpus.query.Query; |
55 | 53 |
|
56 |
// TODO: Auto-generated Javadoc |
|
57 | 54 |
/** |
58 |
* if the selection is a corpus, open an empty Cooc editor if the selection is a |
|
59 |
* concordance, open a Cooc editor already computed @ author mdecorde. |
|
55 |
* if the selection is a corpus, open an empty Cooc editor if the selection is a concordance, open a Cooc editor already computed. |
|
56 |
* |
|
57 |
* @author mdecorde |
|
58 |
* |
|
60 | 59 |
*/ |
61 | 60 |
public class ComputeCooccurrences extends BaseAbstractHandler { |
62 | 61 |
|
... | ... | |
81 | 80 |
} |
82 | 81 |
|
83 | 82 |
|
84 |
|
|
85 | 83 |
if (!Toolbox.isSearchEngineInitialized()) return null; |
86 | 84 |
|
87 | 85 |
|
88 |
IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
|
|
89 |
Object element = selection.getFirstElement();
|
|
86 |
Object selection = this.getSelection();
|
|
87 |
CooccurrenceEditorInput editorInput = null;
|
|
90 | 88 |
|
91 |
if (element instanceof Concordance) { |
|
89 |
// new editor from concordance |
|
90 |
if (selection instanceof Concordance) { |
|
92 | 91 |
Cooccurrence cooc = computeCooc(selection); |
93 | 92 |
if (cooc != null) { |
94 |
openEditor(cooc);
|
|
93 |
editorInput = new CooccurrenceEditorInput(cooc);
|
|
95 | 94 |
} |
96 |
} else if (element instanceof Corpus) { |
|
97 |
openEditor((Corpus)element); |
|
98 |
} else { |
|
99 |
System.out.println(Messages.ComputeCooccurrences_1+ element); |
|
100 | 95 |
} |
101 |
|
|
102 |
return element; |
|
103 |
} |
|
96 |
// new editor from corpus |
|
97 |
else if (selection instanceof Corpus) { |
|
98 |
editorInput = new CooccurrenceEditorInput((Corpus)selection); |
|
99 |
} |
|
100 |
// reopening an existing result |
|
101 |
else if (selection instanceof Cooccurrence) { |
|
102 |
editorInput = new CooccurrenceEditorInput((Cooccurrence)selection); |
|
104 | 103 |
|
105 |
/** |
|
106 |
* |
|
107 |
* @param cooc |
|
108 |
* @return |
|
109 |
*/ |
|
110 |
public static CooccurrencesEditor openEditor(Cooccurrence cooc) { |
|
104 |
} |
|
105 |
else { |
|
106 |
System.out.println(Messages.ComputeCooccurrences_1 + selection); |
|
107 |
} |
|
111 | 108 |
|
112 | 109 |
try { |
113 | 110 |
IWorkbenchWindow window =TXMWindows.getActiveWindow(); |
114 | 111 |
IWorkbenchPage page = window.getActivePage(); |
115 | 112 |
|
116 | 113 |
StatusLine.setMessage(Messages.ComputeCooccurrences_0); |
117 |
CooccurrenceEditorInput editorInput = new CooccurrenceEditorInput(cooc); |
|
118 | 114 |
|
119 | 115 |
CooccurrencesEditor conceditor = (CooccurrencesEditor) page.openEditor(editorInput, CooccurrencesEditor.ID); |
120 | 116 |
return conceditor; |
121 |
} catch (Exception e) { |
|
122 |
org.txm.rcpapplication.utils.Logger.printStackTrace(e); |
|
123 | 117 |
} |
124 |
return null; |
|
125 |
} |
|
126 |
|
|
127 |
/** |
|
128 |
* |
|
129 |
* @param corpus |
|
130 |
* @return |
|
131 |
*/ |
|
132 |
public static CooccurrencesEditor openEditor(Corpus corpus) { |
|
133 |
try { |
|
134 |
IWorkbenchWindow window =TXMWindows.getActiveWindow(); |
|
135 |
IWorkbenchPage page = window.getActivePage(); |
|
136 |
|
|
137 |
StatusLine.setMessage(Messages.ComputeCooccurrences_0); |
|
138 |
CooccurrenceEditorInput editorInput = new CooccurrenceEditorInput(corpus); |
|
139 |
|
|
140 |
CooccurrencesEditor conceditor = (CooccurrencesEditor) page.openEditor(editorInput, CooccurrencesEditor.ID); |
|
141 |
return conceditor; |
|
142 |
} catch (Exception e) { |
|
118 |
catch (Exception e) { |
|
143 | 119 |
org.txm.rcpapplication.utils.Logger.printStackTrace(e); |
144 | 120 |
} |
145 |
return null; |
|
121 |
|
|
122 |
|
|
123 |
return selection; |
|
146 | 124 |
} |
147 | 125 |
|
126 |
|
|
148 | 127 |
/** |
149 | 128 |
* Compute cooc. |
150 | 129 |
* |
151 | 130 |
* @param selection the selection |
152 | 131 |
* @return the cooccurrence |
153 | 132 |
*/ |
154 |
public static Cooccurrence computeCooc(IStructuredSelection selection) {
|
|
133 |
public static Cooccurrence computeCooc(Object selection) {
|
|
155 | 134 |
if (!Toolbox.isSearchEngineInitialized()) return null; |
156 | 135 |
|
157 | 136 |
Cooccurrence cooc = null; |
158 |
Object s = selection.getFirstElement(); |
|
159 | 137 |
|
160 | 138 |
int minleft = 1; |
161 | 139 |
int maxleft = 50; |
... | ... | |
171 | 149 |
Query query = null; |
172 | 150 |
List<Property> properties = null; |
173 | 151 |
|
174 |
if (s instanceof Concordance) { |
|
175 |
Concordance conc = (Concordance) s; |
|
152 |
if (selection instanceof Concordance) {
|
|
153 |
Concordance conc = (Concordance) selection;
|
|
176 | 154 |
corpus = conc.getCorpus(); |
177 | 155 |
maxleft = conc.getLeftContextSize(); |
178 | 156 |
maxright = conc.getRightContextSize(); |
... | ... | |
193 | 171 |
org.txm.rcpapplication.utils.Logger.printStackTrace(e); |
194 | 172 |
return null; |
195 | 173 |
} |
196 |
} else if (s instanceof Corpus) { |
|
197 |
corpus = (Corpus) s; |
|
174 |
} else if (selection instanceof Corpus) {
|
|
175 |
corpus = (Corpus) selection;
|
|
198 | 176 |
} else { |
199 |
System.out.println(Messages.ComputeCooccurrences_1 + s); |
|
177 |
System.out.println(Messages.ComputeCooccurrences_1 + selection);
|
|
200 | 178 |
return null; |
201 | 179 |
} |
202 | 180 |
|
tmp/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/messages/CooccurrenceUIMessages.java (revision 260) | ||
---|---|---|
1 | 1 |
package org.txm.cooccurrence.rcp.messages; |
2 | 2 |
|
3 | 3 |
import org.eclipse.osgi.util.NLS; |
4 |
import org.txm.core.messages.TXMCoreMessages;
|
|
4 |
import org.txm.utils.messages.Utf8NLS;
|
|
5 | 5 |
|
6 | 6 |
public class CooccurrenceUIMessages extends NLS { |
7 | 7 |
|
... | ... | |
57 | 57 |
|
58 | 58 |
static { |
59 | 59 |
// initialize resource bundle |
60 |
TXMCoreMessages.initializeMessages(BUNDLE_NAME, CooccurrenceUIMessages.class);
|
|
60 |
Utf8NLS.initializeMessages(BUNDLE_NAME, CooccurrenceUIMessages.class);
|
|
61 | 61 |
} |
62 | 62 |
|
63 | 63 |
private CooccurrenceUIMessages() { |
tmp/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/editors/CooccurrencesEditor.java (revision 260) | ||
---|---|---|
800 | 800 |
|
801 | 801 |
if (cooc != null) cooc.clearMemory(); |
802 | 802 |
|
803 |
getEditorInput().setResult(cooc); |
|
803 | 804 |
|
804 |
|
|
805 | 805 |
final String message; |
806 | 806 |
if (cooc.getLines().size() == 0) { |
807 | 807 |
message = (CooccurrenceUIMessages.CooccurrencesEditor_23); |
... | ... | |
825 | 825 |
} |
826 | 826 |
}); |
827 | 827 |
|
828 |
corpus.addResult(cooc); |
|
829 | 828 |
} catch(ThreadDeath e) { |
830 | 829 |
if (cooc != null) cooc.clearMemory(); |
831 | 830 |
return Status.CANCEL_STATUS; |
... | ... | |
858 | 857 |
public void run() { |
859 | 858 |
viewer.setInput(cooc.getLines()); |
860 | 859 |
sort(); |
860 |
|
|
861 |
viewer.getControl().setRedraw(false); |
|
861 | 862 |
viewer.refresh(); |
862 |
for (TableColumn col : viewer.getTable().getColumns()) |
|
863 |
for (TableColumn col : viewer.getTable().getColumns()) {
|
|
863 | 864 |
col.pack(); |
865 |
} |
|
866 |
viewer.getControl().setRedraw(true); |
|
867 |
|
|
868 |
|
|
864 | 869 |
setTitleToolTip(cooc.toInfos()); |
870 |
|
|
871 |
refresh(); |
|
872 |
|
|
865 | 873 |
CorporaView.refresh(); |
866 | 874 |
CorporaView.expand(corpus); |
867 | 875 |
QueriesView.refresh(); |
tmp/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/editors/CooccurrenceEditorInput.java (revision 260) | ||
---|---|---|
27 | 27 |
// |
28 | 28 |
package org.txm.cooccurrence.rcp.editors; |
29 | 29 |
|
30 |
import org.eclipse.jface.resource.ImageDescriptor; |
|
31 |
import org.eclipse.ui.IPersistableElement; |
|
32 |
import org.eclipse.ui.plugin.AbstractUIPlugin; |
|
33 | 30 |
import org.txm.cooccurrence.core.functions.Cooccurrence; |
34 |
import org.txm.cooccurrence.rcp.messages.CooccurrenceUIMessages; |
|
35 | 31 |
import org.txm.rcp.editors.TXMResultEditorInput; |
36 |
import org.txm.rcpapplication.Application; |
|
37 |
import org.txm.rcpapplication.IImageKeys; |
|
38 | 32 |
import org.txm.searchengine.cqp.corpus.Corpus; |
39 | 33 |
// TODO: Auto-generated Javadoc |
40 | 34 |
/** |
... | ... | |
42 | 36 |
*/ |
43 | 37 |
public class CooccurrenceEditorInput extends TXMResultEditorInput { |
44 | 38 |
|
45 |
/** The cooc. */ |
|
46 |
private Cooccurrence cooc; |
|
47 |
|
|
48 | 39 |
/** The corpus. */ |
49 | 40 |
private Corpus corpus; |
50 | 41 |
|
... | ... | |
67 | 58 |
super(null); |
68 | 59 |
this.corpus = corpus; |
69 | 60 |
} |
70 |
|
|
71 |
/* (non-Javadoc) |
|
72 |
* @see org.eclipse.ui.IEditorInput#getImageDescriptor() |
|
73 |
*/ |
|
74 |
@Override |
|
75 |
public ImageDescriptor getImageDescriptor() { |
|
76 |
return AbstractUIPlugin.imageDescriptorFromPlugin( |
|
77 |
Application.PLUGIN_ID, IImageKeys.ACTION_COOCCURRENCE); |
|
78 |
} |
|
79 |
|
|
80 |
/* (non-Javadoc) |
|
81 |
* @see org.eclipse.ui.IEditorInput#getName() |
|
82 |
*/ |
|
83 |
@Override |
|
84 |
public String getName() { |
|
85 |
try { |
|
86 |
return cooc.getQuery().toString(); |
|
87 |
} |
|
88 |
catch(Exception e) { |
|
89 |
} |
|
90 |
return CooccurrenceUIMessages.CoocPreferencePage_5; |
|
91 |
} |
|
92 |
|
|
93 |
/* (non-Javadoc) |
|
94 |
* @see org.eclipse.ui.IEditorInput#getPersistable() |
|
95 |
*/ |
|
96 |
@Override |
|
97 |
public IPersistableElement getPersistable() { |
|
98 |
return null; |
|
99 |
} |
|
100 |
|
|
101 |
|
|
102 |
|
|
103 | 61 |
/** |
104 | 62 |
* Gets the cooc. |
105 | 63 |
* |
106 | 64 |
* @return the cooc |
107 | 65 |
*/ |
108 | 66 |
public Cooccurrence getCooc() { |
109 |
return cooc;
|
|
67 |
return (Cooccurrence) this.result;
|
|
110 | 68 |
} |
111 | 69 |
|
112 | 70 |
/* (non-Javadoc) |
tmp/org.txm.cooccurrence.rcp/OSGI-INF/l10n/bundle.properties (revision 260) | ||
---|---|---|
1 |
|
|
2 |
command.name = Cooccurrences |
|
3 |
|
|
4 |
command.tooltip = Cooccurrences |
|
5 |
|
|
6 |
editor.name = Cooccurrences |
|
7 |
|
|
8 |
page.name = Cooccurrences |
|
0 | 9 |
tmp/org.txm.cooccurrence.rcp/OSGI-INF/l10n/bundle_ru.properties (revision 260) | ||
---|---|---|
1 |
|
|
2 |
command.name = Совместная встречаемость |
|
3 |
|
|
4 |
command.tooltip = Совместная встречаемость |
|
5 |
|
|
6 |
editor.name = Совместная встречаемость |
|
7 |
|
|
8 |
page.name = Совместная встречаемость |
|
0 | 9 |
tmp/org.txm.cooccurrence.rcp/OSGI-INF/l10n/bundle_fr.properties (revision 260) | ||
---|---|---|
1 |
|
|
2 |
command.name = Cooccurrences |
|
3 |
|
|
4 |
command.tooltip = Calculer les cooccurrents d'une requête |
|
5 |
|
|
6 |
editor.name = Cooccurrences |
|
7 |
|
|
8 |
page.name = Cooccurrences |
|
0 | 9 |
tmp/org.txm.cooccurrence.rcp/plugin.xml (revision 260) | ||
---|---|---|
7 | 7 |
categoryId="org.txm.rcpapplication.category.txm" |
8 | 8 |
defaultHandler="org.txm.cooccurrence.rcp.handlers.ComputeCooccurrences" |
9 | 9 |
id="ComputeCooccurrences" |
10 |
name="%command.name.35">
|
|
10 |
name="%command.name"> |
|
11 | 11 |
</command> |
12 | 12 |
</extension> |
13 | 13 |
<extension |
... | ... | |
16 | 16 |
category="org.txm.rcpapplication.preferences.UserPreferencePage" |
17 | 17 |
class="org.txm.cooccurrence.rcp.preferences.CoocPreferencePage" |
18 | 18 |
id="org.txm.cooccurrence.rcp.preferences.CoocPreferencePage" |
19 |
name="%page.name.11">
|
|
19 |
name="%page.name"> |
|
20 | 20 |
</page> |
21 | 21 |
</extension> |
22 | 22 |
<extension |
23 | 23 |
point="org.eclipse.core.runtime.adapters"> |
24 | 24 |
<factory |
25 |
adaptableType="org.txm.functions.cooccurrence.Cooccurrence"
|
|
25 |
adaptableType="org.txm.cooccurrence.core.functions.Cooccurrence"
|
|
26 | 26 |
class="org.txm.cooccurrence.rcp.adapters.CooccurrenceAdapterFactory"> |
27 | 27 |
<adapter |
28 | 28 |
type="org.eclipse.ui.model.IWorkbenchAdapter"> |
... | ... | |
37 | 37 |
<command |
38 | 38 |
commandId="ComputeCooccurrences" |
39 | 39 |
icon="icons/cooccurrences.png" |
40 |
label="%command.label.96" |
|
41 |
style="push" |
|
42 |
tooltip="%command.tooltip.57"> |
|
40 |
style="push"> |
|
43 | 41 |
<visibleWhen |
44 | 42 |
checkEnabled="false"> |
45 | 43 |
<or> |
... | ... | |
58 | 56 |
<command |
59 | 57 |
commandId="ComputeCooccurrences" |
60 | 58 |
icon="icons/cooccurrences.png" |
61 |
label="%command.label.91" |
|
62 |
style="push" |
|
63 |
tooltip="%command.tooltip.53"> |
|
59 |
style="push"> |
|
64 | 60 |
<visibleWhen |
65 | 61 |
checkEnabled="false"> |
66 | 62 |
<or> |
... | ... | |
80 | 76 |
<command |
81 | 77 |
commandId="ComputeCooccurrences" |
82 | 78 |
icon="icons/cooccurrences.png" |
83 |
label="%command.label.96" |
|
84 | 79 |
style="push" |
85 |
tooltip="%command.tooltip.57">
|
|
80 |
tooltip="%command.tooltip"> |
|
86 | 81 |
<visibleWhen |
87 | 82 |
checkEnabled="false"> |
88 | 83 |
<or> |
... | ... | |
104 | 99 |
default="false" |
105 | 100 |
icon="icons/cooccurrences.png" |
106 | 101 |
id="CooccurrencesEditor" |
107 |
name="%editor.name.9">
|
|
102 |
name="%editor.name"> |
|
108 | 103 |
</editor> |
109 | 104 |
</extension> |
105 |
<extension |
|
106 |
point="org.eclipse.core.expressions.definitions"> |
|
107 |
<definition |
|
108 |
id="OneCooccurrenceSelected"> |
|
109 |
<with |
|
110 |
variable="selection"> |
|
111 |
<iterate |
|
112 |
ifEmpty="false" |
|
113 |
operator="and"> |
|
114 |
<instanceof |
|
115 |
value="org.txm.cooccurrence.core.functions.Cooccurrence"> |
|
116 |
</instanceof> |
|
117 |
</iterate> |
|
118 |
</with> |
|
119 |
</definition> |
|
120 |
</extension> |
|
110 | 121 |
|
111 | 122 |
</plugin> |
tmp/org.txm.cooccurrence.rcp/META-INF/MANIFEST.MF (revision 260) | ||
---|---|---|
4 | 4 |
Bundle-SymbolicName: org.txm.cooccurrence.rcp;singleton:=true |
5 | 5 |
Bundle-Version: 1.0.0.qualifier |
6 | 6 |
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 |
7 |
Export-Package: org.txm.cooccurrence.rcp.editors |
|
7 |
Export-Package: org.txm.cooccurrence.rcp.adapters, |
|
8 |
org.txm.cooccurrence.rcp.editors, |
|
9 |
org.txm.cooccurrence.rcp.handlers, |
|
10 |
org.txm.cooccurrence.rcp.messages, |
|
11 |
org.txm.cooccurrence.rcp.preferences |
|
8 | 12 |
Require-Bundle: org.txm.cooccurrence.core;bundle-version="1.0.0", |
9 | 13 |
org.eclipse.core.commands, |
10 | 14 |
org.txm.core, |
11 | 15 |
org.txm.rcp, |
12 | 16 |
org.eclipse.ui;bundle-version="3.106.1", |
13 |
org.eclipse.core.runtime;bundle-version="3.10.0" |
|
17 |
org.eclipse.core.runtime;bundle-version="3.10.0", |
|
18 |
org.eclipse.core.expressions;bundle-version="3.4.600" |
|
19 |
Bundle-Vendor: Textometrie.org |
Formats disponibles : Unified diff