KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > edu > rice > cs > drjava > config > OptionConstants


1 /*BEGIN_COPYRIGHT_BLOCK
2  *
3  * This file is part of DrJava. Download the current version of this project from http://www.drjava.org/
4  * or http://sourceforge.net/projects/drjava/
5  *
6  * DrJava Open Source License
7  *
8  * Copyright (C) 2001-2005 JavaPLT group at Rice University (javaplt@rice.edu). All rights reserved.
9  *
10  * Developed by: Java Programming Languages Team, Rice University, http://www.cs.rice.edu/~javaplt/
11  *
12  * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
13  * documentation files (the "Software"), to deal with the Software without restriction, including without limitation
14  * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
15  * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
16  *
17  * - Redistributions of source code must retain the above copyright notice, this list of conditions and the
18  * following disclaimers.
19  * - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
20  * following disclaimers in the documentation and/or other materials provided with the distribution.
21  * - Neither the names of DrJava, the JavaPLT, Rice University, nor the names of its contributors may be used to
22  * endorse or promote products derived from this Software without specific prior written permission.
23  * - Products derived from this software may not be called "DrJava" nor use the term "DrJava" as part of their
24  * names without prior written permission from the JavaPLT group. For permission, write to javaplt@rice.edu.
25  *
26  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
27  * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28  * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
29  * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
30  * WITH THE SOFTWARE.
31  *
32  *END_COPYRIGHT_BLOCK*/

33
34 package edu.rice.cs.drjava.config;
35
36 import java.io.File JavaDoc;
37 import java.util.Vector JavaDoc;
38 import java.util.ArrayList JavaDoc;
39 import java.util.Arrays JavaDoc;
40 import java.awt.Color JavaDoc;
41 import java.awt.Font JavaDoc;
42 import java.awt.Toolkit JavaDoc;
43 import java.awt.event.KeyEvent JavaDoc;
44 import java.awt.event.InputEvent JavaDoc;
45 import javax.swing.KeyStroke JavaDoc;
46 import javax.swing.LookAndFeel JavaDoc;
47 import javax.swing.UIManager JavaDoc;
48 import javax.swing.UIManager.LookAndFeelInfo;
49 import edu.rice.cs.drjava.platform.PlatformFactory;
50
51
52 /** Defines the commonly used Option constants in DrJava config and project profiles.
53  * @version $Id: OptionConstants.java 4096 2007-01-30 02:37:18Z rcartwright $
54  */

