~ubuntu-branches/debian/stretch/insubstantial/stretch

« back to all changes in this revision

Viewing changes to substance/src/main/java/org/pushingpixels/substance/internal/inputmaps/AquaInputMapSet.java

  • Committer: Package Import Robot
  • Author(s): Felix Natter
  • Date: 2016-01-18 20:58:45 UTC
  • Revision ID: package-import@ubuntu.com-20160118205845-crbmrkda61qsi5qa
Tags: upstream-7.3+dfsg2
ImportĀ upstreamĀ versionĀ 7.3+dfsg2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 2005-2010 Substance Kirill Grouchnikov. All Rights Reserved.
 
3
 *
 
4
 * Redistribution and use in source and binary forms, with or without
 
5
 * modification, are permitted provided that the following conditions are met:
 
6
 *
 
7
 *  o Redistributions of source code must retain the above copyright notice,
 
8
 *    this list of conditions and the following disclaimer.
 
9
 *
 
10
 *  o Redistributions in binary form must reproduce the above copyright notice,
 
11
 *    this list of conditions and the following disclaimer in the documentation
 
12
 *    and/or other materials provided with the distribution.
 
13
 *
 
14
 *  o Neither the name of Substance Kirill Grouchnikov nor the names of
 
15
 *    its contributors may be used to endorse or promote products derived
 
16
 *    from this software without specific prior written permission.
 
17
 *
 
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 
19
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 
20
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 
21
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 
22
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 
23
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 
24
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 
25
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 
26
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
 
27
 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 
28
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
29
 */
 
30
package org.pushingpixels.substance.internal.inputmaps;
 
31
 
 
32
import javax.swing.JTextField;
 
33
import javax.swing.text.DefaultEditorKit;
 
34
 
 
35
import org.pushingpixels.substance.api.inputmaps.SubstanceInputMap;
 
