]>
git.argeo.org Git - gpl/argeo-jcr.git/blob - swt/org.argeo.tool.devops.e4/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
.swt
.custom
.ScrolledComposite
;
5 //import org.eclipse.ui.forms.widgets.FormToolkit;
6 //import org.eclipse.ui.forms.widgets.ScrolledForm;
9 * Managed form wraps a form widget and adds life cycle methods for form parts.
10 * A form part is a portion of the form that participates in form life cycle
13 * There is no 1/1 mapping between widgets and form parts. A widget like Section
14 * can be a part by itself, but a number of widgets can gather around one form
17 * This interface should not be extended or implemented. New form instances
18 * should be created using ManagedForm.
22 * @noimplement This interface is not intended to be implemented by clients.
23 * @noextend This interface is not intended to be extended by clients.
25 public interface IManagedForm
{
27 * Initializes the form by looping through the managed parts and
28 * initializing them. Has no effect if already called once.
30 public void initialize();
33 * Returns the toolkit used by this form.
37 public FormToolkit
getToolkit();
40 * Returns the form widget managed by this form.
42 * @return the form widget
44 public ScrolledComposite
getForm();
47 * Reflows the form as a result of the layout change.
50 * if <code>true</code>, discard cached layout information
52 public void reflow(boolean changed
);
55 * A part can use this method to notify other parts that implement
56 * IPartSelectionListener about selection changes.
59 * the part that broadcasts the selection
61 * the selection in the part
63 public void fireSelectionChanged(IFormPart part
, ISelection selection
);
66 * Returns all the parts currently managed by this form.
68 * @return the managed parts
70 IFormPart
[] getParts();
73 * Adds the new part to the form.
78 void addPart(IFormPart part
);
81 * Removes the part from the form.
86 void removePart(IFormPart part
);
89 * Sets the input of this page to the provided object.
93 * @return <code>true</code> if the form contains this object,
94 * <code>false</code> otherwise.
96 boolean setInput(Object input
);
99 * Returns the current page input.
101 * @return page input object or <code>null</code> if not applicable.
106 * Tests if form is dirty. A managed form is dirty if at least one managed
109 * @return <code>true</code> if at least one managed part is dirty,
110 * <code>false</code> otherwise.
115 * Notifies the form that the dirty state of one of its parts has changed.
116 * The global dirty state of the form can be obtained by calling 'isDirty'.
120 void dirtyStateChanged();
123 * Commits the dirty form. All pending changes in the widgets are flushed
128 void commit(boolean onSave
);
131 * Tests if form is stale. A managed form is stale if at least one managed
132 * part is stale. This can happen when the underlying model changes,
133 * resulting in the presentation of the part being out of sync with the
134 * model and needing refreshing.
136 * @return <code>true</code> if the form is stale, <code>false</code>
142 * Notifies the form that the stale state of one of its parts has changed.
143 * The global stale state of the form can be obtained by calling 'isStale'.
145 void staleStateChanged();
148 * Refreshes the form by refreshing every part that is stale.
153 * Sets the container that owns this form. Depending on the context, the
154 * container may be wizard, editor page, editor etc.
157 * the container of this form
159 void setContainer(Object container
);
162 * Returns the container of this form.
164 * @return the form container
166 Object
getContainer();
169 * Returns the message manager that will keep track of messages in this
172 * @return the message manager instance
174 // IMessageManager getMessageManager();