]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.cms.ui/src/org/argeo/cms/ui/eclipse/forms/IManagedForm.java
1 package org
.argeo
.cms
.ui
.eclipse
.forms
;
3 import org
.eclipse
.jface
.viewers
.ISelection
;
4 //import org.eclipse.ui.forms.widgets.FormToolkit;
5 //import org.eclipse.ui.forms.widgets.ScrolledForm;
8 * Managed form wraps a form widget and adds life cycle methods for form parts.
9 * A form part is a portion of the form that participates in form life cycle
12 * There is no 1/1 mapping between widgets and form parts. A widget like Section
13 * can be a part by itself, but a number of widgets can gather around one form
16 * This interface should not be extended or implemented. New form instances
17 * should be created using ManagedForm.
21 * @noimplement This interface is not intended to be implemented by clients.
22 * @noextend This interface is not intended to be extended by clients.
24 public interface IManagedForm
{
26 * Initializes the form by looping through the managed parts and
27 * initializing them. Has no effect if already called once.
29 public void initialize();
32 * Returns the toolkit used by this form.
36 public FormToolkit
getToolkit();
39 * Returns the form widget managed by this form.
41 * @return the form widget
43 // public ScrolledForm getForm();
46 * Reflows the form as a result of the layout change.
49 * if <code>true</code>, discard cached layout information
51 public void reflow(boolean changed
);
54 * A part can use this method to notify other parts that implement
55 * IPartSelectionListener about selection changes.
58 * the part that broadcasts the selection
60 * the selection in the part
62 public void fireSelectionChanged(IFormPart part
, ISelection selection
);
65 * Returns all the parts currently managed by this form.
67 * @return the managed parts
69 IFormPart
[] getParts();
72 * Adds the new part to the form.
77 void addPart(IFormPart part
);
80 * Removes the part from the form.
85 void removePart(IFormPart part
);
88 * Sets the input of this page to the provided object.
92 * @return <code>true</code> if the form contains this object,
93 * <code>false</code> otherwise.
95 boolean setInput(Object input
);
98 * Returns the current page input.
100 * @return page input object or <code>null</code> if not applicable.
105 * Tests if form is dirty. A managed form is dirty if at least one managed
108 * @return <code>true</code> if at least one managed part is dirty,
109 * <code>false</code> otherwise.
114 * Notifies the form that the dirty state of one of its parts has changed.
115 * The global dirty state of the form can be obtained by calling 'isDirty'.
119 void dirtyStateChanged();
122 * Commits the dirty form. All pending changes in the widgets are flushed
127 void commit(boolean onSave
);
130 * Tests if form is stale. A managed form is stale if at least one managed
131 * part is stale. This can happen when the underlying model changes,
132 * resulting in the presentation of the part being out of sync with the
133 * model and needing refreshing.
135 * @return <code>true</code> if the form is stale, <code>false</code>
141 * Notifies the form that the stale state of one of its parts has changed.
142 * The global stale state of the form can be obtained by calling 'isStale'.
144 void staleStateChanged();
147 * Refreshes the form by refreshing every part that is stale.
152 * Sets the container that owns this form. Depending on the context, the
153 * container may be wizard, editor page, editor etc.
156 * the container of this form
158 void setContainer(Object container
);
161 * Returns the container of this form.
163 * @return the form container
165 Object
getContainer();
168 * Returns the message manager that will keep track of messages in this
171 * @return the message manager instance
173 // IMessageManager getMessageManager();