### Eclipse Workspace Patch 1.0
#P JOSM
|
|
|
|
| 5 | 5 | import static org.openstreetmap.josm.tools.I18n.trn; |
| 6 | 6 | |
| 7 | 7 | import java.awt.BorderLayout; |
| 8 | | import java.awt.Component; |
| 9 | 8 | import java.awt.GridBagConstraints; |
| 10 | 9 | import java.awt.GridBagLayout; |
| 11 | 10 | import java.awt.GridLayout; |
| … |
… |
|
| 33 | 32 | import javax.swing.JTextField; |
| 34 | 33 | import javax.swing.SwingUtilities; |
| 35 | 34 | import javax.swing.UIManager; |
| 36 | | import javax.swing.event.ChangeEvent; |
| 37 | | import javax.swing.event.ChangeListener; |
| 38 | 35 | import javax.swing.event.DocumentEvent; |
| 39 | 36 | import javax.swing.event.DocumentListener; |
| 40 | 37 | |
| … |
… |
|
| 60 | 57 | return new PluginPreference(); |
| 61 | 58 | } |
| 62 | 59 | } |
| 63 | | |
| | 60 | |
| 64 | 61 | private PluginPreference() { |
| 65 | 62 | super("plugin", tr("Plugins"), tr("Configure available plugins.")); |
| 66 | 63 | } |
| … |
… |
|
| 184 | 181 | gc.fill = GridBagConstraints.BOTH; |
| 185 | 182 | PreferencePanel plugins = gui.createPreferenceTab(this); |
| 186 | 183 | plugins.add(buildContentPanel(), gc); |
| 187 | | //pnlPluginPreferences.refreshView(); // fix #7541, refreshView() will be called when the first tab will be selected |
| 188 | | gui.addChangeListener(new PluginPreferenceActivationListener(plugins)); |
| | 184 | readLocalPluginInformation(); |
| | 185 | pluginPreferencesActivated = true; |
| | 186 | pnlPluginPreferences.refreshView(); |
| 189 | 187 | } |
| 190 | 188 | |
| 191 | 189 | private void configureSites() { |
| … |
… |
|
| 409 | 407 | } |
| 410 | 408 | |
| 411 | 409 | /** |
| 412 | | * Listens to the activation of the plugin preferences tab. On activation it |
| 413 | | * reloads plugin information from the local file system. |
| 414 | | * |
| 415 | | */ |
| 416 | | class PluginPreferenceActivationListener implements ChangeListener { |
| 417 | | private Component pane; |
| 418 | | public PluginPreferenceActivationListener(Component preferencesPane) { |
| 419 | | pane = preferencesPane; |
| 420 | | } |
| 421 | | |
| 422 | | public void stateChanged(ChangeEvent e) { |
| 423 | | JTabbedPane tp = (JTabbedPane)e.getSource(); |
| 424 | | if (tp.getSelectedComponent() == pane && !pluginPreferencesActivated) { |
| 425 | | readLocalPluginInformation(); |
| 426 | | pluginPreferencesActivated = true; |
| 427 | | } |
| 428 | | } |
| 429 | | } |
| 430 | | |
| 431 | | /** |
| 432 | 410 | * Applies the current filter condition in the filter text field to the |
| 433 | 411 | * model |
| 434 | 412 | */ |