KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > dialogs > IDialogConstants


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  *******************************************************************************/

11 package org.eclipse.jface.dialogs;
12
13 /**
14  * Various dialog-related constants.
15  * <p>
16  * Within the dialog framework, all buttons are referred to by a button id.
17  * Various common buttons, like "OK", "Cancel", and "Finish", have pre-assigned
18  * button ids for convenience. If an application requires other dialog buttons,
19  * they should be assigned application-specific button ids counting up from
20  * <code>CLIENT_ID</code>.
21  * </p>
22  * <p>
23  * Button label constants are also provided for the common buttons. JFace
24  * automatically localizes these strings to the current locale; that is,
25  * <code>YES_LABEL</code> would be bound to the string <code>"Si"</code> in
26  * a Spanish locale, but to <code>"Oui"</code> in a French one.
27  * </p>
28  * <p>
29  * All margins, spacings, and sizes are given in "dialog units" (DLUs), where
30  * <ul>
31  * <li>1 horizontal DLU = 1/4 average character width</li>
32  * <li>1 vertical DLU = 1/8 average character height</li>
33  * </ul>
34  * </p>
35  */

36 import org.eclipse.jface.resource.JFaceResources;
37
38 /**
39  * IDialogConstants is the interface for common dialog strings and ids
40  * used throughout JFace.
41  * It is recommended that you use these labels and ids whereever
42  * for consistency with the JFace dialogs.
43  */

