public ConsoleRemoveAllTerminatedAction() { super(ConsoleMessages.ConsoleRemoveAllTerminatedAction_0); PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.CONSOLE_REMOVE_ALL_TERMINATED); setToolTipText(ConsoleMessages.ConsoleRemoveAllTerminatedAction_1); setImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_REMOVE_ALL)); setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_REMOVE_ALL)); setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_REMOVE_ALL)); DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this); update(); }
@Override public void launchesTerminated(ILaunch[] launches) { update(); } }
@Override public void update() { ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches(); for (int i = 0; i < launches.length; i++) { ILaunch launch = launches[i]; if (launch.isTerminated()) { setEnabled(true); return; } } setEnabled(false); }
@Override public void dispose() { DebugUITools.getDebugContextManager().getContextService(fPage.getSite().getWorkbenchWindow()).removeDebugContextListener(this); DebugPlugin.getDefault().removeDebugEventListener(this); if (fRemoveTerminated != null) { fRemoveTerminated.dispose(); fRemoveTerminated = null; } if (fRemoveAllTerminated != null) { fRemoveAllTerminated.dispose(); fRemoveAllTerminated = null; } if (fTerminate != null) { fTerminate.dispose(); fTerminate = null; } if (fStdOut != null) { fStdOut.dispose(); fStdOut = null; } if (fStdErr != null) { fStdErr.dispose(); fStdErr = null; } fConsole = null; }
@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(); }