55 public interface OptionConstants {
56
57   // STATIC VARIABLES
58

59   /* ---------- Resource Location and Classpath Options ---------- */
60
61   /** A file path to a user's preferred browser. */
62   public static final FileOption BROWSER_FILE = new FileOption("browser.file", FileOption.NULL_FILE);
63
64   /** A String used to launch a user's preferred browser. It is tokenized and appended to the file path. */
65   public static final StringOption BROWSER_STRING = new StringOption("browser.string", "");
66   
67   /** The extension for a DrJava project file */
68   public static final String JavaDoc PROJECT_FILE_EXTENSION = ".pjt";
69   
70   public static final FileOption JAVAC_LOCATION = new FileOption("javac.location", FileOption.NULL_FILE);
71
72   public static final VectorOption<File JavaDoc> EXTRA_CLASSPATH = new ClassPathOption().evaluate("extra.classpath");
73
74   public static final VectorOption<String JavaDoc> EXTRA_COMPILERS =
75     new VectorOption<String JavaDoc>("extra.compilers", new StringOption("",""), new Vector JavaDoc<String JavaDoc>());
76
77   /* ---------- Color Options ---------- */
78
79   public static final ColorOption DEFINITIONS_NORMAL_COLOR = new ColorOption("definitions.normal.color", Color.black);
80   public static final ColorOption DEFINITIONS_KEYWORD_COLOR = new ColorOption("definitions.keyword.color", Color.blue);
81   public static final ColorOption DEFINITIONS_TYPE_COLOR =
82     new ColorOption("definitions.type.color", Color.blue.darker().darker());
83   public static final ColorOption DEFINITIONS_COMMENT_COLOR =
84     new ColorOption("definitions.comment.color", Color.green.darker().darker());
85   public static final ColorOption DEFINITIONS_DOUBLE_QUOTED_COLOR =
86     new ColorOption("definitions.double.quoted.color", Color.red.darker());
87   public static final ColorOption DEFINITIONS_SINGLE_QUOTED_COLOR =
88     new ColorOption("definitions.single.quoted.color", Color.magenta);
89   public static final ColorOption DEFINITIONS_NUMBER_COLOR =
90     new ColorOption("definitions.number.color", Color.cyan.darker());
91   public static final ColorOption SYSTEM_OUT_COLOR = new ColorOption("system.out.color", Color.green.darker().darker());
92   public static final ColorOption SYSTEM_ERR_COLOR = new ColorOption("system.err.color", Color.red);
93   public static final ColorOption SYSTEM_IN_COLOR = new ColorOption("system.in.color", Color.magenta.darker().darker());
94   public static final ColorOption INTERACTIONS_ERROR_COLOR =
95     new ColorOption("interactions.error.color", Color.red.darker());
96   public static final ColorOption DEBUG_MESSAGE_COLOR = new ColorOption("debug.message.color", Color.blue.darker());
97
98   /** Color for background of definitions pane. */
99   public static final ColorOption DEFINITIONS_BACKGROUND_COLOR =
100     new ColorOption("definitions.background.color", Color.white);
101
102   /** Color for highlighting brace-matching. */
103   public static final ColorOption DEFINITIONS_MATCH_COLOR =
104     new ColorOption("definitions.match.color", new Color JavaDoc(190, 255, 230));
105
106   /** Color for highlighting errors and test failures. */
107   public static final ColorOption COMPILER_ERROR_COLOR = new ColorOption("compiler.error.color", Color.yellow);
108
109   /** Color for highlighting bookmarks. */
110   public static final ColorOption BOOKMARK_COLOR = new ColorOption("bookmark.color", Color.green);
111
112   /** Color for highlighting find results. */
113   public static final ColorOption FIND_RESULTS_COLOR1 =
114     new ColorOption("find.results.color1", new Color JavaDoc(0xFF, 0x99, 0x33));
115   public static final ColorOption FIND_RESULTS_COLOR2 =
116     new ColorOption("find.results.color2", new Color JavaDoc(0x30, 0xC9, 0x96));
117   public static final ColorOption FIND_RESULTS_COLOR3 =
118     new ColorOption("find.results.color3", new Color JavaDoc(0x30, 0xFC, 0xFC));
119   public static final ColorOption FIND_RESULTS_COLOR4 =
120     new ColorOption("find.results.color4", new Color JavaDoc(0xFF, 0x66, 0xCC));
121   
122   public static final ColorOption[] FIND_RESULTS_COLORS = new ColorOption[] {
123     FIND_RESULTS_COLOR1,
124       FIND_RESULTS_COLOR2,
125       FIND_RESULTS_COLOR3,
126       FIND_RESULTS_COLOR4
127   };
128
129   /** Color for highlighting breakpoints. */
130   public static final ColorOption DEBUG_BREAKPOINT_COLOR = new ColorOption("debug.breakpoint.color", Color.red);
131
132   /** Color for highlighting disabled breakpoints. */
133   public static final ColorOption DEBUG_BREAKPOINT_DISABLED_COLOR =
134     new ColorOption("debug.breakpoint.disabled.color", new Color JavaDoc(128,0,0));
135
136   /** Color for highlighting thread locations. */
137   public static final ColorOption DEBUG_THREAD_COLOR = new ColorOption("debug.thread.color", new Color JavaDoc(100,255,255));
138
139   /** Color for the background of the "DrJava Errors" button. */
140   public static final ColorOption DRJAVA_ERRORS_BUTTON_COLOR = new ColorOption("drjava.errors.button.color", Color.red);
141
142   /* ---------- Font Options ---------- */
143
144   /** Main (definitions document, tab contents) */
145   public static final FontOption FONT_MAIN = new FontOption("font.main", DefaultFont.getDefaultMainFont());
146
147   /** Class that allows the main font to be initialized properly. On Mac OS X, Monaco is the best monospaced font. */
148   static class DefaultFont {
149     public static Font JavaDoc getDefaultMainFont() {
150       if (PlatformFactory.ONLY.isMacPlatform()) return Font.decode("Monaco-12");
151       else return Font.decode("Monospaced-12");
152     }
153     public static Font JavaDoc getDefaultLineNumberFont() {
154       if (PlatformFactory.ONLY.isMacPlatform()) return Font.decode("Monaco-12");
155       else return Font.decode("Monospaced-12");
156     }
157     public static Font JavaDoc getDefaultDocListFont() {
158       if (PlatformFactory.ONLY.isMacPlatform()) return Font.decode("Monaco-10");
159       else return Font.decode("Monospaced-10");
160     }
161   }
162
163   /** Line numbers */
164   public static final FontOption FONT_LINE_NUMBERS =
165     new FontOption("font.line.numbers", DefaultFont.getDefaultLineNumberFont());
166
167   /** List of open documents */
168   public static final FontOption FONT_DOCLIST = new FontOption("font.doclist", DefaultFont.getDefaultDocListFont());
169
170  /** Toolbar buttons */
171   public static final FontOption FONT_TOOLBAR = new FontOption("font.toolbar", Font.decode("dialog-10"));
172
173   /** Whether to draw anti-aliased text. (Slightly slower.) */
174   public static final BooleanOption TEXT_ANTIALIAS = new BooleanOption("text.antialias", Boolean.FALSE);
175
176
177   /* ---------- Other Display Options ---------- */
178
179   /** Whether icons should be displayed on the toolbar buttons. */
180   public static final BooleanOption TOOLBAR_ICONS_ENABLED =
181     new BooleanOption("toolbar.icons.enabled", Boolean.TRUE);
182
183   /** Whether text should be displayed on toolbar buttons. Note: only relevant if toolbar icons are enabled. */
184   public static final BooleanOption TOOLBAR_TEXT_ENABLED = new BooleanOption("toolbar.text.enabled", Boolean.TRUE);
185
186   /** Whether or not the toolbar should be displayed. */
187    public static final BooleanOption TOOLBAR_ENABLED = new BooleanOption("toolbar.enabled", Boolean.TRUE);
188
189   /** Whether the line-numbers should be displayed in a row header. */
190   public static final BooleanOption LINEENUM_ENABLED = new BooleanOption("lineenum.enabled", Boolean.FALSE);
191
192   /** Whether to save and restore window size and position at startUp/shutdown. */
193   public static final BooleanOption WINDOW_STORE_POSITION = new BooleanOption("window.store.position", Boolean.TRUE);
194
195   /** Whether a sample of the source code will be show when fast switching documents. */
196   public static final BooleanOption SHOW_SOURCE_WHEN_SWITCHING =
197     new BooleanOption("show.source.for.fast.switch", Boolean.TRUE);
198   
199   /** The current look and feel. */
200   public static final ForcedChoiceOption LOOK_AND_FEEL =
201     new ForcedChoiceOption("look.and.feel", LookAndFeels.getDefaultLookAndFeel(), LookAndFeels.getLookAndFeels());
202
203   /** Class that allows the look and feels to be initialized properly. */
204   static class LookAndFeels {
205     
206     /** Mac platform should default to aqua; use metal elsewhere.
207       * @return the look-and-feel to use by default
208       */

209     public static String JavaDoc getDefaultLookAndFeel() {
210       if (PlatformFactory.ONLY.isMacPlatform()) return UIManager.getSystemLookAndFeelClassName();
211       else
212         return UIManager.getCrossPlatformLookAndFeelClassName();
213     }
214     /** Need to ensure that a look-and-feel can be instantiated and is valid.
215       * TODO: store the LookAndFeel object rather than its classname.
216       * This would be much nicer, as we could display a useful name,
217       * and wouldn't have to reinstantiate it when it's installed.
218       * @return the list of available look-and-feel classnames
219       */

220     public static ArrayList JavaDoc<String JavaDoc> getLookAndFeels() {
221       ArrayList JavaDoc<String JavaDoc> lookAndFeels = new ArrayList JavaDoc<String JavaDoc>();
222       LookAndFeelInfo[] lafis = UIManager.getInstalledLookAndFeels();
223       if (lafis != null) {
224         for (int i = 0; i < lafis.length; i++) {
225           try {
226             String JavaDoc currName = lafis[i].getClassName();
227             LookAndFeel JavaDoc currLAF = (LookAndFeel JavaDoc) Class.forName(currName).newInstance();
228             if (currLAF.isSupportedLookAndFeel()) {
229               lookAndFeels.add(currName);
230             }
231           }
232           catch (Exception JavaDoc ex) {
233             // failed to load/instantiate class, or it is not supported.
234
// It is not a valid choice.
235
}
236         }
237       }
238       return lookAndFeels;
239     }
240   }
241
242   /* ---------- Key Binding Options ----------- */
243   static int mask = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
244   /**
245    * The key binding for creating a new file
246    */

247   public static final KeyStrokeOption KEY_NEW_FILE =
248     new KeyStrokeOption("key.new.file",
249                         KeyStroke.getKeyStroke(KeyEvent.VK_N, mask));
250   /**
251    * The key binding for opening an entire project. I is right next to O, so
252    * it seemed logical that ctrl-I would open a project and ctrl-O open a file
253    */

254   public static final KeyStrokeOption KEY_OPEN_PROJECT =
255     new KeyStrokeOption("key.open.project",
256                         KeyStroke.getKeyStroke(KeyEvent.VK_I, mask));
257   /**
258    * The key binding for creating a new JUnit test case
259    */

260   public static final KeyStrokeOption KEY_NEW_TEST =
261     new KeyStrokeOption("key.new.test",
262                         KeyStrokeOption.NULL_KEYSTROKE);
263
264   /**
265    * The key binding for opening a folder
266    */

267   public static final KeyStrokeOption KEY_OPEN_FOLDER =
268     new KeyStrokeOption("key.open.folder",
269                         KeyStrokeOption.NULL_KEYSTROKE);
270   /**
271    * The key binding for opening a file
272    */

273   public static final KeyStrokeOption KEY_OPEN_FILE =
274     new KeyStrokeOption("key.open.file",
275                         KeyStroke.getKeyStroke(KeyEvent.VK_O, mask));
276   /**
277    * The key binding for saving a file
278    */

279   public static final KeyStrokeOption KEY_SAVE_FILE =
280     new KeyStrokeOption("key.save.file",
281                         KeyStroke.getKeyStroke(KeyEvent.VK_S, mask));
282   /**
283    * The key binding for saving a file as
284    */

285   public static final KeyStrokeOption KEY_SAVE_FILE_AS =
286     new KeyStrokeOption("key.save.file.as",
287                         KeyStroke.getKeyStroke(KeyEvent.VK_S, mask |
288                                                InputEvent.SHIFT_MASK));
289   /**
290    * The key binding for saving all files
291    */

292   public static final KeyStrokeOption KEY_SAVE_ALL_FILES =
293     new KeyStrokeOption("key.save.all.files",
294                         KeyStroke.getKeyStroke(KeyEvent.VK_S, mask |
295                                                InputEvent.ALT_MASK));
296   
297   /**
298    * The key binding for renaming a file
299    */

300   public static final KeyStrokeOption KEY_RENAME_FILE =
301     new KeyStrokeOption("key.rename.file", KeyStrokeOption.NULL_KEYSTROKE);
302   
303   /**
304    * The key binding for reverting a file
305    */

306   public static final KeyStrokeOption KEY_REVERT_FILE =
307     new KeyStrokeOption("key.revert.file",
308                         KeyStroke.getKeyStroke(KeyEvent.VK_R, mask));
309   /**
310    * The key binding for closing a file
311    */

312   public static final KeyStrokeOption KEY_CLOSE_FILE =
313     new KeyStrokeOption("key.close.file",
314                         KeyStroke.getKeyStroke(KeyEvent.VK_W, mask));
315   /**
316    * The key binding for closing all files
317    */

318   public static final KeyStrokeOption KEY_CLOSE_ALL_FILES =
319     new KeyStrokeOption("key.close.all.files",
320                         KeyStroke.getKeyStroke(KeyEvent.VK_W, mask |
321                                                InputEvent.ALT_MASK));
322   
323   public static final KeyStrokeOption KEY_CLOSE_PROJECT =
324     new KeyStrokeOption("key.close.project",
325                         KeyStroke.getKeyStroke(KeyEvent.VK_W, mask | InputEvent.SHIFT_MASK));
326   
327   /** The key binding for showing the print preview */
328   public static final KeyStrokeOption KEY_PAGE_SETUP =
329     new KeyStrokeOption("key.page.setup", KeyStrokeOption.NULL_KEYSTROKE);
330   
331   /** The key binding for showing the print preview. */
332   public static final KeyStrokeOption KEY_PRINT_PREVIEW =
333     new KeyStrokeOption("key.print.preview", KeyStroke.getKeyStroke(KeyEvent.VK_P, mask | InputEvent.SHIFT_MASK));
334   
335   /** The key binding for printing a file */
336   public static final KeyStrokeOption KEY_PRINT =
337     new KeyStrokeOption("key.print", KeyStroke.getKeyStroke(KeyEvent.VK_P, mask));
338   
339   /** The key binding for quitting */
340   public static final KeyStrokeOption KEY_QUIT =
341     new KeyStrokeOption("key.quit", KeyStroke.getKeyStroke(KeyEvent.VK_Q, mask));
342   
343   /** The key binding for forced quitting */
344   public static final KeyStrokeOption KEY_FORCE_QUIT =
345     new KeyStrokeOption("key.force.quit", KeyStrokeOption.NULL_KEYSTROKE);
346   
347   /** The key binding for undo-ing */
348   public static final KeyStrokeOption KEY_UNDO =
349     new KeyStrokeOption("key.undo", KeyStroke.getKeyStroke(KeyEvent.VK_Z, mask));
350   
351   /** The key binding for redo-ing */
352   public static final KeyStrokeOption KEY_REDO =
353     new KeyStrokeOption("key.redo", KeyStroke.getKeyStroke(KeyEvent.VK_Z, mask | InputEvent.SHIFT_MASK));
354   
355   /** The key binding for cutting */
356   public static final KeyStrokeOption KEY_CUT =
357     new KeyStrokeOption("key.cut", KeyStroke.getKeyStroke(KeyEvent.VK_X, mask));
358   
359   /** The key binding for copying */
360   public static final KeyStrokeOption KEY_COPY =
361     new KeyStrokeOption("key.copy", KeyStroke.getKeyStroke(KeyEvent.VK_C, mask));
362   
363   /** The key binding for pasting */
364   public static final KeyStrokeOption KEY_PASTE =
365     new KeyStrokeOption("key.paste", KeyStroke.getKeyStroke(KeyEvent.VK_V, mask));
366   
367   /** The key binding for pasting from history */
368   public static final KeyStrokeOption KEY_PASTE_FROM_HISTORY =
369     new KeyStrokeOption("key.paste.from.history", KeyStroke.getKeyStroke(KeyEvent.VK_V , mask | InputEvent.SHIFT_MASK));
370   
371   /** The key binding for selecting all text */
372   public static final KeyStrokeOption KEY_SELECT_ALL =
373     new KeyStrokeOption("key.select.all", KeyStroke.getKeyStroke(KeyEvent.VK_A, mask));
374   
375   /** The key binding for find and replace */
376   public static final KeyStrokeOption KEY_FIND_NEXT =
377     new KeyStrokeOption("key.find.next", KeyStroke.getKeyStroke(KeyEvent.VK_F3, 0));
378   
379   /** The key binding for find previous (opposite direction) */
380   public static final KeyStrokeOption KEY_FIND_PREV =
381     new KeyStrokeOption("key.find.prev",
382                         KeyStroke.getKeyStroke(KeyEvent.VK_F3, InputEvent.SHIFT_MASK));
383   /**
384    * The key binding for find and replace
385    */

386   public static final KeyStrokeOption KEY_FIND_REPLACE =
387     new KeyStrokeOption("key.find.replace",
388                         KeyStroke.getKeyStroke(KeyEvent.VK_F, mask));
389   /**
390    * The key binding for goto line
391    */

392   public static final KeyStrokeOption KEY_GOTO_LINE =
393     new KeyStrokeOption("key.goto.line",
394                         KeyStroke.getKeyStroke(KeyEvent.VK_G, mask));
395
396   /**
397    * The key binding for goto file.
398    */

399   public static final KeyStrokeOption KEY_GOTO_FILE =
400     new KeyStrokeOption("key.goto.file",
401                         KeyStroke.getKeyStroke(KeyEvent.VK_G, mask|KeyEvent.SHIFT_MASK));
402
403   /**
404    * The key binding for goto this file.
405    */

406   public static final KeyStrokeOption KEY_GOTO_FILE_UNDER_CURSOR =
407     new KeyStrokeOption("key.goto.file.under.cursor",
408                         KeyStroke.getKeyStroke(KeyEvent.VK_F6, 0));
409
410   /**
411    * The key binding for open Javadoc.
412    */

413   public static final KeyStrokeOption KEY_OPEN_JAVADOC =
414     new KeyStrokeOption("key.open.javadoc",
415                         KeyStroke.getKeyStroke(KeyEvent.VK_F6, KeyEvent.SHIFT_MASK));
416
417   /**
418    * The key binding for open Javadoc under cursor.
419    */

420   public static final KeyStrokeOption KEY_OPEN_JAVADOC_UNDER_CURSOR =
421     new KeyStrokeOption("key.open.javadoc.under.cursor",
422                         KeyStroke.getKeyStroke(KeyEvent.VK_F6, mask));
423
424   /**
425    * The key binding for complete file.
426    */

427   public static final KeyStrokeOption KEY_COMPLETE_FILE =
428     new KeyStrokeOption("key.complete.file",
429                         KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, mask|KeyEvent.SHIFT_MASK));
430
431   /**
432    * The key binding for indenting
433    *
434   public static final KeyStrokeOption KEY_INDENT =
435     new KeyStrokeOption("key.indent",
436                         KeyStroke.getKeyStroke(KeyEvent.VK_TAB, mask)); */

