001: /*******************************************************************************
002: * Copyright (c) 2000, 2006 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - initial API and implementation
010: *******************************************************************************/package org.eclipse.jface.dialogs;
011:
012: /**
013: * Various dialog-related constants.
014: * <p>
015: * Within the dialog framework, all buttons are referred to by a button id.
016: * Various common buttons, like "OK", "Cancel", and "Finish", have pre-assigned
017: * button ids for convenience. If an application requires other dialog buttons,
018: * they should be assigned application-specific button ids counting up from
019: * <code>CLIENT_ID</code>.
020: * </p>
021: * <p>
022: * Button label constants are also provided for the common buttons. JFace
023: * automatically localizes these strings to the current locale; that is,
024: * <code>YES_LABEL</code> would be bound to the string <code>"Si"</code> in
025: * a Spanish locale, but to <code>"Oui"</code> in a French one.
026: * </p>
027: * <p>
028: * All margins, spacings, and sizes are given in "dialog units" (DLUs), where
029: * <ul>
030: * <li>1 horizontal DLU = 1/4 average character width</li>
031: * <li>1 vertical DLU = 1/8 average character height</li>
032: * </ul>
033: * </p>
034: */
035: import org.eclipse.jface.resource.JFaceResources;
036:
037: /**
038: * IDialogConstants is the interface for common dialog strings and ids
039: * used throughout JFace.
040: * It is recommended that you use these labels and ids whereever
041: * for consistency with the JFace dialogs.
042: */
043: public interface IDialogConstants {
044: // button ids
045:
046: // Note: if new button ids are added, see
047: // MessageDialogWithToggle.mapButtonLabelToButtonID(String, int)
048: /**
049: * Button id for an "Ok" button (value 0).
050: */
051: public int OK_ID = 0;
052:
053: /**
054: * Button id for a "Cancel" button (value 1).
055: */
056: public int CANCEL_ID = 1;
057:
058: /**
059: * Button id for a "Yes" button (value 2).
060: */
061: public int YES_ID = 2;
062:
063: /**
064: * Button id for a "No" button (value 3).
065: */
066: public int NO_ID = 3;
067:
068: /**
069: * Button id for a "Yes to All" button (value 4).
070: */
071: public int YES_TO_ALL_ID = 4;
072:
073: /**
074: * Button id for a "Skip" button (value 5).
075: */
076: public int SKIP_ID = 5;
077:
078: /**
079: * Button id for a "Stop" button (value 6).
080: */
081: public int STOP_ID = 6;
082:
083: /**
084: * Button id for an "Abort" button (value 7).
085: */
086: public int ABORT_ID = 7;
087:
088: /**
089: * Button id for a "Retry" button (value 8).
090: */
091: public int RETRY_ID = 8;
092:
093: /**
094: * Button id for an "Ignore" button (value 9).
095: */
096: public int IGNORE_ID = 9;
097:
098: /**
099: * Button id for a "Proceed" button (value 10).
100: */
101: public int PROCEED_ID = 10;
102:
103: /**
104: * Button id for an "Open" button (value 11).
105: */
106: public int OPEN_ID = 11;
107:
108: /**
109: * Button id for a "Close" button (value 12).
110: */
111: public int CLOSE_ID = 12;
112:
113: /**
114: * Button id for a "Details" button (value 13).
115: */
116: public int DETAILS_ID = 13;
117:
118: /**
119: * Button id for a "Back" button (value 14).
120: */
121: public int BACK_ID = 14;
122:
123: /**
124: * Button id for a "Next" button (value 15).
125: */
126: public int NEXT_ID = 15;
127:
128: /**
129: * Button id for a "Finish" button (value 16).
130: */
131: public int FINISH_ID = 16;
132:
133: /**
134: * Button id for a "Help" button (value 17).
135: */
136: public int HELP_ID = 17;
137:
138: /**
139: * Button id for a "Select All" button (value 18).
140: */
141: public int SELECT_ALL_ID = 18;
142:
143: /**
144: * Button id for a "Deselect All" button (value 19).
145: */
146: public int DESELECT_ALL_ID = 19;
147:
148: /**
149: * Button id for a "Select types" button (value 20).
150: */
151: public int SELECT_TYPES_ID = 20;
152:
153: /**
154: * Button id for a "No to All" button (value 21).
155: */
156: public int NO_TO_ALL_ID = 21;
157:
158: /**
159: * Starting button id reserved for internal use by JFace (value 256). JFace
160: * classes make ids by adding to this number.
161: */
162: public int INTERNAL_ID = 256;
163:
164: /**
165: * Starting button id reserved for use by clients of JFace (value 1024).
166: * Clients of JFace should make ids by adding to this number.
167: */
168: public int CLIENT_ID = 1024;
169:
170: // button labels
171: /**
172: * The label for OK buttons.
173: */
174: public String OK_LABEL = JFaceResources.getString("ok"); //$NON-NLS-1$
175:
176: /**
177: * The label for cancel buttons.
178: */
179: public String CANCEL_LABEL = JFaceResources.getString("cancel"); //$NON-NLS-1$
180:
181: /**
182: * The label for yes buttons.
183: */
184: public String YES_LABEL = JFaceResources.getString("yes"); //$NON-NLS-1$
185:
186: /**
187: * The label for no buttons.
188: */
189: public String NO_LABEL = JFaceResources.getString("no"); //$NON-NLS-1$
190:
191: /**
192: * The label for not to all buttons.
193: */
194: public String NO_TO_ALL_LABEL = JFaceResources.getString("notoall"); //$NON-NLS-1$
195:
196: /**
197: * The label for yes to all buttons.
198: */
199: public String YES_TO_ALL_LABEL = JFaceResources
200: .getString("yestoall"); //$NON-NLS-1$
201:
202: /**
203: * The label for skip buttons.
204: */
205: public String SKIP_LABEL = JFaceResources.getString("skip"); //$NON-NLS-1$
206:
207: /**
208: * The label for stop buttons.
209: */
210: public String STOP_LABEL = JFaceResources.getString("stop"); //$NON-NLS-1$
211:
212: /**
213: * The label for abort buttons.
214: */
215: public String ABORT_LABEL = JFaceResources.getString("abort"); //$NON-NLS-1$
216:
217: /**
218: * The label for retry buttons.
219: */
220: public String RETRY_LABEL = JFaceResources.getString("retry"); //$NON-NLS-1$
221:
222: /**
223: * The label for ignore buttons.
224: */
225: public String IGNORE_LABEL = JFaceResources.getString("ignore"); //$NON-NLS-1$
226:
227: /**
228: * The label for proceed buttons.
229: */
230: public String PROCEED_LABEL = JFaceResources.getString("proceed"); //$NON-NLS-1$
231:
232: /**
233: * The label for open buttons.
234: */
235: public String OPEN_LABEL = JFaceResources.getString("open"); //$NON-NLS-1$
236:
237: /**
238: * The label for close buttons.
239: */
240: public String CLOSE_LABEL = JFaceResources.getString("close"); //$NON-NLS-1$
241:
242: /**
243: * The label for show details buttons.
244: */
245: public String SHOW_DETAILS_LABEL = JFaceResources
246: .getString("showDetails"); //$NON-NLS-1$
247:
248: /**
249: * The label for hide details buttons.
250: */
251: public String HIDE_DETAILS_LABEL = JFaceResources
252: .getString("hideDetails"); //$NON-NLS-1$
253:
254: /**
255: * The label for back buttons.
256: */
257: public String BACK_LABEL = JFaceResources.getString("backButton"); //$NON-NLS-1$
258:
259: /**
260: * The label for next buttons.
261: */
262: public String NEXT_LABEL = JFaceResources.getString("nextButton"); //$NON-NLS-1$
263:
264: /**
265: * The label for finish buttons.
266: */
267: public String FINISH_LABEL = JFaceResources.getString("finish"); //$NON-NLS-1$
268:
269: /**
270: * The label for help buttons.
271: */
272: public String HELP_LABEL = JFaceResources.getString("help"); //$NON-NLS-1$
273:
274: // Margins, spacings, and sizes
275: /**
276: * Vertical margin in dialog units (value 7).
277: */
278: public int VERTICAL_MARGIN = 7;
279:
280: /**
281: * Vertical spacing in dialog units (value 4).
282: */
283: public int VERTICAL_SPACING = 4;
284:
285: /**
286: * Horizontal margin in dialog units (value 7).
287: */
288: public int HORIZONTAL_MARGIN = 7;
289:
290: /**
291: * Horizontal spacing in dialog units (value 4).
292: */
293: public int HORIZONTAL_SPACING = 4;
294:
295: /**
296: * Height of button bar in dialog units (value 25).
297: */
298: public int BUTTON_BAR_HEIGHT = 25;
299:
300: /**
301: * Left margin in dialog units (value 20).
302: */
303: public int LEFT_MARGIN = 20;
304:
305: /**
306: * Button margin in dialog units (value 4).
307: */
308: public int BUTTON_MARGIN = 4;
309:
310: /**
311: * Button height in dialog units (value 14).
312: *
313: * @deprecated This constant is no longer in use.
314: * The button heights are now determined by the layout.
315: */
316: public int BUTTON_HEIGHT = 14;
317:
318: /**
319: * Button width in dialog units (value 61).
320: */
321: public int BUTTON_WIDTH = 61;
322:
323: /**
324: * Indent in dialog units (value 21).
325: */
326: public int INDENT = 21;
327:
328: /**
329: * Small indent in dialog units (value 7).
330: */
331: public int SMALL_INDENT = 7;
332:
333: /**
334: * Entry field width in dialog units (value 200).
335: */
336: public int ENTRY_FIELD_WIDTH = 200;
337:
338: /**
339: * Minimum width of message area in dialog units (value 300).
340: */
341: public int MINIMUM_MESSAGE_AREA_WIDTH = 300;
342: }
|