001: package tide.editor;
002:
003: import javax.swing.KeyStroke;
004: import java.awt.event.KeyEvent;
005:
006: /** Some shared accelerators. To keep an overview.
007: */
008: public final class Accelerators {
009: private Accelerators() {
010: }
011:
012: // global
013: final public static KeyStroke compileWholeProject = KeyStroke
014: .getKeyStroke(KeyEvent.VK_F9, 0, false);
015: //final public static KeyStroke compileWholeProject2 = KeyStroke.getKeyStroke(KeyEvent.VK_F9, 0, false);
016: final public static KeyStroke compileChangedFiles = KeyStroke
017: .getKeyStroke(KeyEvent.VK_F9, KeyEvent.SHIFT_MASK, false);
018: final public static KeyStroke runProject = KeyStroke.getKeyStroke(
019: KeyEvent.VK_F10, 0, false);
020: final public static KeyStroke runSelected = KeyStroke.getKeyStroke(
021: KeyEvent.VK_F10, KeyEvent.SHIFT_MASK, false);
022: final public static KeyStroke saveChangedFiles = KeyStroke
023: .getKeyStroke(KeyEvent.VK_S, KeyEvent.CTRL_MASK);
024: final public static KeyStroke searchRunnables = KeyStroke
025: .getKeyStroke(KeyEvent.VK_R, KeyEvent.CTRL_MASK
026: | KeyEvent.SHIFT_MASK); //TODO
027:
028: final public static KeyStroke moveTabLeft = KeyStroke.getKeyStroke(
029: KeyEvent.VK_LEFT, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK,
030: false);
031: final public static KeyStroke moveTabRight = KeyStroke
032: .getKeyStroke(KeyEvent.VK_RIGHT, KeyEvent.ALT_MASK
033: | KeyEvent.SHIFT_MASK, false);
034: final public static KeyStroke moveTabPos1 = KeyStroke.getKeyStroke(
035: KeyEvent.VK_1, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK,
036: false);
037: final public static KeyStroke selectPreviousTab = KeyStroke
038: .getKeyStroke(KeyEvent.VK_LEFT, KeyEvent.ALT_MASK, false);
039: final public static KeyStroke selectNextTab = KeyStroke
040: .getKeyStroke(KeyEvent.VK_RIGHT, KeyEvent.ALT_MASK, false);
041:
042: final public static KeyStroke manageBookmarks = KeyStroke
043: .getKeyStroke(KeyEvent.VK_B, KeyEvent.CTRL_MASK);
044: final public static KeyStroke addBookmark = KeyStroke.getKeyStroke(
045: KeyEvent.VK_B, KeyEvent.CTRL_MASK | KeyEvent.SHIFT_MASK);
046: final public static KeyStroke exportProject = KeyStroke
047: .getKeyStroke(KeyEvent.VK_E, KeyEvent.CTRL_MASK);
048: final public static KeyStroke generateJarFile = KeyStroke
049: .getKeyStroke(KeyEvent.VK_J, KeyEvent.CTRL_MASK);
050: final public static KeyStroke generateDocumentation = KeyStroke
051: .getKeyStroke(KeyEvent.VK_D, KeyEvent.CTRL_MASK);
052: final public static KeyStroke projectSettings = KeyStroke
053: .getKeyStroke(KeyEvent.VK_P, KeyEvent.CTRL_MASK
054: | KeyEvent.SHIFT_MASK);
055:
056: final public static KeyStroke viewMessages = KeyStroke
057: .getKeyStroke(KeyEvent.VK_M, KeyEvent.CTRL_MASK, false);
058: final public static KeyStroke viewMessagesOfSelected = KeyStroke
059: .getKeyStroke(KeyEvent.VK_M, KeyEvent.CTRL_MASK
060: | KeyEvent.SHIFT_MASK, false);
061:
062: // editor
063: final public static KeyStroke undo = KeyStroke.getKeyStroke(
064: KeyEvent.VK_Z, KeyEvent.CTRL_MASK, false);
065: final public static KeyStroke redo = KeyStroke.getKeyStroke(
066: KeyEvent.VK_R, KeyEvent.CTRL_MASK, false);
067: final public static KeyStroke copy = KeyStroke.getKeyStroke(
068: KeyEvent.VK_C, KeyEvent.CTRL_MASK, false);
069: final public static KeyStroke paste = KeyStroke.getKeyStroke(
070: KeyEvent.VK_V, KeyEvent.CTRL_MASK, false);
071:
072: //[Feb2008] never used... final public static KeyStroke toUppercaseWord = KeyStroke.getKeyStroke(KeyEvent.VK_U, KeyEvent.CTRL_MASK | KeyEvent.SHIFT_MASK);
073: final public static KeyStroke deleteLine = KeyStroke.getKeyStroke(
074: KeyEvent.VK_DELETE, KeyEvent.CTRL_MASK);
075: final public static KeyStroke indentLine = KeyStroke.getKeyStroke(
076: KeyEvent.VK_I, KeyEvent.CTRL_MASK);
077: final public static KeyStroke unindentLine = KeyStroke
078: .getKeyStroke(KeyEvent.VK_U, KeyEvent.CTRL_MASK);
079: final public static KeyStroke commentOutLines = KeyStroke
080: .getKeyStroke(KeyEvent.VK_C, KeyEvent.CTRL_MASK
081: | KeyEvent.SHIFT_MASK);
082: final public static KeyStroke uncommentOutLines = KeyStroke
083: .getKeyStroke(KeyEvent.VK_C, KeyEvent.CTRL_MASK
084: | KeyEvent.SHIFT_MASK | KeyEvent.ALT_MASK);
085:
086: //up-downs
087: // shift up down is already set in the editor
088: // ALT for occ
089: final public static KeyStroke nextOccurence = KeyStroke
090: .getKeyStroke(KeyEvent.VK_DOWN, KeyEvent.ALT_MASK, false);
091: final public static KeyStroke previousOccurence = KeyStroke
092: .getKeyStroke(KeyEvent.VK_UP, KeyEvent.ALT_MASK, false);
093:
094: // Ctrl for line messages
095: final public static KeyStroke jumpToNextMessage = KeyStroke
096: .getKeyStroke(KeyEvent.VK_DOWN, KeyEvent.CTRL_MASK, false);
097: final public static KeyStroke jumpToPreviousMessage = KeyStroke
098: .getKeyStroke(KeyEvent.VK_UP, KeyEvent.CTRL_MASK, false);
099: final public static KeyStroke jumpToFirstMessage = KeyStroke
100: .getKeyStroke(KeyEvent.VK_1, KeyEvent.CTRL_MASK, false);
101: final public static KeyStroke jumpToLastMessage = KeyStroke
102: .getKeyStroke(KeyEvent.VK_9, KeyEvent.CTRL_MASK, false);
103:
104: // ctrl shift to jump to next/prev method/field (not yet perfect...)
105: final public static KeyStroke jumpToNextAttr = KeyStroke
106: .getKeyStroke(KeyEvent.VK_DOWN, KeyEvent.CTRL_MASK
107: | KeyEvent.SHIFT_MASK, false);
108: final public static KeyStroke jumpToPreviousAttr = KeyStroke
109: .getKeyStroke(KeyEvent.VK_UP, KeyEvent.CTRL_MASK
110: | KeyEvent.SHIFT_MASK, false);
111:
112: final public static KeyStroke decreaseFontSize = KeyStroke
113: .getKeyStroke(KeyEvent.VK_DOWN, KeyEvent.CTRL_MASK
114: | KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK, false);
115: final public static KeyStroke increaseFontSize = KeyStroke
116: .getKeyStroke(KeyEvent.VK_UP, KeyEvent.CTRL_MASK
117: | KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK, false);
118:
119: // writes this.XX = XX, "int XX, ..." being the clipboard vars.
120: final public static KeyStroke assignMember = KeyStroke
121: .getKeyStroke(KeyEvent.VK_A, KeyEvent.ALT_MASK, false);
122: // finalize: inserts the text of a list of variables, with final added.
123: final public static KeyStroke prependFinal = KeyStroke
124: .getKeyStroke(KeyEvent.VK_F, KeyEvent.ALT_MASK, false); // TODO
125: // from a list of args, create a class declaration.
126: final public static KeyStroke insertClassMembDeclForArgs = KeyStroke
127: .getKeyStroke(KeyEvent.VK_L, KeyEvent.ALT_MASK, false);
128:
129: // ctrl alt to jump to next/prev source in tree
130: final public static KeyStroke jumpToNextSrc = KeyStroke
131: .getKeyStroke(KeyEvent.VK_DOWN, KeyEvent.CTRL_MASK
132: | KeyEvent.ALT_MASK, false);
133: final public static KeyStroke jumpToPreviousSrc = KeyStroke
134: .getKeyStroke(KeyEvent.VK_UP, KeyEvent.CTRL_MASK
135: | KeyEvent.ALT_MASK, false);
136:
137: // jump history
138: final public static KeyStroke previousJumpPos = KeyStroke
139: .getKeyStroke(KeyEvent.VK_LEFT, KeyEvent.ALT_MASK
140: | KeyEvent.CTRL_MASK, false);
141: final public static KeyStroke nextJumpPos = KeyStroke.getKeyStroke(
142: KeyEvent.VK_RIGHT, KeyEvent.ALT_MASK | KeyEvent.CTRL_MASK,
143: false);
144:
145: // search has many various usages, context based
146: final public static KeyStroke search = KeyStroke.getKeyStroke(
147: KeyEvent.VK_F, KeyEvent.CTRL_MASK, false);
148: final public static KeyStroke searchFirstOcc = KeyStroke
149: .getKeyStroke(KeyEvent.VK_1, KeyEvent.ALT_MASK, false);
150: final public static KeyStroke searchLastOcc = KeyStroke
151: .getKeyStroke(KeyEvent.VK_9, KeyEvent.ALT_MASK, false);
152: final public static KeyStroke escape = KeyStroke.getKeyStroke(
153: KeyEvent.VK_ESCAPE, 0, false);
154: final public static KeyStroke closeCurrentTab = KeyStroke
155: .getKeyStroke(KeyEvent.VK_W, KeyEvent.CTRL_MASK, false);
156: final public static KeyStroke scanExtFileChanges = KeyStroke
157: .getKeyStroke(KeyEvent.VK_F5, 0, false);
158: //KeyStroke.getKeyStroke(KeyEvent.VK_R, KeyEvent.CTRL_MASK|KeyEvent.SHIFT_MASK, false);
159:
160: final public static KeyStroke internalFilesExplorer = KeyStroke
161: .getKeyStroke(KeyEvent.VK_E, KeyEvent.CTRL_MASK
162: | KeyEvent.SHIFT_MASK, false);
163: final public static KeyStroke internalResourcesExplorer = KeyStroke
164: .getKeyStroke(KeyEvent.VK_R, KeyEvent.CTRL_MASK
165: | KeyEvent.SHIFT_MASK, false);
166:
167: final public static KeyStroke globalSearch = KeyStroke
168: .getKeyStroke(KeyEvent.VK_G, KeyEvent.CTRL_MASK, false);
169: final public static KeyStroke searchInPackage = KeyStroke
170: .getKeyStroke(KeyEvent.VK_P, KeyEvent.CTRL_MASK, false);
171:
172: final public static KeyStroke globalProjectFilenameSearch = KeyStroke
173: .getKeyStroke(KeyEvent.VK_G, KeyEvent.CTRL_MASK
174: | KeyEvent.SHIFT_MASK, false);
175:
176: final public static KeyStroke highlightAllOccurences = KeyStroke
177: .getKeyStroke(KeyEvent.VK_K, KeyEvent.CTRL_MASK, false);
178: final public static KeyStroke jumpToLineNumber = KeyStroke
179: .getKeyStroke(KeyEvent.VK_L, KeyEvent.CTRL_MASK, false);
180:
181: final public static KeyStroke insertTypeCompletion = KeyStroke
182: .getKeyStroke(KeyEvent.VK_T, KeyEvent.CTRL_MASK, false);
183: final public static KeyStroke insertTypeCompletionProjectOnly = KeyStroke
184: .getKeyStroke(KeyEvent.VK_T, KeyEvent.CTRL_MASK
185: | KeyEvent.SHIFT_MASK, false);
186:
187: // dot without completion trig ( NOT KeyEvent.VK_STOP !! )
188: final public static KeyStroke dotWithoutCompletion = KeyStroke
189: .getKeyStroke(KeyEvent.VK_PERIOD, KeyEvent.CTRL_MASK, false);
190: final public static KeyStroke manualCompletion = KeyStroke
191: .getKeyStroke(KeyEvent.VK_SPACE, KeyEvent.CTRL_MASK, false);
192: final public static KeyStroke liberateResources = KeyStroke
193: .getKeyStroke(KeyEvent.VK_L, KeyEvent.CTRL_MASK
194: | KeyEvent.SHIFT_MASK, false);
195:
196: // Utilities
197: final public static KeyStroke uiKeysExplorer = KeyStroke
198: .getKeyStroke(KeyEvent.VK_U, KeyEvent.CTRL_MASK
199: | KeyEvent.ALT_MASK);
200: final public static KeyStroke systemPropsExplorer = KeyStroke
201: .getKeyStroke(KeyEvent.VK_P, KeyEvent.CTRL_MASK
202: | KeyEvent.ALT_MASK);
203: }
|