@Override public void init(IPageBookViewPage page, IConsole console) { fCloseAction = new CloseConsoleAction(console); IToolBarManager manager = page.getSite().getActionBars().getToolBarManager(); manager.appendToGroup(IConsoleConstants.LAUNCH_GROUP, fCloseAction); }
/** * Prepares the page in the given page rec for use in this view. * * @param rec */ private void preparePage(PageRec rec) { IPageSite site = null; Integer count; if (!doesPageExist(rec.page)) { if (rec.page instanceof IPageBookViewPage) { site = ((IPageBookViewPage) rec.page).getSite(); } if (site == null) { // We will create a site for our use site = new PageSite(getViewSite()); } mapPageToSite.put(rec.page, site); rec.subActionBars = (SubActionBars) site.getActionBars(); rec.subActionBars.addPropertyChangeListener(actionBarPropListener); // for backward compability with IPage rec.page.setActionBars(rec.subActionBars); count = Integer.valueOf(0); } else { site = mapPageToSite.get(rec.page); rec.subActionBars = (SubActionBars) site.getActionBars(); count = mapPageToNumRecs.get(rec.page); } mapPageToNumRecs.put(rec.page, Integer.valueOf(count.intValue() + 1)); }
@Override public void activated() { // add EOF submissions IPageSite site = fPage.getSite(); if(fActivatedContext == null && fActivatedHandler == null) { IHandlerService handlerService = site.getService(IHandlerService.class); IContextService contextService = site.getService(IContextService.class); fActivatedContext = contextService.activateContext(fContextId); fActivatedHandler = handlerService.activateHandler("org.eclipse.debug.ui.commands.eof", fEOFHandler); //$NON-NLS-1$ } }
@Override public void deactivated() { // remove EOF submissions IPageSite site = fPage.getSite(); IHandlerService handlerService = site.getService(IHandlerService.class); IContextService contextService = site.getService(IContextService.class); handlerService.deactivateHandler(fActivatedHandler); contextService.deactivateContext(fActivatedContext); fActivatedContext = null; fActivatedHandler = null; }
public void init(IPageBookViewPage page, IConsole console) { closeAction = new CloseConsoleAction(console); IToolBarManager manager = page.getSite().getActionBars().getToolBarManager(); manager.appendToGroup(IConsoleConstants.LAUNCH_GROUP, closeAction); }
public void init(IPageBookViewPage page, IConsole console) { fCloseAction = new CloseConsoleAction(console); IToolBarManager manager = page.getSite().getActionBars().getToolBarManager(); manager.appendToGroup(IConsoleConstants.LAUNCH_GROUP, fCloseAction); fFormatAction = new FormatStackTraceActionDelegate((JavaStackTraceConsole) console); }
protected void initPage(ISynchronizePageConfiguration configuration, IPageBookViewPage page) { // A page site does not provide everything the page may need // Also provide the synchronize page site if the page is a synchronize view page ((SynchronizePageConfiguration)configuration).setSite(new WorkbenchPartSynchronizePageSite(this, page.getSite(), getDialogSettings(configuration.getParticipant()))); if (page instanceof ISynchronizePage) { try { ((ISynchronizePage)page).init(configuration.getSite()); } catch (PartInitException e) { TeamUIPlugin.log(IStatus.ERROR, e.getMessage(), e); } } page.getSite().getActionBars().setGlobalActionHandler(ActionFactory.REFRESH.getId(), fPageDropDown); page.getSite().getActionBars().updateActionBars(); }
protected void initPage(ISynchronizePageConfiguration configuration, IPageBookViewPage page) { // A page site does not provide everything the page may need // Also provide the synchronize page site if the page is a synchronize view page ((SynchronizePageConfiguration)configuration).setSite(new WorkbenchPartSynchronizePageSite(this, page.getSite(), getDialogSettings(configuration.getParticipant()))); if (page instanceof ISynchronizePage) { try { ((ISynchronizePage)page).init(configuration.getSite()); } catch (PartInitException e) { TeamUIPlugin.log(IStatus.ERROR, e.getMessage(), e); } } page.getSite().getActionBars().setGlobalActionHandler(ActionFactory.REFRESH.getId(), fRefreshAction); page.getSite().getActionBars().updateActionBars(); }
protected void initPage(IPageBookViewPage page) { super.initPage(page); page.getSite().getActionBars().setGlobalActionHandler(ActionFactory.REFRESH.getId(), fSearchAgainAction); page.getSite().getActionBars().updateActionBars(); ISearchResultPage srPage= (ISearchResultPage) page; IMemento memento= null; if (fPageState != null) { IMemento[] mementos= fPageState.getChildren(MEMENTO_TYPE); for (int i= 0; i < mementos.length; i++) { if (mementos[i].getID().equals(srPage.getID())) { memento= mementos[i]; break; } } } srPage.restoreState(memento); }
private void run() { IWorkbenchPart part = page.getSite().getWorkbenchWindow().getActivePage().getActivePart(); ConsoleOpenAction action = EditorPropertyTester.hasAbstractConsole(part); if (action != null) action.run(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(); }
public void init(IPageBookViewPage page, IConsole console) { this.consoleRemoveAction = new MavenConsoleRemoveAction(); this.debugAction = new MavenDebugOutputAction(); showOnOutputAction = new ShowOnOutputAction(console, SHOW_ON_OUTPUT_LBL); showOnErrorAction = new ShowOnErrorAction(console, SHOW_ON_ERR_LBL); IActionBars actionBars = page.getSite().getActionBars(); configureToolBar(actionBars.getToolBarManager()); }
public void init(IPageBookViewPage myPage, IConsole console) { page = myPage; IToolBarManager toolBarManager = page.getSite().getActionBars() .getToolBarManager(); toolBarManager.appendToGroup(IConsoleConstants.OUTPUT_GROUP, new Separator()); toolBarManager.appendToGroup(IConsoleConstants.OUTPUT_GROUP, new Action( LogViewerPlugin.getResourceString("logviewer.action.openwith.name"), UIImages.getImageDescriptor(ILogViewerConstants.IMG_LOG_VIEWER)) { public void run() { ConsolePageParticipant.this.run(); } }); }
@Override protected void initPage(IPageBookViewPage page) { super.initPage(page); IActionBars actionBars= page.getSite().getActionBars(); actionBars.setGlobalActionHandler(ActionFactory.REFRESH.getId(), fSearchAgainAction); actionBars.updateActionBars(); fUndoRedoActionGroup.fillActionBars(actionBars); ISearchResultPage srPage= (ISearchResultPage) page; IMemento memento= null; if (fPageState != null) { IMemento[] mementos= fPageState.getChildren(MEMENTO_TYPE); for (IMemento memento2 : mementos) { if (memento2.getID().equals(srPage.getID())) { memento= memento2; break; } } } srPage.restoreState(memento); }
/** * Copies the view's global action handlers created by createActions(), * into the page site's action bars. This is necessary because the page * book view resets the view site's global actions after each page switch * (see bug 264618). * * @param page Page to copy the global actions into. * * @since 3.5 */ private void setGlobalActionBarsToPage(IPageBookViewPage page) { IActionBars pageActionBars = page.getSite().getActionBars(); // Set the view site action bars created by createActions() to the // default page site. IActionBars bars = getViewSite().getActionBars(); pageActionBars.setGlobalActionHandler(FIND_ACTION, bars.getGlobalActionHandler(FIND_ACTION)); pageActionBars.setGlobalActionHandler(COPY_ACTION, bars.getGlobalActionHandler(COPY_ACTION)); }
@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 protected PageRec doCreatePage(IWorkbenchPart part) { HistoryPageSourceWorkbenchPart p = (HistoryPageSourceWorkbenchPart) part; IHistoryPageSource source = p.getSource(); IPageBookViewPage page = source.createPage(p.getObject()); if (page != null) { initPage(page); IHistoryPage historyPage = (IHistoryPage) page; historyPage.addPropertyChangeListener(this); historyPage.setSite(new WorkbenchHistoryPageSite(this, page.getSite())); page.createControl(getPageBook()); historyPage.setInput(p.getObject()); ((HistoryPage)page).setHistoryView(this); setContentDescription(historyPage.getName()); return new PageRec(part, page); } return null; }