Eclipse Platform
Release 3.1

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:
ManagedForm

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 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 refreshing every part that is stale.
 void removePart(IFormPart part)
          Removes the part from the form.
 void setContainer(Object container)
          Sets the container that owns this form.
 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.
 

Method Detail

initialize

public 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

public FormToolkit getToolkit()
Returns the toolkit used by this form.

Returns:
the toolkit

getForm

public ScrolledForm getForm()
Returns the form widget managed by this form.

Returns:
the form widget

reflow

public void reflow(boolean changed)
Reflows the form as a result of the layout change.

Parameters:
changed - if true, discard cached layout information

fireSelectionChanged

public void fireSelectionChanged(IFormPart part,
                                 ISelection selection)
A part can use this method to notify other parts that implement IPartSelectionListener about selection changes.

Parameters:
part - the part that broadcasts the selection
selection - the selection in the part

getParts

public IFormPart[] getParts()
Returns all the parts currently managed by this form.

Returns:
the managed parts

addPart

public void addPart(IFormPart part)
Adds the new part to the form.

Parameters:
part - the part to add

removePart

public void removePart(IFormPart part)
Removes the part from the form.

Parameters:
part - the part to remove

setInput

public boolean setInput(Object input)
Sets the input of this page to the provided object.

Parameters:
input - the new page input
Returns:
true if the form contains this object, false otherwise.

getInput

public Object getInput()
Returns the current page input.

Returns:
page input object or null if not applicable.

isDirty

public boolean isDirty()
Tests if form is dirty. A managed form is dirty if at least one managed part is dirty.

Returns:
true if at least one managed part is dirty, false otherwise.

dirtyStateChanged

public 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:
isDirty()

commit

public void commit(boolean onSave)
Commits the dirty form. All pending changes in the widgets are flushed into the model.

Parameters:
onSave -

isStale

public 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:
true if the form is stale, false otherwise.

staleStateChanged

public 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

public void refresh()
Refreshes the form by refreshing every part that is stale.


setContainer

public void setContainer(Object container)
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

public Object getContainer()
Returns the container of this form.

Returns:
the form container

Eclipse Platform
Release 3.1

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.