Changeset 4518 in josm


Ignore:
Timestamp:
2011-10-15T18:21:54+02:00 (13 years ago)
Author:
simon04
Message:

fix #5781 - display mnemonics of {add,edit,delete} of properties dialog

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

    r4503 r4518  
    6565
    6666import org.openstreetmap.josm.Main;
     67import org.openstreetmap.josm.actions.JosmAction;
    6768import org.openstreetmap.josm.command.ChangeCommand;
    6869import org.openstreetmap.josm.command.ChangePropertyCommand;
     
    10161017    }
    10171018
    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        }
    10191027
    10201028        protected void deleteProperty(int row){
     
    10691077        }
    10701078
    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
    10811080        public void actionPerformed(ActionEvent e) {
    10821081            if (propertyTable.getSelectedRowCount() >0 ) {
     
    10891088        }
    10901089
     1090        @Override
    10911091        protected void updateEnabledState() {
    10921092            setEnabled(
     
    10961096        }
    10971097
     1098        @Override
    10981099        public void valueChanged(ListSelectionEvent e) {
    10991100            updateEnabledState();
     
    11011102    }
    11021103
    1103     class AddAction extends AbstractAction {
     1104    class AddAction extends JosmAction {
    11041105        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
    11131112        public void actionPerformed(ActionEvent e) {
    11141113            add();
     
    11161115    }
    11171116
    1118     class EditAction extends AbstractAction implements ListSelectionListener {
     1117    class EditAction extends JosmAction implements ListSelectionListener {
    11191118        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);
    11261122            updateEnabledState();
    11271123        }
    11281124
     1125        @Override
    11291126        public void actionPerformed(ActionEvent e) {
    11301127            if (!isEnabled())
     
    11391136        }
    11401137
     1138        @Override
    11411139        protected void updateEnabledState() {
    11421140            setEnabled(
     
    11461144        }
    11471145
     1146        @Override
    11481147        public void valueChanged(ListSelectionEvent e) {
    11491148            updateEnabledState();
Note: See TracChangeset for help on using the changeset viewer.