public class EditorForm extends Object implements IEditorForm
There is requirement for 1/1 mapping between widgets and form parts. A widget like Section can be a part by itself, but a number of widgets can join around one form part.
Note to developers: this class is left public to allow its use beyond the original intention (inside a multi-page editor's page). You should limit the use of this class to make new instances inside a form container (wizard page, dialog etc.). Clients that need access to the class should not do it directly. Instead, they should do it through IManagedForm interface as much as possible.
| Constructor and Description |
|---|
EditorForm(org.eclipse.swt.widgets.Composite parent)
Creates a managed form in the provided parent.
|
EditorForm(org.eclipse.swt.widgets.Composite parent,
EditorWidgetFactory widgetFactory)
Creates a managed form that will use the provided widget factory
|
EditorForm(org.eclipse.swt.widgets.Composite parent,
org.eclipse.ui.forms.widgets.FormToolkit formToolkit)
Creates a managed form that will use the provided widget factory
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPart(IEditorPart part)
Adds the new part to the form.
|
boolean |
addStateListener(IEditorStateListener stateListener) |
void |
commit(boolean onSave)
Commits the dirty form.
|
void |
dirtyStateChanged()
Notifies the form that the dirty state of one of its parts has changed.
|
void |
dispose()
Disposes all the parts in this form.
|
void |
fireSelectionChanged(IEditorPart firingPart,
org.eclipse.jface.viewers.ISelection selection)
A part can use this method to notify other parts that implement
IPartSelectionListener about selection changes.
|
Object |
getAdapter(Class adapter) |
org.eclipse.swt.widgets.Composite |
getBody() |
Object |
getInput()
Returns the current page input.
|
org.eclipse.ui.forms.IMessageManager |
getMessageManager()
Returns the message manager that will keep track of messages in this
form.
|
IEditorPart[] |
getParts()
Returns all the parts currently managed by this form.
|
org.eclipse.swt.widgets.Shell |
getShell() |
EditorWidgetFactory |
getWidgetFactory()
Returns the toolkit used by this form.
|
void |
initialize()
Initializes the form by looping through the managed parts and
initializing them.
|
boolean |
isDirty()
Tests if form is dirty.
|
boolean |
isStale()
Tests if form is stale.
|
void |
reflow(boolean changed) |
void |
refreshStale()
Refreshes the form by refreshes all the stale parts.
|
void |
removePart(IEditorPart part)
Removes the part from the form.
|
boolean |
removeStateListener(IEditorStateListener stateListener) |
void |
setFocus()
Transfers the focus to the first form part which wants to own it.
|
boolean |
setInput(Object input)
Sets the input of this page to the provided object.
|
void |
staleStateChanged()
Notifies the form that the stale state of one of its parts has changed.
|
public EditorForm(org.eclipse.swt.widgets.Composite parent)
parent - the parent widgetpublic EditorForm(org.eclipse.swt.widgets.Composite parent,
EditorWidgetFactory widgetFactory)
widgetFactory - public EditorForm(org.eclipse.swt.widgets.Composite parent,
org.eclipse.ui.forms.widgets.FormToolkit formToolkit)
widgetFactory - public void addPart(IEditorPart part)
IEditorFormaddPart in interface IEditorFormpart - the part to addpublic void removePart(IEditorPart part)
IEditorFormremovePart in interface IEditorFormpart - the part to removepublic IEditorPart[] getParts()
IEditorFormgetParts in interface IEditorFormpublic EditorWidgetFactory getWidgetFactory()
IEditorFormgetWidgetFactory in interface IEditorFormpublic void initialize()
initialize in interface IEditorFormpublic void dispose()
public void refreshStale()
Display.syncExec or
asyncExec.refreshStale in interface IEditorFormpublic void commit(boolean onSave)
IEditorFormcommit in interface IEditorFormpublic void reflow(boolean changed)
reflow in interface IEditorFormpublic boolean setInput(Object input)
IEditorFormsetInput in interface IEditorForminput - the new page inputtrue if the form contains this object,
false otherwise.public Object getInput()
IEditorFormgetInput in interface IEditorFormnull if not applicable.public void setFocus()
public boolean isDirty()
IEditorFormisDirty in interface IEditorFormtrue if at least one managed part is dirty,
false otherwise.public boolean isStale()
IEditorFormisStale in interface IEditorFormtrue if the form is stale, false
otherwise.public void dirtyStateChanged()
IEditorFormdirtyStateChanged in interface IEditorFormIEditorForm.isDirty()public void staleStateChanged()
IEditorFormstaleStateChanged in interface IEditorFormpublic org.eclipse.ui.forms.IMessageManager getMessageManager()
IEditorFormgetMessageManager in interface IEditorFormpublic org.eclipse.swt.widgets.Shell getShell()
getShell in interface IEditorFormpublic void fireSelectionChanged(IEditorPart firingPart, org.eclipse.jface.viewers.ISelection selection)
fireSelectionChanged in interface IEditorFormfiringPart - the part that broadcasts the selectionselection - the selection in the partIPartSelectionListenerpublic org.eclipse.swt.widgets.Composite getBody()
getBody in interface IEditorFormpublic boolean addStateListener(IEditorStateListener stateListener)
addStateListener in interface IEditorFormpublic boolean removeStateListener(IEditorStateListener stateListener)
removeStateListener in interface IEditorFormCopyright © 2022 Fraunhofer IWU. All rights reserved.