public class ManagedForm extends Object implements IManagedForm
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 |
|---|
ManagedForm(Composite parent)
Creates a managed form in the provided parent.
|
ManagedForm(FormToolkit toolkit,
ScrolledForm form)
Creates a managed form that will use the provided toolkit and
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPart(IFormPart part)
Adds the new part to the form.
|
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(IFormPart part,
ISelection selection)
A part can use this method to notify other parts that implement
IPartSelectionListener about selection changes.
|
Object |
getContainer()
Returns the container of this form.
|
ScrolledForm |
getForm()
Returns the form widget managed by this form.
|
Object |
getInput()
Returns the current page input.
|
IFormPart[] |
getParts()
Returns all the parts currently managed by this form.
|
FormToolkit |
getToolkit()
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)
Reflows the form as a result of the layout change.
|
void |
refresh()
Refreshes the form by refreshes all the stale parts.
|
void |
removePart(IFormPart part)
Removes the part from the form.
|
void |
setContainer(Object container)
Sets the container that owns this form.
|
void |
setFocus()
Transfers the focus to the first form part.
|
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 ManagedForm(Composite parent)
parent - the parent widgetpublic ManagedForm(FormToolkit toolkit, ScrolledForm form)
toolkit - form - public void addPart(IFormPart part)
IManagedFormaddPart in interface IManagedFormpart - the part to addpublic void removePart(IFormPart part)
IManagedFormremovePart in interface IManagedFormpart - the part to removepublic IFormPart[] getParts()
IManagedFormgetParts in interface IManagedFormpublic FormToolkit getToolkit()
IManagedFormgetToolkit in interface IManagedFormpublic ScrolledForm getForm()
IManagedFormgetForm in interface IManagedFormpublic void reflow(boolean changed)
IManagedFormreflow in interface IManagedFormchanged - if true, discard cached layout informationpublic void fireSelectionChanged(IFormPart part, ISelection selection)
fireSelectionChanged in interface IManagedFormpart - the part that broadcasts the selectionselection - the selection in the partIPartSelectionListenerpublic void initialize()
initialize in interface IManagedFormpublic void dispose()
public void refresh()
Display.syncExec or
asyncExec.refresh in interface IManagedFormpublic void commit(boolean onSave)
IManagedFormcommit in interface IManagedFormpublic boolean setInput(Object input)
IManagedFormsetInput in interface IManagedForminput - the new page inputtrue if the form contains this object,
false otherwise.public Object getInput()
IManagedFormgetInput in interface IManagedFormnull if not applicable.public void setFocus()
public boolean isDirty()
IManagedFormisDirty in interface IManagedFormtrue if at least one managed part is dirty,
false otherwise.public boolean isStale()
IManagedFormisStale in interface IManagedFormtrue if the form is stale, false
otherwise.public void dirtyStateChanged()
IManagedFormdirtyStateChanged in interface IManagedFormIManagedForm.isDirty()public void staleStateChanged()
IManagedFormstaleStateChanged in interface IManagedFormpublic Object getContainer()
IManagedFormgetContainer in interface IManagedFormpublic void setContainer(Object container)
IManagedFormsetContainer in interface IManagedFormcontainer - the container of this formGuidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.