Class TextConsolePage
- All Implemented Interfaces:
EventListener,IAdaptable,IPropertyChangeListener,IPage,IPageBookViewPage
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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTextConsolePage(TextConsole console, IConsoleView view) Constructs a text console page for the given console in the given view. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidcontextMenuAboutToShow(IMenuManager menuManager) Fill the context menuprotected voidCreates actions.voidcreateControl(Composite parent) Creates the SWT control for this page under the given parent control.protected TextConsoleViewercreateViewer(Composite parent) Returns a viewer used to display the contents of this page's console.voiddispose()Disposes of this page.<T> TgetAdapter(Class<T> required) Returns an object which is an instance of the given class associated with this object.protected IConsoleReturns the console this page is displaying.protected IConsoleViewReturns the view this page is contained in.Returns the SWT control for this page.getSite()Returns the site for this page.Returns the viewer contained in this page.voidInitializes this page with the given page site.voidNotification that a property has changed.voidsetActionBars(IActionBars actionBars) Allows the page to make contributions to the given action bars.voidsetFocus()Asks this page to take focus within its pagebook view.protected voidsetGlobalAction(IActionBars actionBars, String actionID, IAction action) Configures an action for key bindings.voidsetViewer(TextConsoleViewer viewer) Sets the viewer contained in this page.protected voidupdateAction(String actionId) Updates the global action with the given idprotected voidUpdates selection dependent actions.
-
Field Details
-
fGlobalActions
-
fSelectionActions
-
fClearOutputAction
-
-
Constructor Details
-
TextConsolePage
Constructs a text console page for the given console in the given view.- Parameters:
console- text consoleview- console view the page is contained in
-
-
Method Details
-
createViewer
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
Description copied from interface:IPageBookViewPageReturns the site for this page. May benullif no site has been set.- Specified by:
getSitein interfaceIPageBookViewPage- Returns:
- the page site or
null
-
init
Description copied from interface:IPageBookViewPageInitializes 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:
initin interfaceIPageBookViewPage- Parameters:
pageSite- the page site- Throws:
PartInitException- if this page was not initialized successfully
-
updateSelectionDependentActions
protected void updateSelectionDependentActions()Updates selection dependent actions. -
createControl
Description copied from interface:IPageCreates 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:
createControlin interfaceIPage- Parameters:
parent- the parent control
-
dispose
public void dispose()Description copied from interface:IPageDisposes 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.
-
getControl
Description copied from interface:IPageReturns the SWT control for this page.- Specified by:
getControlin interfaceIPage- Returns:
- the SWT control for this page, or
nullif this page does not have a control
-
setActionBars
Description copied from interface:IPageAllows 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
createControlis called- Specified by:
setActionBarsin interfaceIPage- Parameters:
actionBars- the action bars for this page
-
setFocus
public void setFocus()Description copied from interface:IPageAsks this page to take focus within its pagebook view. -
propertyChange
Description copied from interface:IPropertyChangeListenerNotification that a property has changed.This method gets called when the observed object fires a property change event.
- Specified by:
propertyChangein interfaceIPropertyChangeListener- Parameters:
event- the property change event object describing which property changed and how
-
createActions
protected void createActions()Creates actions. -
setGlobalAction
Configures an action for key bindings.- Parameters:
actionBars- action bars for this pageactionID- action definition idaction- associated action
-
getAdapter
Description copied from interface:IAdaptableReturns an object which is an instance of the given class associated with this object. Returnsnullif 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:
getAdapterin interfaceIAdaptable- Type Parameters:
T- the class type- Parameters:
required- the adapter class to look up- Returns:
- a object of the given class, or
nullif this object does not have an adapter for the given class
-
getConsoleView
Returns the view this page is contained in.- Returns:
- the view this page is contained in
-
getConsole
Returns the console this page is displaying.- Returns:
- the console this page is displaying
-
updateAction
Updates the global action with the given id- Parameters:
actionId- action definition id
-
contextMenuAboutToShow
Fill the context menu- Parameters:
menuManager- menu
-
configureToolBar
-
getViewer
Returns the viewer contained in this page.- Returns:
- the viewer contained in this page
-
setViewer
Sets the viewer contained in this page.- Parameters:
viewer- text viewer
-