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

Change-Id: I515bfe867c4ad9c74280173badae408d0ee5dab9

Former-commit-id: 4fae854006 [formerly c0f98136403a05755d1c7c640f264f1bafe64a4f]
Former-commit-id: ad37f68537
This commit is contained in:
Max Schenkelberg 2013-01-29 17:33:11 -06:00
parent 70ed87a093
commit 9d2a960cb4
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;
}
}