|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.ui.part.WorkbenchPart | +--org.eclipse.ui.part.ViewPart | +--org.eclipse.ui.part.PageBookView | +--org.eclipse.debug.ui.AbstractDebugView
Common function for debug related views:
IDebugView
IUpdate
are updated when updateActions()
is
called.REMOVE_ACTION
when the delete key
is pressed.DOUBLE_CLICK_ACTION
when the mouse
is double-clicked.PageBookView
mechanism.
By default, a page book is created with a page showing
this view's viewer. A message page is also created
and shown when showMessage(String)
is
called.This class may be subclassed.
Nested Class Summary |
Nested classes inherited from class org.eclipse.ui.part.PageBookView |
PageBookView.PageRec, PageBookView.SelectionProvider |
Field Summary |
Fields inherited from interface org.eclipse.debug.ui.IDebugView |
COPY_ACTION, CUT_ACTION, DOUBLE_CLICK_ACTION, FIND_ACTION, PASTE_ACTION, REMOVE_ACTION, SELECT_ALL_ACTION |
Fields inherited from interface org.eclipse.ui.IWorkbenchPart |
PROP_TITLE |
Constructor Summary | |
AbstractDebugView()
Constructs a new debug view. |
Method Summary | |
void |
add(IUpdate updatable)
Adds the given IUpdate to this view's collection of updatable objects. |
void |
asyncExec(Runnable r)
Registers the given runnable with the display associated with this view's control, if any. |
protected abstract void |
configureToolBar(IToolBarManager tbm)
Subclasses implement this menu to contribute actions to the toolbar. |
protected abstract void |
createActions()
Creates this view's actions. |
protected void |
createContextMenu(Control menuControl)
Creates a pop-up menu on the given control. |
protected IPage |
createDefaultPage(PageBook book)
The default page for a debug view is its viewer. |
void |
createPartControl(Composite parent)
Creates this view's underlying viewer and actions. |
protected abstract Viewer |
createViewer(Composite parent)
Creates and returns this view's underlying viewer. |
void |
dispose()
IWorkbenchPart#dispose() |
protected PageBookView.PageRec |
doCreatePage(IWorkbenchPart part)
Creates a new page in the pagebook for a particular part. |
protected void |
doDestroyPage(IWorkbenchPart part,
PageBookView.PageRec pageRecord)
Destroys a page in the pagebook for a particular part. |
void |
doubleClick(DoubleClickEvent event)
Delegate to the DOUBLE_CLICK_ACTION ,
if any. |
protected abstract void |
fillContextMenu(IMenuManager menu)
Subclasses must override this method to fill the context menu each time it is realized. |
protected IViewPart |
findView(String id)
Returns the specified view in this view's page or null if none. |
IAction |
getAction(String actionID)
Returns the action installed under the given action id. |
Object |
getAdapter(Class adapter)
Debug views implement the debug view adapter which provides access to a view's underlying viewer and debug model presentation for a specific debug model. |
protected IWorkbenchPart |
getBootstrapPart()
Returns the active, important workbench part for this view. |
IMenuManager |
getContextMenuManager()
Returns the context menu manager for this view. |
protected Control |
getDefaultControl()
Returns the default control for this view. |
protected abstract String |
getHelpContextId()
Returns this view's help context id, which is hooked to this view on creation. |
protected IMemento |
getMemento()
Returns the memento that contains the persisted state of the view. |
protected MessagePage |
getMessagePage()
Returns this view's message page |
IDebugModelPresentation |
getPresentation(String id)
Returns the debug model presentation for this view specified by the debug model identifier. |
protected StructuredViewer |
getStructuredViewer()
Returns this view's viewer as a structured viewer, or null if none. |
protected TextViewer |
getTextViewer()
Returns this view's viewer as a text viewer, or null if none. |
Viewer |
getViewer()
Returns the viewer contained in this debug view. |
protected void |
handleKeyPressed(KeyEvent event)
Handles key events in viewer. |
void |
init(IViewSite site,
IMemento memento)
Initializes this view with the given view site. |
protected void |
initActionState(IMemento memento,
IAction action)
Restores the persisted checked state of the action as stored in the memento. |
protected void |
initializeToolBar()
Configures this view's toolbar. |
boolean |
isAvailable()
Returns whether this view's viewer is currently available. |
protected boolean |
isImportant(IWorkbenchPart part)
Returns whether the given part should be added to this view. |
void |
remove(IUpdate updatable)
Removes the given IUpdate from this view's collection of updatable objects. |
protected void |
saveActionState(IMemento memento,
IAction action)
Persists the checked state of the action in the memento. |
void |
saveState(IMemento memento)
Persists the state of the enabled check box actions contributed to this view. |
void |
setAction(String actionID,
IAction action)
Installs the given action under the given action id. |
protected void |
setMemento(IMemento memento)
Sets the memento that contains the persisted state of the view. |
void |
showMessage(String message)
Shows the given message in this view's message' page. |
void |
showViewer()
Shows this view's viewer page. |
void |
syncExec(Runnable r)
Registers the given runnable with the display associated with this view's control, if any. |
void |
updateObjects()
Updates all the registered updatables. |
Methods inherited from class org.eclipse.ui.part.PageBookView |
getCurrentContributingPart, getCurrentPage, getDefaultPage, getPageBook, getPageRec, getPageRec, getPageSite, getSelectionProvider, init, initPage, partActivated, partBroughtToTop, partClosed, partDeactivated, partOpened, setFocus, showPageRec |
Methods inherited from class org.eclipse.ui.part.ViewPart |
getViewSite |
Methods inherited from class org.eclipse.ui.part.WorkbenchPart |
addPropertyListener, firePropertyChange, getConfigurationElement, getDefaultImage, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener, setInitializationData, setSite, setTitle, setTitleImage, setTitleToolTip |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.ui.IViewPart |
getViewSite, init |
Methods inherited from interface org.eclipse.ui.IWorkbenchPart |
addPropertyListener, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener, setFocus |
Constructor Detail |
public AbstractDebugView()
Method Detail |
public Object getAdapter(Class adapter)
getAdapter
in interface IAdaptable
getAdapter
in class WorkbenchPart
adapter
- the adapter class to look up
null
if this object does not
have an adapter for the given classIAdaptable.getAdapter(java.lang.Class)
,
IDebugView
public void createPartControl(Composite parent)
REMOVE_ACTION
is invoked. Hooks help to
this view. Subclasses must implement the following methods
which are called in the following order when a view is
created:createViewer(Composite)
- the context
menu is hooked to the viewer's control.createActions()
configureToolBar(IToolBarManager)
getHelpContextId()
createPartControl
in interface IWorkbenchPart
createPartControl
in class PageBookView
parent
- the parent controlIWorkbenchPart.createPartControl(Composite)
,
createPartControl(Composite)
,
createActions()
,
configureToolBar(IToolBarManager)
,
getHelpContextId()
,
fillContextMenu(IMenuManager)
protected IPage createDefaultPage(PageBook book)
createDefaultPage
in class PageBookView
book
- the pagebook control
PageBookView.createDefaultPage(PageBook)
protected abstract Viewer createViewer(Composite parent)
parent
- the parent controlprotected abstract void createActions()
createViewer(Composite)
protected abstract String getHelpContextId()
public void dispose()
dispose
in interface IWorkbenchPart
dispose
in class PageBookView
public Viewer getViewer()
IDebugView
getViewer
in interface IDebugView
IDebugView.getViewer()
protected StructuredViewer getStructuredViewer()
null
if none.
null
protected TextViewer getTextViewer()
null
if none.
null
public IDebugModelPresentation getPresentation(String id)
IDebugView
getPresentation
in interface IDebugView
id
- the debug model identifier that corresponds to the id
attribute of a debug model presentation extension
null
if no
presentation is registered for the specified idIDebugView.getPresentation(String)
protected void createContextMenu(Control menuControl)
#fillContextMenu(IMenuManager)
which will
be called each time the context menu is realized.
menuControl
- the control with which the pop-up
menu will be associated with.public IMenuManager getContextMenuManager()
IDebugView
getContextMenuManager
in interface IDebugView
null
if noneIDebugView.getContextMenuManager()
protected abstract void fillContextMenu(IMenuManager menu)
menu
- the context menuprotected void initializeToolBar()
#configureToolBar(IToolBarManager)
to
contribute actions to the toolbar.
To properly initialize toggle actions that are contributed to this view, state is restored for toggle actions that have a persisted state in the view's memento. As well, any toggle actions that have an initial state of 'checked' are invoked. The actions' states are restored and the actions are invoked in a runnable, after the view is created.
protected abstract void configureToolBar(IToolBarManager tbm)
createActions()
.
tbm
- the tool bar manager for this view's sitecreateViewer(Composite)
public void setAction(String actionID, IAction action)
IDebugView
IUpdate
it is added/remove
from the collection of updateables associated with this view.
setAction
in interface IDebugView
action
- the action, or null
to clear itIDebugView.setAction(String, IAction)
public IAction getAction(String actionID)
IDebugView
getAction
in interface IDebugView
null
if noneIDebugView.getAction(String)
public void updateObjects()
protected void handleKeyPressed(KeyEvent event)
REMOVE_ACTION
when the delete
key is pressed
public void doubleClick(DoubleClickEvent event)
DOUBLE_CLICK_ACTION
,
if any.
doubleClick
in interface IDoubleClickListener
event
- event object describing the double-clickIDoubleClickListener.doubleClick(DoubleClickEvent)
public void asyncExec(Runnable r)
Display.asyncExec(java.lang.Runnable)
public void syncExec(Runnable r)
Display.syncExec(java.lang.Runnable)
public void init(IViewSite site, IMemento memento) throws PartInitException
IViewPart
This method is automatically called by the workbench shortly after part construction. It marks the start of the views's lifecycle. Clients must not call this method.
init
in interface IViewPart
init
in class ViewPart
site
- the view sitememento
- the IViewPart state or null if there is no previous saved state
PartInitException
- if this view was not initialized successfullyIViewPart.init(IViewSite, IMemento)
protected IMemento getMemento()
null
.
protected void setMemento(IMemento memento)
public void saveState(IMemento memento)
saveState
in interface IViewPart
saveState
in class ViewPart
memento
- a memento to receive the object stateIViewPart.saveState(IMemento)
protected void saveActionState(IMemento memento, IAction action)
Integer
: 1
meaning the action is checked; 0
representing unchecked.
protected void initActionState(IMemento memento, IAction action)
The state was persisted as an Integer
: 1
meaning the action is checked; 0
representing unchecked.
memento
- the memento used to persist the actions stateaction
- the action that needs its state restored.protected IViewPart findView(String id)
null
if none.
id
- view identifier
protected boolean isImportant(IWorkbenchPart part)
PageBookView
Subclasses must implement this method.
isImportant
in class PageBookView
part
- the input part
true
if the part is relevant, and false
otherwisePageBookView.isImportant(IWorkbenchPart)
protected PageBookView.PageRec doCreatePage(IWorkbenchPart part)
PageBookView
doDestroyPage
.
Subclasses must implement this method.
Subclasses must call initPage with the new page (if it is an
IPageBookViewPage
) before calling createControl
on the page.
doCreatePage
in class PageBookView
part
- the input part
PageBookView.doCreatePage(IWorkbenchPart)
protected void doDestroyPage(IWorkbenchPart part, PageBookView.PageRec pageRecord)
PageBookView
doCreatePage
.
Subclasses must implement this method.
doDestroyPage
in class PageBookView
part
- the input partpageRecord
- a page record for the partPageBookView#doDestroyPage(IWorkbenchPart, PageRec)
protected IWorkbenchPart getBootstrapPart()
PageBookView
When the page book view is created it has no idea which part within
the workbook should be used to generate the first page. Therefore, it
delegates the choice to subclasses of PageBookView
.
Implementors of this method should return an active, important part
in the workbench or null
if none found.
Subclasses must implement this method.
getBootstrapPart
in class PageBookView
null
if nonePageBookView.getBootstrapPart()
protected Control getDefaultControl()
protected MessagePage getMessagePage()
public void showMessage(String message)
message
- the message to displaypublic void showViewer()
public boolean isAvailable()
public void add(IUpdate updatable)
IDebugView
add
in interface IDebugView
updatable
- The IUpdate instance to be addedIDebugView.add(IUpdate)
public void remove(IUpdate updatable)
IDebugView
remove
in interface IDebugView
updatable
- The IUpdate instance to be removedIDebugView.remove(IUpdate)
|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |