Package org.eclipse.ui.forms.editor
Interface IFormPage
- All Superinterfaces:
IAdaptable,IEditorPart,ISaveablePart,IWorkbenchPart
- All Known Implementing Classes:
FormPage
Interface that all GUI pages need to implement in order to be added to
FormEditor part. The interface makes several assumptions:
- The form page has a managed form
- The form page has a unique id
- The form page can be GUI but can also wrap a complete editor class (in
that case, it should return
truefromisEditor()method). - The form page is lazy i.e. understands that its part control will be created at the last possible moment.
Existing editors can be wrapped by implementing this interface. In this case,
'isEditor' should return true. A common editor to wrap in
TextEditor that is often added to show the raw source code of
the file open into the multi-page editor.
- Since:
- 3.0
-
Field Summary
Fields inherited from interface org.eclipse.ui.IEditorPart
PROP_DIRTY, PROP_INPUTFields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE -
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if the content of the page is in a state that allows the editor to flip to another page.Returns the editor this page belongs to.getId()Page must have a unique id that can be used to show it without knowing its relative position in the editor.intgetIndex()Returns the position of the page in the editor.Returns the managed form of this page, unless this is a source page.Returns the control associated with this page.voidinitialize(FormEditor editor) booleanisActive()Returns true if page is currently active, false if not.booleanisEditor()Tests whether this page wraps a complete editor that can be registered on its own, or represents a page that cannot exist outside the multi-page editor context.booleanselectReveal(Object object) A hint to bring the provided object into focus.voidsetActive(boolean active) Indicates whether the page has become the active in the editor.voidsetIndex(int index) Sets the position of the page in the editor.Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapterMethods inherited from interface org.eclipse.ui.IEditorPart
getEditorInput, getEditorSite, initMethods inherited from interface org.eclipse.ui.ISaveablePart
doSave, doSaveAs, isDirty, isSaveAsAllowed, isSaveOnCloseNeededMethods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, createPartControl, dispose, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener, setFocus
-
Method Details
-
initialize
- Parameters:
editor- the form editor that this page belongs to
-
getEditor
FormEditor getEditor()Returns the editor this page belongs to.- Returns:
- the form editor
-
getManagedForm
IManagedForm getManagedForm()Returns the managed form of this page, unless this is a source page.- Returns:
- the managed form or null if this is a source page.
-
setActive
void setActive(boolean active) Indicates whether the page has become the active in the editor. Classes that implement this interface may use this method to commit the page (onfalse) or lazily create and/or populate the content ontrue.- Parameters:
active-trueif page should be visible,falseotherwise.
-
isActive
boolean isActive()Returns true if page is currently active, false if not.- Returns:
- true for active page.
-
canLeaveThePage
boolean canLeaveThePage()Tests if the content of the page is in a state that allows the editor to flip to another page. Typically, pages that contain raw source with syntax errors should not allow editors to leave them until errors are corrected.- Returns:
trueif the editor can flip to another page,falseotherwise.
-
getPartControl
Control getPartControl()Returns the control associated with this page.- Returns:
- the control of this page if created or null if the page has not been shown yet.
-
getId
String getId()Page must have a unique id that can be used to show it without knowing its relative position in the editor.- Returns:
- the unique page identifier
-
getIndex
int getIndex()Returns the position of the page in the editor.- Returns:
- the zero-based index of the page in the editor.
-
setIndex
void setIndex(int index) Sets the position of the page in the editor.- Parameters:
index- the zero-based index of the page in the editor.
-
isEditor
boolean isEditor()Tests whether this page wraps a complete editor that can be registered on its own, or represents a page that cannot exist outside the multi-page editor context.- Returns:
- true if the page wraps an editor, false if this is a form page.
-
selectReveal
A hint to bring the provided object into focus. If the object is in a tree or table control, select it. If it is shown on a scrollable page, ensure that it is visible. If the object is not presented in the page,falseshould be returned to allow another page to try.- Parameters:
object- object to select and reveal- Returns:
trueif the request was successful,falseotherwise.
-