Class AbstractMultiEditor
- All Implemented Interfaces:
- IAdaptable,- IExecutableExtension,- IEditorPart,- ISaveablePart,- IWorkbenchPart,- IWorkbenchPart2,- IWorkbenchPart3,- IWorkbenchPartOrientation
- Direct Known Subclasses:
- MultiEditor
- Since:
- 3.5
- 
Field SummaryFields inherited from interface org.eclipse.ui.IEditorPartPROP_DIRTY, PROP_INPUTFields inherited from interface org.eclipse.ui.IWorkbenchPartPROP_TITLE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidactivateEditor(IEditorPart part) Activates the given nested editor.voiddispose()Release the added listener.voiddoSave(IProgressMonitor monitor) Saves the contents of this part.voiddoSaveAs()Saves the contents of this part to another object.final IEditorPartReturns the active inner editor.protected intgetIndex(IEditorPart editor) Returns the index of the given nested editor.abstract CompositegetInnerEditorContainer(IEditorReference innerEditorReference) This method is called after createPartControl has been executed and should return the container for the given inner editor.final IEditorPart[]Returns an array with all inner editors.protected voidhandlePropertyChange(int propId) Handles a property change notification from a nested editor.voidinit(IEditorSite site, IEditorInput input) Initializes this editor with the given editor site and input.voidinit(IEditorSite site, MultiEditorInput input) protected abstract voidCalled as soon as the inner editors have been created and are available.booleanisDirty()Returns whether the contents of this part have changed since the last save operation.booleanReturns whether the "Save As" operation is supported by this part.final voidsetChildren(IEditorPart[] children) Set the inner editors.voidsetFocus()Asks this part to take focus within the workbench.Methods inherited from class org.eclipse.ui.part.EditorPartcheckSite, getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setInput, setInputWithNotify, setPartNameMethods inherited from class org.eclipse.ui.part.WorkbenchPartaddPartPropertyListener, addPropertyListener, createPartControl, firePartPropertyChanged, firePropertyChange, getAdapter, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusyMethods inherited from class org.eclipse.core.commands.common.EventManageraddListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObjectMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.core.runtime.IAdaptablegetAdapterMethods inherited from interface org.eclipse.ui.IWorkbenchPartaddPropertyListener, createPartControl, getSite, getTitle, getTitleImage, removePropertyListener
- 
Constructor Details- 
AbstractMultiEditorpublic AbstractMultiEditor()Constructs an editor to contain other editors.
 
- 
- 
Method Details- 
handlePropertyChangeprotected void handlePropertyChange(int propId) Handles a property change notification from a nested editor. The default implementation simply forwards the change to listeners on this multi editor by callingfirePropertyChangewith the same property id. For example, if the dirty state of a nested editor changes (property idISaveablePart.PROP_DIRTY), this method handles it by firing a property change event forISaveablePart.PROP_DIRTYto property listeners on this multi editor.Subclasses may extend or reimplement this method. - Parameters:
- propId- the id of the property that changed
- Since:
- 3.6
 
- 
doSaveDescription copied from interface:ISaveablePartSaves the contents of this part.If the save is successful, the part should fire a property changed event reflecting the new dirty state ( PROP_DIRTYproperty).If the save is cancelled through user action, or for any other reason, the part should invoke setCancelledon theIProgressMonitorto inform the caller.This method is long-running; progress and cancellation are provided by the given progress monitor. - Specified by:
- doSavein interface- ISaveablePart
- Specified by:
- doSavein class- EditorPart
- Parameters:
- monitor- the progress monitor
 
- 
doSaveAspublic void doSaveAs()Description copied from interface:ISaveablePartSaves the contents of this part to another object.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 IProgressMonitorshould be used to indicate progress.If the save is successful, the part fires a property changed event reflecting the new dirty state ( PROP_DIRTYproperty).- Specified by:
- doSaveAsin interface- ISaveablePart
- Specified by:
- doSaveAsin class- EditorPart
 
- 
initDescription copied from interface:IEditorPartInitializes this editor with the given editor site and input.This method is automatically called shortly after the part is instantiated. It marks the start of the part's lifecycle. The IWorkbenchPart.disposemethod 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- Specified by:
- initin interface- IEditorPart
- Specified by:
- initin class- EditorPart
- Parameters:
- site- the editor site
- input- the editor input
- Throws:
- PartInitException- if this editor was not initialized successfully
 
- 
init- Parameters:
- site- the editor site
- input- the editor input
- Throws:
- PartInitException- if this editor was not initialized successfully
- See Also:
 
- 
isDirtypublic boolean isDirty()Description copied from interface:ISaveablePartReturns whether the contents of this part have changed since the last save operation. If this value changes the part must fire a property listener event withPROP_DIRTY.Note: this method is called often on a part open or part activation switch, for example by actions to determine their enabled status. - Specified by:
- isDirtyin interface- ISaveablePart
- Specified by:
- isDirtyin class- EditorPart
- Returns:
- trueif the contents have been modified and need saving, and- falseif they have not changed since the last save
 
- 
isSaveAsAllowedpublic boolean isSaveAsAllowed()Description copied from interface:ISaveablePartReturns whether the "Save As" operation is supported by this part.- Specified by:
- isSaveAsAllowedin interface- ISaveablePart
- Specified by:
- isSaveAsAllowedin class- EditorPart
- Returns:
- trueif "Save As" is supported, and- falseif not supported
 
- 
setFocuspublic void setFocus()Description copied from interface:IWorkbenchPartAsks this part to take focus within the workbench. Parts must assign focus to one of the controls contained in the part's parent composite.Clients should not call this method (the workbench calls this method at appropriate times). To have the workbench activate a part, use IWorkbenchPage.activate(IWorkbenchPart) instead.- Specified by:
- setFocusin interface- IWorkbenchPart
- Specified by:
- setFocusin class- WorkbenchPart
 
- 
getActiveEditorReturns the active inner editor.- Returns:
- the active editor
 
- 
getInnerEditorsReturns an array with all inner editors.- Returns:
- the inner editors
 
- 
setChildrenSet the inner editors. Should not be called by clients.- Parameters:
- children- the inner editors of this multi editor
- Restriction:
- This method is not intended to be referenced by clients.
 
- 
innerEditorsCreatedprotected abstract void innerEditorsCreated()Called as soon as the inner editors have been created and are available.
- 
activateEditorActivates the given nested editor.- Parameters:
- part- the nested editor
- Since:
- 3.0
 
- 
getIndexReturns the index of the given nested editor.- Returns:
- the index of the nested editor
- Since:
- 3.0
 
- 
disposepublic void dispose()Release the added listener.- Specified by:
- disposein interface- IWorkbenchPart
- Overrides:
- disposein class- WorkbenchPart
- Since:
- 3.2
 
- 
getInnerEditorContainerThis method is called after createPartControl has been executed and should return the container for the given inner editor.- Parameters:
- innerEditorReference- a reference to the inner editor that is being created.
- Returns:
- the container in which the inner editor's pane and part controls are to be created.
 
 
-