1 11 12 package org.eclipse.ui.keys; 13 14 import java.util.SortedMap ; 15 import java.util.TreeMap ; 16 17 import org.eclipse.jface.bindings.keys.IKeyLookup; 18 import org.eclipse.jface.bindings.keys.KeyLookupFactory; 19 20 38 public final class SpecialKey extends NaturalKey { 39 40 44 static SortedMap specialKeysByName = new TreeMap (); 45 46 50 public final static SpecialKey ARROW_DOWN; 51 52 56 public final static SpecialKey ARROW_LEFT; 57 58 62 public final static SpecialKey ARROW_RIGHT; 63 64 68 public final static SpecialKey ARROW_UP; 69 70 74 public final static SpecialKey BREAK; 75 76 80 public final static SpecialKey CAPS_LOCK; 81 82 86 public final static SpecialKey END; 87 88 92 public final static SpecialKey F1; 93 94 98 public final static SpecialKey F10; 99 100 104 public final static SpecialKey F11; 105 106 110 public final static SpecialKey F12; 111 112 116 public final static SpecialKey F13; 117 118 122 public final static SpecialKey F14; 123 124 128 public final static SpecialKey F15; 129 130 134 public final static SpecialKey F2; 135 136 140 public final static SpecialKey F3; 141 142 146 public final static SpecialKey F4; 147 148 152 public final static SpecialKey F5; 153 154 158 public final static SpecialKey F6; 159 160 164 public final static SpecialKey F7; 165 166 170 public final static SpecialKey F8; 171 172 176 public final static SpecialKey F9; 177 178 182 public final static SpecialKey HOME; 183 184 188 public final static SpecialKey INSERT; 189 190 194 public final static SpecialKey NUM_LOCK; 195 196 200 public final static SpecialKey NUMPAD_0; 201 202 206 public final static SpecialKey NUMPAD_1; 207 208 212 public final static SpecialKey NUMPAD_2; 213 214 218 public final static SpecialKey NUMPAD_3; 219 220 224 public final static SpecialKey NUMPAD_4; 225 226 230 public final static SpecialKey NUMPAD_5; 231 232 236 public final static SpecialKey NUMPAD_6; 237 238 242 public final static SpecialKey NUMPAD_7; 243 244 248 public final static SpecialKey NUMPAD_8; 249 250 254 public final static SpecialKey NUMPAD_9; 255 256 260 public final static SpecialKey NUMPAD_ADD; 261 262 266 public final static SpecialKey NUMPAD_DECIMAL; 267 268 272 public final static SpecialKey NUMPAD_DIVIDE; 273 274 278 public final static SpecialKey NUMPAD_ENTER; 279 280 284 public final static SpecialKey NUMPAD_EQUAL; 285 286 290 public final static SpecialKey NUMPAD_MULTIPLY; 291 292 296 public final static SpecialKey NUMPAD_SUBTRACT; 297 298 302 public final static SpecialKey PAGE_DOWN; 303 304 308 public final static SpecialKey PAGE_UP; 309 310 314 public final static SpecialKey PAUSE; 315 316 320 public final static SpecialKey PRINT_SCREEN; 321 322 326 public final static SpecialKey SCROLL_LOCK; 327 328 static { 329 final IKeyLookup lookup = KeyLookupFactory.getDefault(); 330 ARROW_DOWN = new SpecialKey(lookup 331 .formalKeyLookup(IKeyLookup.ARROW_DOWN_NAME)); 332 ARROW_LEFT = new SpecialKey(lookup 333 .formalKeyLookup(IKeyLookup.ARROW_LEFT_NAME)); 334 ARROW_RIGHT = new SpecialKey(lookup 335 .formalKeyLookup(IKeyLookup.ARROW_RIGHT_NAME)); 336 ARROW_UP = new SpecialKey(lookup 337 .formalKeyLookup(IKeyLookup.ARROW_UP_NAME)); 338 BREAK = new SpecialKey(lookup.formalKeyLookup(IKeyLookup.BREAK_NAME)); 339 CAPS_LOCK = new SpecialKey(lookup 340 .formalKeyLookup(IKeyLookup.CAPS_LOCK_NAME)); 341 END = new SpecialKey(lookup.formalKeyLookup(IKeyLookup.END_NAME)); 342 F1 = new SpecialKey(lookup.formalKeyLookup(IKeyLookup.F1_NAME)); 343 F2 = new SpecialKey(lookup.formalKeyLookup(IKeyLookup.F2_NAME)); 344 F3 = new SpecialKey(lookup.formalKeyLookup(IKeyLookup.F3_NAME)); 345 F4 = new SpecialKey(lookup.formalKeyLookup(IKeyLookup.F4_NAME)); 346 F5 = new SpecialKey(lookup.formalKeyLookup(IKeyLookup.F5_NAME)); 347 F6 = new SpecialKey(lookup.formalKeyLookup(IKeyLookup.F6_NAME)); 348 F7 = new SpecialKey(lookup.formalKeyLookup(IKeyLookup.F7_NAME)); 349 F8 = new SpecialKey(lookup.formalKeyLookup(IKeyLookup.F8_NAME)); 350 F9 = new SpecialKey(lookup.formalKeyLookup(IKeyLookup.F9_NAME)); 351 F10 = new SpecialKey(lookup.formalKeyLookup(IKeyLookup.F10_NAME)); 352 F11 = new SpecialKey(lookup.formalKeyLookup(IKeyLookup.F11_NAME)); 353 F12 = new SpecialKey(lookup.formalKeyLookup(IKeyLookup.F12_NAME)); 354 F13 = new SpecialKey(lookup.formalKeyLookup(IKeyLookup.F13_NAME)); 355 F14 = new SpecialKey(lookup.formalKeyLookup(IKeyLookup.F14_NAME)); 356 F15 = new SpecialKey(lookup.formalKeyLookup(IKeyLookup.F15_NAME)); 357 HOME = new SpecialKey(lookup.formalKeyLookup(IKeyLookup.HOME_NAME)); 358 INSERT = new SpecialKey(lookup.formalKeyLookup(IKeyLookup.INSERT_NAME)); 359 NUM_LOCK = new SpecialKey(lookup 360 .formalKeyLookup(IKeyLookup.NUM_LOCK_NAME)); 361 NUMPAD_0 = new SpecialKey(lookup 362 .formalKeyLookup(IKeyLookup.NUMPAD_0_NAME)); 363 NUMPAD_1 = new SpecialKey(lookup 364 .formalKeyLookup(IKeyLookup.NUMPAD_1_NAME)); 365 NUMPAD_2 = new SpecialKey(lookup 366 .formalKeyLookup(IKeyLookup.NUMPAD_2_NAME)); 367 NUMPAD_3 = new SpecialKey(lookup 368 .formalKeyLookup(IKeyLookup.NUMPAD_3_NAME)); 369 NUMPAD_4 = new SpecialKey(lookup 370 .formalKeyLookup(IKeyLookup.NUMPAD_4_NAME)); 371 NUMPAD_5 = new SpecialKey(lookup 372 .formalKeyLookup(IKeyLookup.NUMPAD_5_NAME)); 373 NUMPAD_6 = new SpecialKey(lookup 374 .formalKeyLookup(IKeyLookup.NUMPAD_6_NAME)); 375 NUMPAD_7 = new SpecialKey(lookup 376 .formalKeyLookup(IKeyLookup.NUMPAD_7_NAME)); 377 NUMPAD_8 = new SpecialKey(lookup 378 .formalKeyLookup(IKeyLookup.NUMPAD_8_NAME)); 379 NUMPAD_9 = new SpecialKey(lookup 380 .formalKeyLookup(IKeyLookup.NUMPAD_9_NAME)); 381 NUMPAD_ADD = new SpecialKey(lookup 382 .formalKeyLookup(IKeyLookup.NUMPAD_ADD_NAME)); 383 NUMPAD_DECIMAL = new SpecialKey(lookup 384 .formalKeyLookup(IKeyLookup.NUMPAD_DECIMAL_NAME)); 385 NUMPAD_DIVIDE = new SpecialKey(lookup 386 .formalKeyLookup(IKeyLookup.NUMPAD_DIVIDE_NAME)); 387 NUMPAD_ENTER = new SpecialKey(lookup 388 .formalKeyLookup(IKeyLookup.NUMPAD_ENTER_NAME)); 389 NUMPAD_EQUAL = new SpecialKey(lookup 390 .formalKeyLookup(IKeyLookup.NUMPAD_EQUAL_NAME)); 391 NUMPAD_MULTIPLY = new SpecialKey(lookup 392 .formalKeyLookup(IKeyLookup.NUMPAD_MULTIPLY_NAME)); 393 NUMPAD_SUBTRACT = new SpecialKey(lookup 394 .formalKeyLookup(IKeyLookup.NUMPAD_SUBTRACT_NAME)); 395 PAGE_DOWN = new SpecialKey(lookup 396 .formalKeyLookup(IKeyLookup.PAGE_DOWN_NAME)); 397 PAGE_UP = new SpecialKey(lookup 398 .formalKeyLookup(IKeyLookup.PAGE_UP_NAME)); 399 PAUSE = new SpecialKey(lookup.formalKeyLookup(IKeyLookup.PAUSE_NAME)); 400 PRINT_SCREEN = new SpecialKey(lookup 401 .formalKeyLookup(IKeyLookup.PRINT_SCREEN_NAME)); 402 SCROLL_LOCK = new SpecialKey(lookup 403 .formalKeyLookup(IKeyLookup.SCROLL_LOCK_NAME)); 404 405 specialKeysByName.put(SpecialKey.ARROW_DOWN.toString(), 406 SpecialKey.ARROW_DOWN); 407 specialKeysByName.put(SpecialKey.ARROW_LEFT.toString(), 408 SpecialKey.ARROW_LEFT); 409 specialKeysByName.put(SpecialKey.ARROW_RIGHT.toString(), 410 SpecialKey.ARROW_RIGHT); 411 specialKeysByName.put(SpecialKey.ARROW_UP.toString(), 412 SpecialKey.ARROW_UP); 413 specialKeysByName.put(SpecialKey.BREAK.toString(), SpecialKey.BREAK); 414 specialKeysByName.put(SpecialKey.CAPS_LOCK.toString(), 415 SpecialKey.CAPS_LOCK); 416 specialKeysByName.put(SpecialKey.END.toString(), SpecialKey.END); 417 specialKeysByName.put(SpecialKey.F1.toString(), SpecialKey.F1); 418 specialKeysByName.put(SpecialKey.F10.toString(), SpecialKey.F10); 419 specialKeysByName.put(SpecialKey.F11.toString(), SpecialKey.F11); 420 specialKeysByName.put(SpecialKey.F12.toString(), SpecialKey.F12); 421 specialKeysByName.put(SpecialKey.F13.toString(), SpecialKey.F13); 422 specialKeysByName.put(SpecialKey.F14.toString(), SpecialKey.F14); 423 specialKeysByName.put(SpecialKey.F15.toString(), SpecialKey.F15); 424 specialKeysByName.put(SpecialKey.F2.toString(), SpecialKey.F2); 425 specialKeysByName.put(SpecialKey.F3.toString(), SpecialKey.F3); 426 specialKeysByName.put(SpecialKey.F4.toString(), SpecialKey.F4); 427 specialKeysByName.put(SpecialKey.F5.toString(), SpecialKey.F5); 428 specialKeysByName.put(SpecialKey.F6.toString(), SpecialKey.F6); 429 specialKeysByName.put(SpecialKey.F7.toString(), SpecialKey.F7); 430 specialKeysByName.put(SpecialKey.F8.toString(), SpecialKey.F8); 431 specialKeysByName.put(SpecialKey.F9.toString(), SpecialKey.F9); 432 specialKeysByName.put(SpecialKey.NUM_LOCK.toString(), 433 SpecialKey.NUM_LOCK); 434 specialKeysByName.put(SpecialKey.NUMPAD_0.toString(), 435 SpecialKey.NUMPAD_0); 436 specialKeysByName.put(SpecialKey.NUMPAD_1.toString(), 437 SpecialKey.NUMPAD_1); 438 specialKeysByName.put(SpecialKey.NUMPAD_2.toString(), 439 SpecialKey.NUMPAD_2); 440 specialKeysByName.put(SpecialKey.NUMPAD_3.toString(), 441 SpecialKey.NUMPAD_3); 442 specialKeysByName.put(SpecialKey.NUMPAD_4.toString(), 443 SpecialKey.NUMPAD_4); 444 specialKeysByName.put(SpecialKey.NUMPAD_5.toString(), 445 SpecialKey.NUMPAD_5); 446 specialKeysByName.put(SpecialKey.NUMPAD_6.toString(), 447 SpecialKey.NUMPAD_6); 448 specialKeysByName.put(SpecialKey.NUMPAD_7.toString(), 449 SpecialKey.NUMPAD_7); 450 specialKeysByName.put(SpecialKey.NUMPAD_8.toString(), 451 SpecialKey.NUMPAD_8); 452 specialKeysByName.put(SpecialKey.NUMPAD_9.toString(), 453 SpecialKey.NUMPAD_9); 454 specialKeysByName.put(SpecialKey.NUMPAD_ADD.toString(), 455 SpecialKey.NUMPAD_ADD); 456 specialKeysByName.put(SpecialKey.NUMPAD_DECIMAL.toString(), 457 SpecialKey.NUMPAD_DECIMAL); 458 specialKeysByName.put(SpecialKey.NUMPAD_DIVIDE.toString(), 459 SpecialKey.NUMPAD_DIVIDE); 460 specialKeysByName.put(SpecialKey.NUMPAD_ENTER.toString(), 461 SpecialKey.NUMPAD_ENTER); 462 specialKeysByName.put(SpecialKey.NUMPAD_EQUAL.toString(), 463 SpecialKey.NUMPAD_EQUAL); 464 specialKeysByName.put(SpecialKey.NUMPAD_MULTIPLY.toString(), 465 SpecialKey.NUMPAD_MULTIPLY); 466 specialKeysByName.put(SpecialKey.NUMPAD_SUBTRACT.toString(), 467 SpecialKey.NUMPAD_SUBTRACT); 468 specialKeysByName.put(SpecialKey.HOME.toString(), SpecialKey.HOME); 469 specialKeysByName.put(SpecialKey.INSERT.toString(), SpecialKey.INSERT); 470 specialKeysByName.put(SpecialKey.PAGE_DOWN.toString(), 471 SpecialKey.PAGE_DOWN); 472 specialKeysByName 473 .put(SpecialKey.PAGE_UP.toString(), SpecialKey.PAGE_UP); 474 specialKeysByName.put(SpecialKey.PAUSE.toString(), SpecialKey.PAUSE); 475 specialKeysByName.put(SpecialKey.PRINT_SCREEN.toString(), 476 SpecialKey.PRINT_SCREEN); 477 specialKeysByName.put(SpecialKey.SCROLL_LOCK.toString(), 478 SpecialKey.SCROLL_LOCK); 479 } 480 481 487 private SpecialKey(final int key) { 488 super(key); 489 } 490 } 491 | Popular Tags |