001: /*******************************************************************************
002: * Copyright (c) 2006 Andrei Loskutov.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the BSD License
005: * which accompanies this distribution, and is available at
006: * http://www.opensource.org/licenses/bsd-license.php
007: * Contributor: Andrei Loskutov - initial API and implementation
008: *******************************************************************************/package de.loskutov.bco.preferences;
009:
010: import java.util.HashMap;
011: import java.util.Map;
012:
013: /**
014: * Keys for preferences store used in BCO
015: * @author Andrei
016: */
017: public interface BCOConstants {
018: /**
019: * toggle BCO "view content/selection follows editor selection"
020: */
021: String LINK_VIEW_TO_EDITOR = "linkViewToEditor";
022:
023: /**
024: * toggle reference "view content/selection follows editor selection"
025: */
026: String LINK_REF_VIEW_TO_EDITOR = "linkRefViewToEditor";
027:
028: /**
029: * show bytecode only for selected element in editor
030: */
031: String SHOW_ONLY_SELECTED_ELEMENT = "showOnlySelectedElement";
032:
033: /**
034: * show ASMifier java code instead of bytecode
035: */
036: String SHOW_ASMIFIER_CODE = "showASMifierCode";
037:
038: /**
039: * show ASMifier java code instead of bytecode in compare pane
040: */
041: String DIFF_SHOW_ASMIFIER_CODE = "diff_showASMifierCode";
042:
043: /**
044: * show raw bytecode (without any additional help like readable class names etc)
045: */
046: String SHOW_RAW_BYTECODE = "showRawBytecode";
047:
048: /**
049: * show line information (if available)
050: */
051: String SHOW_LINE_INFO = "showLineInfo";
052:
053: /**
054: * show line information (if available) in compare pane
055: */
056: String DIFF_SHOW_LINE_INFO = "diff_showLineInfo";
057:
058: /**
059: * show variables information (if available)
060: */
061: String SHOW_VARIABLES = "showVariables";
062:
063: /**
064: * show variables information (if available) in compare pane
065: */
066: String DIFF_SHOW_VARIABLES = "diff_showVariables";
067:
068: /**
069: * recalculate stackmap (to see computed frames, works for all classes even before MUSTANG)
070: */
071: String SHOW_STACKMAP = "showStackmap";
072:
073: /**
074: * recalculate stackmap (to see computed frames, works for all classes even before MUSTANG) in compare
075: */
076: String DIFF_SHOW_STACKMAP = "diff_showStackmap";
077:
078: /**
079: * expand stackmap frames
080: */
081: String EXPAND_STACKMAP = "expandStackmap";
082:
083: /**
084: * expand stackmap frames in compare pane
085: */
086: String DIFF_EXPAND_STACKMAP = "diff_expandStackmap";
087:
088: /**
089: * recalculate stackmap (to see computed frames, works for all classes even before MUSTANG)
090: */
091: String RECALCULATE_STACKMAP = "recalculateStackmap";
092:
093: /**
094: * show "analyzer" - LVT and stack tables (for current bytecode selection)
095: */
096: String SHOW_ANALYZER = "showAnalyzer";
097:
098: /**
099: * Show non decimal values for numeric constants in the bytecode
100: */
101: String SHOW_HEX_VALUES = "showHexValues";
102:
103: int F_LINK_VIEW_TO_EDITOR = 0;
104: int F_SHOW_ONLY_SELECTED_ELEMENT = 1;
105: int F_SHOW_ASMIFIER_CODE = 2;
106: int F_SHOW_RAW_BYTECODE = 3;
107: int F_SHOW_LINE_INFO = 4;
108: int F_SHOW_VARIABLES = 5;
109: int F_RECALCULATE_STACKMAP = 6;
110: int F_EXPAND_STACKMAP = 7;
111: int F_SHOW_ANALYZER = 8;
112: int F_SHOW_STACKMAP = 9;
113: int F_SHOW_HEX_VALUES = 10;
114:
115: /**
116: * Key is Integer value from one of F_* constants, value is the String value of one of corresponding
117: * preference keys. It is not intended that the map would be modified by clients.
118: */
119: Map/*<Integer,String>*/FLAG_TO_NAME_MAP = new ConstantsMap();
120:
121: final class ConstantsMap extends HashMap {
122: private static final long serialVersionUID = 1L;
123:
124: private ConstantsMap() {
125: super();
126: put(Integer.valueOf(F_EXPAND_STACKMAP), EXPAND_STACKMAP);
127: put(Integer.valueOf(F_LINK_VIEW_TO_EDITOR),
128: LINK_VIEW_TO_EDITOR);
129: put(Integer.valueOf(F_RECALCULATE_STACKMAP),
130: RECALCULATE_STACKMAP);
131: put(Integer.valueOf(F_SHOW_ANALYZER), SHOW_ANALYZER);
132: put(Integer.valueOf(F_SHOW_ASMIFIER_CODE),
133: SHOW_ASMIFIER_CODE);
134: put(Integer.valueOf(F_SHOW_HEX_VALUES), SHOW_HEX_VALUES);
135: put(Integer.valueOf(F_SHOW_LINE_INFO), SHOW_LINE_INFO);
136: put(Integer.valueOf(F_SHOW_ONLY_SELECTED_ELEMENT),
137: SHOW_ONLY_SELECTED_ELEMENT);
138: put(Integer.valueOf(F_SHOW_RAW_BYTECODE), SHOW_RAW_BYTECODE);
139: put(Integer.valueOf(F_SHOW_STACKMAP), SHOW_STACKMAP);
140: put(Integer.valueOf(F_SHOW_VARIABLES), SHOW_VARIABLES);
141: }
142: }
143: }
|