Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemy Suen2010-12-01 16:44:50 +0000
committerRemy Suen2010-12-01 16:44:50 +0000
commit6be5686372a2d91aa289ace048ef57f15210ac64 (patch)
treecf0e20c27ffcf58c1d358a434974460065af4113 /bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
parent1797b13e0d4c9627b2b405bce6dab493cf18963e (diff)
downloadeclipse.platform.ui-6be5686372a2d91aa289ace048ef57f15210ac64.tar.gz
eclipse.platform.ui-6be5686372a2d91aa289ace048ef57f15210ac64.tar.xz
eclipse.platform.ui-6be5686372a2d91aa289ace048ef57f15210ac64.zip
Bug 331546 [Compatibility] ViewReferences are eagerly created for parts that aren't visible
Diffstat (limited to 'bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java')
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java31
1 files changed, 21 insertions, 10 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 b5b525bcfa2..75c1ae5cff3 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
@@ -1921,16 +1921,27 @@ public class WorkbenchPage extends CompatibleWorkbenchPage implements
partService.addPartListener(e4PartListener);
- Collection<MPart> parts = partService.getParts();
- for (MPart part : parts) {
- if (part.isToBeRendered()) {
- String uri = part.getContributionURI();
- if (uri.equals(CompatibilityPart.COMPATIBILITY_VIEW_URI)) {
- createViewReferenceForPart(part, part.getElementId());
- } else if (uri.equals(CompatibilityPart.COMPATIBILITY_EDITOR_URI)) {
- // TODO compat: we need that editor input back, or we have
- // squat
- createEditorReferenceForPart(part, null, part.getElementId(), null);
+ // create editor references for all editors
+ List<MPart> editors = modelService.findElements(window,
+ CompatibilityEditor.MODEL_ELEMENT_ID, MPart.class, null,
+ EModelService.IN_ANY_PERSPECTIVE | EModelService.OUTSIDE_PERSPECTIVE);
+ for (MPart editor : editors) {
+ createEditorReferenceForPart(editor, null, editor.getElementId(), null);
+ }
+
+ // create view references for rendered view placeholders
+ List<MPlaceholder> placeholders = modelService.findElements(window, null,
+ MPlaceholder.class, null, EModelService.IN_ANY_PERSPECTIVE
+ | EModelService.OUTSIDE_PERSPECTIVE);
+ for (MPlaceholder placeholder : placeholders) {
+ if (placeholder.isToBeRendered()) {
+ MUIElement ref = placeholder.getRef();
+ if (ref instanceof MPart) {
+ MPart part = (MPart) ref;
+ String uri = part.getContributionURI();
+ if (uri.equals(CompatibilityPart.COMPATIBILITY_VIEW_URI)) {
+ createViewReferenceForPart(part, part.getElementId());
+ }
}
}
}

Back to the top