Changeset 4905 in josm
- Timestamp:
- 2012-02-07T12:59:45+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
r4590 r4905 31 31 import java.util.Set; 32 32 33 import javax.swing.AbstractAction; 34 import javax.swing.BorderFactory; 35 import javax.swing.JComponent; 36 import javax.swing.JLabel; 37 import javax.swing.JMenu; 38 import javax.swing.JMenuItem; 39 import javax.swing.JOptionPane; 40 import javax.swing.JPanel; 41 import javax.swing.JScrollPane; 42 import javax.swing.JSplitPane; 43 import javax.swing.JTabbedPane; 44 import javax.swing.JToolBar; 45 import javax.swing.KeyStroke; 46 import javax.swing.SwingUtilities; 33 import javax.swing.*; 47 34 import javax.swing.event.ChangeEvent; 48 35 import javax.swing.event.ChangeListener; … … 472 459 memberTableModel.getSelectionModel().addListSelectionListener(moveUpAction); 473 460 tb.add(moveUpAction); 461 memberTable.getActionMap().put("moveUp", moveUpAction); 474 462 475 463 // -- move down action … … 477 465 memberTableModel.getSelectionModel().addListSelectionListener(moveDownAction); 478 466 tb.add(moveDownAction); 479 467 memberTable.getActionMap().put("moveDown", moveDownAction); 468 480 469 tb.addSeparator(); 481 470 … … 484 473 memberTableModel.getSelectionModel().addListSelectionListener(editAction); 485 474 tb.add(editAction); 486 475 487 476 // -- delete action 488 477 RemoveAction removeSelectedAction = new RemoveAction(); 489 478 memberTable.getSelectionModel().addListSelectionListener(removeSelectedAction); 490 479 tb.add(removeSelectedAction); 491 480 memberTable.getActionMap().put("removeSelected", removeSelectedAction); 481 492 482 tb.addSeparator(); 493 483 // -- sort action … … 507 497 memberTable.getModel().addTableModelListener(downloadIncompleteMembersAction); 508 498 tb.add(downloadIncompleteMembersAction); 499 memberTable.getActionMap().put("downloadIncomplete", downloadIncompleteMembersAction); 509 500 510 501 // -- download selected action … … 514 505 tb.add(downloadSelectedIncompleteMembersAction); 515 506 507 InputMap inputMap = memberTable.getInputMap(MemberTable.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); 508 inputMap.put((KeyStroke) removeSelectedAction.getValue(AbstractAction.ACCELERATOR_KEY),"removeSelected"); 509 inputMap.put((KeyStroke) moveUpAction.getValue(AbstractAction.ACCELERATOR_KEY),"moveUp"); 510 inputMap.put((KeyStroke) moveDownAction.getValue(AbstractAction.ACCELERATOR_KEY),"moveDown"); 511 inputMap.put((KeyStroke) downloadIncompleteMembersAction.getValue(AbstractAction.ACCELERATOR_KEY),"downloadIncomplete"); 512 516 513 return tb; 517 514 } … … 892 889 putValue(SMALL_ICON, ImageProvider.get("dialogs/relation", "deletemembers")); 893 890 // putValue(NAME, tr("Remove Selected")); 894 Shortcut.registerShortcut("relationeditor:removeselected", tr("Relation Editor: Remove Selected"),895 KeyEvent.VK_S, Shortcut.GROUP_MNEMONIC);896 897 891 updateEnabledState(); 898 892 } … … 983 977 putValue(SMALL_ICON, ImageProvider.get("dialogs", "sort")); 984 978 putValue(NAME, tr("Sort")); 985 Shortcut.registerShortcut("relationeditor:sort", tr("Relation Editor: Sort"), KeyEvent.VK_T, 986 Shortcut.GROUP_MNEMONIC); 979 // Shortcut.registerShortcut("relationeditor:sort", tr("Relation Editor: Sort"), KeyEvent.VK_HOME, Shortcut.GROUP_MNEMONIC) 987 980 updateEnabledState(); 988 981 } … … 1006 999 putValue(SMALL_ICON, ImageProvider.get("dialogs/relation", "reverse")); 1007 1000 putValue(NAME, tr("Reverse")); 1008 Shortcut.registerShortcut("relationeditor:reverse", tr("Relation Editor: Reverse"), KeyEvent.VK_R, 1009 Shortcut.GROUP_MNEMONIC); 1001 // Shortcut.registerShortcut("relationeditor:reverse", tr("Relation Editor: Reverse"), KeyEvent.VK_END, Shortcut.GROUP_MNEMONIC) 1010 1002 updateEnabledState(); 1011 1003 } … … 1029 1021 putValue(SMALL_ICON, ImageProvider.get("dialogs", "moveup")); 1030 1022 // putValue(NAME, tr("Move Up")); 1031 Shortcut.registerShortcut("relationeditor:moveup", tr("Relation Editor: Move Up"), KeyEvent.VK_N, 1032 Shortcut.GROUP_MNEMONIC); 1023 putValue(ACCELERATOR_KEY, 1024 Shortcut.registerShortcut("relationeditor:moveup", tr("Relation Editor: Move Up"), KeyEvent.VK_UP, Shortcut.GROUP_MNEMONIC) 1025 .getKeyStroke() 1026 ); 1033 1027 setEnabled(false); 1034 1028 } … … 1048 1042 putValue(SMALL_ICON, ImageProvider.get("dialogs", "movedown")); 1049 1043 // putValue(NAME, tr("Move Down")); 1050 Shortcut.registerShortcut("relationeditor:moveup", tr("Relation Editor: Move Down"), KeyEvent.VK_J, 1051 Shortcut.GROUP_MNEMONIC); 1044 putValue(ACCELERATOR_KEY, 1045 Shortcut.registerShortcut("relationeditor:movedown", tr("Relation Editor: Move Down"), KeyEvent.VK_DOWN, Shortcut.GROUP_MNEMONIC) 1046 .getKeyStroke() 1047 ); 1052 1048 setEnabled(false); 1053 1049 } … … 1066 1062 putValue(SHORT_DESCRIPTION, tr("Remove the currently selected members from this relation")); 1067 1063 putValue(SMALL_ICON, ImageProvider.get("dialogs", "remove")); 1068 // putValue(NAME, tr("Remove")); 1069 Shortcut.registerShortcut("relationeditor:remove", tr("Relation Editor: Remove"), KeyEvent.VK_J, 1070 Shortcut.GROUP_MNEMONIC); 1064 putValue(NAME, tr("Remove")); 1065 putValue(ACCELERATOR_KEY, 1066 Shortcut.registerShortcut("relationeditor:remove", tr("Relation Editor: Remove"), KeyEvent.VK_DELETE, 1067 Shortcut.GROUP_MNEMONIC).getKeyStroke()); 1071 1068 setEnabled(false); 1072 1069 } … … 1402 1399 putValue(SMALL_ICON, ImageProvider.get("dialogs/relation", "downloadincomplete")); 1403 1400 putValue(NAME, tr("Download Members")); 1404 Shortcut.registerShortcut("relationeditor:downloadincomplete", tr("Relation Editor: Download Members"), 1405 KeyEvent.VK_K, Shortcut.GROUP_MNEMONIC); 1401 putValue(ACCELERATOR_KEY, 1402 Shortcut.registerShortcut("relationeditor:downloadincomplete", tr("Relation Editor: Download Members"), KeyEvent.VK_HOME, Shortcut.GROUP_MNEMONIC) 1403 .getKeyStroke() 1404 ); 1405 1406 1406 updateEnabledState(); 1407 1407 } … … 1432 1432 putValue(SMALL_ICON, ImageProvider.get("dialogs/relation", "downloadincompleteselected")); 1433 1433 putValue(NAME, tr("Download Members")); 1434 Shortcut.registerShortcut("relationeditor:downloadincomplete", tr("Relation Editor: Download Members"), 1435 KeyEvent.VK_K, Shortcut.GROUP_MNEMONIC); 1434 // Shortcut.registerShortcut("relationeditor:downloadincomplete", tr("Relation Editor: Download Members"), KeyEvent.VK_K, Shortcut.GROUP_MNEMONIC); 1436 1435 updateEnabledState(); 1437 1436 }
Note:
See TracChangeset
for help on using the changeset viewer.