From 884b73ac201456cb81617acf0d87728bfa0c61e1 Mon Sep 17 00:00:00 2001 From: Oleg Besedin Date: Wed, 14 Mar 2012 11:26:03 -0400 Subject: Bug 373294 - Improve startup time --- .../internal/contexts/debug/ui/e4/ContextsDebugProcessor.java | 10 ++++++++-- 1 file 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 293d77b4dc5..11a2f6afebc 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 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 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); } } -- cgit v1.2.3