|
Eclipse Platform 2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An editor is a visual component within a workbench page. It is
typically used to edit or browse a document or input object. The input
is identified using an IEditorInput
. Modifications made
in an editor part follow an open-save-close lifecycle model (in contrast
to a view part, where modifications are saved to the workbench
immediately).
An editor is document or input-centric. Each editor has an input, and only one editor can exist for each editor input within a page. This policy has been designed to simplify part management.
An editor should be used in place of a view whenever more than one instance of a document type can exist.
This interface may be implemented directly. For convenience, a base
implementation is defined in EditorPart
.
An editor part is added to the workbench in two stages:
All editor parts implement the IAdaptable
interface; extensions
are managed by the platform's adapter manager.
IWorkbenchPage.openEditor(IEditorInput, String)
,
EditorPart
Field Summary | |
static int |
PROP_DIRTY
The property id for isDirty . |
static int |
PROP_INPUT
The property id for getEditorInput . |
Fields inherited from interface org.eclipse.ui.IWorkbenchPart |
PROP_TITLE |
Method Summary | |
IEditorInput |
getEditorInput()
Returns the input for this editor. |
IEditorSite |
getEditorSite()
Returns the site for this editor. |
void |
gotoMarker(IMarker marker)
Sets the cursor and selection state for this editor to the passage defined by the given marker. |
void |
init(IEditorSite site,
IEditorInput input)
Initializes this editor with the given editor site and input. |
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 |
Methods inherited from interface org.eclipse.ui.ISaveablePart |
doSave, doSaveAs, isDirty, isSaveAsAllowed, isSaveOnCloseNeeded |
Field Detail |
public static final int PROP_DIRTY
isDirty
.public static final int PROP_INPUT
getEditorInput
.Method Detail |
public IEditorInput getEditorInput()
PROP_INPUT
.public IEditorSite getEditorSite()
(IEditorSite) getSite()
.public void gotoMarker(IMarker marker)
marker
- the markerpublic void init(IEditorSite site, IEditorInput input) throws PartInitException
This method is automatically called shortly after part construction; it marks
the start of the part's lifecycle. The
IWorkbenchPart.dispose
method will be called
automically at the end of the lifecycle. Clients must not call this method.
Implementors of this method must examine the editor input object type to
determine if it is understood. If not, the implementor must throw
a PartInitException
site
- the editor siteinput
- the editor inputPartInitException
- if this editor was not initialized successfully
|
Eclipse Platform 2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |