|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.ui.forms.ManagedForm
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 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 Summary | |
---|---|
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 |
Method Summary | |
---|---|
void |
addPart(IFormPart part)
Add a part to be managed by this form. |
void |
commit(boolean onSave)
Commits the form by commiting all the dirty parts to the model. |
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 current 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 a layout change. |
void |
refresh()
Refreshes the form by refreshes all the stale parts. |
void |
removePart(IFormPart part)
Remove the part from this 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 form input. |
void |
staleStateChanged()
Notifies the form that the stale state of one of its parts has changed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ManagedForm(Composite parent)
parent
- the parent widgetpublic ManagedForm(FormToolkit toolkit, ScrolledForm form)
toolkit
- form
- Method Detail |
public void addPart(IFormPart part)
addPart
in interface IManagedForm
part
- part to addpublic void removePart(IFormPart part)
removePart
in interface IManagedForm
part
- part to removepublic IFormPart[] getParts()
getParts
in interface IManagedForm
public FormToolkit getToolkit()
getToolkit
in interface IManagedForm
public ScrolledForm getForm()
getForm
in interface IManagedForm
public void reflow(boolean changed)
reflow
in interface IManagedForm
changed
- if true
, discard cached layout informationpublic void fireSelectionChanged(IFormPart part, ISelection selection)
fireSelectionChanged
in interface IManagedForm
part
- the part that broadcasts the selectionselection
- the selection in the partIPartSelectionListener
public void initialize()
initialize
in interface IManagedForm
public void dispose()
public void refresh()
Display.syncExec
or asyncExec
.
refresh
in interface IManagedForm
public void commit(boolean onSave)
commit
in interface IManagedForm
onSave
- public boolean setInput(Object input)
setInput
in interface IManagedForm
input
- the input object
true
if the form contains this object,
false
otherwise.public Object getInput()
IManagedForm
getInput
in interface IManagedForm
null
if not applicable.public void setFocus()
public boolean isDirty()
IManagedForm
isDirty
in interface IManagedForm
true
if at least one managed part is dirty,
false
otherwise.public boolean isStale()
IManagedForm
isStale
in interface IManagedForm
true
if the form is stale, false
otherwise.public void dirtyStateChanged()
IManagedForm
dirtyStateChanged
in interface IManagedForm
IManagedForm.dirtyStateChanged()
public void staleStateChanged()
IManagedForm
staleStateChanged
in interface IManagedForm
IManagedForm.staleStateChanged()
public Object getContainer()
IManagedForm
getContainer
in interface IManagedForm
public void setContainer(Object container)
IManagedForm
setContainer
in interface IManagedForm
container
- The container to set.
|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.