Ignore:
Timestamp:
2006-10-08T17:29:58+02:00 (18 years ago)
Author:
imi
Message:
  • added online help system
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java

    r153 r155  
    126126                JPanel buttonPanel = new JPanel(new GridLayout(1,2));
    127127
    128                 JButton button = new JButton(tr("Select"), ImageProvider.get("mapmode/selection/select"));
    129                 button.setToolTipText(tr("Set the selected elements on the map to the selected items in the list above."));
    130                 button.addActionListener(new ActionListener(){
     128                buttonPanel.add(createButton("Select", "mapmode/selection/select", "Set the selected elements on the map to the selected items in the list above.", new ActionListener(){
    131129                        public void actionPerformed(ActionEvent e) {
    132130                                updateMap();
    133131                        }
    134                 });
    135                 buttonPanel.add(button);
    136 
    137                 button = new JButton(tr("Reload"), ImageProvider.get("dialogs", "refresh"));
    138                 button.setToolTipText(tr("Refresh the selection list."));
    139                 button.addActionListener(new ActionListener(){
     132                }));
     133
     134                buttonPanel.add(createButton("Reload", "dialogs/refresh", "Refresh the selection list.", new ActionListener(){
    140135                        public void actionPerformed(ActionEvent e) {
    141136                                selectionChanged(Main.ds.getSelected());
    142                         }
    143                 });
    144                 buttonPanel.add(button);
    145 
    146                 button = new JButton(tr("Search"), ImageProvider.get("dialogs", "search"));
    147                 button.setToolTipText(tr("Search for objects."));
    148                 button.addActionListener(new ActionListener(){
     137            }
     138                }));
     139
     140                buttonPanel.add(createButton("Search", "dialogs/search", "Search for objects.", new ActionListener(){
    149141                        private String lastSearch = "";
    150142                        public void actionPerformed(ActionEvent e) {
     
    185177                                search(lastSearch, mode);
    186178                        }
    187                 });
    188                 buttonPanel.add(button);
     179                }));
    189180
    190181                add(buttonPanel, BorderLayout.SOUTH);
    191182                selectionChanged(Main.ds.getSelected());
     183        }
     184
     185        private JButton createButton(String name, String icon, String tooltip, ActionListener action) {
     186                JButton button = new JButton(tr(name), ImageProvider.get(icon));
     187                button.setToolTipText(tr(tooltip));
     188                button.addActionListener(action);
     189                button.putClientProperty("help", "Dialog/SelectionList/"+name);
     190                return button;
    192191        }
    193192
Note: See TracChangeset for help on using the changeset viewer.