Skip to content

Commit 50c2ad6

Browse files
committed
The PerspectiveSwitcher respects the IPresentationEngine.NO_MOVE tag on
its MToolControl. Drag and drop reordering of perspective items is now prevented if the Perspective Switcher tool control has the NoMove tag. Example usage (programmatic): // To lock the perspective switcher reordering: toolControl.getTags().add(IPresentationEngine.NO_MOVE); // To unlock: toolControl.getTags().remove(IPresentationEngine.NO_MOVE); Otherwise: use the e4 model spy to set this tag
1 parent 96b5ffb commit 50c2ad6

File tree

1 file changed

+4
-0
lines changed
  • bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/e4/ui/workbench/addons/perspectiveswitcher

1 file changed

+4
-0
lines changed

bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/e4/ui/workbench/addons/perspectiveswitcher/PerspectiveSwitcher.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
import org.eclipse.e4.ui.model.application.ui.basic.MTrimBar;
5050
import org.eclipse.e4.ui.model.application.ui.basic.MWindow;
5151
import org.eclipse.e4.ui.model.application.ui.menu.MToolControl;
52+
import org.eclipse.e4.ui.workbench.IPresentationEngine;
5253
import org.eclipse.e4.ui.workbench.UIEvents;
5354
import org.eclipse.e4.ui.workbench.modeling.EModelService;
5455
import org.eclipse.jface.preference.IPreferenceStore;
@@ -454,6 +455,9 @@ public void mouseDown(MouseEvent e) {
454455
// We're only interested if the button went down over a
455456
// perspective item
456457
if (downItem != null && downItem.getData() instanceof MPerspective) {
458+
if (perspSwitcherToolControl.getTags().contains(IPresentationEngine.NO_MOVE)) {
459+
return;
460+
}
457461
dragItem = downItem;
458462
}
459463
}

0 commit comments

Comments
 (0)