437
438   /**
439    * The key binding for commenting out lines
440    */

441   public static final KeyStrokeOption KEY_COMMENT_LINES =
442     new KeyStrokeOption("key.comment.lines",
443                         KeyStroke.getKeyStroke(KeyEvent.VK_SLASH, mask));
444
445   /**
446    * The key binding for un-commenting lines
447    */

448   public static final KeyStrokeOption KEY_UNCOMMENT_LINES =
449     new KeyStrokeOption("key.uncomment.lines",
450                         KeyStroke.getKeyStroke(KeyEvent.VK_SLASH,
451                                                (mask | InputEvent.SHIFT_MASK)));
452
453   /**
454    * The key binding for selecting previous document
455    */

456   public static final KeyStrokeOption KEY_PREVIOUS_DOCUMENT =
457     new KeyStrokeOption("key.previous.document",
458                         KeyStroke.getKeyStroke(KeyEvent.VK_COMMA, mask));
459   /**
460    * The key binding for selecting next document
461    */

462   public static final KeyStrokeOption KEY_NEXT_DOCUMENT =
463     new KeyStrokeOption("key.next.document",
464                         KeyStroke.getKeyStroke(KeyEvent.VK_PERIOD, mask));
465
466   /**
467    * The key binding for changing the focus to the previous pane
468    */

