Révision 922
| tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/editors/ChartEditor.java (revision 922) | ||
|---|---|---|
| 2 | 2 |
|
| 3 | 3 |
|
| 4 | 4 |
import java.io.File; |
| 5 |
import java.util.ArrayList; |
|
| 6 | 5 |
|
| 7 | 6 |
import javax.swing.JComponent; |
| 8 | 7 |
|
| ... | ... | |
| 11 | 10 |
import org.eclipse.core.runtime.Platform; |
| 12 | 11 |
import org.eclipse.swt.SWT; |
| 13 | 12 |
import org.eclipse.swt.layout.GridData; |
| 14 |
import org.eclipse.swt.layout.GridLayout; |
|
| 15 | 13 |
import org.eclipse.swt.widgets.Composite; |
| 16 | 14 |
import org.eclipse.swt.widgets.Group; |
| 17 |
import org.eclipse.ui.IPartListener; |
|
| 18 |
import org.eclipse.ui.IWorkbenchPart; |
|
| 19 | 15 |
import org.eclipse.ui.PlatformUI; |
| 20 |
import org.eclipse.ui.part.EditorPart;
|
|
| 16 |
import org.eclipse.ui.contexts.IContextService;
|
|
| 21 | 17 |
import org.eclipse.ui.part.MultiPageEditorPart; |
| 22 | 18 |
import org.txm.chartsengine.core.ChartsEngine; |
| 23 | 19 |
import org.txm.chartsengine.core.preferences.ChartsEnginePreferences; |
| ... | ... | |
| 218 | 214 |
// check that the charts engine used for the result matches the SWT components provider otherwise find a suitable components provider |
| 219 | 215 |
if(this.getResult().getChartsEngine() != this.getSWTChartsComponentsProvider().getChartsEngine()) {
|
| 220 | 216 |
|
| 221 |
Log.warning("ChartEditor.__updateEditorFromResult(): result charts engine = " + this.getResult().getChartsEngine().getName() + " / Editor charts engine = " + this.getSWTChartsComponentsProvider().getChartsEngine().getName() + "."); //$NON-NLS-1$
|
|
| 217 |
Log.finest("ChartEditor.__updateEditorFromResult(): result charts engine = " + this.getResult().getChartsEngine().getName() + " / Editor charts engine = " + this.getSWTChartsComponentsProvider().getChartsEngine().getName() + "."); //$NON-NLS-1$
|
|
| 222 | 218 |
|
| 223 | 219 |
this.getEditorInput().setSWTChartsComponentsProvider(SWTChartsComponentsProvider.getComponentsProvider(this.getResult().getChartsEngine())); |
| 224 | 220 |
this.getSWTChartsComponentsProvider().setChartsEngine(this.getResult().getChartsEngine()); |
| 225 | 221 |
|
| 226 |
Log.warning("ChartEditor.__updateEditorFromResult(): charts engine used to create the chart does not match the editor one. The SWT components provider has been changed to match it: " + this.getSWTChartsComponentsProvider() + "."); //$NON-NLS-1$
|
|
| 222 |
Log.finest("ChartEditor.__updateEditorFromResult(): charts engine used to create the chart does not match the editor one. The SWT components provider has been changed to match it: " + this.getSWTChartsComponentsProvider() + "."); //$NON-NLS-1$
|
|
| 227 | 223 |
|
| 228 | 224 |
// recreating the chart composite |
| 229 | 225 |
Composite parent = this.chartComposite.getParent(); |
| ... | ... | |
| 267 | 263 |
// registers user entries event call back extensions |
| 268 | 264 |
registerEventCallBackExtensions(); |
| 269 | 265 |
|
| 270 |
//FIXME: test to contribute to menu only in some context |
|
| 266 |
//FIXME: test to contribute to menu only in some context and also for key binding
|
|
| 271 | 267 |
// create chart editor part context |
| 272 |
// IContextService contextService = (IContextService)getSite().getService(IContextService.class);
|
|
| 273 |
// contextService.activateContext(ChartEditor.class.getName());
|
|
| 268 |
IContextService contextService = (IContextService)getSite().getService(IContextService.class); |
|
| 269 |
contextService.activateContext("org.txm.chartsengine.rcp.editors.ChartEditor"); //$NON-NLS-1$
|
|
| 274 | 270 |
// // create chart composite context |
| 275 | 271 |
// contextService.activateContext(this.chartComposite.getClass().getName()); |
| 276 | 272 |
|
| tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/CopyChartViewToClipboard.java (revision 922) | ||
|---|---|---|
| 5 | 5 |
import org.eclipse.core.commands.ExecutionException; |
| 6 | 6 |
import org.txm.chartsengine.rcp.SWTChartsComponentsProvider; |
| 7 | 7 |
import org.txm.chartsengine.rcp.editors.ChartEditor; |
| 8 |
import org.txm.utils.logger.Log; |
|
| 8 | 9 |
|
| 9 | 10 |
/** |
| 10 | 11 |
* Resets the chart view of the active chart editor part. |
| ... | ... | |
| 18 | 19 |
public Object execute(ExecutionEvent event) throws ExecutionException {
|
| 19 | 20 |
ChartEditor chartEditor = SWTChartsComponentsProvider.getActiveChartEditor(event); |
| 20 | 21 |
chartEditor.copyChartViewToClipboard(); |
| 22 |
Log.finest("View copied to clipboard.");
|
|
| 21 | 23 |
return null; |
| 22 | 24 |
} |
| 23 | 25 |
|
| tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/ExportChartEditorView.java (revision 922) | ||
|---|---|---|
| 54 | 54 |
import org.txm.rcp.messages.TXMUIMessages; |
| 55 | 55 |
import org.txm.rcp.swt.dialog.LastOpened; |
| 56 | 56 |
import org.txm.rcp.utils.JobHandler; |
| 57 |
import org.txm.utils.logger.Log; |
|
| 57 | 58 |
|
| 58 | 59 |
/** |
| 59 | 60 |
* Exports chart editor view using chart editor export. |
| tmp/org.txm.chartsengine.rcp/plugin.xml (revision 922) | ||
|---|---|---|
| 16 | 16 |
point="org.eclipse.ui.bindings"> |
| 17 | 17 |
<key |
| 18 | 18 |
commandId="ResetChartView" |
| 19 |
contextId="org.txm.chartsengine.rcp.editors.ChartEditorPart"
|
|
| 20 |
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
|
|
| 19 |
contextId="org.txm.chartsengine.rcp.editors.ChartEditor" |
|
| 20 |
schemeId="org.txm.rcp.scheme"
|
|
| 21 | 21 |
sequence="M1+R"> |
| 22 | 22 |
</key> |
| 23 | 23 |
<key |
| 24 | 24 |
commandId="ExportChartEditorView" |
| 25 |
contextId="org.txm.chartsengine.rcp.editors.ChartEditorPart"
|
|
| 26 |
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
|
|
| 25 |
contextId="org.txm.chartsengine.rcp.editors.ChartEditor" |
|
| 26 |
schemeId="org.txm.rcp.scheme"
|
|
| 27 | 27 |
sequence="M1+E"> |
| 28 | 28 |
</key> |
| 29 | 29 |
<key |
| 30 | 30 |
commandId="CopyChartViewToClipboard" |
| 31 |
contextId="org.txm.chartsengine.rcp.editors.ChartEditorPart"
|
|
| 32 |
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
|
|
| 31 |
contextId="org.txm.chartsengine.rcp.editors.ChartEditor" |
|
| 32 |
schemeId="org.txm.rcp.scheme"
|
|
| 33 | 33 |
sequence="M1+C"> |
| 34 | 34 |
</key> |
| 35 | 35 |
</extension> |
| ... | ... | |
| 192 | 192 |
<extension |
| 193 | 193 |
point="org.eclipse.ui.contexts"> |
| 194 | 194 |
<context |
| 195 |
id="org.txm.chartsengine.rcp.editors.ChartEditorPart" |
|
| 196 |
name="Chart editor context"> |
|
| 195 |
id="org.txm.chartsengine.rcp.editors.ChartEditor" |
|
| 196 |
name="Chart editor context" |
|
| 197 |
parentId="org.eclipse.ui.contexts.window"> |
|
| 197 | 198 |
</context> |
| 198 | 199 |
</extension> |
| 199 | 200 |
|
| tmp/org.txm.referencer.core/src/org/txm/referencer/core/functions/Referencer.java (revision 922) | ||
|---|---|---|
| 345 | 345 |
* @return the name |
| 346 | 346 |
*/ |
| 347 | 347 |
public String getName() {
|
| 348 |
if(pQuery != null) {
|
|
| 348 |
try {
|
|
| 349 | 349 |
return getCorpus().getName() + ": " + pQuery; //$NON-NLS-1$ |
| 350 | 350 |
} |
| 351 |
else {
|
|
| 351 |
catch (Exception e) {
|
|
| 352 | 352 |
return this.getEmptyName(); |
| 353 |
}
|
|
| 353 |
} |
|
| 354 | 354 |
} |
| 355 | 355 |
|
| 356 | 356 |
/** |
| tmp/org.txm.index.core/src/org/txm/index/core/functions/Lexicon.java (revision 922) | ||
|---|---|---|
| 528 | 528 |
|
| 529 | 529 |
|
| 530 | 530 |
/** |
| 531 |
* Number of dif ferent types in the frequency list.
|
|
| 531 |
* Number of different types in the frequency list. |
|
| 532 | 532 |
* |
| 533 | 533 |
* @return number of types in the corpus or subcorpus. |
| 534 | 534 |
*/ |
| 535 | 535 |
public int nbrOfType() {
|
| 536 |
return freqs.length; |
|
| 536 |
try {
|
|
| 537 |
return freqs.length; |
|
| 538 |
} |
|
| 539 |
catch (Exception e) {
|
|
| 540 |
return 0; |
|
| 541 |
} |
|
| 537 | 542 |
} |
| 538 | 543 |
|
| 539 | 544 |
public void setParameters(Property property) {
|
Formats disponibles : Unified diff