|
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
Abstract base implementation of all workbench views.
This class should be subclassed by clients wishing to define new views.
The name of the subclass should be given as the "class"
attribute in a view
extension contributed to the workbench's
view extension point (named "org.eclipse.ui.views"
).
For example, the plug-in's XML markup might contain:
<extension point="org.eclipse.ui.views"> <view id="com.example.myplugin.view" name="My View" class="com.example.myplugin.MyView" icon="images/cview.gif" /> </extension>where
com.example.myplugin.MyView
is the name of the
ViewPart
subclass.
Subclasses must implement the following methods:
createPartControl
- to create the view's controls setFocus
- to accept focusSubclasses may extend or reimplement the following methods as required:
setInitializationData
- extend to provide additional
initialization when view extension is instantiatedinit(IWorkbenchPartSite)
- extend to provide additional
initialization when view is assigned its sitedispose
- extend to provide additional cleanupgetAdapter
- reimplement to make their view adaptable
Field Summary |
Fields inherited from interface org.eclipse.ui.IWorkbenchPart |
PROP_TITLE |
Constructor Summary | |
protected |
ViewPart()
Creates a new view. |
Method Summary | |
IViewSite |
getViewSite()
Returns the site for this view. |
void |
init(IViewSite site)
Initializes this view with the given view site. |
void |
init(IViewSite site,
IMemento memento)
Initializes this view with the given view site. |
void |
saveState(IMemento memento)
Saves the object state within a memento. |
Methods inherited from class org.eclipse.ui.part.WorkbenchPart |
addPropertyListener, createPartControl, dispose, firePropertyChange, getAdapter, getConfigurationElement, getDefaultImage, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener, setFocus, 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.IWorkbenchPart |
addPropertyListener, createPartControl, dispose, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener, setFocus |
Methods inherited from interface org.eclipse.core.runtime.IAdaptable |
getAdapter |
Constructor Detail |
protected ViewPart()
Method Detail |
public IViewSite getViewSite()
IViewPart
getViewSite
in interface IViewPart
public void init(IViewSite site) 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
site
- the view site
PartInitException
- if this view was not initialized successfullypublic 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
site
- the view sitememento
- the IViewPart state or null if there is no previous saved state
PartInitException
- if this view was not initialized successfullypublic void saveState(IMemento memento)
IViewPart
saveState
in interface IViewPart
memento
- a memento to receive the object state
|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |