0001: /*BEGIN_COPYRIGHT_BLOCK
0002: *
0003: * Copyright (c) 2001-2007, JavaPLT group at Rice University (javaplt@rice.edu)
0004: * All rights reserved.
0005: *
0006: * Redistribution and use in source and binary forms, with or without
0007: * modification, are permitted provided that the following conditions are met:
0008: * * Redistributions of source code must retain the above copyright
0009: * notice, this list of conditions and the following disclaimer.
0010: * * Redistributions in binary form must reproduce the above copyright
0011: * notice, this list of conditions and the following disclaimer in the
0012: * documentation and/or other materials provided with the distribution.
0013: * * Neither the names of DrJava, the JavaPLT group, Rice University, nor the
0014: * names of its contributors may be used to endorse or promote products
0015: * derived from this software without specific prior written permission.
0016: *
0017: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0018: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0019: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
0020: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
0021: * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
0022: * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
0023: * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
0024: * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
0025: * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
0026: * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
0027: * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0028: *
0029: * This software is Open Source Initiative approved Open Source Software.
0030: * Open Source Initative Approved is a trademark of the Open Source Initiative.
0031: *
0032: * This file is part of DrJava. Download the current version of this project
0033: * from http://www.drjava.org/ or http://sourceforge.net/projects/drjava/
0034: *
0035: * END_COPYRIGHT_BLOCK*/
0036:
0037: package edu.rice.cs.drjava.config;
0038:
0039: import java.io.File;
0040: import java.util.Vector;
0041: import java.util.ArrayList;
0042: import java.util.Arrays;
0043: import java.awt.Color;
0044: import java.awt.Font;
0045: import java.awt.Frame;
0046: import java.awt.Toolkit;
0047: import java.awt.event.KeyEvent;
0048: import java.awt.event.InputEvent;
0049: import javax.swing.KeyStroke;
0050: import javax.swing.LookAndFeel;
0051: import javax.swing.UIManager;
0052: import javax.swing.UIManager.LookAndFeelInfo;
0053: import edu.rice.cs.drjava.platform.PlatformFactory;
0054:
0055: /** Defines the commonly used Option constants in DrJava config and project profiles.
0056: * @version $Id: OptionConstants.java 4264 2007-11-15 01:33:48Z mgricken $
0057: */
0058: public interface OptionConstants {
0059:
0060: // STATIC VARIABLES
0061:
0062: /* ---------- Resource Location and Classpath Options ---------- */
0063:
0064: /** A file path to a user's preferred browser. */
0065: public static final FileOption BROWSER_FILE = new FileOption(
0066: "browser.file", FileOption.NULL_FILE);
0067:
0068: /** A String used to launch a user's preferred browser. It is tokenized and appended to the file path. */
0069: public static final StringOption BROWSER_STRING = new StringOption(
0070: "browser.string", "");
0071:
0072: /** The extension for a DrJava project file */
0073: public static final String PROJECT_FILE_EXTENSION = ".pjt";
0074:
0075: public static final FileOption JAVAC_LOCATION = new FileOption(
0076: "javac.location", FileOption.NULL_FILE);
0077:
0078: public static final VectorOption<File> EXTRA_CLASSPATH = new ClassPathOption()
0079: .evaluate("extra.classpath");
0080:
0081: public static final VectorOption<String> EXTRA_COMPILERS = new VectorOption<String>(
0082: "extra.compilers", new StringOption("", ""),
0083: new Vector<String>());
0084:
0085: /* ---------- Color Options ---------- */
0086:
0087: public static final ColorOption DEFINITIONS_NORMAL_COLOR = new ColorOption(
0088: "definitions.normal.color", Color.black);
0089: public static final ColorOption DEFINITIONS_KEYWORD_COLOR = new ColorOption(
0090: "definitions.keyword.color", Color.blue);
0091: public static final ColorOption DEFINITIONS_TYPE_COLOR = new ColorOption(
0092: "definitions.type.color", Color.blue.darker().darker());
0093: public static final ColorOption DEFINITIONS_COMMENT_COLOR = new ColorOption(
0094: "definitions.comment.color", Color.green.darker().darker());
0095: public static final ColorOption DEFINITIONS_DOUBLE_QUOTED_COLOR = new ColorOption(
0096: "definitions.double.quoted.color", Color.red.darker());
0097: public static final ColorOption DEFINITIONS_SINGLE_QUOTED_COLOR = new ColorOption(
0098: "definitions.single.quoted.color", Color.magenta);
0099: public static final ColorOption DEFINITIONS_NUMBER_COLOR = new ColorOption(
0100: "definitions.number.color", Color.cyan.darker());
0101: public static final ColorOption SYSTEM_OUT_COLOR = new ColorOption(
0102: "system.out.color", Color.green.darker().darker());
0103: public static final ColorOption SYSTEM_ERR_COLOR = new ColorOption(
0104: "system.err.color", Color.red);
0105: public static final ColorOption SYSTEM_IN_COLOR = new ColorOption(
0106: "system.in.color", Color.magenta.darker().darker());
0107: public static final ColorOption INTERACTIONS_ERROR_COLOR = new ColorOption(
0108: "interactions.error.color", Color.red.darker());
0109: public static final ColorOption DEBUG_MESSAGE_COLOR = new ColorOption(
0110: "debug.message.color", Color.blue.darker());
0111:
0112: /** Color for background of definitions pane. */
0113: public static final ColorOption DEFINITIONS_BACKGROUND_COLOR = new ColorOption(
0114: "definitions.background.color", Color.white);
0115:
0116: /** Color for highlighting brace-matching. */
0117: public static final ColorOption DEFINITIONS_MATCH_COLOR = new ColorOption(
0118: "definitions.match.color", new Color(190, 255, 230));
0119:
0120: /** Color for highlighting errors and test failures. */
0121: public static final ColorOption COMPILER_ERROR_COLOR = new ColorOption(
0122: "compiler.error.color", Color.yellow);
0123:
0124: /** Color for highlighting bookmarks. */
0125: public static final ColorOption BOOKMARK_COLOR = new ColorOption(
0126: "bookmark.color", Color.green);
0127:
0128: /** Color for highlighting find results. */
0129: public static final ColorOption FIND_RESULTS_COLOR1 = new ColorOption(
0130: "find.results.color1", new Color(0xFF, 0x99, 0x33));
0131: public static final ColorOption FIND_RESULTS_COLOR2 = new ColorOption(
0132: "find.results.color2", new Color(0x30, 0xC9, 0x96));
0133: public static final ColorOption FIND_RESULTS_COLOR3 = new ColorOption(
0134: "find.results.color3", new Color(0x30, 0xFC, 0xFC));
0135: public static final ColorOption FIND_RESULTS_COLOR4 = new ColorOption(
0136: "find.results.color4", new Color(0xFF, 0x66, 0xCC));
0137:
0138: public static final ColorOption[] FIND_RESULTS_COLORS = new ColorOption[] {
0139: FIND_RESULTS_COLOR1, FIND_RESULTS_COLOR2,
0140: FIND_RESULTS_COLOR3, FIND_RESULTS_COLOR4 };
0141:
0142: /** Color for highlighting breakpoints. */
0143: public static final ColorOption DEBUG_BREAKPOINT_COLOR = new ColorOption(
0144: "debug.breakpoint.color", Color.red);
0145:
0146: /** Color for highlighting disabled breakpoints. */
0147: public static final ColorOption DEBUG_BREAKPOINT_DISABLED_COLOR = new ColorOption(
0148: "debug.breakpoint.disabled.color", new Color(128, 0, 0));
0149:
0150: /** Color for highlighting thread locations. */
0151: public static final ColorOption DEBUG_THREAD_COLOR = new ColorOption(
0152: "debug.thread.color", new Color(100, 255, 255));
0153:
0154: /** Color for the background of the "DrJava Errors" button. */
0155: public static final ColorOption DRJAVA_ERRORS_BUTTON_COLOR = new ColorOption(
0156: "drjava.errors.button.color", Color.red);
0157:
0158: /* ---------- Font Options ---------- */
0159:
0160: /** Main (definitions document, tab contents) */
0161: public static final FontOption FONT_MAIN = new FontOption(
0162: "font.main", DefaultFont.getDefaultMainFont());
0163:
0164: /** Class that allows the main font to be initialized properly. On Mac OS X, Monaco is the best monospaced font. */
0165: static class DefaultFont {
0166: public static Font getDefaultMainFont() {
0167: if (PlatformFactory.ONLY.isMacPlatform())
0168: return Font.decode("Monaco-12");
0169: else
0170: return Font.decode("Monospaced-12");
0171: }
0172:
0173: public static Font getDefaultLineNumberFont() {
0174: if (PlatformFactory.ONLY.isMacPlatform())
0175: return Font.decode("Monaco-12");
0176: else
0177: return Font.decode("Monospaced-12");
0178: }
0179:
0180: public static Font getDefaultDocListFont() {
0181: if (PlatformFactory.ONLY.isMacPlatform())
0182: return Font.decode("Monaco-10");
0183: else
0184: return Font.decode("Monospaced-10");
0185: }
0186: }
0187:
0188: /** Line numbers */
0189: public static final FontOption FONT_LINE_NUMBERS = new FontOption(
0190: "font.line.numbers", DefaultFont.getDefaultLineNumberFont());
0191:
0192: /** List of open documents */
0193: public static final FontOption FONT_DOCLIST = new FontOption(
0194: "font.doclist", DefaultFont.getDefaultDocListFont());
0195:
0196: /** Toolbar buttons */
0197: public static final FontOption FONT_TOOLBAR = new FontOption(
0198: "font.toolbar", Font.decode("dialog-10"));
0199:
0200: /** Whether to draw anti-aliased text. (Slightly slower.) */
0201: public static final BooleanOption TEXT_ANTIALIAS = new BooleanOption(
0202: "text.antialias", Boolean.FALSE);
0203:
0204: /* ---------- Other Display Options ---------- */
0205:
0206: /** Whether icons should be displayed on the toolbar buttons. */
0207: public static final BooleanOption TOOLBAR_ICONS_ENABLED = new BooleanOption(
0208: "toolbar.icons.enabled", Boolean.TRUE);
0209:
0210: /** Whether text should be displayed on toolbar buttons. Note: only relevant if toolbar icons are enabled. */
0211: public static final BooleanOption TOOLBAR_TEXT_ENABLED = new BooleanOption(
0212: "toolbar.text.enabled", Boolean.TRUE);
0213:
0214: /** Whether or not the toolbar should be displayed. */
0215: public static final BooleanOption TOOLBAR_ENABLED = new BooleanOption(
0216: "toolbar.enabled", Boolean.TRUE);
0217:
0218: /** Whether the line-numbers should be displayed in a row header. */
0219: public static final BooleanOption LINEENUM_ENABLED = new BooleanOption(
0220: "lineenum.enabled", Boolean.FALSE);
0221:
0222: /** Whether to save and restore window size and position at startUp/shutdown. */
0223: public static final BooleanOption WINDOW_STORE_POSITION = new BooleanOption(
0224: "window.store.position", Boolean.TRUE);
0225:
0226: /** Whether a sample of the source code will be show when fast switching documents. */
0227: public static final BooleanOption SHOW_SOURCE_WHEN_SWITCHING = new BooleanOption(
0228: "show.source.for.fast.switch", Boolean.TRUE);
0229:
0230: /** The current look and feel. */
0231: public static final ForcedChoiceOption LOOK_AND_FEEL = new ForcedChoiceOption(
0232: "look.and.feel", LookAndFeels.getDefaultLookAndFeel(),
0233: LookAndFeels.getLookAndFeels());
0234:
0235: /** Class that allows the look and feels to be initialized properly. */
0236: static class LookAndFeels {
0237:
0238: /** Mac platform should default to aqua; use metal elsewhere.
0239: * @return the look-and-feel to use by default
0240: */
0241: public static String getDefaultLookAndFeel() {
0242: if (PlatformFactory.ONLY.isMacPlatform())
0243: return UIManager.getSystemLookAndFeelClassName();
0244: else
0245: return UIManager.getCrossPlatformLookAndFeelClassName();
0246: }
0247:
0248: /** Need to ensure that a look-and-feel can be instantiated and is valid.
0249: * TODO: store the LookAndFeel object rather than its classname.
0250: * This would be much nicer, as we could display a useful name,
0251: * and wouldn't have to reinstantiate it when it's installed.
0252: * @return the list of available look-and-feel classnames
0253: */
0254: public static ArrayList<String> getLookAndFeels() {
0255: ArrayList<String> lookAndFeels = new ArrayList<String>();
0256: LookAndFeelInfo[] lafis = UIManager
0257: .getInstalledLookAndFeels();
0258: if (lafis != null) {
0259: for (int i = 0; i < lafis.length; i++) {
0260: try {
0261: String currName = lafis[i].getClassName();
0262: LookAndFeel currLAF = (LookAndFeel) Class
0263: .forName(currName).newInstance();
0264: if (currLAF.isSupportedLookAndFeel()) {
0265: lookAndFeels.add(currName);
0266: }
0267: } catch (Exception ex) {
0268: // failed to load/instantiate class, or it is not supported.
0269: // It is not a valid choice.
0270: }
0271: }
0272: }
0273: return lookAndFeels;
0274: }
0275: }
0276:
0277: /* ---------- Key Binding Options ----------- */
0278: static int mask = Toolkit.getDefaultToolkit()
0279: .getMenuShortcutKeyMask();
0280: /**
0281: * The key binding for creating a new file
0282: */
0283: public static final KeyStrokeOption KEY_NEW_FILE = new KeyStrokeOption(
0284: "key.new.file", KeyStroke.getKeyStroke(KeyEvent.VK_N, mask));
0285: /**
0286: * The key binding for opening an entire project. I is right next to O, so
0287: * it seemed logical that ctrl-I would open a project and ctrl-O open a file
0288: */
0289: public static final KeyStrokeOption KEY_OPEN_PROJECT = new KeyStrokeOption(
0290: "key.open.project", KeyStroke.getKeyStroke(KeyEvent.VK_I,
0291: mask));
0292: /**
0293: * The key binding for creating a new JUnit test case
0294: */
0295: public static final KeyStrokeOption KEY_NEW_TEST = new KeyStrokeOption(
0296: "key.new.test", KeyStrokeOption.NULL_KEYSTROKE);
0297:
0298: /**
0299: * The key binding for opening a folder
0300: */
0301: public static final KeyStrokeOption KEY_OPEN_FOLDER = new KeyStrokeOption(
0302: "key.open.folder", KeyStrokeOption.NULL_KEYSTROKE);
0303: /**
0304: * The key binding for opening a file
0305: */
0306: public static final KeyStrokeOption KEY_OPEN_FILE = new KeyStrokeOption(
0307: "key.open.file", KeyStroke
0308: .getKeyStroke(KeyEvent.VK_O, mask));
0309: /**
0310: * The key binding for saving a file
0311: */
0312: public static final KeyStrokeOption KEY_SAVE_FILE = new KeyStrokeOption(
0313: "key.save.file", KeyStroke
0314: .getKeyStroke(KeyEvent.VK_S, mask));
0315: /**
0316: * The key binding for saving a file as
0317: */
0318: public static final KeyStrokeOption KEY_SAVE_FILE_AS = new KeyStrokeOption(
0319: "key.save.file.as", KeyStroke.getKeyStroke(KeyEvent.VK_S,
0320: mask | InputEvent.SHIFT_MASK));
0321: /**
0322: * The key binding for saving all files
0323: */
0324: public static final KeyStrokeOption KEY_SAVE_ALL_FILES = new KeyStrokeOption(
0325: "key.save.all.files", KeyStroke.getKeyStroke(KeyEvent.VK_S,
0326: mask | InputEvent.ALT_MASK));
0327:
0328: /**
0329: * The key binding for renaming a file
0330: */
0331: public static final KeyStrokeOption KEY_RENAME_FILE = new KeyStrokeOption(
0332: "key.rename.file", KeyStrokeOption.NULL_KEYSTROKE);
0333:
0334: /**
0335: * The key binding for reverting a file
0336: */
0337: public static final KeyStrokeOption KEY_REVERT_FILE = new KeyStrokeOption(
0338: "key.revert.file", KeyStroke.getKeyStroke(KeyEvent.VK_R,
0339: mask));
0340: /**
0341: * The key binding for closing a file
0342: */
0343: public static final KeyStrokeOption KEY_CLOSE_FILE = new KeyStrokeOption(
0344: "key.close.file", KeyStroke.getKeyStroke(KeyEvent.VK_W,
0345: mask));
0346: /**
0347: * The key binding for closing all files
0348: */
0349: public static final KeyStrokeOption KEY_CLOSE_ALL_FILES = new KeyStrokeOption(
0350: "key.close.all.files", KeyStroke.getKeyStroke(
0351: KeyEvent.VK_W, mask | InputEvent.ALT_MASK));
0352:
0353: public static final KeyStrokeOption KEY_CLOSE_PROJECT = new KeyStrokeOption(
0354: "key.close.project", KeyStroke.getKeyStroke(KeyEvent.VK_W,
0355: mask | InputEvent.SHIFT_MASK));
0356:
0357: /** The key binding for showing the print preview */
0358: public static final KeyStrokeOption KEY_PAGE_SETUP = new KeyStrokeOption(
0359: "key.page.setup", KeyStrokeOption.NULL_KEYSTROKE);
0360:
0361: /** The key binding for showing the print preview. */
0362: public static final KeyStrokeOption KEY_PRINT_PREVIEW = new KeyStrokeOption(
0363: "key.print.preview", KeyStroke.getKeyStroke(KeyEvent.VK_P,
0364: mask | InputEvent.SHIFT_MASK));
0365:
0366: /** The key binding for printing a file */
0367: public static final KeyStrokeOption KEY_PRINT = new KeyStrokeOption(
0368: "key.print", KeyStroke.getKeyStroke(KeyEvent.VK_P, mask));
0369:
0370: /** The key binding for quitting */
0371: public static final KeyStrokeOption KEY_QUIT = new KeyStrokeOption(
0372: "key.quit", KeyStroke.getKeyStroke(KeyEvent.VK_Q, mask));
0373:
0374: /** The key binding for forced quitting */
0375: public static final KeyStrokeOption KEY_FORCE_QUIT = new KeyStrokeOption(
0376: "key.force.quit", KeyStrokeOption.NULL_KEYSTROKE);
0377:
0378: /** The key binding for undo-ing */
0379: public static final KeyStrokeOption KEY_UNDO = new KeyStrokeOption(
0380: "key.undo", KeyStroke.getKeyStroke(KeyEvent.VK_Z, mask));
0381:
0382: /** The key binding for redo-ing */
0383: public static final KeyStrokeOption KEY_REDO = new KeyStrokeOption(
0384: "key.redo", KeyStroke.getKeyStroke(KeyEvent.VK_Z, mask
0385: | InputEvent.SHIFT_MASK));
0386:
0387: /** The key binding for cutting */
0388: public static final KeyStrokeOption KEY_CUT = new KeyStrokeOption(
0389: "key.cut", KeyStroke.getKeyStroke(KeyEvent.VK_X, mask));
0390:
0391: /** The key binding for copying */
0392: public static final KeyStrokeOption KEY_COPY = new KeyStrokeOption(
0393: "key.copy", KeyStroke.getKeyStroke(KeyEvent.VK_C, mask));
0394:
0395: /** The key binding for pasting */
0396: public static final KeyStrokeOption KEY_PASTE = new KeyStrokeOption(
0397: "key.paste", KeyStroke.getKeyStroke(KeyEvent.VK_V, mask));
0398:
0399: /** The key binding for pasting from history */
0400: public static final KeyStrokeOption KEY_PASTE_FROM_HISTORY = new KeyStrokeOption(
0401: "key.paste.from.history", KeyStroke.getKeyStroke(
0402: KeyEvent.VK_V, mask | InputEvent.SHIFT_MASK));
0403:
0404: /** The key binding for selecting all text */
0405: public static final KeyStrokeOption KEY_SELECT_ALL = new KeyStrokeOption(
0406: "key.select.all", KeyStroke.getKeyStroke(KeyEvent.VK_A,
0407: mask));
0408:
0409: /** The key binding for find and replace */
0410: public static final KeyStrokeOption KEY_FIND_NEXT = new KeyStrokeOption(
0411: "key.find.next", KeyStroke.getKeyStroke(KeyEvent.VK_F3, 0));
0412:
0413: /** The key binding for find previous (opposite direction) */
0414: public static final KeyStrokeOption KEY_FIND_PREV = new KeyStrokeOption(
0415: "key.find.prev", KeyStroke.getKeyStroke(KeyEvent.VK_F3,
0416: InputEvent.SHIFT_MASK));
0417: /**
0418: * The key binding for find and replace
0419: */
0420: public static final KeyStrokeOption KEY_FIND_REPLACE = new KeyStrokeOption(
0421: "key.find.replace", KeyStroke.getKeyStroke(KeyEvent.VK_F,
0422: mask));
0423: /**
0424: * The key binding for goto line
0425: */
0426: public static final KeyStrokeOption KEY_GOTO_LINE = new KeyStrokeOption(
0427: "key.goto.line", KeyStroke
0428: .getKeyStroke(KeyEvent.VK_G, mask));
0429:
0430: /**
0431: * The key binding for goto file.
0432: */
0433: public static final KeyStrokeOption KEY_GOTO_FILE = new KeyStrokeOption(
0434: "key.goto.file", KeyStroke.getKeyStroke(KeyEvent.VK_G, mask
0435: | KeyEvent.SHIFT_MASK));
0436:
0437: /**
0438: * The key binding for goto this file.
0439: */
0440: public static final KeyStrokeOption KEY_GOTO_FILE_UNDER_CURSOR = new KeyStrokeOption(
0441: "key.goto.file.under.cursor", KeyStroke.getKeyStroke(
0442: KeyEvent.VK_F6, 0));
0443:
0444: /**
0445: * The key binding for open Javadoc.
0446: */
0447: public static final KeyStrokeOption KEY_OPEN_JAVADOC = new KeyStrokeOption(
0448: "key.open.javadoc", KeyStroke.getKeyStroke(KeyEvent.VK_F6,
0449: KeyEvent.SHIFT_MASK));
0450:
0451: /**
0452: * The key binding for open Javadoc under cursor.
0453: */
0454: public static final KeyStrokeOption KEY_OPEN_JAVADOC_UNDER_CURSOR = new KeyStrokeOption(
0455: "key.open.javadoc.under.cursor", KeyStroke.getKeyStroke(
0456: KeyEvent.VK_F6, mask));
0457:
0458: /**
0459: * The key binding for complete file.
0460: */
0461: public static final KeyStrokeOption KEY_COMPLETE_FILE = new KeyStrokeOption(
0462: "key.complete.file", KeyStroke.getKeyStroke(
0463: KeyEvent.VK_SPACE, mask | KeyEvent.SHIFT_MASK));
0464:
0465: /**
0466: * The key binding for indenting
0467: *
0468: public static final KeyStrokeOption KEY_INDENT =
0469: new KeyStrokeOption("key.indent",
0470: KeyStroke.getKeyStroke(KeyEvent.VK_TAB, mask)); */
0471:
0472: /**
0473: * The key binding for commenting out lines
0474: */
0475: public static final KeyStrokeOption KEY_COMMENT_LINES = new KeyStrokeOption(
0476: "key.comment.lines", KeyStroke.getKeyStroke(
0477: KeyEvent.VK_SLASH, mask));
0478:
0479: /**
0480: * The key binding for un-commenting lines
0481: */
0482: public static final KeyStrokeOption KEY_UNCOMMENT_LINES = new KeyStrokeOption(
0483: "key.uncomment.lines", KeyStroke.getKeyStroke(
0484: KeyEvent.VK_SLASH, (mask | InputEvent.SHIFT_MASK)));
0485:
0486: /**
0487: * The key binding for selecting previous document
0488: */
0489: public static final KeyStrokeOption KEY_PREVIOUS_DOCUMENT = new KeyStrokeOption(
0490: "key.previous.document", KeyStroke.getKeyStroke(
0491: KeyEvent.VK_COMMA, mask));
0492: /**
0493: * The key binding for selecting next document
0494: */
0495: public static final KeyStrokeOption KEY_NEXT_DOCUMENT = new KeyStrokeOption(
0496: "key.next.document", KeyStroke.getKeyStroke(
0497: KeyEvent.VK_PERIOD, mask));
0498:
0499: /**
0500: * The key binding for changing the focus to the previous pane
0501: */
0502: public static final KeyStrokeOption KEY_PREVIOUS_PANE = new KeyStrokeOption(
0503: "key.previous.pane", KeyStroke.getKeyStroke(
0504: KeyEvent.VK_OPEN_BRACKET, mask));
0505:
0506: /**
0507: * The key binding for changing the focus to the next pane
0508: */
0509: public static final KeyStrokeOption KEY_NEXT_PANE = new KeyStrokeOption(
0510: "key.next.pane", KeyStroke.getKeyStroke(
0511: KeyEvent.VK_CLOSE_BRACKET, mask));
0512:
0513: /**
0514: * The key binding for going to the opening brace.
0515: */
0516: public static final KeyStrokeOption KEY_OPENING_BRACE = new KeyStrokeOption(
0517: "key.goto.opening.brace", KeyStroke.getKeyStroke(
0518: KeyEvent.VK_OPEN_BRACKET, mask
0519: | InputEvent.SHIFT_MASK));
0520:
0521: /**
0522: * The key binding for going to the closing brace.
0523: */
0524: public static final KeyStrokeOption KEY_CLOSING_BRACE = new KeyStrokeOption(
0525: "key.goto.closing.brace", KeyStroke.getKeyStroke(
0526: KeyEvent.VK_CLOSE_BRACKET, mask
0527: | InputEvent.SHIFT_MASK));
0528:
0529: /**
0530: * The key binding for jumping to the next location in the browser history
0531: */
0532: public static final KeyStrokeOption KEY_BROWSE_FORWARD = new KeyStrokeOption(
0533: "key.browse.forward", KeyStroke.getKeyStroke(
0534: KeyEvent.VK_RIGHT, InputEvent.ALT_MASK
0535: | InputEvent.SHIFT_MASK));
0536:
0537: /**
0538: * The key binding for jumping to the previous location in the browser history
0539: */
0540: public static final KeyStrokeOption KEY_BROWSE_BACK = new KeyStrokeOption(
0541: "key.browse.back", KeyStroke.getKeyStroke(KeyEvent.VK_LEFT,
0542: InputEvent.ALT_MASK | InputEvent.SHIFT_MASK));
0543:
0544: /**
0545: * The key binding for openning the preferences dialog
0546: */
0547: public static final KeyStrokeOption KEY_PREFERENCES = new KeyStrokeOption(
0548: "key.preferences", KeyStroke.getKeyStroke(
0549: KeyEvent.VK_SEMICOLON, mask));
0550:
0551: /**
0552: * The key binding for compiling current document
0553: */
0554: public static final KeyStrokeOption KEY_COMPILE = new KeyStrokeOption(
0555: "key.compile", KeyStroke.getKeyStroke(KeyEvent.VK_F5,
0556: InputEvent.SHIFT_MASK));
0557:
0558: /**
0559: * The key binding for compiling all
0560: */
0561: public static final KeyStrokeOption KEY_COMPILE_ALL = new KeyStrokeOption(
0562: "key.compile.all", KeyStroke
0563: .getKeyStroke(KeyEvent.VK_F5, 0));
0564:
0565: /**
0566: * The key binding for running the main method of the current document
0567: */
0568: public static final KeyStrokeOption KEY_RUN = new KeyStrokeOption(
0569: "key.run", KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0));
0570:
0571: /**
0572: * The key binding for running the project's main document
0573: */
0574: public static final KeyStrokeOption KEY_RUN_MAIN = new KeyStrokeOption(
0575: "key.run.main", KeyStroke.getKeyStroke(KeyEvent.VK_F4, 0));
0576:
0577: /**
0578: * The key binding for testing the current document
0579: */
0580: public static final KeyStrokeOption KEY_TEST = new KeyStrokeOption(
0581: "key.test", KeyStroke.getKeyStroke(KeyEvent.VK_T, mask
0582: | InputEvent.SHIFT_MASK));
0583:
0584: /**
0585: * The key binding for testing all open JUnit test cases.
0586: */
0587: public static final KeyStrokeOption KEY_TEST_ALL = new KeyStrokeOption(
0588: "key.test.all", KeyStroke.getKeyStroke(KeyEvent.VK_T, mask));
0589:
0590: /**
0591: * The key binding for generating javadoc for all documents
0592: */
0593: public static final KeyStrokeOption KEY_JAVADOC_ALL = new KeyStrokeOption(
0594: "key.javadoc.all", KeyStroke.getKeyStroke(KeyEvent.VK_J,
0595: mask));
0596:
0597: /**
0598: * The key binding for generating javadoc for the current document
0599: */
0600: public static final KeyStrokeOption KEY_JAVADOC_CURRENT = new KeyStrokeOption(
0601: "key.javadoc.current", KeyStroke.getKeyStroke(
0602: KeyEvent.VK_J, mask | InputEvent.SHIFT_MASK));
0603:
0604: /**
0605: * The key binding for executing an interactions history.
0606: */
0607: public static final KeyStrokeOption KEY_EXECUTE_HISTORY = new KeyStrokeOption(
0608: "key.execute.history", KeyStrokeOption.NULL_KEYSTROKE);
0609:
0610: /**
0611: * The key binding for loading an interactions history as a script.
0612: */
0613: public static final KeyStrokeOption KEY_LOAD_HISTORY_SCRIPT = new KeyStrokeOption(
0614: "key.load.history.script", KeyStrokeOption.NULL_KEYSTROKE);
0615:
0616: /**
0617: * The key binding for saving an interactions history.
0618: */
0619: public static final KeyStrokeOption KEY_SAVE_HISTORY = new KeyStrokeOption(
0620: "key.save.history", KeyStrokeOption.NULL_KEYSTROKE);
0621:
0622: /**
0623: * The key binding for clearing the interactions history.
0624: */
0625: public static final KeyStrokeOption KEY_CLEAR_HISTORY = new KeyStrokeOption(
0626: "key.clear.history", KeyStrokeOption.NULL_KEYSTROKE);
0627:
0628: /**
0629: * The key binding for resetting the interactions pane.
0630: */
0631: public static final KeyStrokeOption KEY_RESET_INTERACTIONS = new KeyStrokeOption(
0632: "key.reset.interactions", KeyStrokeOption.NULL_KEYSTROKE);
0633:
0634: /**
0635: * The key binding for viewing the interactions classpath.
0636: */
0637: public static final KeyStrokeOption KEY_VIEW_INTERACTIONS_CLASSPATH = new KeyStrokeOption(
0638: "key.view.interactions.classpath",
0639: KeyStrokeOption.NULL_KEYSTROKE);
0640:
0641: /**
0642: * The key binding for printing the interactions.
0643: */
0644: public static final KeyStrokeOption KEY_PRINT_INTERACTIONS = new KeyStrokeOption(
0645: "key.view.print.interactions",
0646: KeyStrokeOption.NULL_KEYSTROKE);
0647:
0648: /**
0649: * The key binding for lifting the current interaction to definitions.
0650: */
0651: public static final KeyStrokeOption KEY_LIFT_CURRENT_INTERACTION = new KeyStrokeOption(
0652: "key.lift.current.interaction",
0653: KeyStrokeOption.NULL_KEYSTROKE);
0654:
0655: /**
0656: * The key binding to enter or leave multiline input mode.
0657: *
0658: public static final KeyStrokeOption KEY_TOGGLE_MULTILINE_INTERACTION =
0659: new KeyStrokeOption("key.toggle.multiline.interaction",
0660: KeyStroke.getKeyStroke(KeyEvent.VK_M, mask));
0661: */
0662:
0663: /**
0664: * The key binding for clearing the console.
0665: */
0666: public static final KeyStrokeOption KEY_CLEAR_CONSOLE = new KeyStrokeOption(
0667: "key.clear.console", KeyStrokeOption.NULL_KEYSTROKE);
0668:
0669: /**
0670: * The key binding for printing the console.
0671: */
0672: public static final KeyStrokeOption KEY_PRINT_CONSOLE = new KeyStrokeOption(
0673: "key.view.print.console", KeyStrokeOption.NULL_KEYSTROKE);
0674:
0675: /**
0676: * The key binding for moving the cursor backwards
0677: */
0678: public static final KeyStrokeOption KEY_BACKWARD = new KeyStrokeOption(
0679: "key.backward", KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0));
0680:
0681: /**
0682: * The key binding for moving the cursor to the beginning of the document
0683: */
0684: public static final KeyStrokeOption KEY_BEGIN_DOCUMENT = new KeyStrokeOption(
0685: "key.begin.document", KeyStroke.getKeyStroke(
0686: KeyEvent.VK_HOME, mask));
0687:
0688: /**
0689: * The key binding for moving the cursor to the beginning of the current line
0690: */
0691: public static final KeyStrokeOption KEY_BEGIN_LINE = new KeyStrokeOption(
0692: "key.begin.line", KeyStroke.getKeyStroke(KeyEvent.VK_HOME,
0693: 0));
0694:
0695: /**
0696: * The key binding for moving the cursor to the beginning of the current paragraph.
0697: * (Doesn't seem to do anything useful...)
0698: *
0699: public static final KeyStrokeOption KEY_BEGIN_PARAGRAPH =
0700: new KeyStrokeOption("key.begin.paragraph",
0701: KeyStroke.getKeyStroke(KeyEvent.VK_UP, mask));
0702: */
0703:
0704: /**
0705: * The key binding for moving the cursor to the beginning of the previous word
0706: */
0707: public static final KeyStrokeOption KEY_PREVIOUS_WORD = new KeyStrokeOption(
0708: "key.previous.word", KeyStroke.getKeyStroke(
0709: KeyEvent.VK_LEFT, mask));
0710:
0711: /**
0712: * The key binding for deleting the next character
0713: */
0714: public static final KeyStrokeOption KEY_DELETE_NEXT = new KeyStrokeOption(
0715: "key.delete.next", KeyStroke.getKeyStroke(
0716: KeyEvent.VK_DELETE, 0));
0717: /**
0718: * The key binding for deleting the previous character (with shift set)
0719: */
0720: public static final KeyStrokeOption KEY_DELETE_PREVIOUS = new KeyStrokeOption(
0721: "key.delete.previous", KeyStroke.getKeyStroke(
0722: KeyEvent.VK_BACK_SPACE, 0));
0723:
0724: /**
0725: * The key binding for deleting the next character (with shift set)
0726: */
0727: public static final KeyStrokeOption KEY_SHIFT_DELETE_NEXT = new KeyStrokeOption(
0728: "key.delete.next", KeyStroke.getKeyStroke(
0729: KeyEvent.VK_DELETE, InputEvent.SHIFT_MASK));
0730: /**
0731: * The key binding for deleting the previous character (with shift set)
0732: */
0733: public static final KeyStrokeOption KEY_SHIFT_DELETE_PREVIOUS = new KeyStrokeOption(
0734: "key.delete.previous", KeyStroke.getKeyStroke(
0735: KeyEvent.VK_BACK_SPACE, InputEvent.SHIFT_MASK));
0736:
0737: /**
0738: * The key binding for moving the cursor down
0739: */
0740: public static final KeyStrokeOption KEY_DOWN = new KeyStrokeOption(
0741: "key.down", KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0));
0742:
0743: /**
0744: * The key binding for moving the cursor up
0745: */
0746: public static final KeyStrokeOption KEY_UP = new KeyStrokeOption(
0747: "key.up", KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0));
0748:
0749: /**
0750: * The key binding for moving the cursor to the end of the document
0751: */
0752: public static final KeyStrokeOption KEY_END_DOCUMENT = new KeyStrokeOption(
0753: "key.end.document", KeyStroke.getKeyStroke(KeyEvent.VK_END,
0754: mask));
0755: /**
0756: * The key binding for moving the cursor to the end of the current line
0757: */
0758: public static final KeyStrokeOption KEY_END_LINE = new KeyStrokeOption(
0759: "key.end.line", KeyStroke.getKeyStroke(KeyEvent.VK_END, 0));
0760:
0761: // /** The key binding for moving the cursor to the end of the current paragraph. */
0762: // public static final KeyStrokeOption KEY_END_PARAGRAPH =
0763: // new KeyStrokeOption("key.end.paragraph", KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, mask));
0764:
0765: /** The key binding for moving the cursor to the beginning of the next word. */
0766: public static final KeyStrokeOption KEY_NEXT_WORD = new KeyStrokeOption(
0767: "key.next.word", KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT,
0768: mask));
0769:
0770: /** The key binding for moving the cursor forwards. */
0771: public static final KeyStrokeOption KEY_FORWARD = new KeyStrokeOption(
0772: "key.forward", KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0));
0773:
0774: /** The key binding for page down. */
0775: public static final KeyStrokeOption KEY_PAGE_DOWN = new KeyStrokeOption(
0776: "key.page.down", KeyStroke.getKeyStroke(
0777: KeyEvent.VK_PAGE_DOWN, 0));
0778:
0779: /** The key binding for page up. */
0780: public static final KeyStrokeOption KEY_PAGE_UP = new KeyStrokeOption(
0781: "key.page.up", KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP,
0782: 0));
0783:
0784: /** The key binding for cutting a line. */
0785: public static final KeyStrokeOption KEY_CUT_LINE = new KeyStrokeOption(
0786: "key.cut.line", KeyStroke.getKeyStroke(KeyEvent.VK_K,
0787: (mask | InputEvent.ALT_MASK)));
0788:
0789: /** The key binding for clearing a line, emacs-style. */
0790: public static final KeyStrokeOption KEY_CLEAR_LINE = new KeyStrokeOption(
0791: "key.clear.line", KeyStroke.getKeyStroke(KeyEvent.VK_K,
0792: mask));
0793:
0794: /** The key binding for toggling debug mode. */
0795: public static final KeyStrokeOption KEY_DEBUG_MODE_TOGGLE = new KeyStrokeOption(
0796: "key.debug.mode.toggle", KeyStroke.getKeyStroke(
0797: KeyEvent.VK_D, mask));
0798:
0799: // /** The key binding for suspending the debugger. */
0800: // public static final KeyStrokeOption KEY_DEBUG_SUSPEND =
0801: // new KeyStrokeOption("key.debug.suspend", KeyStroke.getKeyStroke(KeyEvent.VK_F6, 0));
0802:
0803: /** The key binding for resuming the debugger. */
0804: public static final KeyStrokeOption KEY_DEBUG_RESUME = new KeyStrokeOption(
0805: "key.debug.resume", KeyStroke.getKeyStroke(KeyEvent.VK_F7,
0806: 0));
0807:
0808: /** The key binding for stepping into in the debugger */
0809: public static final KeyStrokeOption KEY_DEBUG_STEP_INTO = new KeyStrokeOption(
0810: "key.debug.step.into", KeyStroke.getKeyStroke(
0811: KeyEvent.VK_F12, 0));
0812:
0813: /** The key binding for stepping over in the debugger. */
0814: public static final KeyStrokeOption KEY_DEBUG_STEP_OVER = new KeyStrokeOption(
0815: "key.debug.step.over", KeyStroke.getKeyStroke(
0816: KeyEvent.VK_F11, 0));
0817:
0818: /** The key binding for stepping out in the debugger. */
0819: public static final KeyStrokeOption KEY_DEBUG_STEP_OUT = new KeyStrokeOption(
0820: "key.debug.step.out", KeyStroke.getKeyStroke(
0821: KeyEvent.VK_F12, InputEvent.SHIFT_MASK));
0822:
0823: /** The key binding for toggling a breakpoint. */
0824: public static final KeyStrokeOption KEY_DEBUG_BREAKPOINT_TOGGLE = new KeyStrokeOption(
0825: "key.debug.breakpoint.toggle", KeyStroke.getKeyStroke(
0826: KeyEvent.VK_B, mask));
0827:
0828: /** The key binding for displaying the breakpoints panel. */
0829: public static final KeyStrokeOption KEY_DEBUG_BREAKPOINT_PANEL = new KeyStrokeOption(
0830: "key.debug.breakpoint.panel", KeyStroke.getKeyStroke(
0831: KeyEvent.VK_B, mask | InputEvent.SHIFT_MASK));
0832:
0833: /** The key binding for clearing all breakpoints. */
0834: public static final KeyStrokeOption KEY_DEBUG_CLEAR_ALL_BREAKPOINTS = new KeyStrokeOption(
0835: "key.debug.clear.all.breakpoints",
0836: KeyStrokeOption.NULL_KEYSTROKE);
0837:
0838: /** The key binding for toggling a bookmark. */
0839: public static final KeyStrokeOption KEY_BOOKMARKS_TOGGLE = new KeyStrokeOption(
0840: "key.bookmarks.toggle", KeyStroke.getKeyStroke(
0841: KeyEvent.VK_M, mask));
0842:
0843: /** The key binding for displaying the bookmarks panel. */
0844: public static final KeyStrokeOption KEY_BOOKMARKS_PANEL = new KeyStrokeOption(
0845: "key.bookmarks.panel", KeyStroke.getKeyStroke(
0846: KeyEvent.VK_M, mask | InputEvent.SHIFT_MASK));
0847:
0848: /** The key binding for help */
0849: public static final KeyStrokeOption KEY_HELP = new KeyStrokeOption(
0850: "key.help", KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0));
0851:
0852: /** The key binding for quickstart. Currently set to the null keystroke. */
0853: public static final KeyStrokeOption KEY_QUICKSTART = new KeyStrokeOption(
0854: "key.quickstart", KeyStrokeOption.NULL_KEYSTROKE);
0855:
0856: /** The key binding for the about dialog */
0857: public static final KeyStrokeOption KEY_ABOUT = new KeyStrokeOption(
0858: "key.about", KeyStrokeOption.NULL_KEYSTROKE);
0859:
0860: /** The key binding for the "DrJava Errors" dialog */
0861: public static final KeyStrokeOption KEY_DRJAVA_ERRORS = new KeyStrokeOption(
0862: "key.drjava.errors", KeyStrokeOption.NULL_KEYSTROKE);
0863:
0864: /* ---------- Find Replace Options ---------- */
0865:
0866: public static final BooleanOption FIND_MATCH_CASE = new BooleanOption(
0867: "find.replace.match.case", Boolean.TRUE);
0868:
0869: public static final BooleanOption FIND_SEARCH_BACKWARDS = new BooleanOption(
0870: "find.replace.search.backwards", Boolean.FALSE);
0871:
0872: public static final BooleanOption FIND_WHOLE_WORD = new BooleanOption(
0873: "find.replace.whole.word", Boolean.FALSE);
0874:
0875: public static final BooleanOption FIND_ALL_DOCUMENTS = new BooleanOption(
0876: "find.replace.all.documents", Boolean.FALSE);
0877:
0878: public static final BooleanOption FIND_NO_COMMENTS_STRINGS = new BooleanOption(
0879: "find.replace.no.comments.strings", Boolean.FALSE);
0880:
0881: /* ---------- Debugger Options ---------- */
0882:
0883: /**
0884: * A classpath-structured vector of all paths to look for source files on
0885: * while stepping in the debugger.
0886: */
0887: public static final VectorOption<File> DEBUG_SOURCEPATH = new ClassPathOption()
0888: .evaluate("debug.sourcepath");
0889:
0890: /**
0891: * Whether stepping should step through Java's source files
0892: */
0893: public static final BooleanOption DEBUG_STEP_JAVA = new BooleanOption(
0894: "debug.step.java", Boolean.FALSE);
0895:
0896: /**
0897: * Whether stepping should step through Dynamic Java's source files
0898: */
0899: public static final BooleanOption DEBUG_STEP_INTERPRETER = new BooleanOption(
0900: "debug.step.interpreter", Boolean.FALSE);
0901:
0902: /**
0903: * Whether stepping should step through DrJava's source files
0904: */
0905: public static final BooleanOption DEBUG_STEP_DRJAVA = new BooleanOption(
0906: "debug.step.drjava", Boolean.FALSE);
0907:
0908: /**
0909: * Which packages to exclude when stepping.
0910: */
0911: public static final StringOption DEBUG_STEP_EXCLUDE = new StringOption(
0912: "debug.step.exclude", "");
0913:
0914: /* ---------- Javadoc Options ---------- */
0915:
0916: /**
0917: * Possible options for Javadoc access levels.
0918: */
0919: static final ArrayList<String> accessLevelChoices = AccessLevelChoices
0920: .evaluate();
0921:
0922: static class AccessLevelChoices {
0923: public static ArrayList<String> evaluate() {
0924: ArrayList<String> aList = new ArrayList<String>(4);
0925: aList.add("public");
0926: aList.add("protected");
0927: aList.add("package");
0928: aList.add("private");
0929: return aList;
0930: }
0931: }
0932:
0933: /** The lowest access level of classes and members to include in the javadoc. */
0934: public static final ForcedChoiceOption JAVADOC_ACCESS_LEVEL = new ForcedChoiceOption(
0935: "javadoc.access.level", "package", accessLevelChoices);
0936:
0937: /** Possible options for Javadoc system class documentation links. */
0938: static final String JAVADOC_NONE_TEXT = "none";
0939: static final String JAVADOC_1_3_TEXT = "1.3";
0940: static final String JAVADOC_1_4_TEXT = "1.4";
0941: static final String JAVADOC_1_5_TEXT = "1.5";
0942:
0943: static final String[] choices = new String[] { JAVADOC_NONE_TEXT,
0944: JAVADOC_1_3_TEXT, JAVADOC_1_4_TEXT, JAVADOC_1_5_TEXT };
0945:
0946: static final ArrayList<String> linkVersionChoices = new ArrayList<String>(
0947: Arrays.asList(choices));
0948:
0949: /** Constants for the URLs of Sun's system class documentation for different versions of Java. */
0950: public static final StringOption JAVADOC_1_3_LINK = new StringOption(
0951: "javadoc.1.3.link", "http://java.sun.com/j2se/1.3/docs/api");
0952: public static final StringOption JAVADOC_1_4_LINK = new StringOption(
0953: "javadoc.1.4.link", "http://java.sun.com/j2se/1.4/docs/api");
0954: public static final StringOption JAVADOC_1_5_LINK = new StringOption(
0955: "javadoc.1.5.link", "http://java.sun.com/j2se/1.5/docs/api");
0956:
0957: /** The version of Java to use for links to Javadoc for system classes. */
0958: public static final ForcedChoiceOption JAVADOC_LINK_VERSION = new ForcedChoiceOption(
0959: "javadoc.link.version",
0960: (System.getProperty("java.specification.version").equals(
0961: "1.3") ? JAVADOC_1_3_TEXT
0962: : (System.getProperty("java.specification.version")
0963: .equals("1.4") ? JAVADOC_1_4_TEXT
0964: : JAVADOC_1_5_TEXT)), linkVersionChoices);
0965:
0966: /** Whether to include the entire package heirarchy from the source roots when generating JavaDoc output. */
0967: public static final BooleanOption JAVADOC_FROM_ROOTS = new BooleanOption(
0968: "javadoc.from.roots", Boolean.FALSE);
0969:
0970: /** A string containing custom options to be passed to Javadoc. This needs to be tokenized before passing it to
0971: * Javadoc.
0972: */
0973: public static final StringOption JAVADOC_CUSTOM_PARAMS = new StringOption(
0974: "javadoc.custom.params", "-author -version");
0975:
0976: /** The default destination directory for Javadoc output. */
0977: public static final FileOption JAVADOC_DESTINATION = new FileOption(
0978: "javadoc.destination", FileOption.NULL_FILE);
0979:
0980: /** Whether to always prompt for a destination directory, whether or not a default has been set. */
0981: public static final BooleanOption JAVADOC_PROMPT_FOR_DESTINATION = new BooleanOption(
0982: "javadoc.prompt.for.destination", Boolean.TRUE);
0983:
0984: /* ---------- NOTIFICATION OPTIONS ---------- */
0985:
0986: /** Whether to prompt when the interactions pane is unexpectedly reset. */
0987: public static final BooleanOption INTERACTIONS_EXIT_PROMPT = new BooleanOption(
0988: "interactions.exit.prompt", Boolean.TRUE);
0989:
0990: /** Whether to prompt before quitting DrJava. */
0991: public static final BooleanOption QUIT_PROMPT = new BooleanOption(
0992: "quit.prompt", Boolean.TRUE);
0993:
0994: /** Whether to prompt before resetting the interactions pane. */
0995: public static final BooleanOption INTERACTIONS_RESET_PROMPT = new BooleanOption(
0996: "interactions.reset.prompt", Boolean.TRUE);
0997:
0998: /** Whether to prompt to save before compiling. */
0999: public static final BooleanOption ALWAYS_SAVE_BEFORE_COMPILE = new BooleanOption(
1000: "save.before.compile", Boolean.FALSE);
1001:
1002: /** Whether to prompt to save before running. */
1003: public static final BooleanOption ALWAYS_SAVE_BEFORE_RUN = new BooleanOption(
1004: "save.before.run", Boolean.FALSE);
1005:
1006: /** Whether to prompt to save before testing. */
1007: public static final BooleanOption ALWAYS_COMPILE_BEFORE_JUNIT = new BooleanOption(
1008: "compile.before.junit", Boolean.FALSE);
1009:
1010: /**
1011: * Whether to prompt to save before compiling.
1012: */
1013: public static final BooleanOption ALWAYS_SAVE_BEFORE_JAVADOC = new BooleanOption(
1014: "save.before.javadoc", Boolean.FALSE);
1015:
1016: /** Whether to prompt to save before compiling. */
1017: public static final BooleanOption ALWAYS_SAVE_BEFORE_DEBUG = new BooleanOption(
1018: "save.before.debug", Boolean.FALSE);
1019:
1020: /** Whether to warn if a document has been modified before allowing the user to set a breakpoint in it. */
1021: public static final BooleanOption WARN_BREAKPOINT_OUT_OF_SYNC = new BooleanOption(
1022: "warn.breakpoint.out.of.sync", Boolean.TRUE);
1023:
1024: /** Whether to warn that the user is debugging a file that is out of sync with its class file. */
1025: public static final BooleanOption WARN_DEBUG_MODIFIED_FILE = new BooleanOption(
1026: "warn.debug.modified.file", Boolean.TRUE);
1027:
1028: /** Whether to warn that a restart is necessary before the look and feel will change. */
1029: public static final BooleanOption WARN_CHANGE_LAF = new BooleanOption(
1030: "warn.change.laf", Boolean.TRUE);
1031:
1032: /** Whether to warn that a file's path contains a "#' symbol. */
1033: public static final BooleanOption WARN_PATH_CONTAINS_POUND = new BooleanOption(
1034: "warn.path.contains.pound", Boolean.TRUE);
1035:
1036: /* ---------- MISC OPTIONS ---------- */
1037:
1038: /** Whether to warn when cleaning the build directory */
1039: public static final BooleanOption PROMPT_BEFORE_CLEAN = new BooleanOption(
1040: "prompt.before.clean", Boolean.TRUE);
1041:
1042: /** Open directory should default to recursive */
1043: public static final BooleanOption OPEN_FOLDER_RECURSIVE = new BooleanOption(
1044: "open.folder.recursive", Boolean.FALSE);
1045:
1046: /** How many spaces to use for indenting. */
1047: public static final NonNegativeIntegerOption INDENT_LEVEL = new NonNegativeIntegerOption(
1048: "indent.level", new Integer(2));
1049:
1050: /** Number of lines to remember in the Interactions History */
1051: public static final NonNegativeIntegerOption HISTORY_MAX_SIZE = new NonNegativeIntegerOption(
1052: "history.max.size", new Integer(500));
1053:
1054: /** Number of files to list in the recent file list */
1055: public static final NonNegativeIntegerOption RECENT_FILES_MAX_SIZE = new NonNegativeIntegerOption(
1056: "recent.files.max.size", new Integer(5));
1057:
1058: /** Whether to automatically close comments. */
1059: public static final BooleanOption AUTO_CLOSE_COMMENTS = new BooleanOption(
1060: "auto.close.comments", Boolean.FALSE);
1061:
1062: /** Whether to clear the console when manually resetting the interactions pane. */
1063: public static final BooleanOption RESET_CLEAR_CONSOLE = new BooleanOption(
1064: "reset.clear.console", Boolean.TRUE);
1065:
1066: /** Whether to run assert statements in the interactions pane. */
1067: public static final BooleanOption RUN_WITH_ASSERT = new BooleanOption(
1068: "run.with.assert", Boolean.TRUE);
1069:
1070: /** Whether to make emacs-style backup files. */
1071: public static final BooleanOption BACKUP_FILES = new BooleanOption(
1072: "files.backup", Boolean.TRUE);
1073:
1074: /** Whether to allow users to access to all members in the Interactions Pane. */
1075: public static final BooleanOption ALLOW_PRIVATE_ACCESS = new BooleanOption(
1076: "allow.private.access", Boolean.FALSE);
1077:
1078: /** Whether to force test classes in projects to end in "Test". */
1079: public static final BooleanOption FORCE_TEST_SUFFIX = new BooleanOption(
1080: "force.test.suffix", Boolean.FALSE);
1081:
1082: /** Whether remote control using sockets is enabled. */
1083: public static final BooleanOption REMOTE_CONTROL_ENABLED = new BooleanOption(
1084: "remote.control.enabled", Boolean.TRUE);
1085:
1086: /** The port where DrJava will listen for remote control requests. */
1087: public static final IntegerOption REMOTE_CONTROL_PORT = new IntegerOption(
1088: "remote.control.port", new Integer(4444));
1089:
1090: /* ---------- COMPILER OPTIONS ------------- */
1091:
1092: /** Whether to show unchecked warnings */
1093: public static final BooleanOption SHOW_UNCHECKED_WARNINGS = new BooleanOption(
1094: "show.unchecked.warnings", Boolean.TRUE);
1095:
1096: /** Whether to show deprecation warnings */
1097: public static final BooleanOption SHOW_DEPRECATION_WARNINGS = new BooleanOption(
1098: "show.deprecation.warnings", Boolean.TRUE);
1099:
1100: /** Whether to show finally warnings */
1101: public static final BooleanOption SHOW_FINALLY_WARNINGS = new BooleanOption(
1102: "show.finally.warnings", Boolean.FALSE);
1103:
1104: /** Whether to show serial warnings */
1105: public static final BooleanOption SHOW_SERIAL_WARNINGS = new BooleanOption(
1106: "show.serial.warnings", Boolean.FALSE);
1107:
1108: /** Whether to show serial warnings */
1109: public static final BooleanOption SHOW_FALLTHROUGH_WARNINGS = new BooleanOption(
1110: "show.fallthrough.warnings", Boolean.FALSE);
1111:
1112: /** Whether to show serial warnings */
1113: public static final BooleanOption SHOW_PATH_WARNINGS = new BooleanOption(
1114: "show.path.warnings", Boolean.FALSE);
1115:
1116: /* ---------- UNDISPLAYED OPTIONS ---------- */
1117:
1118: /** The language level to use when starting DrJava. Stores the most recently used one. Defaults to full java. */
1119: public static final IntegerOption LANGUAGE_LEVEL = new IntegerOption(
1120: "language.level", new Integer(0));
1121:
1122: /** A vector containing the most recently used files. */
1123: public static final VectorOption<File> RECENT_FILES = new VectorOption<File>(
1124: "recent.files", new FileOption("", null),
1125: new Vector<File>());
1126:
1127: /** A vector containing the most recently used projects. */
1128: public static final VectorOption<File> RECENT_PROJECTS = new VectorOption<File>(
1129: "recent.projects", new FileOption("", null),
1130: new Vector<File>());
1131:
1132: /** Whether to enabled the Show Debug Console menu item in the Tools menu. */
1133: public static final BooleanOption SHOW_DEBUG_CONSOLE = new BooleanOption(
1134: "show.debug.console", Boolean.FALSE);
1135:
1136: /** Height of MainFrame at startUp. Can be overridden if out of bounds. */
1137: public static final NonNegativeIntegerOption WINDOW_HEIGHT = new NonNegativeIntegerOption(
1138: "window.height", new Integer(700));
1139:
1140: /** Width of MainFrame at startUp. Can be overridden if out of bounds. */
1141: public static final NonNegativeIntegerOption WINDOW_WIDTH = new NonNegativeIntegerOption(
1142: "window.width", new Integer(800));
1143:
1144: /** X position of MainFrame at startUp. Can be overridden if out of bounds. This value can legally be negative in a
1145: * multi-screen setup.
1146: */
1147: public static final IntegerOption WINDOW_X = new IntegerOption(
1148: "window.x", new Integer(Integer.MAX_VALUE));
1149:
1150: /** Y position of MainFrame at startUp. Can be overridden if out of bounds. This value can legally be negative in a
1151: * multi-screen setup.
1152: */
1153: public static final IntegerOption WINDOW_Y = new IntegerOption(
1154: "window.y", new Integer(Integer.MAX_VALUE));
1155:
1156: /** The window state (maxamized or normal). The current window state
1157: * is saved on shutdown.
1158: */
1159: public static final IntegerOption WINDOW_STATE = new IntegerOption(
1160: "window.state", new Integer(Frame.MAXIMIZED_BOTH));
1161:
1162: /** Width of DocList at startUp. Must be less than WINDOW_WIDTH. Can be overridden if out of bounds. */
1163: public static final NonNegativeIntegerOption DOC_LIST_WIDTH = new NonNegativeIntegerOption(
1164: "doc.list.width", new Integer(150));
1165:
1166: /** Height of tabbed panel at startUp. Must be less than WINDOW_HEIGHT + DEBUG_PANEL_HEIGHT. Can be overridden if
1167: * out of bounds.
1168: */
1169: public static final NonNegativeIntegerOption TABS_HEIGHT = new NonNegativeIntegerOption(
1170: "tabs.height", new Integer(120));
1171:
1172: /** Height of debugger panel at startUp. Must be less than WINDOW_HEIGHT + TABS_HEIGHT. Can be overridden if out of
1173: * bounds.
1174: */
1175: public static final NonNegativeIntegerOption DEBUG_PANEL_HEIGHT = new NonNegativeIntegerOption(
1176: "debug.panel.height", new Integer(0));
1177:
1178: /** The directory in use by the file choosers upon the previous quit. */
1179: public static final FileOption LAST_DIRECTORY = new FileOption(
1180: "last.dir", FileOption.NULL_FILE);
1181:
1182: /** The directory in use by the Interactions pane upon the previous quit. */
1183: public static final FileOption LAST_INTERACTIONS_DIRECTORY = new FileOption(
1184: "last.interactions.dir", FileOption.NULL_FILE);
1185:
1186: /** Whether to save and restore Interactions pane directory at startUp/shutdown (sticky=true), or to use
1187: * "user.home" (sticky=false). */
1188: public static final BooleanOption STICKY_INTERACTIONS_DIRECTORY = new BooleanOption(
1189: "sticky.interactions.dir", Boolean.TRUE);
1190:
1191: /** The command-line arguments to be passed to the Master JVM. */
1192: public static final StringOption MASTER_JVM_ARGS = new StringOption(
1193: "master.jvm.args", "");
1194:
1195: /** The command-line arguments to be passed to the Slave JVM. */
1196: public static final StringOption SLAVE_JVM_ARGS = new StringOption(
1197: "slave.jvm.args", "");
1198:
1199: /** The last state of the "Clipboard History" dialog. */
1200: public static final StringOption DIALOG_CLIPBOARD_HISTORY_STATE = new StringOption(
1201: "dialog.clipboard.history.state", "default");
1202:
1203: /** Whether to save and restore window size and position at startUp/shutdown. */
1204: public static final BooleanOption DIALOG_CLIPBOARD_HISTORY_STORE_POSITION = new BooleanOption(
1205: "dialog.clipboardhistory.store.position", Boolean.TRUE);
1206:
1207: /** How many entries are kept in the clipboard history. */
1208: public static final NonNegativeIntegerOption CLIPBOARD_HISTORY_SIZE = new NonNegativeIntegerOption(
1209: "clipboardhistory.store.size", 10);
1210:
1211: /** The last state of the "Go to File" dialog. */
1212: public static final StringOption DIALOG_GOTOFILE_STATE = new StringOption(
1213: "dialog.gotofile.state", "default");
1214:
1215: /** Whether to save and restore window size and position at startUp/shutdown. */
1216: public static final BooleanOption DIALOG_GOTOFILE_STORE_POSITION = new BooleanOption(
1217: "dialog.gotofile.store.position", Boolean.TRUE);
1218:
1219: /** The last state of the "Open Javadoc" dialog. */
1220: public static final StringOption DIALOG_OPENJAVADOC_STATE = new StringOption(
1221: "dialog.openjavadoc.state", "default");
1222:
1223: /** Whether to save and restore window size and position at startUp/shutdown. */
1224: public static final BooleanOption DIALOG_OPENJAVADOC_STORE_POSITION = new BooleanOption(
1225: "dialog.openjavadoc.store.position", Boolean.TRUE);
1226:
1227: /** The last state of the "Auto Import" dialog. */
1228: public static final StringOption DIALOG_AUTOIMPORT_STATE = new StringOption(
1229: "dialog.autoimport.state", "default");
1230:
1231: /** Whether to save and restore window size and position at startUp/shutdown. */
1232: public static final BooleanOption DIALOG_AUTOIMPORT_STORE_POSITION = new BooleanOption(
1233: "dialog.autoimport.store.position", Boolean.TRUE);
1234:
1235: /** Number of entries in the browser history (0 for unlimited). */
1236: public static final NonNegativeIntegerOption BROWSER_HISTORY_MAX_SIZE = new NonNegativeIntegerOption(
1237: "browser.history.max.size", new Integer(50));
1238:
1239: /**
1240: * Whether to also list files with fully qualified paths.
1241: */
1242: public static final BooleanOption DIALOG_GOTOFILE_FULLY_QUALIFIED = new BooleanOption(
1243: "dialog.gotofile.fully.qualified", Boolean.FALSE);
1244:
1245: /** The last state of the "Complete File" dialog. */
1246: public static final StringOption DIALOG_COMPLETE_WORD_STATE = new StringOption(
1247: "dialog.completeword.state", "default");
1248:
1249: /** Whether to save and restore window size and position at startUp/shutdown. */
1250: public static final BooleanOption DIALOG_COMPLETE_WORD_STORE_POSITION = new BooleanOption(
1251: "dialog.completeword.store.position", Boolean.TRUE);
1252:
1253: /** Whether to scan class files for auto-completion class names. */
1254: public static final BooleanOption DIALOG_COMPLETE_SCAN_CLASS_FILES = new BooleanOption(
1255: "dialog.completeword.scan.class.files", Boolean.FALSE);
1256:
1257: // Any lightweight parsing has been disabled until we have something that is beneficial and works better in the background.
1258: /** Whether to perform light-weight parsing. */
1259: public static final BooleanOption LIGHTWEIGHT_PARSING_ENABLED = new BooleanOption(
1260: "lightweight.parsing.enabled", Boolean.FALSE);
1261:
1262: /** Delay for light-weight parsing. */
1263: public static final NonNegativeIntegerOption DIALOG_LIGHTWEIGHT_PARSING_DELAY = new NonNegativeIntegerOption(
1264: "lightweight.parsing.delay", new Integer(500));
1265:
1266: /** The last state of the "Create Jar from Project " dialog. */
1267: public static final StringOption DIALOG_JAROPTIONS_STATE = new StringOption(
1268: "dialog.jaroptions.state", "default");
1269:
1270: /** Whether to save and restore window size and position at startUp/shutdown. */
1271: public static final BooleanOption DIALOG_JAROPTIONS_STORE_POSITION = new BooleanOption(
1272: "dialog.jaroptions.store.position", Boolean.TRUE);
1273:
1274: /** Whether to put the focus in the definitions pane after find/replace. */
1275: public static final BooleanOption FIND_REPLACE_FOCUS_IN_DEFPANE = new BooleanOption(
1276: "find.replace.focus.in.defpane", Boolean.FALSE);
1277:
1278: /** Whether to show a notification popup when the first DrJava error occurs. */
1279: public static final BooleanOption DIALOG_DRJAVA_ERROR_POPUP_ENABLED = new BooleanOption(
1280: "dialog.drjava.error.popup.enabled", Boolean.TRUE);
1281:
1282: /** Whether to show the "code preview" popups in the RegionTreePanels (bookmarks, breakpoints, find all). */
1283: public static final BooleanOption SHOW_CODE_PREVIEW_POPUPS = new BooleanOption(
1284: "show.code.preview.popups", Boolean.TRUE);
1285:
1286: /** Whether to use Runtime.halt to quit DrJava (see bugs 1550220 and 1478796). */
1287: public static final BooleanOption DRJAVA_USE_FORCE_QUIT = new BooleanOption(
1288: "drjava.use.force.quit", Boolean.FALSE);
1289:
1290: /** Whether to display the "Auto Import" dialog when an undefined class
1291: * is encountered in the Interactions Pane. */
1292: public static final BooleanOption DIALOG_AUTOIMPORT_ENABLED = new BooleanOption(
1293: "dialog.autoimport.enabled", Boolean.TRUE);
1294: }
|