aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Besedin2012-03-14 11:26:03 (EDT)
committerOleg Besedin2012-03-19 09:38:52 (EDT)
commit884b73ac201456cb81617acf0d87728bfa0c61e1 (patch)
tree8aba4b2427008dbf3d6712bdce814a8f4ca8f609
parentbd105d713f616ea81f3d0c9c7b93e81e306e4810 (diff)
downloadeclipse.platform.ui-884b73ac201456cb81617acf0d87728bfa0c61e1.zip
eclipse.platform.ui-884b73ac201456cb81617acf0d87728bfa0c61e1.tar.gz
eclipse.platform.ui-884b73ac201456cb81617acf0d87728bfa0c61e1.tar.bz2
Bug 373294 - Improve startup time
-rw-r--r--bundles/org.eclipse.e4.core.contexts.debug/src/org/eclipse/e4/core/internal/contexts/debug/ui/e4/ContextsDebugProcessor.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/bundles/org.eclipse.e4.core.contexts.debug/src/org/eclipse/e4/core/internal/contexts/debug/ui/e4/ContextsDebugProcessor.java b/bundles/org.eclipse.e4.core.contexts.debug/src/org/eclipse/e4/core/internal/contexts/debug/ui/e4/ContextsDebugProcessor.java
index 293d77b..11a2f6a 100644
--- a/bundles/org.eclipse.e4.core.contexts.debug/src/org/eclipse/e4/core/internal/contexts/debug/ui/e4/ContextsDebugProcessor.java
+++ b/bundles/org.eclipse.e4.core.contexts.debug/src/org/eclipse/e4/core/internal/contexts/debug/ui/e4/ContextsDebugProcessor.java
@@ -32,6 +32,8 @@ import org.eclipse.e4.ui.workbench.swt.internal.copy.WorkbenchSWTMessages;
public class ContextsDebugProcessor {
+ private final String DESCRIPTOR_ID = "org.eclipse.e4.core.contexts.debug.ui.view"; //$NON-NLS-1$
+
@Inject
public ContextsDebugProcessor() {
// placeholder
@@ -40,10 +42,14 @@ public class ContextsDebugProcessor {
@Execute
public void addDebugDescriptor(MApplication application) {
List<MPartDescriptor> descriptors = application.getDescriptors();
+ for (MPartDescriptor desc : descriptors) {
+ if (DESCRIPTOR_ID.equals(desc.getElementId()))
+ return; // we already have a descriptor
+ }
MPartDescriptor descriptor = BasicFactoryImpl.eINSTANCE.createPartDescriptor();
descriptor.setLabel("Contexts"); // XXX translate
- descriptor.setElementId("org.eclipse.e4.core.contexts.debug.ui.view");
+ descriptor.setElementId(DESCRIPTOR_ID);
descriptor.setCategory("org.eclipse.e4.secondaryDataStack"); //$NON-NLS-1$
List<String> tags = descriptor.getTags();
@@ -55,7 +61,7 @@ public class ContextsDebugProcessor {
descriptor.setContributionURI("bundleclass://org.eclipse.e4.core.contexts.debug/org.eclipse.e4.core.internal.contexts.debug.ui.ContextsView");
descriptor.setIconURI("platform:/plugin/org.eclipse.e4.core.contexts.debug/icons/full/obj16/contexts.gif");
- application.getDescriptors().add(descriptor);
+ descriptors.add(descriptor);
}
}