Package org.eclipse.ui.forms
Interface IManagedForm
- All Known Implementing Classes:
ManagedForm
public interface IManagedForm
Managed form wraps a form widget and adds life cycle methods for form parts.
A form part is a portion of the form that participates in form life cycle
events.
There is no 1/1 mapping between widgets and form parts. A widget like Section can be a part by itself, but a number of widgets can gather around one form part.
This interface should not be extended or implemented. New form instances should be created using ManagedForm.
- Since:
- 3.0
- See Also:
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the new part to the form.voidcommit(boolean onSave) Commits the dirty form.voidNotifies the form that the dirty state of one of its parts has changed.voidfireSelectionChanged(IFormPart part, ISelection selection) A part can use this method to notify other parts that implement IPartSelectionListener about selection changes.Returns the container of this form.getForm()Returns the form widget managed by this form.getInput()Returns the current page input.Returns the message manager that will keep track of messages in this form.getParts()Returns all the parts currently managed by this form.Returns the toolkit used by this form.voidInitializes the form by looping through the managed parts and initializing them.booleanisDirty()Tests if form is dirty.booleanisStale()Tests if form is stale.voidreflow(boolean changed) Reflows the form as a result of the layout change.voidrefresh()Refreshes the form by refreshing every part that is stale.voidremovePart(IFormPart part) Removes the part from the form.voidsetContainer(Object container) Sets the container that owns this form.booleanSets the input of this page to the provided object.voidNotifies the form that the stale state of one of its parts has changed.
-
Method Details
-
initialize
void initialize()Initializes the form by looping through the managed parts and initializing them. Has no effect if already called once.- Since:
- 3.1
-
getToolkit
FormToolkit getToolkit()Returns the toolkit used by this form.- Returns:
- the toolkit
-
getForm
ScrolledForm getForm()Returns the form widget managed by this form.- Returns:
- the form widget
-
reflow
void reflow(boolean changed) Reflows the form as a result of the layout change.- Parameters:
changed- iftrue, discard cached layout information
-
fireSelectionChanged
A part can use this method to notify other parts that implement IPartSelectionListener about selection changes.- Parameters:
part- the part that broadcasts the selectionselection- the selection in the part
-
getParts
IFormPart[] getParts()Returns all the parts currently managed by this form.- Returns:
- the managed parts
-
addPart
Adds the new part to the form.- Parameters:
part- the part to add
-
removePart
Removes the part from the form.- Parameters:
part- the part to remove
-
setInput
Sets the input of this page to the provided object.- Parameters:
input- the new page input- Returns:
trueif the form contains this object,falseotherwise.
-
getInput
Object getInput()Returns the current page input.- Returns:
- page input object or
nullif not applicable.
-
isDirty
boolean isDirty()Tests if form is dirty. A managed form is dirty if at least one managed part is dirty.- Returns:
trueif at least one managed part is dirty,falseotherwise.
-
dirtyStateChanged
void dirtyStateChanged()Notifies the form that the dirty state of one of its parts has changed. The global dirty state of the form can be obtained by calling 'isDirty'.- See Also:
-
commit
void commit(boolean onSave) Commits the dirty form. All pending changes in the widgets are flushed into the model.- Parameters:
onSave- indicates if commit is called during 'save' operation or for some other reason (for example, if form is contained in a wizard or a multi-page editor and the user is about to leave the page).
-
isStale
boolean isStale()Tests if form is stale. A managed form is stale if at least one managed part is stale. This can happen when the underlying model changes, resulting in the presentation of the part being out of sync with the model and needing refreshing.- Returns:
trueif the form is stale,falseotherwise.
-
staleStateChanged
void staleStateChanged()Notifies the form that the stale state of one of its parts has changed. The global stale state of the form can be obtained by calling 'isStale'. -
refresh
void refresh()Refreshes the form by refreshing every part that is stale. -
setContainer
Sets the container that owns this form. Depending on the context, the container may be wizard, editor page, editor etc.- Parameters:
container- the container of this form
-
getContainer
Object getContainer()Returns the container of this form.- Returns:
- the form container
-
getMessageManager
IMessageManager getMessageManager()Returns the message manager that will keep track of messages in this form.- Returns:
- the message manager instance
- Since:
- 3.3
-