469   public static final KeyStrokeOption KEY_PREVIOUS_PANE =
470     new KeyStrokeOption("key.previous.pane",
471                         KeyStroke.getKeyStroke(KeyEvent.VK_OPEN_BRACKET, mask));
472
473   /**
474    * The key binding for changing the focus to the next pane
475    */

476   public static final KeyStrokeOption KEY_NEXT_PANE =
477     new KeyStrokeOption("key.next.pane",
478                         KeyStroke.getKeyStroke(KeyEvent.VK_CLOSE_BRACKET, mask));
479
480   /**
481    * The key binding for going to the opening brace.
482    */

483   public static final KeyStrokeOption KEY_OPENING_BRACE =
484     new KeyStrokeOption("key.goto.opening.brace",
485                         KeyStroke.getKeyStroke(KeyEvent.VK_OPEN_BRACKET, mask|InputEvent.SHIFT_MASK));
486
487   /**
488    * The key binding for going to the closing brace.
489    */

490   public static final KeyStrokeOption KEY_CLOSING_BRACE =
491     new KeyStrokeOption("key.goto.closing.brace",
492                         KeyStroke.getKeyStroke(KeyEvent.VK_CLOSE_BRACKET, mask|InputEvent.SHIFT_MASK));
493
494   /**
495    * The key binding for jumping to the next location in the browser history
496    */

497   public static final KeyStrokeOption KEY_BROWSE_FORWARD =
498     new KeyStrokeOption("key.browse.forward",
499                         KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.ALT_MASK|InputEvent.SHIFT_MASK));
500
501   /**
502    * The key binding for jumping to the previous location in the browser history
503    */

504   public static final KeyStrokeOption KEY_BROWSE_BACK =
505     new KeyStrokeOption("key.browse.back",
506                         KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.ALT_MASK|InputEvent.SHIFT_MASK));
507
508   /**
509    * The key binding for openning the preferences dialog
510    */

511   public static final KeyStrokeOption KEY_PREFERENCES =
512     new KeyStrokeOption("key.preferences",
513                         KeyStroke.getKeyStroke(KeyEvent.VK_SEMICOLON, mask));
514
515   /**
516    * The key binding for compiling current document
517    */

518   public static final KeyStrokeOption KEY_COMPILE =
519     new KeyStrokeOption("key.compile", KeyStroke.getKeyStroke(KeyEvent.VK_F5, InputEvent.SHIFT_MASK));
520
521   /**
522    * The key binding for compiling all
523    */

524   public static final KeyStrokeOption KEY_COMPILE_ALL =
525     new KeyStrokeOption("key.compile.all", KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0));
526
527   /**
528    * The key binding for running the main method of the current document
529    */

530   public static final KeyStrokeOption KEY_RUN =
531     new KeyStrokeOption("key.run", KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0));
532   
533   /**
534    * The key binding for running the project's main document
535    */

536   public static final KeyStrokeOption KEY_RUN_MAIN =
537     new KeyStrokeOption("key.run.main", KeyStroke.getKeyStroke(KeyEvent.VK_F4, 0));
538
539   /**
540    * The key binding for testing the current document
541    */

542   public static final KeyStrokeOption KEY_TEST =
543     new KeyStrokeOption("key.test",
544                         KeyStroke.getKeyStroke(KeyEvent.VK_T, mask | InputEvent.SHIFT_MASK));
545
546   /**
547    * The key binding for testing all open JUnit test cases.
548    */

549   public static final KeyStrokeOption KEY_TEST_ALL =
550     new KeyStrokeOption("key.test.all", KeyStroke.getKeyStroke(KeyEvent.VK_T, mask));
551
552   /**
553    * The key binding for generating javadoc for all documents
554    */

555   public static final KeyStrokeOption KEY_JAVADOC_ALL =
556     new KeyStrokeOption("key.javadoc.all", KeyStroke.getKeyStroke(KeyEvent.VK_J, mask));
557
558   /**
559    * The key binding for generating javadoc for the current document
560    */

561   public static final KeyStrokeOption KEY_JAVADOC_CURRENT =
562     new KeyStrokeOption("key.javadoc.current",
563                         KeyStroke.getKeyStroke(KeyEvent.VK_J, mask | InputEvent.SHIFT_MASK));
564
565   /**
566    * The key binding for executing an interactions history.
567    */

568   public static final KeyStrokeOption KEY_EXECUTE_HISTORY =
569     new KeyStrokeOption("key.execute.history", KeyStrokeOption.NULL_KEYSTROKE);
570
571   /**
572    * The key binding for loading an interactions history as a script.
573    */

574   public static final KeyStrokeOption KEY_LOAD_HISTORY_SCRIPT =
575     new KeyStrokeOption("key.load.history.script", KeyStrokeOption.NULL_KEYSTROKE);
576
577   /**
578    * The key binding for saving an interactions history.
579    */

580   public static final KeyStrokeOption KEY_SAVE_HISTORY =
581     new KeyStrokeOption("key.save.history", KeyStrokeOption.NULL_KEYSTROKE);
582
583   /**
584    * The key binding for clearing the interactions history.
585    */

586   public static final KeyStrokeOption KEY_CLEAR_HISTORY =
587     new KeyStrokeOption("key.clear.history", KeyStrokeOption.NULL_KEYSTROKE);
588
589   /**
590    * The key binding for resetting the interactions pane.
591    */

592   public static final KeyStrokeOption KEY_RESET_INTERACTIONS =
593     new KeyStrokeOption("key.reset.interactions", KeyStrokeOption.NULL_KEYSTROKE);
594
595   /**
596    * The key binding for viewing the interactions classpath.
597    */

598   public static final KeyStrokeOption KEY_VIEW_INTERACTIONS_CLASSPATH =
599     new KeyStrokeOption("key.view.interactions.classpath", KeyStrokeOption.NULL_KEYSTROKE);
600   
601   /**
602    * The key binding for printing the interactions.
603    */

604   public static final KeyStrokeOption KEY_PRINT_INTERACTIONS =
605     new KeyStrokeOption("key.view.print.interactions", KeyStrokeOption.NULL_KEYSTROKE);
606
607   /**
608    * The key binding for lifting the current interaction to definitions.
609    */

610   public static final KeyStrokeOption KEY_LIFT_CURRENT_INTERACTION =
611     new KeyStrokeOption("key.lift.current.interaction", KeyStrokeOption.NULL_KEYSTROKE);
612
613   /**
614    * The key binding to enter or leave multiline input mode.
615    *
616   public static final KeyStrokeOption KEY_TOGGLE_MULTILINE_INTERACTION =
617     new KeyStrokeOption("key.toggle.multiline.interaction",
618                         KeyStroke.getKeyStroke(KeyEvent.VK_M, mask));
619    */

620
621   /**
622    * The key binding for clearing the console.
623    */

624   public static final KeyStrokeOption KEY_CLEAR_CONSOLE =
625     new KeyStrokeOption("key.clear.console", KeyStrokeOption.NULL_KEYSTROKE);
626   
627   /**
628    * The key binding for printing the console.
629    */

