|
Eclipse Platform Release 3.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.ui.forms.ManagedForm
public class 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)
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. |
java.lang.Object |
getContainer()
Returns the container of this form. |
ScrolledForm |
getForm()
Returns the form widget managed by this form. |
java.lang.Object |
getInput()
Returns the current page input. |
IMessageManager |
getMessageManager()
Returns the message manager that will keep track of messages in this form. |
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(java.lang.Object container)
Sets the container that owns this form. |
void |
setFocus()
Transfers the focus to the first form part. |
boolean |
setInput(java.lang.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. |
| 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 widget
public ManagedForm(FormToolkit toolkit,
ScrolledForm form)
toolkit - form - | Method Detail |
|---|
public void addPart(IFormPart part)
IManagedForm
addPart in interface IManagedFormpart - the part to addpublic void removePart(IFormPart part)
IManagedForm
removePart in interface IManagedFormpart - the part to removepublic IFormPart[] getParts()
IManagedForm
getParts in interface IManagedFormpublic FormToolkit getToolkit()
IManagedForm
getToolkit in interface IManagedFormpublic ScrolledForm getForm()
IManagedForm
getForm in interface IManagedFormpublic void reflow(boolean changed)
IManagedForm
reflow in interface IManagedFormchanged - if true, discard cached layout information
public 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)
IManagedForm
commit in interface IManagedFormpublic boolean setInput(java.lang.Object input)
IManagedForm
setInput in interface IManagedForminput - the new page input
true if the form contains this object,
false otherwise.public java.lang.Object getInput()
IManagedForm
getInput in interface IManagedFormnull if not applicable.public void setFocus()
public boolean isDirty()
IManagedForm
isDirty in interface IManagedFormtrue if at least one managed part is dirty,
false otherwise.public boolean isStale()
IManagedForm
isStale in interface IManagedFormtrue if the form is stale, false
otherwise.public void dirtyStateChanged()
IManagedForm
dirtyStateChanged in interface IManagedFormIManagedForm.isDirty()public void staleStateChanged()
IManagedForm
staleStateChanged in interface IManagedFormpublic java.lang.Object getContainer()
IManagedForm
getContainer in interface IManagedFormpublic void setContainer(java.lang.Object container)
IManagedForm
setContainer in interface IManagedFormcontainer - the container of this formpublic IMessageManager getMessageManager()
IManagedForm
getMessageManager in interface IManagedForm
|
Eclipse Platform Release 3.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2010. All rights reserved.