|
Eclipse Platform 2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | 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 views related to debugging. Clients implementing views for a debugger should subclass this class. Common function includes:
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.
Inner classes inherited from class org.eclipse.ui.part.PageBookView |
PageBookView.PageRec, PageBookView.SelectionProvider |
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 |
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()
Deregisters and disposes this event handler's part listener. |
void |
dispose()
Disposes of this workbench part. |
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()
Returns the context menu manager for this view. |
List |
getContextMenuManagers()
Returns the context menu managers relevant to 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 |
protected IPreferenceStore |
getPreferenceStore()
Convenience method to return the preference store for the Debug UI plugin. |
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(IAction action)
Restires 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 toggleable 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. |
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, saveState |
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, saveState |
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 PageBookView
IAdaptable.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
IWorkbenchPart.createPartControl(Composite)
,
createPartControl(Composite)
,
createActions()
,
configureToolBar(IToolBarManager)
,
getHelpContextId()
,
fillContextMenu(IMenuManager)
protected IPage createDefaultPage(PageBook book)
createDefaultPage
in class PageBookView
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()
IWorkbenchPart
This is the last method called on the IWorkbenchPart
. At this
point the part controls (if they were ever created) have been disposed as part
of an SWT composite. There is no guarantee that createPartControl() has been
called, so the part controls may never have been created.
Within this method a part may release any resources, fonts, images, etc. held by this part. It is also very important to deregister all listeners from the workbench.
Clients should not call this method (the workbench calls this method at appropriate times).
dispose
in interface IWorkbenchPart
dispose
in class PageBookView
IWorkbenchPart.dispose()
protected void saveAllCheckedActionStates()
protected void saveCheckedActionState(IAction action)
IAction.AS_CHECK_BOX
.action
- the enabled, toggleable action whose checked state will be
saved in preferencesprotected String generatePreferenceKey(IAction action)
protected IPreferenceStore getPreferenceStore()
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
IDebugView.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
IDebugView.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
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
IViewPart.init(IViewSite, IMemento)
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
IDebugView.setAction(String, IAction)
public IAction getAction(String actionID)
IDebugView
getAction
in interface IDebugView
IDebugView.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 IDoubleClickListener
IDoubleClickListener.doubleClick(DoubleClickEvent)
public void asyncExec(Runnable r)
Display.asyncExec(java.lang.Runnable)
public 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)
PageBookView
Subclasses must implement this method.
isImportant
in class PageBookView
PageBookView.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
PageBookView.doCreatePage(IWorkbenchPart)
protected void doDestroyPage(IWorkbenchPart part, PageBookView.PageRec pageRecord)
PageBookView
doCreatePage
.
Subclasses must implement this method.
doDestroyPage
in class PageBookView
PageBookView.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 PageBookView
PageBookView.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
IDebugView.add(IUpdate)
public void remove(IUpdate updatable)
IDebugView
remove
in interface IDebugView
IDebugView.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()
|
Eclipse Platform 2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |