Issue #1541 Fixed tool activation so always happens in part activated/deactivated listener.

Change-Id: I515bfe867c4ad9c74280173badae408d0ee5dab9

Former-commit-id: 1255469084 [formerly eaae098e29] [formerly 4fae854006] [formerly ad37f68537 [formerly 4fae854006 [formerly c0f98136403a05755d1c7c640f264f1bafe64a4f]]]
Former-commit-id: ad37f68537
Former-commit-id: 44472abf492b5c54704e9e81afafe3a668b3bfa3 [formerly 9d2a960cb4]
Former-commit-id: 88d5c2f793
This commit is contained in:
Max Schenkelberg 2013-01-29 17:33:11 -06:00
parent d25d858a66
commit 5d59242f46
2 changed files with 15 additions and 6 deletions

View file

@ -136,6 +136,20 @@ public abstract class AbstractVizPerspectiveManager implements
@Override
public void partDeactivated(IWorkbenchPart part) {
// update editor on last selected modal tool
if (part instanceof IEditorPart
&& part instanceof IDisplayPaneContainer) {
AbstractVizPerspectiveManager mgr = VizPerspectiveListener
.getCurrentPerspectiveManager();
if (mgr != null) {
for (AbstractModalTool tool : mgr.getToolManager()
.getSelectedModalTools()) {
if (tool.getCurrentEditor() == part) {
tool.deactivate();
}
}
}
}
}
@Override
@ -362,12 +376,6 @@ public abstract class AbstractVizPerspectiveManager implements
page.hideEditor(ref);
}
for (AbstractModalTool tool : toolManager.getSelectedModalTools()) {
if (tool != null) {
tool.deactivate();
}
}
deactivateDialogs();
deactivateContexts();
removeFromStatusLine();

View file

@ -156,6 +156,7 @@ public abstract class AbstractModalTool extends AbstractTool {
this.setEnabled(false);
if (editor != null) {
deactivateTool();
editor = null;
}
}