Changeset 4518 in josm
- Timestamp:
- 2011-10-15T18:21:54+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r4503 r4518 65 65 66 66 import org.openstreetmap.josm.Main; 67 import org.openstreetmap.josm.actions.JosmAction; 67 68 import org.openstreetmap.josm.command.ChangeCommand; 68 69 import org.openstreetmap.josm.command.ChangePropertyCommand; … … 1016 1017 } 1017 1018 1018 class DeleteAction extends AbstractAction implements ListSelectionListener { 1019 class DeleteAction extends JosmAction implements ListSelectionListener { 1020 1021 public DeleteAction() { 1022 super(tr("Delete"), "dialogs/delete", tr("Delete the selected key in all objects"), 1023 Shortcut.registerShortcut("properties:delete", tr("Delete Properties"), KeyEvent.VK_D, 1024 Shortcut.GROUP_MNEMONIC), false); 1025 updateEnabledState(); 1026 } 1019 1027 1020 1028 protected void deleteProperty(int row){ … … 1069 1077 } 1070 1078 1071 public DeleteAction() { 1072 putValue(NAME, tr("Delete")); 1073 putValue(SHORT_DESCRIPTION, tr("Delete the selected key in all objects")); 1074 putValue(SMALL_ICON, ImageProvider.get("dialogs", "delete")); 1075 Shortcut s = Shortcut.registerShortcut("properties:delete", tr("Delete Properties"), KeyEvent.VK_D, 1076 Shortcut.GROUP_MNEMONIC); 1077 putValue(MNEMONIC_KEY, (int) KeyEvent.getKeyText(s.getAssignedKey()).charAt(0)); 1078 updateEnabledState(); 1079 } 1080 1079 @Override 1081 1080 public void actionPerformed(ActionEvent e) { 1082 1081 if (propertyTable.getSelectedRowCount() >0 ) { … … 1089 1088 } 1090 1089 1090 @Override 1091 1091 protected void updateEnabledState() { 1092 1092 setEnabled( … … 1096 1096 } 1097 1097 1098 @Override 1098 1099 public void valueChanged(ListSelectionEvent e) { 1099 1100 updateEnabledState(); … … 1101 1102 } 1102 1103 1103 class AddAction extends AbstractAction {1104 class AddAction extends JosmAction { 1104 1105 public AddAction() { 1105 putValue(NAME, tr("Add")); 1106 putValue(SHORT_DESCRIPTION, tr("Add a new key/value pair to all objects")); 1107 putValue(SMALL_ICON, ImageProvider.get("dialogs", "add")); 1108 Shortcut s = Shortcut.registerShortcut("properties:add", tr("Add Property"), KeyEvent.VK_A, 1109 Shortcut.GROUP_MNEMONIC); 1110 putValue(MNEMONIC_KEY, (int) KeyEvent.getKeyText(s.getAssignedKey()).charAt(0)); 1111 } 1112 1106 super(tr("Add"), "dialogs/add", tr("Add a new key/value pair to all objects"), 1107 Shortcut.registerShortcut("properties:add", tr("Add Property"), KeyEvent.VK_A, 1108 Shortcut.GROUP_MNEMONIC), false); 1109 } 1110 1111 @Override 1113 1112 public void actionPerformed(ActionEvent e) { 1114 1113 add(); … … 1116 1115 } 1117 1116 1118 class EditAction extends AbstractAction implements ListSelectionListener {1117 class EditAction extends JosmAction implements ListSelectionListener { 1119 1118 public EditAction() { 1120 putValue(NAME, tr("Edit")); 1121 putValue(SHORT_DESCRIPTION, tr("Edit the value of the selected key for all objects")); 1122 putValue(SMALL_ICON, ImageProvider.get("dialogs", "edit")); 1123 Shortcut s = Shortcut.registerShortcut("properties:edit", tr("Edit Properties"), KeyEvent.VK_S, 1124 Shortcut.GROUP_MNEMONIC); 1125 putValue(MNEMONIC_KEY, (int) KeyEvent.getKeyText(s.getAssignedKey()).charAt(0)); 1119 super(tr("Edit"), "dialogs/edit", tr("Edit the value of the selected key for all objects"), 1120 Shortcut.registerShortcut("properties:edit", tr("Edit Properties"), KeyEvent.VK_S, 1121 Shortcut.GROUP_MNEMONIC), false); 1126 1122 updateEnabledState(); 1127 1123 } 1128 1124 1125 @Override 1129 1126 public void actionPerformed(ActionEvent e) { 1130 1127 if (!isEnabled()) … … 1139 1136 } 1140 1137 1138 @Override 1141 1139 protected void updateEnabledState() { 1142 1140 setEnabled( … … 1146 1144 } 1147 1145 1146 @Override 1148 1147 public void valueChanged(ListSelectionEvent e) { 1149 1148 updateEnabledState();
Note:
See TracChangeset
for help on using the changeset viewer.