/** * Returns the context service this action linked to. By default, this actions is * associated with the context service for the window this action is operating in. * * @return associated context service */ protected IDebugContextService getDebugContextService() { return DebugUITools.getDebugContextManager().getContextService(fWindow); }
private EvaluationContextManager() { DebugUITools.getDebugContextManager().addDebugContextListener(this); }
private IDebugContextService getContextService(IWorkbenchWindow window) { return DebugUITools.getDebugContextManager().getContextService(window); }
public SourceLookupService(IWorkbenchWindow window) { fWindow = window; fDebugContextService = DebugUITools.getDebugContextManager().getContextService(window); fDebugContextService.addDebugContextListener(this); }
@Override public void dispose() { DebugUITools.getDebugContextManager().getContextService(fWindow).removeDebugContextListener(fContextListener); super.dispose(); } /* (non-Javadoc)
@Override public synchronized void dispose() { super.dispose(); if (fWindow != null) { DebugUITools.getDebugContextManager().getContextService(fWindow).removeDebugContextListener(this); fWindow = null; } }
@Override public void dispose() { DebugUITools.getDebugContextManager().getContextService(fActivePart.getSite().getWorkbenchWindow()).removeDebugContextListener(fContextListener); fActivePart = null; fPartTarget = null; } /* (non-Javadoc)
public void propertyChange(PropertyChangeEvent event) { if (IJDIPreferencesConstants.PREF_OPEN_INSPECT_POPUP_ON_EXCEPTION.equals(event.getProperty())) { IDebugContextManager manager = DebugUITools.getDebugContextManager(); if (JDIDebugUIPlugin.getDefault().getPluginPreferences().getBoolean(IJDIPreferencesConstants.PREF_OPEN_INSPECT_POPUP_ON_EXCEPTION)) { manager.addDebugContextListener(this); } else { manager.removeDebugContextListener(this); } } }
/** * Disposes this action. Clients must call this method when * this action is no longer needed. */ public void dispose() { IDebugContextManager manager = DebugUITools.getDebugContextManager(); if (fActivePart != null) { manager.getContextService(fActivePart.getSite().getWorkbenchWindow()).removeDebugContextListener(fContextListener); } fActivePart = null; fTargetElement = null; fPartTarget = null; }
/** * Returns the active debug context given the active part. It is used * in creating the evaluation context for the factories' enablement expression. * @param part active part * @return current active debug context */ private IStructuredSelection getDebugContext(IWorkbenchPart part) { ISelection selection = DebugUITools.getDebugContextManager(). getContextService(part.getSite().getWorkbenchWindow()).getActiveContext(); if (selection instanceof IStructuredSelection) { return (IStructuredSelection)selection; } return StructuredSelection.EMPTY; }
/** * Constructor */ public ExceptionInspector() { Preferences pluginPreferences = JDIDebugUIPlugin.getDefault().getPluginPreferences(); pluginPreferences.addPropertyChangeListener(this); if (pluginPreferences.getBoolean(IJDIPreferencesConstants.PREF_OPEN_INSPECT_POPUP_ON_EXCEPTION)) { DebugUITools.getDebugContextManager().addDebugContextListener(this); } }
@Override public void init(IWorkbenchWindow window) { super.init(window); IDebugContextService service = DebugUITools.getDebugContextManager().getContextService(window); service.addDebugContextListener(fContextListener); ISelection activeContext = service.getActiveContext(); fContextListener.contextActivated(activeContext); }
@Override public void init(IViewPart view) { fView = view; DebugUITools.getDebugContextManager().getContextService(fView.getViewSite().getWorkbenchWindow()).addDebugContextListener(fDebugContextListener); DebugPlugin.getDefault().getMemoryBlockManager().addListener(fListener); fUpdateJob.runInUIThread(new NullProgressMonitor()); }
/** * Returns the element of the currently selected context in the * active workbench window. Returns <code>null</code> if there is no * current debug context. * <p> * This method used to return <code>null</code> when called from a non-UI thread, * but since 3.1, this methods also works when called from a non-UI thread. * </p> * @return the currently selected debug context, or <code>null</code> * @since 2.0 */ public static IAdaptable getDebugContext() { IWorkbenchWindow activeWindow = SelectedResourceManager.getDefault().getActiveWindow(); if (activeWindow != null) { ISelection activeContext = DebugUITools.getDebugContextManager().getContextService(activeWindow).getActiveContext(); return getDebugContextElementForSelection(activeContext); } return null; }
private void initializeListeners() { IDebugContextManager manager = DebugUITools.getDebugContextManager(); IWorkbenchWindow workbenchWindow = fActivePart.getSite().getWorkbenchWindow(); IDebugContextService service = manager.getContextService(workbenchWindow); service.addDebugContextListener(fContextListener); fPartTarget = fActivePart.getAdapter(IRunToLineTarget.class); if (fPartTarget == null) { IAdapterManager adapterManager = Platform.getAdapterManager(); if (adapterManager.hasAdapter(fActivePart, IRunToLineTarget.class.getName())) { fPartTarget = (IRunToLineTarget) adapterManager.loadAdapter(fActivePart, IRunToLineTarget.class.getName()); } } ISelection activeContext = service.getActiveContext(); fContextListener.contextActivated(activeContext); }
/** * Returns the active debug context for this view based on the view's * site IDs. * * @return Active debug context for this view. * * @since 3.7 */ protected ISelection getDebugContext() { IViewSite site = (IViewSite)getSite(); IDebugContextService contextService = DebugUITools.getDebugContextManager().getContextService(site.getWorkbenchWindow()); return contextService.getActiveContext(site.getId(), site.getSecondaryId()); }
@Override public void dispose() { fAction = null; DebugPlugin.getDefault().getMemoryBlockManager().removeListener(fListener); DebugUITools.getDebugContextManager().getContextService(fView.getViewSite().getWorkbenchWindow()).removeDebugContextListener(fDebugContextListener); if (fMenuCreator != null) { fMenuCreator.dispose(); } }
void dispose() { // Unregister listener to breakpoint organizers. IBreakpointOrganizer[] organizers; synchronized(this) { organizers = fOrganizers; fOrganizers = null; } registerOrganizersListener(organizers, null); // Unregister listener to presentation context. fInput.getContext().removePropertyChangeListener(fPresentationContextListener); // Unregister listener to debug context in window. IWorkbenchWindow window = fInput.getContext().getWindow(); if (window != null) { IDebugContextService debugContextService = DebugUITools.getDebugContextManager().getContextService(window); debugContextService.removeDebugContextListener(fDebugContextListener); } }
private DebugModelContextBindingManager() { loadDebugModelContextBindings(); loadDebugModelActivityExtensions(); DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this); DebugUITools.getDebugContextManager().addDebugContextListener(this); IWorkbenchActivitySupport activitySupport = PlatformUI.getWorkbench().getActivitySupport(); activitySupport.getActivityManager().addActivityManagerListener(this); }
@Override public void init(IPageBookViewPage page, IConsole console) { fPage = page; fConsole = (ProcessConsole) console; fRemoveTerminated = new ConsoleRemoveLaunchAction(fConsole.getProcess().getLaunch()); fRemoveAllTerminated = new ConsoleRemoveAllTerminatedAction(); fTerminate = new ConsoleTerminateAction(page.getSite().getWorkbenchWindow(), fConsole); fStdOut = new ShowStandardOutAction(); fStdErr = new ShowStandardErrorAction(); fView = (IConsoleView) fPage.getSite().getPage().findView(IConsoleConstants.ID_CONSOLE_VIEW); DebugPlugin.getDefault().addDebugEventListener(this); DebugUITools.getDebugContextManager().getContextService(fPage.getSite().getWorkbenchWindow()).addDebugContextListener(this); // contribute to toolbar IActionBars actionBars = fPage.getSite().getActionBars(); configureToolBar(actionBars.getToolBarManager()); // create handler and submissions for EOF fEOFHandler = new EOFHandler(); }