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<String,IAction> |
fGlobalActions |
protected ArrayList<String> |
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.
|
<T> T |
getAdapter(Class<T> 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 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()
IPageBookViewPage
null
if no site has been set.getSite
in interface IPageBookViewPage
null
public void init(IPageSite pageSite) throws PartInitException
IPageBookViewPage
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.
init
in interface IPageBookViewPage
pageSite
- the page sitePartInitException
- if this page was not initialized successfullyprotected void updateSelectionDependentActions()
public void createControl(Composite parent)
IPage
Clients should not call this method (the workbench calls this method when it needs to, which may be never).
createControl
in interface IPage
parent
- 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()
IPage
getControl
in interface IPage
null
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 IPage
actionBars
- the action bars for this pagepublic void setFocus()
IPage
public void propertyChange(PropertyChangeEvent event)
IPropertyChangeListener
This method gets called when the observed object fires a property change event.
propertyChange
in interface IPropertyChangeListener
event
- 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 <T> T getAdapter(Class<T> required)
IAdaptable
null
if
no such object can be found.getAdapter
in interface IAdaptable
required
- 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 viewer
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.