630   public static final KeyStrokeOption KEY_PRINT_CONSOLE =
631     new KeyStrokeOption("key.view.print.console", KeyStrokeOption.NULL_KEYSTROKE);
632
633   /**
634    * The key binding for moving the cursor backwards
635    */

636   public static final KeyStrokeOption KEY_BACKWARD =
637     new KeyStrokeOption("key.backward", KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0));
638
639   /**
640    * The key binding for moving the cursor to the beginning of the document
641    */

642   public static final KeyStrokeOption KEY_BEGIN_DOCUMENT =
643     new KeyStrokeOption("key.begin.document", KeyStroke.getKeyStroke(KeyEvent.VK_HOME, mask));
644
645   /**
646    * The key binding for moving the cursor to the beginning of the current line
647    */

648   public static final KeyStrokeOption KEY_BEGIN_LINE =
649     new KeyStrokeOption("key.begin.line", KeyStroke.getKeyStroke(KeyEvent.VK_HOME, 0));
650
651   /**
652    * The key binding for moving the cursor to the beginning of the current paragraph.
653    * (Doesn't seem to do anything useful...)
654    *
655   public static final KeyStrokeOption KEY_BEGIN_PARAGRAPH =
656     new KeyStrokeOption("key.begin.paragraph",
657                         KeyStroke.getKeyStroke(KeyEvent.VK_UP, mask));
658    */

659
660   /**
661    * The key binding for moving the cursor to the beginning of the previous word
662    */

663   public static final KeyStrokeOption KEY_PREVIOUS_WORD =
664     new KeyStrokeOption("key.previous.word", KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, mask));
665
666  /**
667    * The key binding for deleting the next character
668    */

669   public static final KeyStrokeOption KEY_DELETE_NEXT =
670     new KeyStrokeOption("key.delete.next",
671                         KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0));
672   /**
673    * The key binding for deleting the previous character (with shift set)
674    */

675   public static final KeyStrokeOption KEY_DELETE_PREVIOUS =
676     new KeyStrokeOption("key.delete.previous", KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0));
677
678   /**
679    * The key binding for deleting the next character (with shift set)
680    */

681   public static final KeyStrokeOption KEY_SHIFT_DELETE_NEXT =
682     new KeyStrokeOption("key.delete.next",
683                         KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, InputEvent.SHIFT_MASK));
684   /**
685    * The key binding for deleting the previous character (with shift set)
686    */

687   public static final KeyStrokeOption KEY_SHIFT_DELETE_PREVIOUS =
688     new KeyStrokeOption("key.delete.previous", KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, InputEvent.SHIFT_MASK));
689
690   /**
691    * The key binding for moving the cursor down
692    */

693   public static final KeyStrokeOption KEY_DOWN =
694     new KeyStrokeOption("key.down", KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0));
695
696   /**
697    * The key binding for moving the cursor up
698    */

699   public static final KeyStrokeOption KEY_UP =
700     new KeyStrokeOption("key.up", KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0));
701
702   /**
703    * The key binding for moving the cursor to the end of the document
704    */

705   public static final KeyStrokeOption KEY_END_DOCUMENT =
706     new KeyStrokeOption("key.end.document",
707                         KeyStroke.getKeyStroke(KeyEvent.VK_END, mask));
708   /**
709    * The key binding for moving the cursor to the end of the current line
710    */

711   public static final KeyStrokeOption KEY_END_LINE =
712     new KeyStrokeOption("key.end.line",
713                         KeyStroke.getKeyStroke(KeyEvent.VK_END, 0));
714   
715 // /** The key binding for moving the cursor to the end of the current paragraph. */
716
// public static final KeyStrokeOption KEY_END_PARAGRAPH =
717
// new KeyStrokeOption("key.end.paragraph", KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, mask));
718

719   /** The key binding for moving the cursor to the beginning of the next word. */
720   public static final KeyStrokeOption KEY_NEXT_WORD =
721     new KeyStrokeOption("key.next.word", KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, mask));
722   
723   /** The key binding for moving the cursor forwards. */
724   public static final KeyStrokeOption KEY_FORWARD =
725     new KeyStrokeOption("key.forward", KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0));
726   
727   /** The key binding for page down. */
728   public static final KeyStrokeOption KEY_PAGE_DOWN =
729     new KeyStrokeOption("key.page.down", KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0));
730   
731   /** The key binding for page up. */
732   public static final KeyStrokeOption KEY_PAGE_UP =
733     new KeyStrokeOption("key.page.up", KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0));
734
735   /** The key binding for cutting a line. */
736   public static final KeyStrokeOption KEY_CUT_LINE =
737     new KeyStrokeOption("key.cut.line", KeyStroke.getKeyStroke(KeyEvent.VK_K, (mask | InputEvent.ALT_MASK)));
738
739   /** The key binding for clearing a line, emacs-style. */
740   public static final KeyStrokeOption KEY_CLEAR_LINE =
741     new KeyStrokeOption("key.clear.line", KeyStroke.getKeyStroke(KeyEvent.VK_K, mask));
742
743   /** The key binding for toggling debug mode. */
744   public static final KeyStrokeOption KEY_DEBUG_MODE_TOGGLE =
745     new KeyStrokeOption("key.debug.mode.toggle", KeyStroke.getKeyStroke(KeyEvent.VK_D, mask));
746
747 // /** The key binding for suspending the debugger. */
748
// public static final KeyStrokeOption KEY_DEBUG_SUSPEND =
749
// new KeyStrokeOption("key.debug.suspend", KeyStroke.getKeyStroke(KeyEvent.VK_F6, 0));
750

