public abstract class AbstractDebugView extends PageBookView implements IDebugView, IDoubleClickListener
IDebugViewIUpdate
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.becomesVisible() and becomesHidden().getHelpContextId().This class may be subclassed.
PageBookView.PageRec, PageBookView.SelectionProviderCOPY_ACTION, CUT_ACTION, DOUBLE_CLICK_ACTION, FIND_ACTION, PASTE_ACTION, REMOVE_ACTION, SELECT_ALL_ACTIONPROP_TITLE| Constructor and Description |
|---|
AbstractDebugView()
Constructs a new debug view.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(IUpdate updatable)
Adds the given IUpdate to this view's collection of updatable
objects.
|
void |
addContextMenuManager(IMenuManager contextMenuManager)
Adds a context menu manager that is relevant to this view.
|
void |
asyncExec(Runnable r)
Registers the given runnable with the display
associated with this view's control, if any.
|
protected void |
becomesHidden()
Notification this view is now hidden.
|
protected void |
becomesVisible()
Notification this view is now visible.
|
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.
|
protected void |
deregisterPartListener()
Unregisters and disposes this event handler's part listener.
|
void |
dispose()
The
PageBookView implementation of this
IWorkbenchPart method cleans up all the pages. |
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. |
protected String |
generatePreferenceKey(IAction action)
Generate a String that can be used as a key into a preference store based
on the specified action.
|
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()
Deprecated.
@see AbstractDebugView.getContextMenuManagers()
|
List |
getContextMenuManagers()
Returns the context menu managers relevant to this view.
|
protected Control |
getControl()
Returns the control for this view, or
null if none. |
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
|
protected IPreferenceStore |
getPreferenceStore()
Convenience method to return the preference store for the Debug UI
plug-in.
|
IDebugModelPresentation |
getPresentation(String id)
Returns the debug model presentation for this view specified
by the debug model identifier.
|
Map |
getPresentationAttributes(String modelId)
Returns a map of the current attribute settings in the model
presentation in this view associated with the given debug model.
|
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(IAction action)
Restores the persisted checked state of the specified action that was
stored in preferences.
|
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.
|
boolean |
isVisible()
Returns whether this view is currently visible.
|
protected void |
registerPartListener()
Creates and registers a part listener with this event handler's page,
if one does not already exist.
|
void |
remove(IUpdate updatable)
Removes the given IUpdate from this view's collection of updatable
objects.
|
protected void |
saveAllCheckedActionStates()
Saves the checked state for all actions contributed to the toolbar
manager that function as a toggle action.
|
protected void |
saveCheckedActionState(IAction action)
Save the checked state of the specified action in the Debug UI plugin's
preference store.
|
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.
|
protected void |
setViewer(Viewer viewer)
Sets the viewer for this 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.
|
doesPageExist, getCurrentContributingPart, getCurrentPage, getDefaultPage, getPageBook, getPageRec, getPageRec, getPageSite, getSelectionProvider, getViewAdapter, init, initPage, partActivated, partBroughtToTop, partClosed, partDeactivated, partOpened, setFocus, showPageReccheckSite, getViewSite, saveState, setContentDescription, setInitializationData, setPartNameaddPropertyListener, firePropertyChange, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener, setSite, setTitle, setTitleImage, setTitleToolTip, showBusyaddListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObjectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetViewSite, init, saveStateaddPropertyListener, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener, setFocuspublic Object getAdapter(Class adapter)
getAdapter in interface IAdaptablegetAdapter in class PageBookViewadapter - the adapter class to look upnull if this object does not
have an adapter for the given classIAdaptable.getAdapter(java.lang.Class),
IDebugViewpublic 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 IWorkbenchPartcreatePartControl in class PageBookViewparent - the parent controlIWorkbenchPart.createPartControl(Composite),
createPartControl(Composite),
createActions(),
configureToolBar(IToolBarManager),
getHelpContextId(),
fillContextMenu(IMenuManager)protected IPage createDefaultPage(PageBook book)
createDefaultPage in class PageBookViewbook - the pagebook controlPageBookView.createDefaultPage(PageBook)protected abstract Viewer createViewer(Composite parent)
parent - the parent controlprotected abstract void createActions()
createViewer(Composite)protected abstract String getHelpContextId()
public void dispose()
PageBookViewPageBookView implementation of this
IWorkbenchPart method cleans up all the pages. Subclasses
may extend.dispose in interface IWorkbenchPartdispose in class PageBookViewIWorkbenchPart.dispose()protected void saveAllCheckedActionStates()
protected void saveCheckedActionState(IAction action)
IAction.AS_CHECK_BOX.action - the enabled, toggle action whose checked state will be
saved in preferencesprotected String generatePreferenceKey(IAction action)
protected IPreferenceStore getPreferenceStore()
public Viewer getViewer()
IDebugViewgetViewer in interface IDebugViewIDebugView.getViewer()protected StructuredViewer getStructuredViewer()
null if none.nullprotected TextViewer getTextViewer()
null if none.nullpublic IDebugModelPresentation getPresentation(String id)
IDebugViewgetPresentation in interface IDebugViewid - the debug model identifier that corresponds to the id
attribute of a debug model presentation extensionnull 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()
IDebugViewgetContextMenuManager in interface IDebugViewnull if noneIDebugView.getContextMenuManager()public List getContextMenuManagers()
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 Debug UI plugin's preferences. 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 void initActionState(IAction action)
action - the action whose checked state will be restoredpublic void init(IViewSite site, IMemento memento) throws PartInitException
IViewPartThis method is automatically called by the workbench shortly after the part is instantiated. It marks the start of the views's lifecycle. Clients must not call this method.
init in interface IViewPartinit in class ViewPartsite - the view sitememento - the IViewPart state or null if there is no previous saved statePartInitException - if this view was not initialized successfullyIViewPart.init(IViewSite, IMemento)protected void setViewer(Viewer viewer)
viewer - viewerprotected abstract void configureToolBar(IToolBarManager tbm)
createActions().tbm - the tool bar manager for this view's sitecreateViewer(Composite)public void setAction(String actionID, IAction action)
IDebugViewIUpdate it is added/remove
from the collection of updateables associated with this view.setAction in interface IDebugViewactionID - the action idaction - the action, or null to clear itIDebugView.setAction(String, IAction)public IAction getAction(String actionID)
IDebugViewgetAction in interface IDebugViewactionID - the action idnull if noneIDebugView.getAction(String)public void updateObjects()
protected void handleKeyPressed(KeyEvent event)
REMOVE_ACTION when the delete
key is pressedpublic void doubleClick(DoubleClickEvent event)
DOUBLE_CLICK_ACTION,
if any.doubleClick in interface IDoubleClickListenerevent - event object describing the double-clickIDoubleClickListener.doubleClick(DoubleClickEvent)public void asyncExec(Runnable r)
protected Control getControl()
null if none.null if nonepublic void syncExec(Runnable r)
Display.syncExec(java.lang.Runnable)protected IMemento getMemento()
null.protected void setMemento(IMemento memento)
protected IViewPart findView(String id)
null if none.id - view identifierprotected boolean isImportant(IWorkbenchPart part)
PageBookViewSubclasses must implement this method.
isImportant in class PageBookViewpart - the input parttrue if the part is relevant, and
false otherwisePageBookView.isImportant(IWorkbenchPart)protected PageBookView.PageRec doCreatePage(IWorkbenchPart part)
PageBookViewdoDestroyPage.
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 PageBookViewpart - the input partPageBookView.doCreatePage(IWorkbenchPart)protected void doDestroyPage(IWorkbenchPart part, PageBookView.PageRec pageRecord)
PageBookViewdoCreatePage.
Subclasses must implement this method.
doDestroyPage in class PageBookViewpart - the input partpageRecord - a page record for the partPageBookView.doDestroyPage(org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.part.PageBookView.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 PageBookViewnull 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)
IDebugViewadd in interface IDebugViewupdatable - The IUpdate instance to be addedIDebugView.add(IUpdate)public void remove(IUpdate updatable)
IDebugViewremove in interface IDebugViewupdatable - The IUpdate instance to be removedIDebugView.remove(IUpdate)public void addContextMenuManager(IMenuManager contextMenuManager)
contextMenuManager - The contextMenuManager to addprotected void becomesVisible()
protected void becomesHidden()
public boolean isVisible()
protected void registerPartListener()
protected void deregisterPartListener()
public Map getPresentationAttributes(String modelId)
Guidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.