summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorEric Moffatt2013-06-25 16:09:45 (EDT)
committer Eric Moffatt2013-07-17 11:35:00 (EDT)
commit38ea5984944342cee3ca93522ac2dc1ec6652950 (patch)
treeb07442010be2d7baad1a5dbbd26a3a3487c9504e
parentdfe61b2c79977df80c8208405770347d157b862d (diff)
downloadeclipse.platform.ui-38ea5984944342cee3ca93522ac2dc1ec6652950.zip
eclipse.platform.ui-38ea5984944342cee3ca93522ac2dc1ec6652950.tar.gz
eclipse.platform.ui-38ea5984944342cee3ca93522ac2dc1ec6652950.tar.bz2
Initial code for [Bug 411386] Enable separate UI presentations based on
monitor configurations Change-Id: I35a8a1a991ec3d6c99ca4eee92bb4c919a6d26bd
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/MinMaxAddon.java19
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/TrimStack.java4
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java2
3 files changed, 18 insertions, 7 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/MinMaxAddon.java b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/MinMaxAddon.java
index 63f6db0..58431a9 100644
--- a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/MinMaxAddon.java
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/MinMaxAddon.java
@@ -295,11 +295,20 @@ public class MinMaxAddon {
final MPerspective curPersp = ps.getSelectedElement();
if (curPersp != null) {
+ List<String> tags = new ArrayList<String>();
+ tags.add(IPresentationEngine.MINIMIZED);
+
+ List<MUIElement> minimizedElements = modelService.findElements(curPersp, null,
+ MUIElement.class, tags);
// Show any minimized stack from the current perspective
String perspId = '(' + curPersp.getElementId() + ')';
- for (MToolControl tc : tcList) {
- if (tc.getObject() instanceof TrimStack && tc.getElementId().contains(perspId)) {
- tc.setVisible(true);
+ for (MUIElement ele : minimizedElements) {
+ String fullId = ele.getElementId() + perspId;
+
+ for (MToolControl tc : tcList) {
+ if (fullId.equals(tc.getElementId())) {
+ tc.setToBeRendered(true);
+ }
}
}
@@ -317,7 +326,7 @@ public class MinMaxAddon {
if (tc.getObject() instanceof TrimStack && tc.getElementId().contains(perspId)) {
TrimStack ts = (TrimStack) tc.getObject();
ts.showStack(false);
- tc.setVisible(false);
+ tc.setToBeRendered(false);
}
}
}
@@ -573,7 +582,7 @@ public class MinMaxAddon {
MWindow window = modelService.getTopLevelWindowFor(element);
String trimId = element.getElementId() + getMinimizedElementSuffix(element);
MToolControl trimStack = (MToolControl) modelService.find(trimId, window);
- if (trimStack == null)
+ if (trimStack == null || trimStack.getObject() == null)
return;
TrimStack ts = (TrimStack) trimStack.getObject();
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/TrimStack.java b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/TrimStack.java
index ba35b35..1fd9c0d 100644
--- a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/TrimStack.java
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/TrimStack.java
@@ -656,6 +656,10 @@ public class TrimStack {
}
}
+ public MUIElement getMinimizedElement() {
+ return minimizedElement;
+ }
+
private MUIElement findElement() {
MUIElement result;
List<MPerspectiveStack> ps = modelService.findElements(window, null,
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
index 9f44399..5028f77 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
@@ -3960,8 +3960,6 @@ public class WorkbenchPage extends CompatibleWorkbenchPage implements
* @return the stack of perspectives of this page's containing window
*/
private MPerspectiveStack getPerspectiveStack() {
- if (_perspectiveStack != null)
- return _perspectiveStack;
List<MPerspectiveStack> theStack = modelService.findElements(window, null,
MPerspectiveStack.class, null);
if (theStack.size() > 0) {