751   /** The key binding for resuming the debugger. */
752   public static final KeyStrokeOption KEY_DEBUG_RESUME =
753     new KeyStrokeOption("key.debug.resume", KeyStroke.getKeyStroke(KeyEvent.VK_F7, 0));
754   
755   /** The key binding for stepping into in the debugger */
756   public static final KeyStrokeOption KEY_DEBUG_STEP_INTO =
757     new KeyStrokeOption("key.debug.step.into", KeyStroke.getKeyStroke(KeyEvent.VK_F12, 0));
758   
759   /** The key binding for stepping over in the debugger. */
760   public static final KeyStrokeOption KEY_DEBUG_STEP_OVER =
761     new KeyStrokeOption("key.debug.step.over", KeyStroke.getKeyStroke(KeyEvent.VK_F11, 0));
762   
763   /** The key binding for stepping out in the debugger. */
764   public static final KeyStrokeOption KEY_DEBUG_STEP_OUT =
765     new KeyStrokeOption("key.debug.step.out", KeyStroke.getKeyStroke(KeyEvent.VK_F12, InputEvent.SHIFT_MASK));
766   
767   /** The key binding for toggling a breakpoint. */
768   public static final KeyStrokeOption KEY_DEBUG_BREAKPOINT_TOGGLE =
769     new KeyStrokeOption("key.debug.breakpoint.toggle", KeyStroke.getKeyStroke(KeyEvent.VK_B, mask));
770
771   /** The key binding for displaying the breakpoints panel. */
772   public static final KeyStrokeOption KEY_DEBUG_BREAKPOINT_PANEL =
773     new KeyStrokeOption("key.debug.breakpoint.panel", KeyStroke.getKeyStroke(KeyEvent.VK_B, mask | InputEvent.SHIFT_MASK));
774
775   /** The key binding for clearing all breakpoints. */
776   public static final KeyStrokeOption KEY_DEBUG_CLEAR_ALL_BREAKPOINTS =
777     new KeyStrokeOption("key.debug.clear.all.breakpoints", KeyStrokeOption.NULL_KEYSTROKE);
778
779   /** The key binding for toggling a bookmark. */
780   public static final KeyStrokeOption KEY_BOOKMARKS_TOGGLE =
781     new KeyStrokeOption("key.bookmarks.toggle", KeyStroke.getKeyStroke(KeyEvent.VK_M, mask));
782
783   /** The key binding for displaying the bookmarks panel. */
784   public static final KeyStrokeOption KEY_BOOKMARKS_PANEL =
785     new KeyStrokeOption("key.bookmarks.panel", KeyStroke.getKeyStroke(KeyEvent.VK_M, mask | InputEvent.SHIFT_MASK));
786   
787   /** The key binding for help */
788   public static final KeyStrokeOption KEY_HELP =
789     new KeyStrokeOption("key.help", KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0));
790
791   /** The key binding for quickstart. Currently set to the null keystroke. */
792   public static final KeyStrokeOption KEY_QUICKSTART =
793     new KeyStrokeOption("key.quickstart", KeyStrokeOption.NULL_KEYSTROKE);
794   
795   /** The key binding for the about dialog */
796   public static final KeyStrokeOption KEY_ABOUT =
797     new KeyStrokeOption("key.about", KeyStrokeOption.NULL_KEYSTROKE);
798   
799   /** The key binding for the "DrJava Errors" dialog */
800   public static final KeyStrokeOption KEY_DRJAVA_ERRORS =
801     new KeyStrokeOption("key.drjava.errors", KeyStrokeOption.NULL_KEYSTROKE);
802
803   
804   /* ---------- Find Replace Options ---------- */
805   
806   public static final BooleanOption FIND_MATCH_CASE =
807     new BooleanOption("find.replace.match.case", Boolean.TRUE);
808   
809   public static final BooleanOption FIND_SEARCH_BACKWARDS =
810     new BooleanOption("find.replace.search.backwards", Boolean.FALSE);
811   
812   public static final BooleanOption FIND_WHOLE_WORD =
813     new BooleanOption("find.replace.whole.word", Boolean.FALSE);
814   
815   public static final BooleanOption FIND_ALL_DOCUMENTS =
816     new BooleanOption("find.replace.all.documents", Boolean.FALSE);
817   
818   public static final BooleanOption FIND_NO_COMMENTS_STRINGS =
819     new BooleanOption("find.replace.no.comments.strings", Boolean.FALSE);
820   
821
822   /* ---------- Debugger Options ---------- */
823
824   /**
825    * A classpath-structured vector of all paths to look for source files on
826    * while stepping in the debugger.
827    */

828   public static final VectorOption<File JavaDoc> DEBUG_SOURCEPATH =
829     new ClassPathOption().evaluate("debug.sourcepath");
830
831   /**
832    * Whether stepping should step through Java's source files
833    */

834   public static final BooleanOption DEBUG_STEP_JAVA =
835     new BooleanOption("debug.step.java", Boolean.FALSE);
836
837   /**
838    * Whether stepping should step through Dynamic Java's source files
839    */

840   public static final BooleanOption DEBUG_STEP_INTERPRETER =
841     new BooleanOption("debug.step.interpreter", Boolean.FALSE);
842
843   /**
844    * Whether stepping should step through DrJava's source files
845    */

846   public static final BooleanOption DEBUG_STEP_DRJAVA =
847     new BooleanOption("debug.step.drjava", Boolean.FALSE);
848
849   /**
850    * Which packages to exclude when stepping.
851    */

852   public static final StringOption DEBUG_STEP_EXCLUDE =
853     new StringOption("debug.step.exclude", "");
854
855
856
857   /* ---------- Javadoc Options ---------- */
858
859   /**
860    * Possible options for Javadoc access levels.
861    */

862   static final ArrayList JavaDoc<String JavaDoc> accessLevelChoices =
863     AccessLevelChoices.evaluate();
864   static class AccessLevelChoices {
865     public static ArrayList JavaDoc<String JavaDoc> evaluate() {
866       ArrayList JavaDoc<String JavaDoc> aList = new ArrayList JavaDoc<String JavaDoc>(4);
867       aList.add("public");
868       aList.add("protected");
869       aList.add("package");
870       aList.add("private");
871       return aList;
872     }
873   }
874
875   /** The lowest access level of classes and members to include in the javadoc. */
876   public static final ForcedChoiceOption JAVADOC_ACCESS_LEVEL =
877     new ForcedChoiceOption("javadoc.access.level", "package", accessLevelChoices);
878
879   /** Possible options for Javadoc system class documentation links. */
880   static final String JavaDoc JAVADOC_NONE_TEXT = "none";
881   static final String JavaDoc JAVADOC_1_3_TEXT = "1.3";
882   static final String JavaDoc JAVADOC_1_4_TEXT = "1.4";
883   static final String JavaDoc JAVADOC_1_5_TEXT = "1.5";
884   
885   static final String JavaDoc[] choices = new String JavaDoc[]{JAVADOC_NONE_TEXT, JAVADOC_1_3_TEXT, JAVADOC_1_4_TEXT, JAVADOC_1_5_TEXT};
886   
887   static final ArrayList JavaDoc<String JavaDoc> linkVersionChoices = new ArrayList JavaDoc<String JavaDoc>(Arrays.asList(choices));
888
889   /** Constants for the URLs of Sun's system class documentation for different versions of Java. */
890   public static final StringOption JAVADOC_1_3_LINK =
891     new StringOption("javadoc.1.3.link", "http://java.sun.com/j2se/1.3/docs/api");
892   public static final StringOption JAVADOC_1_4_LINK =
893     new StringOption("javadoc.1.4.link", "http://java.sun.com/j2se/1.4/docs/api");
894   public static final StringOption JAVADOC_1_5_LINK =
895     new StringOption("javadoc.1.5.link", "http://java.sun.com/j2se/1.5/docs/api");
896
897   /** The version of Java to use for links to Javadoc for system classes. */
898   public static final ForcedChoiceOption JAVADOC_LINK_VERSION =
899     new ForcedChoiceOption("javadoc.link.version",
900                            (System.getProperty("java.specification.version").equals("1.3") ? JAVADOC_1_3_TEXT :
901                               (System.getProperty("java.specification.version").equals("1.4") ? JAVADOC_1_4_TEXT :
902                                  JAVADOC_1_5_TEXT)),
903                            linkVersionChoices);
904
905   /** Whether to include the entire package heirarchy from the source roots when generating JavaDoc output. */
906   public static final BooleanOption JAVADOC_FROM_ROOTS = new BooleanOption("javadoc.from.roots", Boolean.FALSE);
907
908   /** A string containing custom options to be passed to Javadoc. This needs to be tokenized before passing it to
909    * Javadoc.
910    */

911   public static final StringOption JAVADOC_CUSTOM_PARAMS =
912     new StringOption("javadoc.custom.params", "-author -version");
913
914   /** The default destination directory for Javadoc output. */
915   public static final FileOption JAVADOC_DESTINATION = new FileOption("javadoc.destination", FileOption.NULL_FILE);
916
917   /** Whether to always prompt for a destination directory, whether or not a default has been set. */
918   public static final BooleanOption JAVADOC_PROMPT_FOR_DESTINATION =
919     new BooleanOption("javadoc.prompt.for.destination", Boolean.TRUE);
920
921   /* ---------- NOTIFICATION OPTIONS ---------- */
922
923   /** Whether to prompt when the interactions pane is unexpectedly reset. */
924   public static final BooleanOption INTERACTIONS_EXIT_PROMPT =
925     new BooleanOption("interactions.exit.prompt", Boolean.TRUE);
926
927   /** Whether to prompt before quitting DrJava. */
928   public static final BooleanOption QUIT_PROMPT =
929     new BooleanOption("quit.prompt", Boolean.TRUE);
930
931   /** Whether to prompt before resetting the interactions pane. */
932   public static final BooleanOption INTERACTIONS_RESET_PROMPT =
933     new BooleanOption("interactions.reset.prompt", Boolean.TRUE);
934
935   /** Whether to prompt to save before compiling. */
936   public static final BooleanOption ALWAYS_SAVE_BEFORE_COMPILE =
937     new BooleanOption("save.before.compile", Boolean.FALSE);
938   
939   /** Whether to prompt to save before running. */
940   public static final BooleanOption ALWAYS_SAVE_BEFORE_RUN =
941     new BooleanOption("save.before.run", Boolean.FALSE);
942
943   /** Whether to prompt to save before testing. */
944   public static final BooleanOption ALWAYS_COMPILE_BEFORE_JUNIT =
945     new BooleanOption("compile.before.junit", Boolean.FALSE);
946
947   /**
948    * Whether to prompt to save before compiling.
949    */

