public class TextConsolePage extends Object implements IPageBookViewPage, IPropertyChangeListener, IAdaptable
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.
| Modifier and Type | Field and Description |
|---|---|
protected ClearOutputAction |
fClearOutputAction |
protected Map |
fGlobalActions |
protected ArrayList |
fSelectionActions |
| Constructor and Description |
|---|
TextConsolePage(TextConsole console,
IConsoleView view)
Constructs a text console page for the given console in the given view.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
configureToolBar(IToolBarManager mgr) |
protected void |
contextMenuAboutToShow(IMenuManager menuManager)
Fill the context menu
|
protected void |
createActions()
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.
|
Object |
getAdapter(Class required)
Returns an object which is an instance of the given class
associated with this object.
|
protected IConsole |
getConsole()
Returns the console this page is displaying.
|
protected IConsoleView |
getConsoleView()
Returns the view this page is contained in.
|
Control |
getControl()
Returns the SWT control for this page.
|
IPageSite |
getSite()
Returns the site for this page.
|
TextConsoleViewer |
getViewer()
Returns the viewer contained in this page.
|
void |
init(IPageSite pageSite)
Initializes this page with the given page site.
|
void |
propertyChange(PropertyChangeEvent event)
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 id
|
protected void |
updateSelectionDependentActions()
Updates selection dependent actions.
|
protected Map fGlobalActions
protected ArrayList fSelectionActions
protected ClearOutputAction fClearOutputAction
public TextConsolePage(TextConsole console, IConsoleView view)
console - text consoleview - console view the page is contained inprotected TextConsoleViewer createViewer(Composite parent)
parent - container for the viewerpublic IPageSite getSite()
IPageBookViewPagenull
if no site has been set.getSite in interface IPageBookViewPagenullpublic void init(IPageSite pageSite) throws PartInitException
IPageBookViewPageThis 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.
init in interface IPageBookViewPagepageSite - the page sitePartInitException - if this page was not initialized successfullyprotected void updateSelectionDependentActions()
public void createControl(Composite parent)
IPageClients should not call this method (the workbench calls this method when it needs to, which may be never).
createControl in interface IPageparent - the parent controlpublic void dispose()
IPage
This is the last method called on the IPage. Implementors should
clean up any resources associated with the page.
Note that there is no guarantee that createControl() has been called, so the control may never have been created.
public Control getControl()
IPagegetControl in interface IPagenull if this
page does not have a controlpublic void setActionBars(IActionBars actionBars)
IPage
This method is automatically called shortly after
createControl is called
setActionBars in interface IPageactionBars - the action bars for this pagepublic void setFocus()
IPagepublic void propertyChange(PropertyChangeEvent event)
IPropertyChangeListenerThis method gets called when the observed object fires a property change event.
propertyChange in interface IPropertyChangeListenerevent - the property change event object describing which property
changed and howprotected void createActions()
protected void setGlobalAction(IActionBars actionBars, String actionID, IAction action)
actionBars - action bars for this pageactionID - action definition idaction - associated actionpublic Object getAdapter(Class required)
IAdaptablenull if
no such object can be found.getAdapter in interface IAdaptablerequired - the adapter class to look upnull if this object does not
have an adapter for the given classprotected IConsoleView getConsoleView()
protected IConsole getConsole()
protected void updateAction(String actionId)
actionId - action definition idprotected void contextMenuAboutToShow(IMenuManager menuManager)
menuManager - menuprotected void configureToolBar(IToolBarManager mgr)
public TextConsoleViewer getViewer()
public void setViewer(TextConsoleViewer viewer)
viewer - text viewerGuidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.