8
|
1 /*******************************************************************************
|
|
2 * Copyright (c) 2000, 2006 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 dwtx.jface.dialogs.IDialogConstants;
|
|
14
|
|
15 /**
|
|
16 * Various dialog-related constants.
|
|
17 * <p>
|
|
18 * Within the dialog framework, all buttons are referred to by a button id.
|
|
19 * Various common buttons, like "OK", "Cancel", and "Finish", have pre-assigned
|
|
20 * button ids for convenience. If an application requires other dialog buttons,
|
|
21 * they should be assigned application-specific button ids counting up from
|
|
22 * <code>CLIENT_ID</code>.
|
|
23 * </p>
|
|
24 * <p>
|
|
25 * Button label constants are also provided for the common buttons. JFace
|
|
26 * automatically localizes these strings to the current locale; that is,
|
|
27 * <code>YES_LABEL</code> would be bound to the string <code>"Si"</code> in
|
|
28 * a Spanish locale, but to <code>"Oui"</code> in a French one.
|
|
29 * </p>
|
|
30 * <p>
|
|
31 * All margins, spacings, and sizes are given in "dialog units" (DLUs), where
|
|
32 * <ul>
|
|
33 * <li>1 horizontal DLU = 1/4 average character width</li>
|
|
34 * <li>1 vertical DLU = 1/8 average character height</li>
|
|
35 * </ul>
|
|
36 * </p>
|
|
37 */
|
|
38 import dwtx.jface.resource.JFaceResources;
|
|
39
|
|
40 import dwt.dwthelper.utils;
|
|
41
|
|
42 /**
|
|
43 * IDialogConstants is the interface for common dialog strings and ids
|
|
44 * used throughout JFace.
|
|
45 * It is recommended that you use these labels and ids whereever
|
|
46 * for consistency with the JFace dialogs.
|
|
47 */
|
|
48 public abstract class IDialogConstants {
|
|
49 static{
|
|
50 const{
|
|
51 // button ids
|
|
52
|
|
53 // Note: if new button ids are added, see
|
|
54 // MessageDialogWithToggle.mapButtonLabelToButtonID(String, int)
|
|
55 /**
|
|
56 * Button id for an "Ok" button (value 0).
|
|
57 */
|
|
58 public int OK_ID = 0;
|
|
59
|
|
60 /**
|
|
61 * Button id for a "Cancel" button (value 1).
|
|
62 */
|
|
63 public int CANCEL_ID = 1;
|
|
64
|
|
65 /**
|
|
66 * Button id for a "Yes" button (value 2).
|
|
67 */
|
|
68 public int YES_ID = 2;
|
|
69
|
|
70 /**
|
|
71 * Button id for a "No" button (value 3).
|
|
72 */
|
|
73 public int NO_ID = 3;
|
|
74
|
|
75 /**
|
|
76 * Button id for a "Yes to All" button (value 4).
|
|
77 */
|
|
78 public int YES_TO_ALL_ID = 4;
|
|
79
|
|
80 /**
|
|
81 * Button id for a "Skip" button (value 5).
|
|
82 */
|
|
83 public int SKIP_ID = 5;
|
|
84
|
|
85 /**
|
|
86 * Button id for a "Stop" button (value 6).
|
|
87 */
|
|
88 public int STOP_ID = 6;
|
|
89
|
|
90 /**
|
|
91 * Button id for an "Abort" button (value 7).
|
|
92 */
|
|
93 public int ABORT_ID = 7;
|
|
94
|
|
95 /**
|
|
96 * Button id for a "Retry" button (value 8).
|
|
97 */
|
|
98 public int RETRY_ID = 8;
|
|
99
|
|
100 /**
|
|
101 * Button id for an "Ignore" button (value 9).
|
|
102 */
|
|
103 public int IGNORE_ID = 9;
|
|
104
|
|
105 /**
|
|
106 * Button id for a "Proceed" button (value 10).
|
|
107 */
|
|
108 public int PROCEED_ID = 10;
|
|
109
|
|
110 /**
|
|
111 * Button id for an "Open" button (value 11).
|
|
112 */
|
|
113 public int OPEN_ID = 11;
|
|
114
|
|
115 /**
|
|
116 * Button id for a "Close" button (value 12).
|
|
117 */
|
|
118 public int CLOSE_ID = 12;
|
|
119
|
|
120 /**
|
|
121 * Button id for a "Details" button (value 13).
|
|
122 */
|
|
123 public int DETAILS_ID = 13;
|
|
124
|
|
125 /**
|
|
126 * Button id for a "Back" button (value 14).
|
|
127 */
|
|
128 public int BACK_ID = 14;
|
|
129
|
|
130 /**
|
|
131 * Button id for a "Next" button (value 15).
|
|
132 */
|
|
133 public int NEXT_ID = 15;
|
|
134
|
|
135 /**
|
|
136 * Button id for a "Finish" button (value 16).
|
|
137 */
|
|
138 public int FINISH_ID = 16;
|
|
139
|
|
140 /**
|
|
141 * Button id for a "Help" button (value 17).
|
|
142 */
|
|
143 public int HELP_ID = 17;
|
|
144
|
|
145 /**
|
|
146 * Button id for a "Select All" button (value 18).
|
|
147 */
|
|
148 public int SELECT_ALL_ID = 18;
|
|
149
|
|
150 /**
|
|
151 * Button id for a "Deselect All" button (value 19).
|
|
152 */
|
|
153 public int DESELECT_ALL_ID = 19;
|
|
154
|
|
155 /**
|
|
156 * Button id for a "Select types" button (value 20).
|
|
157 */
|
|
158 public int SELECT_TYPES_ID = 20;
|
|
159
|
|
160 /**
|
|
161 * Button id for a "No to All" button (value 21).
|
|
162 */
|
|
163 public int NO_TO_ALL_ID = 21;
|
|
164
|
|
165 /**
|
|
166 * Starting button id reserved for internal use by JFace (value 256). JFace
|
|
167 * classes make ids by adding to this number.
|
|
168 */
|
|
169 public int INTERNAL_ID = 256;
|
|
170
|
|
171 /**
|
|
172 * Starting button id reserved for use by clients of JFace (value 1024).
|
|
173 * Clients of JFace should make ids by adding to this number.
|
|
174 */
|
|
175 public int CLIENT_ID = 1024;
|
|
176 } // const
|
|
177 // button labels
|
|
178 /**
|
|
179 * The label for OK buttons.
|
|
180 */
|
|
181 public String OK_LABEL;
|
|
182
|
|
183 /**
|
|
184 * The label for cancel buttons.
|
|
185 */
|
|
186 public String CANCEL_LABEL;
|
|
187
|
|
188 /**
|
|
189 * The label for yes buttons.
|
|
190 */
|
|
191 public String YES_LABEL;
|
|
192
|
|
193 /**
|
|
194 * The label for no buttons.
|
|
195 */
|
|
196 public String NO_LABEL;
|
|
197
|
|
198 /**
|
|
199 * The label for not to all buttons.
|
|
200 */
|
|
201 public String NO_TO_ALL_LABEL;
|
|
202
|
|
203 /**
|
|
204 * The label for yes to all buttons.
|
|
205 */
|
|
206 public String YES_TO_ALL_LABEL;
|
|
207
|
|
208 /**
|
|
209 * The label for skip buttons.
|
|
210 */
|
|
211 public String SKIP_LABEL;
|
|
212
|
|
213 /**
|
|
214 * The label for stop buttons.
|
|
215 */
|
|
216 public String STOP_LABEL;
|
|
217
|
|
218 /**
|
|
219 * The label for abort buttons.
|
|
220 */
|
|
221 public String ABORT_LABEL;
|
|
222
|
|
223 /**
|
|
224 * The label for retry buttons.
|
|
225 */
|
|
226 public String RETRY_LABEL;
|
|
227
|
|
228 /**
|
|
229 * The label for ignore buttons.
|
|
230 */
|
|
231 public String IGNORE_LABEL;
|
|
232
|
|
233 /**
|
|
234 * The label for proceed buttons.
|
|
235 */
|
|
236 public String PROCEED_LABEL;
|
|
237
|
|
238 /**
|
|
239 * The label for open buttons.
|
|
240 */
|
|
241 public String OPEN_LABEL;
|
|
242
|
|
243 /**
|
|
244 * The label for close buttons.
|
|
245 */
|
|
246 public String CLOSE_LABEL;
|
|
247
|
|
248 /**
|
|
249 * The label for show details buttons.
|
|
250 */
|
|
251 public String SHOW_DETAILS_LABEL;
|
|
252
|
|
253 /**
|
|
254 * The label for hide details buttons.
|
|
255 */
|
|
256 public String HIDE_DETAILS_LABEL;
|
|
257
|
|
258 /**
|
|
259 * The label for back buttons.
|
|
260 */
|
|
261 public String BACK_LABEL;
|
|
262
|
|
263 /**
|
|
264 * The label for next buttons.
|
|
265 */
|
|
266 public String NEXT_LABEL;
|
|
267
|
|
268 /**
|
|
269 * The label for finish buttons.
|
|
270 */
|
|
271 public String FINISH_LABEL;
|
|
272
|
|
273 /**
|
|
274 * The label for help buttons.
|
|
275 */
|
|
276 public String HELP_LABEL;
|
|
277
|
|
278 const{
|
|
279 // Margins, spacings, and sizes
|
|
280 /**
|
|
281 * Vertical margin in dialog units (value 7).
|
|
282 */
|
|
283 public int VERTICAL_MARGIN = 7;
|
|
284
|
|
285 /**
|
|
286 * Vertical spacing in dialog units (value 4).
|
|
287 */
|
|
288 public int VERTICAL_SPACING = 4;
|
|
289
|
|
290 /**
|
|
291 * Horizontal margin in dialog units (value 7).
|
|
292 */
|
|
293 public int HORIZONTAL_MARGIN = 7;
|
|
294
|
|
295 /**
|
|
296 * Horizontal spacing in dialog units (value 4).
|
|
297 */
|
|
298 public int HORIZONTAL_SPACING = 4;
|
|
299
|
|
300 /**
|
|
301 * Height of button bar in dialog units (value 25).
|
|
302 */
|
|
303 public int BUTTON_BAR_HEIGHT = 25;
|
|
304
|
|
305 /**
|
|
306 * Left margin in dialog units (value 20).
|
|
307 */
|
|
308 public int LEFT_MARGIN = 20;
|
|
309
|
|
310 /**
|
|
311 * Button margin in dialog units (value 4).
|
|
312 */
|
|
313 public int BUTTON_MARGIN = 4;
|
|
314
|
|
315 /**
|
|
316 * Button height in dialog units (value 14).
|
|
317 *
|
|
318 * @deprecated This constant is no longer in use.
|
|
319 * The button heights are now determined by the layout.
|
|
320 */
|
|
321 public int BUTTON_HEIGHT = 14;
|
|
322
|
|
323 /**
|
|
324 * Button width in dialog units (value 61).
|
|
325 */
|
|
326 public int BUTTON_WIDTH = 61;
|
|
327
|
|
328 /**
|
|
329 * Indent in dialog units (value 21).
|
|
330 */
|
|
331 public int INDENT = 21;
|
|
332
|
|
333 /**
|
|
334 * Small indent in dialog units (value 7).
|
|
335 */
|
|
336 public int SMALL_INDENT = 7;
|
|
337
|
|
338 /**
|
|
339 * Entry field width in dialog units (value 200).
|
|
340 */
|
|
341 public int ENTRY_FIELD_WIDTH = 200;
|
|
342
|
|
343 /**
|
|
344 * Minimum width of message area in dialog units (value 300).
|
|
345 */
|
|
346 public int MINIMUM_MESSAGE_AREA_WIDTH = 300;
|
|
347 }// const
|
|
348 }// static
|
|
349 }
|
|
350 static this(){
|
|
351 IDialogConstants.OK_LABEL = JFaceResources.getString("ok"); //$NON-NLS-1$
|
|
352 IDialogConstants.CANCEL_LABEL = JFaceResources.getString("cancel"); //$NON-NLS-1$
|
|
353 IDialogConstants.YES_LABEL = JFaceResources.getString("yes"); //$NON-NLS-1$
|
|
354 IDialogConstants.NO_LABEL = JFaceResources.getString("no"); //$NON-NLS-1$
|
|
355 IDialogConstants.NO_TO_ALL_LABEL = JFaceResources.getString("notoall"); //$NON-NLS-1$
|
|
356 IDialogConstants.YES_TO_ALL_LABEL = JFaceResources.getString("yestoall"); //$NON-NLS-1$
|
|
357 IDialogConstants.SKIP_LABEL = JFaceResources.getString("skip"); //$NON-NLS-1$
|
|
358 IDialogConstants.STOP_LABEL = JFaceResources.getString("stop"); //$NON-NLS-1$
|
|
359 IDialogConstants.ABORT_LABEL = JFaceResources.getString("abort"); //$NON-NLS-1$
|
|
360 IDialogConstants.RETRY_LABEL = JFaceResources.getString("retry"); //$NON-NLS-1$
|
|
361 IDialogConstants.IGNORE_LABEL = JFaceResources.getString("ignore"); //$NON-NLS-1$
|
|
362 IDialogConstants.PROCEED_LABEL = JFaceResources.getString("proceed"); //$NON-NLS-1$
|
|
363 IDialogConstants.OPEN_LABEL = JFaceResources.getString("open"); //$NON-NLS-1$
|
|
364 IDialogConstants.CLOSE_LABEL = JFaceResources.getString("close"); //$NON-NLS-1$
|
|
365 IDialogConstants.SHOW_DETAILS_LABEL = JFaceResources.getString("showDetails"); //$NON-NLS-1$
|
|
366 IDialogConstants.HIDE_DETAILS_LABEL = JFaceResources.getString("hideDetails"); //$NON-NLS-1$
|
|
367 IDialogConstants.BACK_LABEL = JFaceResources.getString("backButton"); //$NON-NLS-1$
|
|
368 IDialogConstants.NEXT_LABEL = JFaceResources.getString("nextButton"); //$NON-NLS-1$
|
|
369 IDialogConstants.FINISH_LABEL = JFaceResources.getString("finish"); //$NON-NLS-1$
|
|
370 IDialogConstants.HELP_LABEL = JFaceResources.getString("help"); //$NON-NLS-1$
|
|
371 }
|