Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Besedin2012-02-13 21:04:17 +0000
committerOleg Besedin2012-02-13 21:04:17 +0000
commitdff95701b43229051eb9de5860ec6f2068578c18 (patch)
treebb39c36c06e3943345e3c03efa974a99b59c0e9e
parent73986f3da72f4d8144c980d8216ac01f39ad4565 (diff)
downloadeclipse.platform.ui-dff95701b43229051eb9de5860ec6f2068578c18.tar.gz
eclipse.platform.ui-dff95701b43229051eb9de5860ec6f2068578c18.tar.xz
eclipse.platform.ui-dff95701b43229051eb9de5860ec6f2068578c18.zip
Bug 371424 - WorkbenchPage#getPerspectiveStack() gets called a lot whenv20120213-2104I20120214-0600
opening&closing views
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java19
1 files changed, 14 insertions, 5 deletions
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 583abdd094b..36080af9850 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
@@ -208,6 +208,11 @@ public class WorkbenchPage extends CompatibleWorkbenchPage implements
ArrayList<MPart> activationList = new ArrayList<MPart>();
/**
+ * Cached perspective stack for this workbench page.
+ */
+ private MPerspectiveStack _perspectiveStack;
+
+ /**
* Deactivate the last editor's action bars if another type of editor has
* been activated.
*
@@ -3360,14 +3365,19 @@ UIEvents.UIElement.TOPIC_TOBERENDERED,
* @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)
- return theStack.get(0);
+ if (theStack.size() > 0) {
+ _perspectiveStack = theStack.get(0);
+ return _perspectiveStack;
+ }
for (MWindowElement child : window.getChildren()) {
if (child instanceof MPerspectiveStack) {
- return (MPerspectiveStack) child;
+ _perspectiveStack = (MPerspectiveStack) child;
+ return _perspectiveStack;
}
}
@@ -3398,10 +3408,9 @@ UIEvents.UIElement.TOPIC_TOBERENDERED,
window.getChildren().add(stickySash);
window.setSelectedElement(stickySash);
+ _perspectiveStack = perspectiveStack;
return perspectiveStack;
}
-
-
/**
* Sets the active working set for the workbench page. Notifies property

Back to the top