diff options
Diffstat (limited to 'debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java')
-rw-r--r-- | debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java | 53 |
1 files changed, 29 insertions, 24 deletions
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java index f6391cf6863..bf211af2577 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2010 QNX Software Systems and others. + * Copyright (c) 2004, 2011 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -289,43 +289,48 @@ public class CDebugUIPlugin extends AbstractUIPlugin { @Override public void start( BundleContext context ) throws Exception { super.start( context ); - ViewIDCounterManager.getInstance().init(); fDisassemblyEditorManager = new DisassemblyEditorManager(); - EvaluationContextManager.startup(); CDebugCorePlugin.getDefault().addCBreakpointListener( CBreakpointUpdater.getInstance() ); // Register the CDI backend for DSF's disassembly view Platform.getAdapterManager().registerAdapters(new DisassemblyBackendCdiFactory(), ICDebugElement.class); - // We contribute actions to the platform's Variables view with a - // criteria to enable only when this plugin is loaded. This can lead to - // some edge cases with broken behavior (273306). The solution is to - // force a selection change notification after we get loaded. - WorkbenchJob wjob = new WorkbenchJob("CDT Variable view action updater") { //$NON-NLS-1$ + WorkbenchJob wjob = new WorkbenchJob("Initializing CDT Debug UI") { //$NON-NLS-1$ @Override public IStatus runInUIThread(IProgressMonitor monitor) { - IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows(); - for (IWorkbenchWindow window : windows) { - IWorkbenchPage[] pages = window.getPages(); - for (IWorkbenchPage page : pages) { - IViewReference viewRef = page.findViewReference(IDebugUIConstants.ID_VARIABLE_VIEW); - if (viewRef != null) { - IViewPart part = viewRef.getView(false); - if (part instanceof IDebugView) { - Viewer viewer = ((IDebugView)part).getViewer(); - if (viewer != null) { - viewer.setSelection(viewer.getSelection()); - } - } - } - } - } + startupInUIThread(); return Status.OK_STATUS; } }; wjob.schedule(); } + private void startupInUIThread() { + EvaluationContextManager.startup(); + ViewIDCounterManager.getInstance().init(); + + // We contribute actions to the platform's Variables view with a + // criteria to enable only when this plugin is loaded. This can lead to + // some edge cases with broken behavior (273306). The solution is to + // force a selection change notification after we get loaded. + IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows(); + for (IWorkbenchWindow window : windows) { + IWorkbenchPage[] pages = window.getPages(); + for (IWorkbenchPage page : pages) { + IViewReference viewRef = page.findViewReference(IDebugUIConstants.ID_VARIABLE_VIEW); + if (viewRef != null) { + IViewPart part = viewRef.getView(false); + if (part instanceof IDebugView) { + Viewer viewer = ((IDebugView)part).getViewer(); + if (viewer != null) { + viewer.setSelection(viewer.getSelection()); + } + } + } + } + } + } + /* * (non-Javadoc) * |