950   public static final BooleanOption ALWAYS_SAVE_BEFORE_JAVADOC =
951     new BooleanOption("save.before.javadoc", Boolean.FALSE);
952
953   /** Whether to prompt to save before compiling. */
954   public static final BooleanOption ALWAYS_SAVE_BEFORE_DEBUG =
955     new BooleanOption("save.before.debug", Boolean.FALSE);
956
957   /** Whether to warn if a document has been modified before allowing the user to set a breakpoint in it. */
958   public static final BooleanOption WARN_BREAKPOINT_OUT_OF_SYNC =
959     new BooleanOption("warn.breakpoint.out.of.sync", Boolean.TRUE);
960
961   /** Whether to warn that the user is debugging a file that is out of sync with its class file. */
962   public static final BooleanOption WARN_DEBUG_MODIFIED_FILE =
963     new BooleanOption("warn.debug.modified.file", Boolean.TRUE);
964
965   /** Whether to warn that a restart is necessary before the look and feel will change. */
966   public static final BooleanOption WARN_CHANGE_LAF = new BooleanOption("warn.change.laf", Boolean.TRUE);
967
968   /** Whether to warn that a file's path contains a "#' symbol. */
969   public static final BooleanOption WARN_PATH_CONTAINS_POUND =
970     new BooleanOption("warn.path.contains.pound", Boolean.TRUE);
971
972   /* ---------- MISC OPTIONS ---------- */
973
974   /** Whether to warn when cleaning the build directory */
975   public static final BooleanOption PROMPT_BEFORE_CLEAN = new BooleanOption("prompt.before.clean", Boolean.TRUE);
976   
977   /** Open directory should default to recursive */
978   public static final BooleanOption OPEN_FOLDER_RECURSIVE = new BooleanOption("open.folder.recursive", Boolean.FALSE);
979
980   /** How many spaces to use for indenting. */
981   public static final NonNegativeIntegerOption INDENT_LEVEL =
982     new NonNegativeIntegerOption("indent.level",new Integer JavaDoc(2));
983
984   /** Number of lines to remember in the Interactions History */
985   public static final NonNegativeIntegerOption HISTORY_MAX_SIZE =
986     new NonNegativeIntegerOption("history.max.size", new Integer JavaDoc(500));
987
988   /** Number of files to list in the recent file list */
989   public static final NonNegativeIntegerOption RECENT_FILES_MAX_SIZE =
990     new NonNegativeIntegerOption("recent.files.max.size", new Integer JavaDoc(5));
991
992   /** Whether to automatically close comments. */
993   public static final BooleanOption AUTO_CLOSE_COMMENTS =
994     new BooleanOption("auto.close.comments", Boolean.FALSE);
995
996   /** Whether to clear the console when manually resetting the interactions pane. */
997   public static final BooleanOption RESET_CLEAR_CONSOLE =
998     new BooleanOption("reset.clear.console", Boolean.TRUE);
999
1000  /** Whether to run assert statements in the interactions pane. */
1001  public static final BooleanOption RUN_WITH_ASSERT =
1002    new BooleanOption("run.with.assert", Boolean.TRUE);
1003
1004  /** Whether to make emacs-style backup files. */
1005  public static final BooleanOption BACKUP_FILES = new BooleanOption("files.backup", Boolean.TRUE);
1006
1007  /** Whether to allow users to access to all members in the Interactions Pane. */
1008  public static final BooleanOption ALLOW_PRIVATE_ACCESS = new BooleanOption("allow.private.access", Boolean.FALSE);
1009  
1010  /** Whether to force test classes in projects to end in "Test". */
1011  public static final BooleanOption FORCE_TEST_SUFFIX = new BooleanOption("force.test.suffix", Boolean.FALSE);
1012
1013  /* ---------- COMPILER OPTIONS ------------- */
1014  
1015  /** Whether to show unchecked warnings */
1016  public static final BooleanOption SHOW_UNCHECKED_WARNINGS =
1017    new BooleanOption("show.unchecked.warnings", Boolean.TRUE);
1018  
1019  /** Whether to show deprecation warnings */
1020  public static final BooleanOption SHOW_DEPRECATION_WARNINGS =
1021    new BooleanOption("show.deprecation.warnings", Boolean.TRUE);
1022    
1023  /** Whether to show finally warnings */
1024  public static final BooleanOption SHOW_FINALLY_WARNINGS = new BooleanOption("show.finally.warnings", Boolean.FALSE);
1025  
1026  /** Whether to show serial warnings */
1027  public static final BooleanOption SHOW_SERIAL_WARNINGS =
1028    new BooleanOption("show.serial.warnings", Boolean.FALSE);
1029  
1030  /** Whether to show serial warnings */
1031  public static final BooleanOption SHOW_FALLTHROUGH_WARNINGS =
1032    new BooleanOption("show.fallthrough.warnings", Boolean.FALSE);
1033  
1034  /** Whether to show serial warnings */
1035  public static final BooleanOption SHOW_PATH_WARNINGS =
1036    new BooleanOption("show.path.warnings", Boolean.FALSE);
1037  
1038  /* ---------- UNDISPLAYED OPTIONS ---------- */
1039
1040  /** The language level to use when starting DrJava. Stores the most recently used one. Defaults to full java. */
1041  public static final IntegerOption LANGUAGE_LEVEL = new IntegerOption("language.level", new Integer JavaDoc(0));
1042  
1043  /** A vector containing the most recently used files. */
1044  public static final VectorOption<File JavaDoc> RECENT_FILES =
1045    new VectorOption<File JavaDoc>("recent.files",new FileOption("",null),new Vector JavaDoc<File JavaDoc>());
1046
1047  /** A vector containing the most recently used projects. */
1048  public static final VectorOption<File JavaDoc> RECENT_PROJECTS =
1049    new VectorOption<File JavaDoc>("recent.projects",new FileOption("",null),new Vector JavaDoc<File JavaDoc>());
1050  
1051  /** Whether to enabled the Show Debug Console menu item in the Tools menu. */
1052  public static final BooleanOption SHOW_DEBUG_CONSOLE = new BooleanOption("show.debug.console", Boolean.FALSE);
1053
1054  /** Height of MainFrame at startUp. Can be overridden if out of bounds. */
1055  public static final NonNegativeIntegerOption WINDOW_HEIGHT =
1056    new NonNegativeIntegerOption("window.height",new Integer JavaDoc(700));
1057
1058  /** Width of MainFrame at startUp. Can be overridden if out of bounds. */
1059  public static final NonNegativeIntegerOption WINDOW_WIDTH =
1060    new NonNegativeIntegerOption("window.width",new Integer JavaDoc(800));
1061
1062  /** X position of MainFrame at startUp. Can be overridden if out of bounds. This value can legally be negative in a
1063   * multi-screen setup.
1064   */

