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:
parent
70ed87a093
commit
9d2a960cb4
2 changed files with 15 additions and 6 deletions
|
@ -136,6 +136,20 @@ public abstract class AbstractVizPerspectiveManager implements
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void partDeactivated(IWorkbenchPart part) {
|
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
|
@Override
|
||||||
|
@ -362,12 +376,6 @@ public abstract class AbstractVizPerspectiveManager implements
|
||||||
page.hideEditor(ref);
|
page.hideEditor(ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (AbstractModalTool tool : toolManager.getSelectedModalTools()) {
|
|
||||||
if (tool != null) {
|
|
||||||
tool.deactivate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
deactivateDialogs();
|
deactivateDialogs();
|
||||||
deactivateContexts();
|
deactivateContexts();
|
||||||
removeFromStatusLine();
|
removeFromStatusLine();
|
||||||
|
|
|
@ -156,6 +156,7 @@ public abstract class AbstractModalTool extends AbstractTool {
|
||||||
this.setEnabled(false);
|
this.setEnabled(false);
|
||||||
if (editor != null) {
|
if (editor != null) {
|
||||||
deactivateTool();
|
deactivateTool();
|
||||||
|
editor = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue