diff options
| author | Tom Schindl | 2012-04-13 15:19:42 +0000 |
|---|---|---|
| committer | Tom Schindl | 2012-04-13 15:19:42 +0000 |
| commit | e6b7de262207f204d76bf5650a6ff531c5381da2 (patch) | |
| tree | bd6df431c15ce0aac4c546339256e56f6a447553 | |
| parent | 0e62440540c9ff7a295e7a71918de5e81542df4c (diff) | |
| download | eclipse.platform.ui-e6b7de262207f204d76bf5650a6ff531c5381da2.tar.gz eclipse.platform.ui-e6b7de262207f204d76bf5650a6ff531c5381da2.tar.xz eclipse.platform.ui-e6b7de262207f204d76bf5650a6ff531c5381da2.zip | |
Bug 355763 - Provide tag which prohibits a PartStack to collapse whenv20120413-1519
empty
2 files changed, 17 insertions, 5 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/cleanupaddon/CleanupAddon.java b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/cleanupaddon/CleanupAddon.java index 3dff1074ee5..00eec793953 100644 --- a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/cleanupaddon/CleanupAddon.java +++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/cleanupaddon/CleanupAddon.java @@ -28,6 +28,7 @@ import org.eclipse.e4.ui.model.application.ui.basic.MTrimBar; import org.eclipse.e4.ui.model.application.ui.basic.MWindow; import org.eclipse.e4.ui.model.application.ui.menu.MMenuElement; import org.eclipse.e4.ui.model.application.ui.menu.MToolBar; +import org.eclipse.e4.ui.workbench.IPresentationEngine; import org.eclipse.e4.ui.workbench.UIEvents; import org.eclipse.e4.ui.workbench.modeling.EModelService; import org.eclipse.e4.ui.workbench.renderers.swt.SashLayout; @@ -62,7 +63,8 @@ public class CleanupAddon { // Determine the elements that should *not* ever be auto-destroyed if (container instanceof MApplication || container instanceof MPerspectiveStack || container instanceof MMenuElement || container instanceof MTrimBar - || container instanceof MToolBar || container instanceof MArea) { + || container instanceof MToolBar || container instanceof MArea + || container.getTags().contains(IPresentationEngine.NO_AUTO_COLLAPSE)) { return; } @@ -262,6 +264,11 @@ public class CleanupAddon { if (!container.isToBeRendered()) container.setToBeRendered(true); } else { + // Never hide the container marked as no_close + if (container.getTags().contains(IPresentationEngine.NO_AUTO_COLLAPSE)) { + return; + } + int visCount = modelService.countRenderableChildren(container); // Remove stacks with no visible children from the display (but not the diff --git a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/IPresentationEngine.java b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/IPresentationEngine.java index 3eae9018004..db6f7698dba 100644 --- a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/IPresentationEngine.java +++ b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/IPresentationEngine.java @@ -43,6 +43,11 @@ public interface IPresentationEngine { public static final String NO_CLOSE = "NoClose"; //$NON-NLS-1$ /** + * Don't remove the element from the display even if it has no displayable children + */ + public static final String NO_AUTO_COLLAPSE = "NoAutoCollapse"; //$NON-NLS-1$ + + /** * When applied as a tag to an MUIElement inhibits moving the element (ie. through DnD... */ public static final String NO_MOVE = "NoMove"; //$NON-NLS-1$ @@ -69,10 +74,10 @@ public interface IPresentationEngine { public static String MINIMIZED_BY_ZOOM = "MinimizedByZoom"; //$NON-NLS-1$ /** - * This key should be used to add an optional String to an element that is a - * URI to the elements disabled icon. This is used, for example, by Toolbar Items - * which, in Eclipse SDK, provide a unique icon for disabled tool items that look better - * than the OS default graying on the default icon. + * This key should be used to add an optional String to an element that is a URI to the elements + * disabled icon. This is used, for example, by Toolbar Items which, in Eclipse SDK, provide a + * unique icon for disabled tool items that look better than the OS default graying on the + * default icon. * * There is a strong argument to be made that this disabledIconURI actually be part of the model */ |
