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
-
Constructor Summary
ConstructorDescriptionTextConsolePage
(TextConsole console, IConsoleView view) Constructs a text console page for the given console in the given view. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
contextMenuAboutToShow
(IMenuManager menuManager) Fill the context menuprotected void
Creates actions.void
createControl
(Composite parent) Creates the SWT control for this page under the given parent control.protected TextConsoleViewer
createViewer
(Composite parent) Returns a viewer used to display the contents of this page's console.void
dispose()
Disposes of this page.<T> T
getAdapter
(Class<T> required) Returns an object which is an instance of the given class associated with this object.protected IConsole
Returns the console this page is displaying.protected IConsoleView
Returns 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.void
Initializes this page with the given page site.void
Notification that a property has changed.void
setActionBars
(IActionBars actionBars) Allows the page to make contributions to the given action bars.void
setFocus()
Asks this page to take focus within its pagebook view.protected void
setGlobalAction
(IActionBars actionBars, String actionID, IAction action) Configures an action for key bindings.void
setViewer
(TextConsoleViewer viewer) Sets the viewer contained in this page.protected void
updateAction
(String actionId) Updates the global action with the given idprotected void
Updates 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:IPageBookViewPage
Returns the site for this page. May benull
if no site has been set.- Specified by:
getSite
in interfaceIPageBookViewPage
- Returns:
- the page site or
null
-
init
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 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: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 interfaceIPage
- 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.
-
getControl
Description copied from interface:IPage
Returns the SWT control for this page.- Specified by:
getControl
in interfaceIPage
- Returns:
- the SWT control for this page, or
null
if this page does not have a control
-
setActionBars
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 interfaceIPage
- 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. -
propertyChange
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 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:IAdaptable
Returns an object which is an instance of the given class associated with this object. Returnsnull
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 interfaceIAdaptable
- 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
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
-