com.pvx.ooadide.editors
Class ProvideXMultiPageEditor
java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.ui.part.WorkbenchPart
org.eclipse.ui.part.EditorPart
org.eclipse.ui.part.MultiPageEditorPart
com.pvx.ooadide.editors.ProvideXMultiPageEditor
- All Implemented Interfaces:
- java.util.EventListener, org.eclipse.core.resources.IResourceChangeListener, org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.ui.IEditorPart, org.eclipse.ui.ISaveablePart, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2, org.eclipse.ui.IWorkbenchPart3, org.eclipse.ui.part.IWorkbenchPartOrientation
public class ProvideXMultiPageEditor
- extends org.eclipse.ui.part.MultiPageEditorPart
- implements org.eclipse.core.resources.IResourceChangeListener
An example showing how to create a multi-page editor.
This example has 3 pages:
- page 0 contains a nested text editor.
- page 1 allows you to change the font used in page 2
- page 2 shows the words in page 0 in sorted order
Fields inherited from interface org.eclipse.ui.IEditorPart |
PROP_DIRTY, PROP_INPUT |
Fields inherited from interface org.eclipse.ui.IWorkbenchPart |
PROP_TITLE |
Method Summary |
void |
dispose()
The MultiPageEditorPart implementation of this
IWorkbenchPart method disposes all nested editors. |
void |
doSave(org.eclipse.core.runtime.IProgressMonitor monitor)
Saves the multi-page editor's document. |
void |
doSaveAs()
Saves the multi-page editor's document as another file. |
void |
gotoMarker(org.eclipse.core.resources.IMarker marker)
|
void |
init(org.eclipse.ui.IEditorSite site,
org.eclipse.ui.IEditorInput editorInput)
The MultiPageEditorExample implementation of this method
checks that the input is an instance of IFileEditorInput . |
boolean |
isSaveAsAllowed()
|
void |
resourceChanged(org.eclipse.core.resources.IResourceChangeEvent event)
Closes all project files on project close. |
Methods inherited from class org.eclipse.ui.part.MultiPageEditorPart |
addPage, addPage, addPage, addPage, createPartControl, findEditors, getAdapter, isDirty, removePage, setActiveEditor, setFocus |
Methods inherited from class org.eclipse.ui.part.EditorPart |
getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setInitializationData |
Methods inherited from class org.eclipse.ui.part.WorkbenchPart |
addPartPropertyListener, addPropertyListener, getContentDescription, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, removePartPropertyListener, removePropertyListener, setPartProperty, showBusy |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.ui.IWorkbenchPart |
addPropertyListener, getSite, getTitle, getTitleImage, removePropertyListener |
ProvideXMultiPageEditor
public ProvideXMultiPageEditor()
- Creates a multi-page editor example.
dispose
public void dispose()
- The
MultiPageEditorPart
implementation of this
IWorkbenchPart
method disposes all nested editors.
Subclasses may extend.
- Specified by:
dispose
in interface org.eclipse.ui.IWorkbenchPart
- Overrides:
dispose
in class org.eclipse.ui.part.MultiPageEditorPart
doSave
public void doSave(org.eclipse.core.runtime.IProgressMonitor monitor)
- Saves the multi-page editor's document.
- Specified by:
doSave
in interface org.eclipse.ui.ISaveablePart
- Specified by:
doSave
in class org.eclipse.ui.part.EditorPart
doSaveAs
public void doSaveAs()
- Saves the multi-page editor's document as another file.
Also updates the text for page 0's tab, and updates this multi-page editor's input
to correspond to the nested editor's.
- Specified by:
doSaveAs
in interface org.eclipse.ui.ISaveablePart
- Specified by:
doSaveAs
in class org.eclipse.ui.part.EditorPart
gotoMarker
public void gotoMarker(org.eclipse.core.resources.IMarker marker)
init
public void init(org.eclipse.ui.IEditorSite site,
org.eclipse.ui.IEditorInput editorInput)
throws org.eclipse.ui.PartInitException
- The
MultiPageEditorExample
implementation of this method
checks that the input is an instance of IFileEditorInput
.
- Specified by:
init
in interface org.eclipse.ui.IEditorPart
- Overrides:
init
in class org.eclipse.ui.part.MultiPageEditorPart
- Throws:
org.eclipse.ui.PartInitException
isSaveAsAllowed
public boolean isSaveAsAllowed()
- Specified by:
isSaveAsAllowed
in interface org.eclipse.ui.ISaveablePart
- Specified by:
isSaveAsAllowed
in class org.eclipse.ui.part.EditorPart
resourceChanged
public void resourceChanged(org.eclipse.core.resources.IResourceChangeEvent event)
- Closes all project files on project close.
- Specified by:
resourceChanged
in interface org.eclipse.core.resources.IResourceChangeListener