44 public interface IDialogConstants {
45     // button ids
46

47     // Note: if new button ids are added, see
48
// MessageDialogWithToggle.mapButtonLabelToButtonID(String, int)
49
/**
50      * Button id for an "Ok" button (value 0).
51      */

52     public int OK_ID = 0;
53
54     /**
55      * Button id for a "Cancel" button (value 1).
56      */

57     public int CANCEL_ID = 1;
58
59     /**
60      * Button id for a "Yes" button (value 2).
61      */

62     public int YES_ID = 2;
63
64     /**
65      * Button id for a "No" button (value 3).
66      */

67     public int NO_ID = 3;
68
69     /**
70      * Button id for a "Yes to All" button (value 4).
71      */

72     public int YES_TO_ALL_ID = 4;
73
74     /**
75      * Button id for a "Skip" button (value 5).
76      */

77     public int SKIP_ID = 5;
78
79     /**
80      * Button id for a "Stop" button (value 6).
81      */

82     public int STOP_ID = 6;
83
84     /**
85      * Button id for an "Abort" button (value 7).
86      */

87     public int ABORT_ID = 7;
88
89     /**
90      * Button id for a "Retry" button (value 8).
91      */

92     public int RETRY_ID = 8;
93
94     /**
95      * Button id for an "Ignore" button (value 9).
96      */

97     public int IGNORE_ID = 9;
98
99     /**
100      * Button id for a "Proceed" button (value 10).
101      */

102     public int PROCEED_ID = 10;
103
104     /**
105      * Button id for an "Open" button (value 11).
106      */

107     public int OPEN_ID = 11;
108
109     /**
110      * Button id for a "Close" button (value 12).
111      */

112     public int CLOSE_ID = 12;
113
114     /**
115      * Button id for a "Details" button (value 13).
116      */

117     public int DETAILS_ID = 13;
118
119     /**
120      * Button id for a "Back" button (value 14).
121      */

122     public int BACK_ID = 14;
123
124     /**
125      * Button id for a "Next" button (value 15).
126      */

127     public int NEXT_ID = 15;
128
129     /**
130      * Button id for a "Finish" button (value 16).
131      */

132     public int FINISH_ID = 16;
133
134     /**
135      * Button id for a "Help" button (value 17).
136      */

137     public int HELP_ID = 17;
138
139     /**
140      * Button id for a "Select All" button (value 18).
141      */

142     public int SELECT_ALL_ID = 18;
143
144     /**
145      * Button id for a "Deselect All" button (value 19).
146      */

147     public int DESELECT_ALL_ID = 19;
148
149     /**
150      * Button id for a "Select types" button (value 20).
151      */

152     public int SELECT_TYPES_ID = 20;
153
154     /**
155      * Button id for a "No to All" button (value 21).
156      */

157     public int NO_TO_ALL_ID = 21;
158
159     /**
160      * Starting button id reserved for internal use by JFace (value 256). JFace
161      * classes make ids by adding to this number.
162      */

163     public int INTERNAL_ID = 256;
164
165     /**
166      * Starting button id reserved for use by clients of JFace (value 1024).
167      * Clients of JFace should make ids by adding to this number.
168      */

169     public int CLIENT_ID = 1024;
170
171     // button labels
172
/**
173      * The label for OK buttons.
174      */

175     public String JavaDoc OK_LABEL = JFaceResources.getString("ok"); //$NON-NLS-1$
176

177     /**
178      * The label for cancel buttons.
179      */

180     public String JavaDoc CANCEL_LABEL = JFaceResources.getString("cancel"); //$NON-NLS-1$
181

182     /**
183      * The label for yes buttons.
184      */

185     public String JavaDoc YES_LABEL = JFaceResources.getString("yes"); //$NON-NLS-1$
186

187     /**
188      * The label for no buttons.
189      */

190     public String JavaDoc NO_LABEL = JFaceResources.getString("no"); //$NON-NLS-1$
191

192     /**
193      * The label for not to all buttons.
194      */

195     public String JavaDoc NO_TO_ALL_LABEL = JFaceResources.getString("notoall"); //$NON-NLS-1$
196

197     /**
198      * The label for yes to all buttons.
199      */

200     public String JavaDoc YES_TO_ALL_LABEL = JFaceResources.getString("yestoall"); //$NON-NLS-1$
201

202     /**
203      * The label for skip buttons.
204      */

205     public String JavaDoc SKIP_LABEL = JFaceResources.getString("skip"); //$NON-NLS-1$
206

207     /**
208      * The label for stop buttons.
209      */

210     public String JavaDoc STOP_LABEL = JFaceResources.getString("stop"); //$NON-NLS-1$
211

212     /**
213      * The label for abort buttons.
214      */

215     public String JavaDoc ABORT_LABEL = JFaceResources.getString("abort"); //$NON-NLS-1$
216

217     /**
218      * The label for retry buttons.
219      */

220     public String JavaDoc RETRY_LABEL = JFaceResources.getString("retry"); //$NON-NLS-1$
221

222     /**
223      * The label for ignore buttons.
224      */

225     public String JavaDoc IGNORE_LABEL = JFaceResources.getString("ignore"); //$NON-NLS-1$
226

227     /**
228      * The label for proceed buttons.
229      */

230     public String JavaDoc PROCEED_LABEL = JFaceResources.getString("proceed"); //$NON-NLS-1$
231

232     /**
233      * The label for open buttons.
234      */

235     public String JavaDoc OPEN_LABEL = JFaceResources.getString("open"); //$NON-NLS-1$
236

237     /**
238      * The label for close buttons.
239      */

240     public String JavaDoc CLOSE_LABEL = JFaceResources.getString("close"); //$NON-NLS-1$
241

242     /**
243      * The label for show details buttons.
244      */

245     public String JavaDoc SHOW_DETAILS_LABEL = JFaceResources.getString("showDetails"); //$NON-NLS-1$
246

247     /**
248      * The label for hide details buttons.
249      */

250     public String JavaDoc HIDE_DETAILS_LABEL = JFaceResources.getString("hideDetails"); //$NON-NLS-1$
251

252     /**
253      * The label for back buttons.
254      */

255     public String JavaDoc BACK_LABEL = JFaceResources.getString("backButton"); //$NON-NLS-1$
256

257     /**
258      * The label for next buttons.
259      */

260     public String JavaDoc NEXT_LABEL = JFaceResources.getString("nextButton"); //$NON-NLS-1$
261

262     /**
263      * The label for finish buttons.
264      */

265     public String JavaDoc FINISH_LABEL = JFaceResources.getString("finish"); //$NON-NLS-1$
266

267     /**
268      * The label for help buttons.
269      */

270     public String JavaDoc HELP_LABEL = JFaceResources.getString("help"); //$NON-NLS-1$
271

272     // Margins, spacings, and sizes
273
/**
274      * Vertical margin in dialog units (value 7).
275      */

276     public int VERTICAL_MARGIN = 7;
277
278     /**
279      * Vertical spacing in dialog units (value 4).
280      */

281     public int VERTICAL_SPACING = 4;
282
283     /**
284      * Horizontal margin in dialog units (value 7).
285      */

286     public int HORIZONTAL_MARGIN = 7;
287
288     /**
289      * Horizontal spacing in dialog units (value 4).
290      */

291     public int HORIZONTAL_SPACING = 4;
292
293     /**
294      * Height of button bar in dialog units (value 25).
295      */

296     public int BUTTON_BAR_HEIGHT = 25;
297
298     /**
299      * Left margin in dialog units (value 20).
300      */

301     public int LEFT_MARGIN = 20;
302
303     /**
304      * Button margin in dialog units (value 4).
305      */

306     public int BUTTON_MARGIN = 4;
307
308     /**
309      * Button height in dialog units (value 14).
310      *
311      * @deprecated This constant is no longer in use.
312      * The button heights are now determined by the layout.
313      */

314     public int BUTTON_HEIGHT = 14;
315
316     /**
317      * Button width in dialog units (value 61).
318      */

319     public int BUTTON_WIDTH = 61;
320
321     /**
322      * Indent in dialog units (value 21).
323      */

324     public int INDENT = 21;
325
326     /**
327      * Small indent in dialog units (value 7).
328      */

329     public int SMALL_INDENT = 7;
330
331     /**
332      * Entry field width in dialog units (value 200).
333      */

334     public int ENTRY_FIELD_WIDTH = 200;
335
336     /**
337      * Minimum width of message area in dialog units (value 300).
338      */

339     public int MINIMUM_MESSAGE_AREA_WIDTH = 300;
340 }
341
Popular Tags