Changeset 2147 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2009-09-16T17:55:01+02:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/PluginPreference.java
r2017 r2147 17 17 import javax.swing.JLabel; 18 18 import javax.swing.JList; 19 import javax.swing.JTextField; 19 20 import javax.swing.JOptionPane; 20 21 import javax.swing.JPanel; 21 22 import javax.swing.JScrollPane; 22 23 import javax.swing.Scrollable; 24 import javax.swing.event.DocumentEvent; 25 import javax.swing.event.DocumentListener; 23 26 24 27 import org.openstreetmap.josm.Main; … … 40 43 private JScrollPane pluginPane; 41 44 private PluginSelection selection = new PluginSelection(); 45 private JTextField txtFilter; 42 46 43 47 public void addGui(final PreferenceDialog gui) { 44 48 this.gui = gui; 45 49 plugin = gui.createPreferenceTab("plugin", tr("Plugins"), tr("Configure available plugins."), false); 50 51 txtFilter = new JTextField(); 52 JLabel lbFilter = new JLabel(tr("Search: ")); 53 lbFilter.setLabelFor(txtFilter); 54 plugin.add(lbFilter); 55 plugin.add(txtFilter, GBC.eol().fill(GBC.HORIZONTAL)); 56 txtFilter.getDocument().addDocumentListener(new DocumentListener(){ 57 public void changedUpdate(DocumentEvent e) { 58 action(); 59 } 60 61 public void insertUpdate(DocumentEvent e) { 62 action(); 63 } 64 65 public void removeUpdate(DocumentEvent e) { 66 action(); 67 } 68 69 private void action() { 70 selection.drawPanel(pluginPanel); 71 } 72 }); 73 plugin.add(GBC.glue(0,10), GBC.eol()); 74 75 /* main plugin area */ 46 76 pluginPane = new JScrollPane(pluginPanel, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); 47 77 pluginPane.setBorder(null); 48 78 plugin.add(pluginPane, GBC.eol().fill(GBC.BOTH)); 49 79 plugin.add(GBC.glue(0,10), GBC.eol()); 80 81 /* buttons at the bottom */ 50 82 JButton morePlugins = new JButton(tr("Download List")); 51 83 morePlugins.addActionListener(new ActionListener(){ … … 72 104 plugin.add(configureSites, GBC.std()); 73 105 106 selection.passTxtFilter(txtFilter); 74 107 selection.drawPanel(pluginPanel); 75 108 }
Note:
See TracChangeset
for help on using the changeset viewer.
