|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A view is a visual component within a workbench page. It is typically used to navigate a hierarchy of information (like the workspace), open an editor, or display properties for the active editor. Modifications made in a view are saved immediately (in contrast to an editor part, which conforms to a more elaborate open-save-close lifecycle).
Only one instance of a particular view type may exist within a workbench page. This policy is designed to simplify part management for a user.
This interface may be implemented directly. For convenience, a base
implementation is defined in ViewPart
.
A view is added to the workbench in two steps:
Views implement the IAdaptable
interface; extensions
are managed by the platform's adapter manager.
IWorkbenchPage.showView(java.lang.String)
,
ViewPart
Field Summary |
---|
Fields inherited from interface org.eclipse.ui.IWorkbenchPart |
---|
PROP_TITLE |
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 interface org.eclipse.ui.IWorkbenchPart |
---|
addPropertyListener, createPartControl, dispose, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener, setFocus |
Methods inherited from interface org.eclipse.core.runtime.IAdaptable |
---|
getAdapter |
Method Detail |
public IViewSite getViewSite()
(IViewSite) getSite()
.
The site can be null
while the view is being initialized.
After the initialization is complete, this value must be non-null
for the remainder of the view's life cycle.
null
if the view
has not yet been initializedpublic void init(IViewSite site) throws PartInitException
This 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.
site
- the view site
PartInitException
- if this view was not initialized successfullypublic void init(IViewSite site, IMemento memento) throws PartInitException
This 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.
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)
saveState
in interface IPersistable
memento
- a memento to receive the object state
|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.