1065  public static final IntegerOption WINDOW_X = new IntegerOption("window.x", new Integer JavaDoc(Integer.MAX_VALUE));
1066
1067  /** Y position of MainFrame at startUp. Can be overridden if out of bounds. This value can legally be negative in a
1068   * multi-screen setup.
1069   */

1070  public static final IntegerOption WINDOW_Y = new IntegerOption("window.y", new Integer JavaDoc(Integer.MAX_VALUE));
1071
1072  /** Width of DocList at startUp. Must be less than WINDOW_WIDTH. Can be overridden if out of bounds. */
1073  public static final NonNegativeIntegerOption DOC_LIST_WIDTH =
1074    new NonNegativeIntegerOption("doc.list.width",new Integer JavaDoc(150));
1075
1076  /** Height of tabbed panel at startUp. Must be less than WINDOW_HEIGHT + DEBUG_PANEL_HEIGHT. Can be overridden if
1077   * out of bounds.
1078   */

1079  public static final NonNegativeIntegerOption TABS_HEIGHT =
1080    new NonNegativeIntegerOption("tabs.height",new Integer JavaDoc(120));
1081
1082  /** Height of debugger panel at startUp. Must be less than WINDOW_HEIGHT + TABS_HEIGHT. Can be overridden if out of
1083   * bounds.
1084   */

1085  public static final NonNegativeIntegerOption DEBUG_PANEL_HEIGHT =
1086    new NonNegativeIntegerOption("debug.panel.height",new Integer JavaDoc(0));
1087
1088  /** The directory in use by the file choosers upon the previous quit. */
1089  public static final FileOption LAST_DIRECTORY = new FileOption("last.dir", FileOption.NULL_FILE);
1090
1091  /** The directory in use by the Interactions pane upon the previous quit. */
1092  public static final FileOption LAST_INTERACTIONS_DIRECTORY = new FileOption("last.interactions.dir", FileOption.NULL_FILE);
1093
1094  /** Whether to save and restore Interactions pane directory at startUp/shutdown (sticky=true), or to use
1095    * "user.home" (sticky=false). */

1096  public static final BooleanOption STICKY_INTERACTIONS_DIRECTORY =
1097    new BooleanOption("sticky.interactions.dir", Boolean.TRUE);
1098  
1099  /** The command-line arguments to be passed to the Master JVM. */
1100  public static final StringOption MASTER_JVM_ARGS = new StringOption("master.jvm.args", "");
1101
1102  /** The command-line arguments to be passed to the Slave JVM. */
1103  public static final StringOption SLAVE_JVM_ARGS = new StringOption("slave.jvm.args", "");
1104
1105  /** The last state of the "Clipboard History" dialog. */
1106  public static final StringOption DIALOG_CLIPBOARD_HISTORY_STATE = new StringOption("dialog.clipboard.history.state", "default");
1107
1108  /** Whether to save and restore window size and position at startUp/shutdown. */
1109  public static final BooleanOption DIALOG_CLIPBOARD_HISTORY_STORE_POSITION =
1110    new BooleanOption("dialog.clipboardhistory.store.position", Boolean.TRUE);
1111
1112  /** How many entries are kept in the clipboard history. */
1113  public static final NonNegativeIntegerOption CLIPBOARD_HISTORY_SIZE =
1114    new NonNegativeIntegerOption("clipboardhistory.store.size", 10);
1115
1116  /** The last state of the "Go to File" dialog. */
1117  public static final StringOption DIALOG_GOTOFILE_STATE = new StringOption("dialog.gotofile.state", "default");
1118
1119  /** Whether to save and restore window size and position at startUp/shutdown. */
1120  public static final BooleanOption DIALOG_GOTOFILE_STORE_POSITION =
1121    new BooleanOption("dialog.gotofile.store.position", Boolean.TRUE);
1122
1123  /** The last state of the "Open Javadoc" dialog. */
1124  public static final StringOption DIALOG_OPENJAVADOC_STATE = new StringOption("dialog.openjavadoc.state", "default");
1125
1126  /** Whether to save and restore window size and position at startUp/shutdown. */
1127  public static final BooleanOption DIALOG_OPENJAVADOC_STORE_POSITION =
1128    new BooleanOption("dialog.openjavadoc.store.position", Boolean.TRUE);
1129
1130  /** Number of entries in the browser history (0 for unlimited). */
1131  public static final NonNegativeIntegerOption BROWSER_HISTORY_MAX_SIZE =
1132    new NonNegativeIntegerOption("browser.history.max.size", new Integer JavaDoc(50));
1133
1134  /**
1135   * Whether to also list files with fully qualified paths.
1136   */

1137  public static final BooleanOption DIALOG_GOTOFILE_FULLY_QUALIFIED =
1138    new BooleanOption("dialog.gotofile.fully.qualified", Boolean.FALSE);
1139
1140  /** The last state of the "Complete File" dialog. */
1141  public static final StringOption DIALOG_COMPLETE_WORD_STATE = new StringOption("dialog.completeword.state", "default");
1142
1143  /** Whether to save and restore window size and position at startUp/shutdown. */
1144  public static final BooleanOption DIALOG_COMPLETE_WORD_STORE_POSITION =
1145    new BooleanOption("dialog.completeword.store.position", Boolean.TRUE);
1146  
1147  /** Whether to scan class files for auto-completion class names. */
1148  public static final BooleanOption DIALOG_COMPLETE_SCAN_CLASS_FILES =
1149    new BooleanOption("dialog.completeword.scan.class.files", Boolean.FALSE);
1150
1151// Any lightweight parsing has been disabled until we have something that is beneficial and works better in the background.
1152
/** Whether to perform light-weight parsing. */
1153  public static final BooleanOption LIGHTWEIGHT_PARSING_ENABLED =
1154    new BooleanOption("lightweight.parsing.enabled", Boolean.FALSE);
1155  
1156  /** Delay for light-weight parsing. */
1157  public static final NonNegativeIntegerOption DIALOG_LIGHTWEIGHT_PARSING_DELAY =
1158    new NonNegativeIntegerOption("lightweight.parsing.delay", new Integer JavaDoc(500));
1159
1160  /** The last state of the "Create Jar from Project " dialog. */
1161  public static final StringOption DIALOG_JAROPTIONS_STATE = new StringOption("dialog.jaroptions.state", "default");
1162
1163  /** Whether to save and restore window size and position at startUp/shutdown. */
1164  public static final BooleanOption DIALOG_JAROPTIONS_STORE_POSITION =
1165    new BooleanOption("dialog.jaroptions.store.position", Boolean.TRUE);
1166
1167  /** Whether to put the focus in the definitions pane after find/replace. */
1168  public static final BooleanOption FIND_REPLACE_FOCUS_IN_DEFPANE =
1169    new BooleanOption("find.replace.focus.in.defpane", Boolean.FALSE);
1170
1171  /** Whether to show a notification popup when the first DrJava error occurs. */
1172  public static final BooleanOption DIALOG_DRJAVA_ERROR_POPUP_ENABLED =
1173    new BooleanOption("dialog.drjava.error.popup.enabled", Boolean.TRUE);
1174
1175  /** Whether to show the "code preview" popups in the RegionTreePanels (bookmarks, breakpoints, find all). */
1176  public static final BooleanOption SHOW_CODE_PREVIEW_POPUPS =
1177    new BooleanOption("show.code.preview.popups", Boolean.TRUE);
1178
1179  /** Whether to use Runtime.halt to quit DrJava (see bugs 1550220 and 1478796). */
1180  public static final BooleanOption DRJAVA_USE_FORCE_QUIT =
1181    new BooleanOption("drjava.use.force.quit", Boolean.FALSE);
1182}
1183
Popular Tags