36
 
 
37
public class AquaInputMapSet extends BaseInputMapSet {
 
38
        @Override
 
39
        public SubstanceInputMap getComboBoxAncestorInputMap() {
 
40
                // All entries in Aqua are "aqua" except ESCAPE mapped to "hidePopup"
 
41
                return super.getComboBoxAncestorInputMap();
 
42
        }
 
43
 
 
44
        protected SubstanceInputMap getSingleLineTextComponentFocusInputMap() {
 
45
                SubstanceInputMap result = new SubstanceInputMap();
 
46
 
 
47
                result.put("meta C", DefaultEditorKit.copyAction);
 
48
                result.put("meta V", DefaultEditorKit.pasteAction);
 
49
                result.put("meta X", DefaultEditorKit.cutAction);
 
50
                result.put("COPY", DefaultEditorKit.copyAction);
 
51
                result.put("PASTE", DefaultEditorKit.pasteAction);
 
52
                result.put("CUT", DefaultEditorKit.cutAction);
 
53
 
 
54
                result.put("shift LEFT", DefaultEditorKit.selectionBackwardAction);
 
55
                result.put("shift KP_LEFT", DefaultEditorKit.selectionBackwardAction);
 
56
                result.put("shift RIGHT", DefaultEditorKit.selectionForwardAction);
 
57
                result.put("shift KP_RIGHT", DefaultEditorKit.selectionForwardAction);
 
58
 
 
59
                result.put("meta LEFT", DefaultEditorKit.beginLineAction);
 
60
                result.put("meta KP_LEFT", DefaultEditorKit.beginLineAction);
 
61
                result.put("ctrl A", DefaultEditorKit.beginLineAction);
 
62
                result.put("UP", DefaultEditorKit.beginLineAction);
 
63
                result.put("KP_UP", DefaultEditorKit.beginLineAction);
 
64
                result.put("meta RIGHT", DefaultEditorKit.endLineAction);
 
65
                result.put("meta KP_RIGHT", DefaultEditorKit.endLineAction);
 
66
                result.put("ctrl E", DefaultEditorKit.endLineAction);
 
67
                result.put("DOWN", DefaultEditorKit.endLineAction);
 
68
                result.put("KP_DOWN", DefaultEditorKit.endLineAction);
 
69
 
 
70
                result
 
71
                                .put("meta shift LEFT",
 
72
                                                DefaultEditorKit.selectionBeginLineAction);
 
73
                result.put("meta shift KP_LEFT",
 
74
                                DefaultEditorKit.selectionBeginLineAction);
 
75
                result.put("shift UP", DefaultEditorKit.selectionBeginLineAction);
 
76
                result.put("shift KP_UP", DefaultEditorKit.selectionBeginLineAction);
 
77
                result.put("meta shift RIGHT", DefaultEditorKit.selectionEndLineAction);
 
78
                result.put("meta shift KP_RIGHT",
 
79
                                DefaultEditorKit.selectionEndLineAction);
 
80
                result.put("shift DOWN", DefaultEditorKit.selectionEndLineAction);
 
81
                result.put("shift KP_DOWN", DefaultEditorKit.selectionEndLineAction);
 
82
 
 
83
                result.put("meta A", DefaultEditorKit.selectAllAction);
 
84
 
 
85
                result.put("HOME", DefaultEditorKit.beginAction);
 
86
                result.put("ctrl P", DefaultEditorKit.beginAction);
 
87
                result.put("meta UP", DefaultEditorKit.beginAction);
 
88
                result.put("meta KP_UP", DefaultEditorKit.beginAction);
 
89
                result.put("END", DefaultEditorKit.endAction);
 
90
                result.put("ctrl N", DefaultEditorKit.endAction);
 
91
                result.put("ctrl V", DefaultEditorKit.endAction);
 
92
                result.put("meta DOWN", DefaultEditorKit.endAction);
 
93
                result.put("meta KP_DOWN", DefaultEditorKit.endAction);
 
94
 
 
95
                result.put("shift meta KP_UP", DefaultEditorKit.selectionBeginAction);
 
96
                result.put("shift UP", DefaultEditorKit.selectionBeginAction);
 
97
                result.put("shift HOME", DefaultEditorKit.selectionBeginAction);
 
98
                result.put("shift meta DOWN", DefaultEditorKit.selectionEndAction);
 
99
                result.put("shift meta KP_DOWN", DefaultEditorKit.selectionEndAction);
 
100
                result.put("shift END", DefaultEditorKit.selectionEndAction);
 
101
 
 
102
                result.put("BACK_SPACE", DefaultEditorKit.deletePrevCharAction);
 
103
                result.put("ctrl H", DefaultEditorKit.deletePrevCharAction);
 
104
                result.put("DELETE", DefaultEditorKit.deleteNextCharAction);
 
105
                result.put("ctrl D", DefaultEditorKit.deleteNextCharAction);
 
106
                result.put("alt BACK_SPACE", DefaultEditorKit.deletePrevWordAction);
 
107
                result.put("ctrl W", DefaultEditorKit.deletePrevWordAction);
 
108
                result.put("alt DELETE", DefaultEditorKit.deleteNextWordAction);
 
109
 
 
110
                result.put("RIGHT", DefaultEditorKit.forwardAction);
 
111
                result.put("KP_RIGHT", DefaultEditorKit.forwardAction);
 
112
                result.put("ctrl F", DefaultEditorKit.forwardAction);
 
113
                result.put("LEFT", DefaultEditorKit.backwardAction);
 
114
                result.put("KP_LEFT", DefaultEditorKit.backwardAction);
 
115
                result.put("ctrl B", DefaultEditorKit.backwardAction);
 
116
 
 
117
                result.put("alt RIGHT", DefaultEditorKit.nextWordAction);
 
118
                result.put("alt KP_RIGHT", DefaultEditorKit.nextWordAction);
 
119
                result.put("alt LEFT", DefaultEditorKit.previousWordAction);
 
120
                result.put("alt KP_LEFT", DefaultEditorKit.previousWordAction);
 
121
 
 
122
                result.put("shift alt RIGHT", DefaultEditorKit.selectionNextWordAction);
 
123
                result.put("shift alt KP_RIGHT",
 
124
                                DefaultEditorKit.selectionNextWordAction);
 
125
                result.put("shift alt LEFT",
 
126
                                DefaultEditorKit.selectionPreviousWordAction);
 
127
                result.put("shift alt KP_LEFT",
 
128
                                DefaultEditorKit.selectionPreviousWordAction);
 
129
 
 
130
                result.put("shift meta PAGE_UP",
 
131
                                TextComponentActions.SELECTION_PAGE_LEFT);
 
132
                result.put("shift meta PAGE_DOWN",
 
133
                                TextComponentActions.SELECTION_PAGE_RIGHT);
 
134
                result
 
135
                                .put("shift meta PAGE_UP",
 
136
                                                TextComponentActions.SELECTION_PAGE_UP);
 
137
                result.put("shift meta PAGE_DOWN",
 
138
                                TextComponentActions.SELECTION_PAGE_DOWN);
 
139
 
 
140
                result.put("ENTER", JTextField.notifyAction);
 
141
                result.put("meta BACK_SLASH", TextComponentActions.UNSELECT);
 
142
                result.put("control shift O",
 
143
                                TextComponentActions.TOGGLE_COMPONENT_ORIENTATION);
 
144
 
 
145
                // XXX: in Aqua these are aqua-page-down and aqua-page-up
 
146
                result.put("PAGE_DOWN", DefaultEditorKit.pageDownAction);
 
147
                result.put("PAGE_UP", DefaultEditorKit.pageUpAction);
 
148
 
 
149
                return result;
 
150
        }
 
151
 
 
152
        @Override
 
153
        protected SubstanceInputMap getMultilineTextComponentFocusInputMap() {
 
154
                // This is used in EditorPane, TextArea and TextPane. Almost
 
155
                // all key strokes can be mapped to the same basic actions used in Aqua.
 
156
                // There are 7 key strokes that use Aqua-specific actions. These
 
157
                // are mapped to the closest basic actions.
 
158
                SubstanceInputMap result = new SubstanceInputMap();
 
159
 
 
160
                result.put("meta C", DefaultEditorKit.copyAction);
 
161
                result.put("meta V", DefaultEditorKit.pasteAction);
 
162
                result.put("meta X", DefaultEditorKit.cutAction);
 
163
                result.put("COPY", DefaultEditorKit.copyAction);
 
164
                result.put("PASTE", DefaultEditorKit.pasteAction);
 
165
                result.put("CUT", DefaultEditorKit.cutAction);
 
166
 
 
167
                result.put("shift LEFT", DefaultEditorKit.selectionBackwardAction);
 
168
                result.put("shift KP_LEFT", DefaultEditorKit.selectionBackwardAction);
 
169
                result.put("shift RIGHT", DefaultEditorKit.selectionForwardAction);
 
170
                result.put("shift KP_RIGHT", DefaultEditorKit.selectionForwardAction);
 
171
                result.put("alt LEFT", DefaultEditorKit.previousWordAction);
 
172
                result.put("alt KP_LEFT", DefaultEditorKit.previousWordAction);
 
173
                result.put("alt RIGHT", DefaultEditorKit.nextWordAction);
 
174
                result.put("alt KP_RIGHT", DefaultEditorKit.nextWordAction);
 
175
                result.put("alt shift LEFT",
 
176
                                DefaultEditorKit.selectionPreviousWordAction);
 
177
                result.put("alt shift KP_LEFT",
 
178
                                DefaultEditorKit.selectionPreviousWordAction);
 
179
                result.put("alt shift RIGHT", DefaultEditorKit.selectionNextWordAction);
 
180
                result.put("alt shift KP_RIGHT",
 
181
                                DefaultEditorKit.selectionNextWordAction);
 
182
 
 
183
                result.put("meta A", DefaultEditorKit.selectAllAction);
 
184
                result.put("ctrl A", DefaultEditorKit.beginLineAction);
 
185
                result.put("meta KP_LEFT", DefaultEditorKit.beginLineAction);
 
186
                result.put("meta LEFT", DefaultEditorKit.beginLineAction);
 
187
                result.put("ctrl E", DefaultEditorKit.endLineAction);
 
188
                result.put("meta KP_RIGHT", DefaultEditorKit.endLineAction);
 
189
                result.put("meta RIGHT", DefaultEditorKit.endLineAction);
 
190
 
 
191
                result.put("shift meta KP_LEFT",
 
192
                                DefaultEditorKit.selectionBeginLineAction);
 
193
                result
 
194
                                .put("shift meta LEFT",
 
195
                                                DefaultEditorKit.selectionBeginLineAction);
 
196
                result.put("shift meta KP_RIGHT",
 
197
                                DefaultEditorKit.selectionEndLineAction);
 
198
                result.put("shift meta RIGHT", DefaultEditorKit.selectionEndLineAction);
 
199
 
 
200
                result.put("ctrl P", DefaultEditorKit.upAction);
 
201
                result.put("ctrl N", DefaultEditorKit.downAction);
 
202
                // XXX: these are actually mapped to aqua-move-up and aqua-move-down
 
203
                result.put("UP", DefaultEditorKit.upAction);
 
204
                result.put("KP_UP", DefaultEditorKit.upAction);
 
205
                result.put("DOWN", DefaultEditorKit.downAction);
 
206
                result.put("KP_DOWN", DefaultEditorKit.downAction);
 
207
                // XXX: these are actually mapped to aqua-page-up and aqua-page-down
 
208
                result.put("PAGE_UP", DefaultEditorKit.pageUpAction);
 
209
                result.put("PAGE_DOWN", DefaultEditorKit.pageDownAction);
 
210
                result.put("ctrl V", DefaultEditorKit.pageDownAction);
 
211
 
 
212
                result.put("shift PAGE_UP", TextComponentActions.SELECTION_PAGE_UP);
 
213
                result.put("shift PAGE_DOWN", TextComponentActions.SELECTION_PAGE_DOWN);
 
214
                result.put("meta shift PAGE_UP",
 
215
                                TextComponentActions.SELECTION_PAGE_LEFT);
 
216
                result.put("meta shift PAGE_DOWN",
 
217
                                TextComponentActions.SELECTION_PAGE_RIGHT);
 
218
                result.put("shift UP", DefaultEditorKit.selectionUpAction);
 
219
                result.put("shift KP_UP", DefaultEditorKit.selectionUpAction);
 
220
                result.put("shift DOWN", DefaultEditorKit.selectionDownAction);
 
221
                result.put("shift KP_DOWN", DefaultEditorKit.selectionDownAction);
 
222
 
 
223
                result.put("meta shift KP_UP", DefaultEditorKit.selectionBeginAction);
 
224
                result.put("meta shift UP", DefaultEditorKit.selectionBeginAction);
 
225
                result.put("shift HOME", DefaultEditorKit.selectionBeginAction);
 
226
                result.put("meta shift KP_DOWN", DefaultEditorKit.selectionEndAction);
 
227
                result.put("meta shift DOWN", DefaultEditorKit.selectionEndAction);
 
228
                result.put("shift END", DefaultEditorKit.selectionEndAction);
 
229
 
 
230
                result.put("shift alt KP_UP",
 
231
                                DefaultEditorKit.selectionBeginParagraphAction);
 
232
                result.put("shift alt UP",
 
233
                                DefaultEditorKit.selectionBeginParagraphAction);
 
234
                result.put("shift alt KP_DOWN",
 
235
                                DefaultEditorKit.selectionEndParagraphAction);
 
236
                result.put("shift alt DOWN",
 
237
                                DefaultEditorKit.selectionEndParagraphAction);
 
238
 
 
239
                result.put("ENTER", DefaultEditorKit.insertBreakAction);
 
240
                result.put("BACK_SPACE", DefaultEditorKit.deletePrevCharAction);
 
241
                result.put("ctrl H", DefaultEditorKit.deletePrevCharAction);
 
242
                result.put("DELETE", DefaultEditorKit.deleteNextCharAction);
 
243
                result.put("ctrl D", DefaultEditorKit.deleteNextCharAction);
 
244
                result.put("alt DELETE", DefaultEditorKit.deleteNextWordAction);
 
245
                result.put("alt BACK_SPACE", DefaultEditorKit.deletePrevWordAction);
 
246
                result.put("ctrl W", DefaultEditorKit.deletePrevWordAction);
 
247
 
 
248
                result.put("RIGHT", DefaultEditorKit.forwardAction);
 
249
                result.put("KP_RIGHT", DefaultEditorKit.forwardAction);
 
250
                result.put("ctrl F", DefaultEditorKit.forwardAction);
 
251
                result.put("LEFT", DefaultEditorKit.backwardAction);
 
252
                result.put("KP_LEFT", DefaultEditorKit.backwardAction);
 
253
                result.put("ctrl B", DefaultEditorKit.backwardAction);
 
254
                result.put("TAB", DefaultEditorKit.insertTabAction);
 
255
                result.put("meta BACK_SLASH", TextComponentActions.UNSELECT);
 
256
 
 
257
                result.put("meta KP_UP", DefaultEditorKit.beginAction);
 
258
                result.put("meta UP", DefaultEditorKit.beginAction);
 
259
                result.put("HOME", DefaultEditorKit.beginAction);
 
260
                result.put("meta KP_DOWN", DefaultEditorKit.endAction);
 
261
                result.put("meta DOWN", DefaultEditorKit.endAction);
 
262
                result.put("END", DefaultEditorKit.endAction);
 
263
 
 
264
                result.put("meta T", TextComponentActions.NEXT_LINK);
 
265
                result.put("meta shift T", TextComponentActions.PREVIOUS_LINK);
 
266
                result.put("meta SPACE", TextComponentActions.ACTIVATE_LINK);
 
267
                result.put("control shift O",
 
268
                                TextComponentActions.TOGGLE_COMPONENT_ORIENTATION);
 
269
 
 
270
                return result;
 
271
        }
 
272
 
 
273
        @Override
 
274
        public SubstanceInputMap getFileChooserAncestorInputMap() {
 
275
                SubstanceInputMap result = new SubstanceInputMap();
 
276
 
 
277
                result.put("ESCAPE", FileChooserActions.CANCEL_SELECTION);
 
278
                result.put("F5", FileChooserActions.REFRESH);
 
279
 
 
280
                return result;
 
281
        }
 
282
 
 
283
        @Override
 
284
        public SubstanceInputMap getListFocusInputMap() {
 
285
                SubstanceInputMap result = new SubstanceInputMap();
 
286
 
 
287
                result.put("meta C", COPY);
 
288
                result.put("meta V", PASTE);
 
289
                result.put("meta X", CUT);
 
290
                result.put("COPY", COPY);
 
291
                result.put("PASTE", PASTE);
 
292
                result.put("CUT", CUT);
 
293
 
 
294
                result.put("UP", ListActions.SELECT_PREVIOUS_ROW);
 
295
                result.put("KP_UP", ListActions.SELECT_PREVIOUS_ROW);
 
296
                result.put("shift UP", ListActions.SELECT_PREVIOUS_ROW_EXTEND);
 
297
                result.put("shift KP_UP", ListActions.SELECT_PREVIOUS_ROW_EXTEND);
 
298
 
 
299
                result.put("DOWN", ListActions.SELECT_NEXT_ROW);
 
300
                result.put("KP_DOWN", ListActions.SELECT_NEXT_ROW);
 
301
                result.put("shift DOWN", ListActions.SELECT_NEXT_ROW_EXTEND);
 
302
                result.put("shift KP_DOWN", ListActions.SELECT_NEXT_ROW_EXTEND);
 
303
 
 
304
                result.put("LEFT", ListActions.SELECT_PREVIOUS_COLUMN);
 
305
                result.put("KP_LEFT", ListActions.SELECT_PREVIOUS_COLUMN);
 
306
                result.put("shift LEFT", ListActions.SELECT_PREVIOUS_COLUMN_EXTEND);
 
307
                result.put("shift KP_LEFT", ListActions.SELECT_PREVIOUS_COLUMN_EXTEND);
 
308
 
 
309
                result.put("RIGHT", ListActions.SELECT_NEXT_COLUMN);
 
310
                result.put("KP_RIGHT", ListActions.SELECT_NEXT_COLUMN);
 
311
                result.put("shift RIGHT", ListActions.SELECT_NEXT_COLUMN_EXTEND);
 
312
                result.put("shift KP_RIGHT", ListActions.SELECT_NEXT_COLUMN_EXTEND);
 
313
 
 
314
                result.put("shift HOME", ListActions.SELECT_FIRST_ROW_EXTEND);
 
315
                result.put("shift END", ListActions.SELECT_LAST_ROW_EXTEND);
 
316
 
 
317
                result.put("shift PAGE_UP", ListActions.SCROLL_UP_EXTEND);
 
318
                result.put("shift PAGE_DOWN", ListActions.SCROLL_DOWN_EXTEND);
 
319
 
 
320
                result.put("meta A", ListActions.SELECT_ALL);
 
321
 
 
322
                // XXX: missing:
 
323
                // END -> aquaEnd
 
324
                // HOME -> aquaHome
 
325
 
 
326
                return result;
 
327
        }
 
328
 
 
329
        @Override
 
330
        public SubstanceInputMap getPasswordFieldFocusInputMap() {
 
331
                return this.getSingleLineTextComponentFocusInputMap();
 
332
        }
 
333
 
 
334
        @Override
 
335
        public SubstanceInputMap getScrollPaneAncestorInputMap() {
 
336
                SubstanceInputMap result = new SubstanceInputMap();
 
337
 
 
338
                result.put("RIGHT", ScrollPaneActions.UNIT_SCROLL_RIGHT);
 
339
                result.put("KP_RIGHT", ScrollPaneActions.UNIT_SCROLL_RIGHT);
 
340
                result.put("DOWN", ScrollPaneActions.UNIT_SCROLL_DOWN);
 
341
                result.put("KP_DOWN", ScrollPaneActions.UNIT_SCROLL_DOWN);
 
342
                result.put("LEFT", ScrollPaneActions.UNIT_SCROLL_LEFT);
 
343
                result.put("KP_LEFT", ScrollPaneActions.UNIT_SCROLL_LEFT);
 
344
                result.put("UP", ScrollPaneActions.UNIT_SCROLL_UP);
 
345
                result.put("KP_UP", ScrollPaneActions.UNIT_SCROLL_UP);
 
346
 
 
347
                result.put("PAGE_UP", ScrollPaneActions.SCROLL_UP);
 
348
                result.put("PAGE_DOWN", ScrollPaneActions.SCROLL_DOWN);
 
349
                result.put("HOME", ScrollPaneActions.SCROLL_HOME);
 
350
                result.put("END", ScrollPaneActions.SCROLL_END);
 
351
 
 
352
                return result;
 
353
        }
 
354
 
 
355
        @Override
 
356
        public SubstanceInputMap getSliderFocusInputMap() {
 
357
                SubstanceInputMap result = super.getSliderFocusInputMap();
 
358
                result.remove("ctrl PAGE_DOWN");
 
359
                result.remove("ctrl PAGE_UP");
 
360
                return result;
 
361
        }
 
362
 
 
363
        @Override
 
364
        public SubstanceInputMap getTableAncestorInputMap() {
 
365
                SubstanceInputMap result = new SubstanceInputMap();
 
366
 
 
367
                result.put("meta C", COPY);
 
368
                result.put("meta V", PASTE);
 
369
                result.put("meta X", CUT);
 
370
                result.put("COPY", COPY);
 
371
                result.put("PASTE", PASTE);
 
372
                result.put("CUT", CUT);
 
373
 
 
374
                result.put("RIGHT", TableActions.NEXT_COLUMN);
 
375
                result.put("KP_RIGHT", TableActions.NEXT_COLUMN);
 
376
                result.put("shift RIGHT", TableActions.NEXT_COLUMN_EXTEND_SELECTION);
 
377
                result.put("shift KP_RIGHT", TableActions.NEXT_COLUMN_EXTEND_SELECTION);
 
378
 
 
379
                result.put("LEFT", TableActions.PREVIOUS_COLUMN);
 
380
                result.put("KP_LEFT", TableActions.PREVIOUS_COLUMN);
 
381
                result.put("shift LEFT", TableActions.PREVIOUS_COLUMN_EXTEND_SELECTION);
 
382
                result.put("shift KP_LEFT",
 
383
                                TableActions.PREVIOUS_COLUMN_EXTEND_SELECTION);
 
384
 
 
385
                result.put("DOWN", TableActions.NEXT_ROW);
 
386
                result.put("KP_DOWN", TableActions.NEXT_ROW);
 
387
                result.put("shift DOWN", TableActions.NEXT_ROW_EXTEND_SELECTION);
 
388
                result.put("shift KP_DOWN", TableActions.NEXT_ROW_EXTEND_SELECTION);
 
389
 
 
390
                result.put("UP", TableActions.PREVIOUS_ROW);
 
391
                result.put("KP_UP", TableActions.PREVIOUS_ROW);
 
392
                result.put("shift UP", TableActions.PREVIOUS_ROW_EXTEND_SELECTION);
 
393
                result.put("shift KP_UP", TableActions.PREVIOUS_ROW_EXTEND_SELECTION);
 
394
 
 
395
                result.put("HOME", TableActions.FIRST_COLUMN);
 
396
                result.put("shift HOME", TableActions.FIRST_COLUMN_EXTEND_SELECTION);
 
397
                result.put("END", TableActions.LAST_COLUMN);
 
398
                result.put("shift END", TableActions.LAST_COLUMN_EXTEND_SELECTION);
 
399
 
 
400
                result.put("PAGE_UP", TableActions.SCROLL_UP_CHANGE_SELECTION);
 
401
                result.put("shift PAGE_UP", TableActions.SCROLL_UP_EXTEND_SELECTION);
 
402
                result.put("PAGE_DOWN", TableActions.SCROLL_DOWN_CHANGE_SELECTION);
 
403
                result
 
404
                                .put("shift PAGE_DOWN",
 
405
                                                TableActions.SCROLL_DOWN_EXTEND_SELECTION);
 
406
 
 
407
                result.put("TAB", TableActions.NEXT_COLUMN_CELL);
 
408
                result.put("shift TAB", TableActions.PREVIOUS_COLUMN_CELL);
 
409
                result.put("ENTER", TableActions.NEXT_ROW_CELL);
 
410
                result.put("shift ENTER", TableActions.PREVIOUS_ROW_CELL);
 
411
                result.put("meta A", TableActions.SELECT_ALL);
 
412
 
 
413
                result.put("alt TAB", TableActions.FOCUS_HEADER);
 
414
                result.put("shift alt TAB", TableActions.FOCUS_HEADER);
 
415
 
 
416
                return result;
 
417
        }
 
418
 
 
419
        @Override
 
420
        public SubstanceInputMap getTextFieldFocusInputMap() {
 
421
                return this.getSingleLineTextComponentFocusInputMap();
 
422
        }
 
423
 
 
424
        @Override
 
425
        public SubstanceInputMap getTreeFocusInputMap() {
 
426
                SubstanceInputMap result = new SubstanceInputMap();
 
427
 
 
428
                result.put("meta C", COPY);
 
429
                result.put("meta V", PASTE);
 
430
                result.put("meta X", CUT);
 
431
                result.put("COPY", COPY);
 
432
                result.put("PASTE", PASTE);
 
433
                result.put("CUT", CUT);
 
434
 
 
435
                result.put("UP", TreeActions.SELECT_PREVIOUS);
 
436
                result.put("KP_UP", TreeActions.SELECT_PREVIOUS);
 
437
                result.put("shift UP", TreeActions.SELECT_PREVIOUS_EXTEND_SELECTION);
 
438
                result.put("shift KP_UP", TreeActions.SELECT_PREVIOUS_EXTEND_SELECTION);
 
439
 
 
440
                result.put("DOWN", TreeActions.SELECT_NEXT);
 
441
                result.put("KP_DOWN", TreeActions.SELECT_NEXT);
 
442
                result.put("shift DOWN", TreeActions.SELECT_NEXT_EXTEND_SELECTION);
 
443
                result.put("shift KP_DOWN", TreeActions.SELECT_NEXT_EXTEND_SELECTION);
 
444
 
 
445
                result.put("ctrl A", TreeActions.SELECT_ALL);
 
446
 
 
447
                // XXX: in Aqua this is mapped to aquaExpandNode
 
448
                result.put("RIGHT", TreeActions.EXPAND);
 
449
                result.put("KP_RIGHT", TreeActions.EXPAND);
 
450
                result.put("ctrl RIGHT", TreeActions.EXPAND);
 
451
                result.put("ctrl KP_RIGHT", TreeActions.EXPAND);
 
452
                result.put("shift RIGHT", TreeActions.EXPAND);
 
453
                result.put("shift KP_RIGHT", TreeActions.EXPAND);
 
454
 
 
455
                // XXX: in Aqua this is mapped to aquaCollapseNode
 
456
                result.put("LEFT", TreeActions.COLLAPSE);
 
457
                result.put("KP_LEFT", TreeActions.COLLAPSE);
 
458
                result.put("ctrl LEFT", TreeActions.COLLAPSE);
 
459
                result.put("ctrl KP_LEFT", TreeActions.COLLAPSE);
 
460
                result.put("shift LEFT", TreeActions.COLLAPSE);
 
461
                result.put("shift KP_LEFT", TreeActions.COLLAPSE);
 
462
 
 
463
                // XXX: in Aqua there are mappings to aquaFullyCollapseNode and
 
464
                // aquaFullyExpandNode
 
465
 
 
466
                return result;
 
467
        }
 
468
}