Package org.eclipse.ui.forms.editor
Class SharedHeaderFormEditor
java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.ui.part.WorkbenchPart
org.eclipse.ui.part.EditorPart
org.eclipse.ui.part.MultiPageEditorPart
org.eclipse.ui.forms.editor.FormEditor
org.eclipse.ui.forms.editor.SharedHeaderFormEditor
- All Implemented Interfaces:
IAdaptable,IExecutableExtension,IPageChangeProvider,IEditorPart,ISaveablePart,IWorkbenchPart,IWorkbenchPart2,IWorkbenchPart3,IWorkbenchPartOrientation
A variation of
FormEditor, this editor has a stable header that does
not change when pages are switched. Pages that are added to this editor
should not have the title or image set.- Since:
- 3.3
-
Field Summary
Fields inherited from class org.eclipse.ui.forms.editor.FormEditor
pagesFields inherited from class org.eclipse.ui.part.MultiPageEditorPart
PAGE_CONTAINER_SITEFields inherited from interface org.eclipse.ui.IEditorPart
PROP_DIRTY, PROP_INPUTFields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcommitPages(boolean onSave) Commits all dirty pages in the editor.protected voidcreateHeaderContents(IManagedForm headerForm) Subclasses should extend this method to configure the form that owns the shared header.protected CompositecreatePageContainer(Composite parent) Overridessuperto create a form in which to host the tab folder.protected voidCreates the common toolkit for this editor and adds pages to the editor.voiddispose()Disposes the pages and the toolkit after disposing the editor itself.Returns the form that owns the shared header.booleanisDirty()Tests whether the editor is dirty by checking all the pages that implementIFormPage.protected voidsetActivePage(int pageIndex) Sets the currently active page.voidsetFocus()TheMultiPageEditorimplementation of thisIWorkbenchPartmethod sets focus on the active nested editor, if there is one.Methods inherited from class org.eclipse.ui.forms.editor.FormEditor
addPage, addPage, addPage, addPage, addPage, addPage, addPages, close, configurePage, createToolkit, editorDirtyStateChanged, findPage, getActiveEditor, getActivePageInstance, getCurrentPage, getSelectedPage, getToolkit, init, pageChange, removePage, selectReveal, setActivePage, setActivePage, updateActionBarContributorMethods inherited from class org.eclipse.ui.part.MultiPageEditorPart
activateSite, addPageChangedListener, createContainer, createItem, createPartControl, createSite, deactivateSite, findEditors, getActivePage, getAdapter, getAPIPreferenceStore, getContainer, getControl, getEditor, getPageCount, getPageImage, getPageSite, getPageText, getTabStyle, handlePropertyChange, initializePageSwitching, isUpdateRequired, removePageChangedListener, setActiveEditor, setControl, setPageImage, setPageText, updateContainerMethods inherited from class org.eclipse.ui.part.EditorPart
checkSite, doSave, doSaveAs, getEditorInput, getEditorSite, getTitleToolTip, isSaveAsAllowed, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setInput, setInputWithNotify, setPartNameMethods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, firePropertyChange, 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.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObjectMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, removePropertyListener
-
Constructor Details
-
SharedHeaderFormEditor
public SharedHeaderFormEditor()The default constructor.
-
-
Method Details
-
createPageContainer
Overridessuperto create a form in which to host the tab folder. This form will be responsible for creating a common form header. Child pages should not have a header of their own.- Overrides:
createPageContainerin classFormEditor- Parameters:
parent- the page container parent- Returns:
- the parent for this editor's container. Must not be
null. - See Also:
-
getHeaderForm
Returns the form that owns the shared header.- Returns:
- the shared header
-
createPages
protected void createPages()Description copied from class:FormEditorCreates the common toolkit for this editor and adds pages to the editor.- Overrides:
createPagesin classFormEditor- See Also:
-
setActivePage
protected void setActivePage(int pageIndex) Description copied from class:MultiPageEditorPartSets the currently active page.- Overrides:
setActivePagein classFormEditor- Parameters:
pageIndex- the index of the page to be activated; the index must be valid- See Also:
-
setFocus
public void setFocus()Description copied from class:MultiPageEditorPartTheMultiPageEditorimplementation of thisIWorkbenchPartmethod sets focus on the active nested editor, if there is one.Subclasses may extend or reimplement.
- Specified by:
setFocusin interfaceIWorkbenchPart- Overrides:
setFocusin classMultiPageEditorPart
-
dispose
public void dispose()Description copied from class:FormEditorDisposes the pages and the toolkit after disposing the editor itself. Subclasses must call 'super' when reimplementing the method.- Specified by:
disposein interfaceIWorkbenchPart- Overrides:
disposein classFormEditor
-
isDirty
public boolean isDirty()Description copied from class:FormEditorTests whether the editor is dirty by checking all the pages that implementIFormPage. If none of them is dirty, the method delegates further processing tosuper.isDirty().- Specified by:
isDirtyin interfaceISaveablePart- Overrides:
isDirtyin classFormEditor- Returns:
trueif any of the pages in the editor are dirty,falseotherwise.
-
commitPages
protected void commitPages(boolean onSave) Description copied from class:FormEditorCommits all dirty pages in the editor. This method should be called as a first step of a 'save' operation.- Overrides:
commitPagesin classFormEditor- Parameters:
onSave-trueif commit is performed as part of the 'save' operation,falseotherwise.
-
createHeaderContents
Subclasses should extend this method to configure the form that owns the shared header. If the header form will contain controls that can change the state of the editor, they should be wrapped in an IFormPart so that they can participate in the life cycle event management.- Parameters:
headerForm- the form that owns the shared header- See Also:
-