Mercurial > projects > dwt2
comparison org.eclipse.ui.forms/src/org/eclipse/ui/forms/IManagedForm.d @ 12:bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 14 Mar 2009 18:23:29 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
11:43904fec5dca | 12:bc29606a740c |
---|---|
1 /******************************************************************************* | |
2 * Copyright (c) 2003, 2007 IBM Corporation and others. | |
3 * All rights reserved. This program and the accompanying materials | |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
10 * Port to the D programming language: | |
11 * Frank Benoit <benoit@tionex.de> | |
12 *******************************************************************************/ | |
13 module org.eclipse.ui.forms.IManagedForm; | |
14 | |
15 import org.eclipse.ui.forms.IFormPart; | |
16 import org.eclipse.ui.forms.IMessageManager; | |
17 | |
18 import org.eclipse.jface.viewers.ISelection; | |
19 import org.eclipse.ui.forms.widgets.FormToolkit; | |
20 import org.eclipse.ui.forms.widgets.ScrolledForm; | |
21 | |
22 import java.lang.all; | |
23 import java.util.Set; | |
24 | |
25 /** | |
26 * Managed form wraps a form widget and adds life cycle methods for form parts. | |
27 * A form part is a portion of the form that participates in form life cycle | |
28 * events. | |
29 * <p> | |
30 * There is no 1/1 mapping between widgets and form parts. A widget like Section | |
31 * can be a part by itself, but a number of widgets can gather around one form | |
32 * part. | |
33 * <p> | |
34 * This interface should not be extended or implemented. New form instances | |
35 * should be created using ManagedForm. | |
36 * | |
37 * @see ManagedForm | |
38 * @since 3.0 | |
39 * @noimplement This interface is not intended to be implemented by clients. | |
40 */ | |
41 public interface IManagedForm { | |
42 /** | |
43 * Initializes the form by looping through the managed parts and | |
44 * initializing them. Has no effect if already called once. | |
45 * | |
46 * @since 3.1 | |
47 */ | |
48 public void initialize(); | |
49 | |
50 /** | |
51 * Returns the toolkit used by this form. | |
52 * | |
53 * @return the toolkit | |
54 */ | |
55 public FormToolkit getToolkit(); | |
56 | |
57 /** | |
58 * Returns the form widget managed by this form. | |
59 * | |
60 * @return the form widget | |
61 */ | |
62 public ScrolledForm getForm(); | |
63 | |
64 /** | |
65 * Reflows the form as a result of the layout change. | |
66 * | |
67 * @param changed | |
68 * if <code>true</code>, discard cached layout information | |
69 */ | |
70 public void reflow(bool changed); | |
71 | |
72 /** | |
73 * A part can use this method to notify other parts that implement | |
74 * IPartSelectionListener about selection changes. | |
75 * | |
76 * @param part | |
77 * the part that broadcasts the selection | |
78 * @param selection | |
79 * the selection in the part | |
80 */ | |
81 public void fireSelectionChanged(IFormPart part, ISelection selection); | |
82 | |
83 /** | |
84 * Returns all the parts currently managed by this form. | |
85 * | |
86 * @return the managed parts | |
87 */ | |
88 IFormPart[] getParts(); | |
89 | |
90 /** | |
91 * Adds the new part to the form. | |
92 * | |
93 * @param part | |
94 * the part to add | |
95 */ | |
96 void addPart(IFormPart part); | |
97 | |
98 /** | |
99 * Removes the part from the form. | |
100 * | |
101 * @param part | |
102 * the part to remove | |
103 */ | |
104 void removePart(IFormPart part); | |
105 | |
106 /** | |
107 * Sets the input of this page to the provided object. | |
108 * | |
109 * @param input | |
110 * the new page input | |
111 * @return <code>true</code> if the form contains this object, | |
112 * <code>false</code> otherwise. | |
113 */ | |
114 bool setInput(Object input); | |
115 | |
116 /** | |
117 * Returns the current page input. | |
118 * | |
119 * @return page input object or <code>null</code> if not applicable. | |
120 */ | |
121 Object getInput(); | |
122 | |
123 /** | |
124 * Tests if form is dirty. A managed form is dirty if at least one managed | |
125 * part is dirty. | |
126 * | |
127 * @return <code>true</code> if at least one managed part is dirty, | |
128 * <code>false</code> otherwise. | |
129 */ | |
130 bool isDirty(); | |
131 | |
132 /** | |
133 * Notifies the form that the dirty state of one of its parts has changed. | |
134 * The global dirty state of the form can be obtained by calling 'isDirty'. | |
135 * | |
136 * @see #isDirty | |
137 */ | |
138 void dirtyStateChanged(); | |
139 | |
140 /** | |
141 * Commits the dirty form. All pending changes in the widgets are flushed | |
142 * into the model. | |
143 * | |
144 * @param onSave | |
145 */ | |
146 void commit(bool onSave); | |
147 | |
148 /** | |
149 * Tests if form is stale. A managed form is stale if at least one managed | |
150 * part is stale. This can happen when the underlying model changes, | |
151 * resulting in the presentation of the part being out of sync with the | |
152 * model and needing refreshing. | |
153 * | |
154 * @return <code>true</code> if the form is stale, <code>false</code> | |
155 * otherwise. | |
156 */ | |
157 bool isStale(); | |
158 | |
159 /** | |
160 * Notifies the form that the stale state of one of its parts has changed. | |
161 * The global stale state of the form can be obtained by calling 'isStale'. | |
162 */ | |
163 void staleStateChanged(); | |
164 | |
165 /** | |
166 * Refreshes the form by refreshing every part that is stale. | |
167 */ | |
168 void refresh(); | |
169 | |
170 /** | |
171 * Sets the container that owns this form. Depending on the context, the | |
172 * container may be wizard, editor page, editor etc. | |
173 * | |
174 * @param container | |
175 * the container of this form | |
176 */ | |
177 void setContainer(Object container); | |
178 | |
179 /** | |
180 * Returns the container of this form. | |
181 * | |
182 * @return the form container | |
183 */ | |
184 Object getContainer(); | |
185 | |
186 /** | |
187 * Returns the message manager that will keep track of messages in this | |
188 * form. | |
189 * | |
190 * @return the message manager instance | |
191 * @since 3.3 | |
192 */ | |
193 IMessageManager getMessageManager(); | |
194 } |