Class TextConsolePage

java.lang.Object
org.eclipse.ui.console.TextConsolePage
All Implemented Interfaces:
EventListener, IAdaptable, IPropertyChangeListener, IPage, IPageBookViewPage

public class TextConsolePage extends Object implements IPageBookViewPage, IPropertyChangeListener, IAdaptable
A page for a text console.

Clients may contribute actions to the context menu of a text console page using the org.eclipse.ui.popupMenus extension point. The context menu identifier for a text console page is the associated console's type suffixed with .#ContextMenu. When a console does not specify a type, the context menu id is #ContextMenu.

Clients may subclass this class.

Since:
3.1
  • Field Details

  • Constructor Details

    • TextConsolePage

      public TextConsolePage(TextConsole console, IConsoleView view)
      Constructs a text console page for the given console in the given view.
      Parameters:
      console - text console
      view - console view the page is contained in
  • Method Details

    • createViewer

      protected TextConsoleViewer createViewer(Composite parent)
      Returns a viewer used to display the contents of this page's console.
      Parameters:
      parent - container for the viewer
      Returns:
      a viewer used to display the contents of this page's console
    • getSite

      public IPageSite getSite()
      Description copied from interface: IPageBookViewPage
      Returns the site for this page. May be null if no site has been set.
      Specified by:
      getSite in interface IPageBookViewPage
      Returns:
      the page site or null
    • init

      public void init(IPageSite pageSite) throws PartInitException
      Description copied from interface: IPageBookViewPage
      Initializes this page with the given page site.

      This method is automatically called by the workbench shortly after page construction. It marks the start of the pages's lifecycle. Clients must not call this method.

      Specified by:
      init in interface IPageBookViewPage
      Parameters:
      pageSite - the page site
      Throws:
      PartInitException - if this page was not initialized successfully
    • updateSelectionDependentActions

      protected void updateSelectionDependentActions()
      Updates selection dependent actions.
    • createControl

      public void createControl(Composite parent)
      Description copied from interface: IPage
      Creates the SWT control for this page under the given parent control.

      Clients should not call this method (the workbench calls this method when it needs to, which may be never).

      Specified by:
      createControl in interface IPage
      Parameters:
      parent - the parent control
    • dispose

      public void dispose()
      Description copied from interface: IPage
      Disposes of this page.

      This is the last method called on the IPage. Implementors should clean up any resources associated with the page.

      Callers of this method should ensure that the page's control (if it exists) has been disposed before calling this method. However, for backward compatibilty, implementors must also ensure that the page's control has been disposed before this method returns.

      Note that there is no guarantee that createControl() has been called, so the control may never have been created.

      Specified by:
      dispose in interface IPage
    • getControl

      public Control getControl()
      Description copied from interface: IPage
      Returns the SWT control for this page.
      Specified by:
      getControl in interface IPage
      Returns:
      the SWT control for this page, or null if this page does not have a control
    • setActionBars

      public void setActionBars(IActionBars actionBars)
      Description copied from interface: IPage
      Allows the page to make contributions to the given action bars. The contributions will be visible when the page is visible.

      This method is automatically called shortly after createControl is called

      Specified by:
      setActionBars in interface IPage
      Parameters:
      actionBars - the action bars for this page
    • setFocus

      public void setFocus()
      Description copied from interface: IPage
      Asks this page to take focus within its pagebook view.
      Specified by:
      setFocus in interface IPage
    • propertyChange

      public void propertyChange(PropertyChangeEvent event)
      Description copied from interface: IPropertyChangeListener
      Notification that a property has changed.

      This method gets called when the observed object fires a property change event.

      Specified by:
      propertyChange in interface IPropertyChangeListener
      Parameters:
      event - the property change event object describing which property changed and how
    • createActions

      protected void createActions()
      Creates actions.
    • setGlobalAction

      protected void setGlobalAction(IActionBars actionBars, String actionID, IAction action)
      Configures an action for key bindings.
      Parameters:
      actionBars - action bars for this page
      actionID - action definition id
      action - associated action
    • getAdapter

      public <T> T getAdapter(Class<T> required)
      Description copied from interface: IAdaptable
      Returns an object which is an instance of the given class associated with this object. Returns null if no such object can be found.

      Clients may implement this method but should generally call Adapters.adapt(Object, Class, boolean) rather than invoking it directly.

      Specified by:
      getAdapter in interface IAdaptable
      Type Parameters:
      T - the class type
      Parameters:
      required - the adapter class to look up
      Returns:
      a object of the given class, or null if this object does not have an adapter for the given class
    • getConsoleView

      protected IConsoleView getConsoleView()
      Returns the view this page is contained in.
      Returns:
      the view this page is contained in
    • getConsole

      protected IConsole getConsole()
      Returns the console this page is displaying.
      Returns:
      the console this page is displaying
    • updateAction

      protected void updateAction(String actionId)
      Updates the global action with the given id
      Parameters:
      actionId - action definition id
    • contextMenuAboutToShow

      protected void contextMenuAboutToShow(IMenuManager menuManager)
      Fill the context menu
      Parameters:
      menuManager - menu
    • configureToolBar

      protected void configureToolBar(IToolBarManager mgr)
    • getViewer

      public TextConsoleViewer getViewer()
      Returns the viewer contained in this page.
      Returns:
      the viewer contained in this page
    • setViewer

      public void setViewer(TextConsoleViewer viewer)
      Sets the viewer contained in this page.
      Parameters:
      viewer - text viewer