@Override public void init(IPageBookViewPage page, IConsole console) { Preconditions.checkArgument(console instanceof DeployConsole, "console should be instance of %s", DeployConsole.class.getName()); this.console = (DeployConsole) console; console.addPropertyChangeListener(new IPropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent event) { if (event.getProperty().equals(DeployConsole.PROPERTY_JOB)) { // keep the order of adding a listener and then calling update() to ensure update // is called regardless of when the job finishes addJobChangeListener(); update(); } } }); IActionBars actionBars = page.getSite().getActionBars(); configureToolBar(actionBars.getToolBarManager()); // keep the order of adding a listener and then calling update() to ensure update // is called regardless of when the job finishes addJobChangeListener(); update(); }
@Override public void init(IPageBookViewPage page, IConsole console) { IPageSite pageSite = page.getSite(); IWorkbenchPage workbenchPage = pageSite.getPage(); IViewPart viewPart = workbenchPage.findView(IConsoleConstants.ID_CONSOLE_VIEW); IViewSite viewSite = viewPart.getViewSite(); IActionBars actionBars = viewSite.getActionBars(); IToolBarManager toolBarManager = actionBars.getToolBarManager(); IContributionItem[] items = toolBarManager.getItems(); for(int i = 0; i < items.length; ++i) { IContributionItem item = items[i]; if(item instanceof ActionContributionItem) { IAction action = ((ActionContributionItem) item).getAction(); String text = action.getText(); if(text.equals("Pi&n Console") || text.equals("Open Console")) toolBarManager.remove(item); } } }
private void updateOutLineView( IFormPage activePageInstance ) { if ( outlinePage == null ) { return; } if ( reloadOutlinePage( ) ) { return; } Object designOutLinePage = activePageInstance.getAdapter( IContentOutlinePage.class ); if ( designOutLinePage instanceof DesignerOutlinePage ) { ( (DesignerOutlinePage) designOutLinePage ).setBackupState( outlineBackup ); } outlinePage.setActivePage( (IPageBookViewPage) designOutLinePage ); }
public void outlineSwitch( ) { if ( !getActivePageInstance( ).getId( ).equals( XMLSourcePage_ID ) || outlinePage == null ) { return; } if ( outlinePage.getCurrentPage( ) instanceof DesignerOutlinePage ) { outlinePage.setActivePage( (IPageBookViewPage) getActivePageInstance( ).getAdapter( ContentOutlinePage.class ) ); } else { outlinePage.setActivePage( (IPageBookViewPage) getActivePageInstance( ).getAdapter( IContentOutlinePage.class ) ); } outlinePage.getSite( ).getActionBars( ).updateActionBars( ); }
public boolean reloadOutlinePage( ) { if ( !getActivePageInstance( ).getId( ).equals( XMLSourcePage_ID ) || outlinePage == null || !getCurrentPageInstance( ).getId( ) .equals( XMLSourcePage_ID ) ) { return false; } if ( outlinePage.getCurrentPage( ) instanceof DesignerOutlinePage || outlinePage.getCurrentPage( ) == null || outlinePage.getCurrentPage( ) instanceof EmptyPage ) { outlinePage.setActivePage( (IPageBookViewPage) getActivePageInstance( ).getAdapter( IContentOutlinePage.class ) ); } else { outlinePage.setActivePage( (IPageBookViewPage) getActivePageInstance( ).getAdapter( ContentOutlinePage.class ) ); } if ( outlinePage.getSite( ) != null ) { outlinePage.getSite( ).getActionBars( ).updateActionBars( ); } return true; }
@Override public void init(IPageBookViewPage viewPage, IConsole console) { Control control = viewPage.getControl(); String consoleName = console.getName(); if (control instanceof StyledText) { this.tc = (StyledText) control; util = new TextUtil(tc); boolean gdbConsole = consoleName.endsWith(" gdb"); // For now, only support the gdb console if (gdbConsole) { tc.addVerifyKeyListener(this); tc.addMouseListener(this); tc.addLineStyleListener(this); } } else { String exception = "This plugin requires that the ProcessConsole " + "is using a StyledText control"; throw new IllegalStateException(exception); } }
@Override public void init(IPageBookViewPage viewPage, IConsole console) { super.init(viewPage, console); SimpleContentProposalProvider proposalsProvider = new SimpleContentProposalProvider( proposals); proposalsProvider.setFiltering(true); KeyStroke ctrlSpace = null; try { ctrlSpace = KeyStroke.getInstance("Ctrl+Space"); } catch (ParseException e) { e.printStackTrace(); } ContentProposalAdapter adapter = new ContentProposalAdapter(tc, new StyledTextContentAdapter(util), proposalsProvider, ctrlSpace, null); adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE); }
@Override public void init(IPageBookViewPage page, IConsole console) { if (!(console instanceof ProcessConsole)) { return; } ProcessConsole processConsole = (ProcessConsole) console; IProcess process = processConsole.getProcess(); if (process == null) { return; } String attribute = process.getAttribute(Constants.PYDEV_DEBUG_IPROCESS_ATTR); if (!Constants.PYDEV_DEBUG_IPROCESS_ATTR_TRUE.equals(attribute)) { //Only provide the console page return; } if (page instanceof IOConsolePage) { final CurrentPyStackFrameForConsole currentPyStackFrameForConsole = new CurrentPyStackFrameForConsole( console); IOConsolePage consolePage = (IOConsolePage) page; this.promptOverlay = new PromptOverlay(consolePage, processConsole, currentPyStackFrameForConsole); } }
@Override public void init ( final IPageBookViewPage page, final IConsole console ) { final ItemTraceIOConsole traceConsole = (ItemTraceIOConsole)console; this.mgr = page.getSite ().getActionBars ().getToolBarManager (); this.mgr.appendToGroup ( IConsoleConstants.OUTPUT_GROUP, new StopAction ( traceConsole ) ); this.mgr.appendToGroup ( IConsoleConstants.OUTPUT_GROUP, new CloseAction ( traceConsole ) ); }
@Override public void init(IPageBookViewPage page, IConsole console) { action = new ShowConsoleAction(); page.getSite().getActionBars().getToolBarManager() .appendToGroup(IConsoleConstants.OUTPUT_GROUP, action); pageControl = page.getControl(); prefs.addPropertyChangeListener(action); }
@Override public void init(IPageBookViewPage page, IConsole console) { Control control = page.getControl(); if (control instanceof StyledText) { /* connect only to EGRADLE consoles */ /* * only process consoles with EGradle in name are handled or the * dedicated EGradle console */ String type = console.getType(); String name = console.getName(); boolean needsEGradleStyling = false; needsEGradleStyling = needsEGradleStyling || console instanceof EGradleSystemConsole; needsEGradleStyling = needsEGradleStyling || ("org.eclipse.debug.ui.ProcessConsoleType".equals(type) && name.indexOf("EGradle") != -1); if (!needsEGradleStyling) { return; } /* Add EGradle process style listener to viewer */ StyledText viewer = (StyledText) control; EGradleConsoleStyleListener myListener = new EGradleConsoleStyleListener(); viewer.addLineStyleListener(myListener); IDEActivator.getDefault().addViewer(viewer, this); } }
@Override public void init(final IPageBookViewPage page, final IConsole console) { menuAction = new ShowConsoleMenuAction( Messages.getString("TFSMessageConsolePageParticipant.ShowConsoleMenu"), //$NON-NLS-1$ imageHelper.getImageDescriptor("/images/common/console_showmessages.gif")); //$NON-NLS-1$ messageAction = new ShowConsoleAction( Messages.getString("TFSMessageConsolePageParticipant.ShowConsoleForNewMessage"), //$NON-NLS-1$ UIPreferenceConstants.CONSOLE_SHOW_ON_NEW_MESSAGE, null); warningAction = new ShowConsoleAction( Messages.getString("TFSMessageConsolePageParticipant.ShowConsoleForNewWarning"), //$NON-NLS-1$ UIPreferenceConstants.CONSOLE_SHOW_ON_NEW_WARNING, null); errorAction = new ShowConsoleAction( Messages.getString("TFSMessageConsolePageParticipant.ShowConsoleForNewError"), //$NON-NLS-1$ UIPreferenceConstants.CONSOLE_SHOW_ON_NEW_ERROR, null); // contribute to menubar menuAction.addAction(messageAction); menuAction.addAction(warningAction); menuAction.addAction(errorAction); // contribute to toolbar final IActionBars actionBars = page.getSite().getActionBars(); actionBars.getToolBarManager().appendToGroup(IConsoleConstants.OUTPUT_GROUP, menuAction); }
@Override public void init(IPageBookViewPage page, IConsole console) { this.console = (LocalAppEngineConsole) console; // contribute to toolbar IActionBars actionBars = page.getSite().getActionBars(); configureToolBar(actionBars.getToolBarManager()); LocalAppEngineServerBehaviour serverBehaviour = this.console.getServerBehaviourDelegate(); if (serverBehaviour != null) { serverBehaviour.getServer().addServerListener(serverStateListener); } }
@Override public void init(IPageBookViewPage page, IConsole console) { this.fConsole = (TypeScriptConsole) console; this.fTerminate = new ConsoleTerminateAction(fConsole.getProject()); IActionBars actionBars = page.getSite().getActionBars(); configureToolBar(actionBars.getToolBarManager()); }
public void init(IPageBookViewPage page, IConsole console) { if (isCloudFoundryConsole(console)) { CloseConsoleAction closeAction = new CloseConsoleAction(console); closeAction.setImageDescriptor(CloudFoundryImages.CLOSE_CONSOLE); IToolBarManager manager = page.getSite().getActionBars().getToolBarManager(); manager.appendToGroup(IConsoleConstants.LAUNCH_GROUP, closeAction); } }
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 public void init(IPageBookViewPage page, IConsole console1) { removeAction = new RemoveAction(); xmlAction = new ToggleXmlAction(); IActionBars bars = page.getSite().getActionBars(); bars.getToolBarManager().appendToGroup(IConsoleConstants.LAUNCH_GROUP, removeAction); bars.getToolBarManager().appendToGroup(IConsoleConstants.LAUNCH_GROUP, xmlAction); }
@SuppressWarnings({ "unchecked", "rawtypes" }) public void init(IPageBookViewPage page, IConsole console) { if (console instanceof TextConsole) { TextConsole textConsole = (TextConsole) console; Object themeConsoleStreamToColor = textConsole.getAttribute(THEME_CONSOLE_STREAM_TO_COLOR_ATTRIBUTE); if (themeConsoleStreamToColor instanceof Map<?, ?>) { Map m = (Map) themeConsoleStreamToColor; Set<Map.Entry> entrySet = m.entrySet(); for (Map.Entry entry : entrySet) { if (!(entry.getKey() instanceof IOConsoleOutputStream) || !(entry.getValue() instanceof String)) { return; // Cannot handle it. } } this.extension = new ConsoleThemer(textConsole, (Map) themeConsoleStreamToColor); } if (page instanceof TextConsolePage) { TextConsolePage tcp = (TextConsolePage) page; TextViewerThemer themer = new TextViewerThemer(tcp.getViewer()); themer.apply(); } } this.page = page; }
/** * @see org.eclipse.ui.part.PageBookView#doCreatePage(org.eclipse.ui.IWorkbenchPart) */ protected PageRec doCreatePage(IWorkbenchPart part) { // Try to get a custom palette page Object obj = part.getAdapter(PalettePage.class); if (obj != null && obj instanceof IPage) { IPage page = (IPage) obj; page.createControl(getPageBook()); initPage((IPageBookViewPage) page); return new PageRec(part, page); } // Use the default page by returning null return null; }
public void init(IPageBookViewPage page, IConsole console) { IToolBarManager manager = page.getSite().getActionBars().getToolBarManager(); closeAction = new IvyConsoleRemoveAction(console); manager.appendToGroup(IConsoleConstants.LAUNCH_GROUP, closeAction); filterLogAction = new IvyConsoleFilterAction((IvyConsole) console); manager.appendToGroup(IConsoleConstants.LAUNCH_GROUP, filterLogAction); }
private void updateAttributeView( IFormPage activePageInstance ) { if ( attributePage == null ) { return; } Object adapter = activePageInstance.getAdapter( IAttributeViewPage.class ); attributePage.setActivePage( (IPageBookViewPage) adapter ); }
private void updateDateView( IFormPage activePageInstance ) { if ( dataPage == null ) { return; } Object adapter = activePageInstance.getAdapter( IDataViewPage.class ); if ( adapter instanceof DataViewTreeViewerPage ) { ( (DataViewTreeViewerPage) adapter ).setBackupState( dataBackup ); } dataPage.setActivePage( (IPageBookViewPage) adapter ); }
private void updatePaletteView( IFormPage activePageInstance ) { if ( fPalettePage == null ) { return; } Object palette = activePageInstance.getAdapter( PalettePage.class ); fPalettePage.setActivePage( (IPageBookViewPage) palette ); }
public void selectionChanged( SelectionChangedEvent event ) { setSelection( event.getSelection( ) ); StructuredSelection selection = (StructuredSelection) event.getSelection( ); Object obj = selection.getFirstElement( ); if ( obj instanceof IFormPage ) { Object palette = ( (IFormPage) obj ).getAdapter( PalettePage.class ); setActivePage( (IPageBookViewPage) palette ); } }
/** * Creates a new page in the pagebook for a particular part. This page will * be made visible whenever the part is active, and will be destroyed with a * call to <code>doDestroyPage</code>. * * @param part * the input part * @return the record describing a new page for this view * @see #doDestroyPage */ protected PageRec doCreatePage( IWorkbenchPart part ) { Object page = part.getAdapter( IAttributeViewPage.class ); if ( page instanceof IPageBookViewPage ) { initPage( (IPageBookViewPage) page ); ( (IPageBookViewPage) page ).createControl( getPageBook( ) ); return new PageRec( part, (IPageBookViewPage) page ); } return null; }
/** * @see org.eclipse.ui.console.IConsole#createPage(org.eclipse.ui.console.IConsoleView) */ public IPageBookViewPage createPage(IConsoleView view) { IPageBookViewPage page = super.createPage(view); if (page instanceof TextConsolePage) { myPage = (TextConsolePage)page; } return page; }
@Override public void init(IPageBookViewPage page, IConsole console) { this.page = page; this.console = (PydevConsole) console; view = (IConsoleView) page.getSite().getPage().findView(IConsoleConstants.ID_CONSOLE_VIEW); DebugUITools.getDebugContextManager().getContextService(page.getSite().getWorkbenchWindow()) .addDebugContextListener(this); }
public RestartLaunchAction(IPageBookViewPage page, ProcessConsole console) { this.page = page; this.console = console; launch = this.console.getProcess().getLaunch(); launchConfiguration = launch.getLaunchConfiguration(); lastLaunch = launch; lastConfig = launch.getLaunchConfiguration(); update(); }
@Override public void init(IPageBookViewPage page, IConsole console) { try { if (!(console instanceof ProcessConsole)) { return; } ProcessConsole processConsole = (ProcessConsole) console; IProcess process = processConsole.getProcess(); if (process == null) { return; } String attribute = process.getAttribute(RelaunchConstants.PYDEV_ADD_RELAUNCH_IPROCESS_ATTR); if (!RelaunchConstants.PYDEV_ADD_RELAUNCH_IPROCESS_ATTR_TRUE.equals(attribute)) { //Only provide relaunch if specified return; } this.fConsole = processConsole; DebugPlugin.getDefault().addDebugEventListener(this); IActionBars bars = page.getSite().getActionBars(); IToolBarManager toolbarManager = bars.getToolBarManager(); restartLaunchAction = new RestartLaunchAction(page, processConsole); terminateAllLaunchesAction = new TerminateAllLaunchesAction(); toolbarManager.appendToGroup(IConsoleConstants.LAUNCH_GROUP, restartLaunchAction); toolbarManager.appendToGroup(IConsoleConstants.LAUNCH_GROUP, terminateAllLaunchesAction); bars.updateActionBars(); } catch (Exception e) { Log.log(e); } }
public void init(IPageBookViewPage page, IConsole console) { if (page.getControl() instanceof StyledText) { StyledText styledText = (StyledText) (page.getControl()); GradleLineStyleListener gradleLineStyleListener = new GradleLineStyleListener(); styledText.addLineStyleListener(gradleLineStyleListener); } }
public void init(IPageBookViewPage page, IConsole console) { this.consoleRemoveAction = new ConsoleRemoveAction(); IActionBars bars = page.getSite().getActionBars(); bars.getToolBarManager().appendToGroup(IConsoleConstants.LAUNCH_GROUP, consoleRemoveAction); }
public void init(IPageBookViewPage page, IConsole console) { closeAction = new CloseConsoleAction(console); IToolBarManager manager = page.getSite().getActionBars().getToolBarManager(); manager.appendToGroup(IConsoleConstants.LAUNCH_GROUP, closeAction); }
/** * @see org.eclipse.ui.console.IConsole#createPage(org.eclipse.ui.console.IConsoleView) */ public IPageBookViewPage createPage(IConsoleView view) { return new ConsolePage(this); }
public void init(IPageBookViewPage page, IConsole console) { if (console instanceof CustomMessageConsole) { ((CustomMessageConsole) console).setActiveToolbarManager(page.getSite().getActionBars().getToolBarManager()); } }
public void init(IPageBookViewPage page, IConsole console) { if (console.getType() != IDebugUIConstants.ID_PROCESS_CONSOLE_TYPE || !(page instanceof TextConsolePage)) { return; } TextConsolePage consolePage = (TextConsolePage) page; TextConsoleViewer textViewer = consolePage.getViewer(); if (!(textViewer instanceof IOConsoleViewer)) { return; } final IOConsoleViewer viewer = (IOConsoleViewer) textViewer; scrollActionEnabled = viewer.isAutoScroll(); final IToolBarManager toolBarManager = consolePage.getSite().getActionBars().getToolBarManager(); IAction slAction = null; // Look for the ScrollLockAction for (IContributionItem item : toolBarManager.getItems()) { if (item instanceof ActionContributionItem) { IAction action = ((ActionContributionItem) item).getAction(); if (action instanceof ScrollLockAction) { slAction = action; break; } } } textWidget = viewer.getTextWidget(); listener = new ConsoleListener(viewer, toolBarManager, slAction); // Based on Eclipse Snippet191 - Detects scrolling that were initiated by the user. textWidget.addListener(SWT.MouseDown, listener); textWidget.addListener(SWT.MouseMove, listener); textWidget.addListener(SWT.MouseUp, listener); textWidget.addListener(SWT.KeyDown, listener); textWidget.addListener(SWT.KeyUp, listener); ScrollBar vBar = textWidget.getVerticalBar(); if (vBar != null) { vBar.addListener(SWT.Selection, listener); } }
@Override public void init(IPageBookViewPage page, IConsole console1) { removeAction = new RemoveAction(); IActionBars bars = page.getSite().getActionBars(); bars.getToolBarManager().appendToGroup(IConsoleConstants.LAUNCH_GROUP, removeAction); }
@Override public void init(IPageBookViewPage page, IConsole console) { if (page.getControl() instanceof StyledText) { StyledText viewer = (StyledText) page.getControl(); AnsiConsoleStyleListener myListener = new AnsiConsoleStyleListener(); viewer.addLineStyleListener(myListener); ESBRunContainerPlugin.getDefault().addViewer(viewer, this); } startRuntimeAction = new StartRuntimeAction(true, page.getControl().getShell()); haltRuntimeAction = new StopRuntimeAction(page.getControl().getShell()); openRuntimeInfoAction = new OpenRuntimeInfoAction(); openRuntimePrefsAction = new OpenRuntimePrefsAction(); serverListener = new RuntimeStatusChangeListener() { @Override public void stopRunning() { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { startRuntimeAction.setEnabled(true); haltRuntimeAction.setEnabled(false); openRuntimeInfoAction.setEnabled(false); } }); } @Override public void startRunning() { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { startRuntimeAction.setEnabled(false); haltRuntimeAction.setEnabled(true); openRuntimeInfoAction.setEnabled(true); } }); } @Override public void featureUninstalled(int id) { } @Override public void featureInstalled(int id) { } }; RuntimeServerController.getInstance().addStatusChangeListener(serverListener); IActionBars actionBars = page.getSite().getActionBars(); configureToolBar(actionBars.getToolBarManager()); }
@Override public IPageBookViewPage createPage(IConsoleView view) { return new NSISConsolePage(this, view); }
@Override public IPageBookViewPage createPage(IConsoleView view) { page = new CppStyleConsolePage(this, view); return page; }