|
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.EditorPart | +--org.eclipse.ui.part.MultiEditor
A MultiEditor is a composite of editors. This class is intended to be supclassed.
Nested Class Summary | |
static class |
MultiEditor.Gradient
|
Field Summary |
Fields inherited from interface org.eclipse.ui.IEditorPart |
PROP_DIRTY, PROP_INPUT |
Fields inherited from interface org.eclipse.ui.IWorkbenchPart |
PROP_TITLE |
Constructor Summary | |
MultiEditor()
Constructor for TileEditor. |
Method Summary | |
Composite |
createInnerPartControl(Composite parent,
IEditorPart e)
Create the control of the inner editor. |
void |
doSave(IProgressMonitor monitor)
Saves the contents of this editor. |
void |
doSaveAs()
Saves the contents of this editor to another object. |
protected abstract void |
drawGradient(IEditorPart innerEditor,
MultiEditor.Gradient g)
Draw the gradient in the title bar. |
IEditorPart |
getActiveEditor()
Returns the active inner editor. |
IEditorPart[] |
getInnerEditors()
Returns an array with all inner editors. |
protected boolean |
getShellActivated()
Return true if the shell is activated. |
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. |
void |
init(IEditorSite site,
MultiEditorInput input)
|
boolean |
isDirty()
Returns whether the contents of this editor have changed since the last save operation. |
boolean |
isSaveAsAllowed()
Returns whether the "save as" operation is supported by this editor. |
void |
setChildren(IEditorPart[] children)
Set the inner editors. |
void |
setFocus()
Asks this part to take focus within the workbench. |
void |
updateGradient(IEditorPart editor)
Update the gradient in the title bar. |
Methods inherited from class org.eclipse.ui.part.EditorPart |
getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setInput |
Methods inherited from class org.eclipse.ui.part.WorkbenchPart |
addPropertyListener, createPartControl, dispose, firePropertyChange, getAdapter, getConfigurationElement, getDefaultImage, getSite, getTitle, getTitleImage, 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.IWorkbenchPart |
addPropertyListener, createPartControl, dispose, getSite, getTitle, getTitleImage, removePropertyListener |
Methods inherited from interface org.eclipse.core.runtime.IAdaptable |
getAdapter |
Constructor Detail |
public MultiEditor()
Method Detail |
public void doSave(IProgressMonitor monitor)
IEditorPart
If the save is successful, the editor should fire a property changed event
reflecting the new dirty state (PROP_SAVE_NEEDED
property).
If the save is cancelled through user action, or for any other reason, the
editor should invoke setCancelled
on the monitor
to inform the caller.
This method is long-running; progress and cancellation are provided by the given progress monitor.
doSave
in interface IEditorPart
doSave
in class EditorPart
monitor
- the progress monitorpublic Composite createInnerPartControl(Composite parent, IEditorPart e)
public void doSaveAs()
IEditorPart
Implementors are expected to open a "save as" dialog where the user will
be able to select a new name for the contents. After the selection is made,
the contents should be saved to that new name. During this operation a
ProgressMonitorDialog
should be used to indicate progress.
If the save is successful, the editor fires a property changed event
reflecting the new dirty state (PROP_SAVE_NEEDED
property).
doSaveAs
in interface IEditorPart
doSaveAs
in class EditorPart
public void gotoMarker(IMarker marker)
IEditorPart
gotoMarker
in interface IEditorPart
gotoMarker
in class EditorPart
marker
- the markerpublic void init(IEditorSite site, IEditorInput input) throws PartInitException
IEditorPart
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
init
in interface IEditorPart
init
in class EditorPart
site
- the editor siteinput
- the editor input
PartInitException
- if this editor was not initialized successfullypublic void init(IEditorSite site, MultiEditorInput input) throws PartInitException
PartInitException
public boolean isDirty()
IEditorPart
PROP_DIRTY
.
isDirty
in interface IEditorPart
isDirty
in class EditorPart
true
if the contents have been modified and need
saving, and false
if they have not changed since the last
savepublic boolean isSaveAsAllowed()
IEditorPart
isSaveAsAllowed
in interface IEditorPart
isSaveAsAllowed
in class EditorPart
true
if "save as" is supported, and false
if "save as" is not supportedpublic void setFocus()
IWorkbenchPart
Clients should not call this method (the workbench calls this method at appropriate times).
setFocus
in interface IWorkbenchPart
setFocus
in class WorkbenchPart
public final IEditorPart getActiveEditor()
public final IEditorPart[] getInnerEditors()
public final void setChildren(IEditorPart[] children)
public void updateGradient(IEditorPart editor)
protected abstract void drawGradient(IEditorPart innerEditor, MultiEditor.Gradient g)
protected boolean getShellActivated()
|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |