Révision 2320
tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/SWTChartsComponentsProvider.java (revision 2320) | ||
---|---|---|
1 | 1 |
package org.txm.chartsengine.rcp; |
2 | 2 |
|
3 | 3 |
|
4 |
import java.io.File; |
|
5 | 4 |
import java.util.ArrayList; |
6 | 5 |
import java.util.Arrays; |
7 | 6 |
import java.util.List; |
... | ... | |
437 | 436 |
Event eevent = (Event)event.getTrigger(); |
438 | 437 |
Widget widget = eevent.widget; |
439 | 438 |
|
440 |
IWorkbenchPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart(); |
|
441 | 439 |
// Toolbars |
442 | 440 |
if(event != null && widget instanceof ToolItem) { |
443 | 441 |
ToolItem to = (ToolItem) widget; |
... | ... | |
449 | 447 |
chartEditor = ((AdvancedChartEditorToolBar)((ToolItem)((Event)event.getTrigger()).widget).getParent()).getEditorPart(); |
450 | 448 |
} |
451 | 449 |
} |
452 |
// Context menu, multi pages editor |
|
453 |
else if(part instanceof TXMMultiPageEditor) { |
|
454 |
TXMMultiPageEditor mpart = (TXMMultiPageEditor) part; |
|
455 |
// Main editor |
|
456 |
if(mpart.getMainEditorPart() instanceof ChartEditor |
|
457 |
&& ((ChartEditor)mpart.getMainEditorPart()).hasFocus()) { |
|
458 |
chartEditor = (ChartEditor)mpart.getMainEditorPart(); |
|
450 |
else { |
|
451 |
IWorkbenchPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart(); |
|
452 |
|
|
453 |
// Context menu, multi pages editor |
|
454 |
if(part instanceof TXMMultiPageEditor) { |
|
455 |
TXMMultiPageEditor editor = (TXMMultiPageEditor) part; |
|
456 |
// Main editor |
|
457 |
if(editor.getMainEditorPart() instanceof ChartEditor |
|
458 |
&& ((ChartEditor)editor.getMainEditorPart()).hasFocus()) { |
|
459 |
chartEditor = (ChartEditor)editor.getMainEditorPart(); |
|
460 |
} |
|
461 |
// FIXME: SJ: became useless? |
|
462 |
// else if(((MultiPageEditorPart) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()).getSelectedPage() instanceof ChartEditor |
|
463 |
// && ((ChartEditor)((MultiPageEditorPart) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()).getSelectedPage()).hasFocus() ) { |
|
464 |
// chartEditor = (ChartEditor)((MultiPageEditorPart) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()).getSelectedPage(); |
|
465 |
// } |
|
459 | 466 |
} |
460 |
// FIXME: SJ: became useless? |
|
461 |
// else if(((MultiPageEditorPart) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()).getSelectedPage() instanceof ChartEditor |
|
462 |
// && ((ChartEditor)((MultiPageEditorPart) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()).getSelectedPage()).hasFocus() ) { |
|
463 |
// chartEditor = (ChartEditor)((MultiPageEditorPart) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()).getSelectedPage(); |
|
464 |
// } |
|
467 |
// Context menu, Normal editor |
|
468 |
else if(part instanceof ChartEditor) { |
|
469 |
chartEditor = (ChartEditor) part; |
|
470 |
} |
|
465 | 471 |
} |
466 |
// Context menu, Normal editor |
|
467 |
else if(part instanceof ChartEditor) { |
|
468 |
chartEditor = (ChartEditor) part; |
|
469 |
} |
|
470 | 472 |
return chartEditor; |
471 | 473 |
} |
472 | 474 |
|
Formats disponibles : Unified diff