Changeset 5120 in josm
- Timestamp:
- 2012-03-25T21:09:26+02:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/preferences
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/PluginPreference.java
r5117 r5120 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; … … 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; … … 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 selected188 gui.addChangeListener(new PluginPreferenceActivationListener(plugins));184 readLocalPluginInformation(); 185 pluginPreferencesActivated = true; 189 186 } 190 187 … … 410 407 411 408 /** 412 * Listens to the activation of the plugin preferences tab. On activation it413 * 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 409 * Applies the current filter condition in the filter text field to the 433 410 * model -
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginListPanel.java
r4191 r5120 7 7 import java.awt.GridBagLayout; 8 8 import java.awt.Insets; 9 import java.awt.Rectangle; 9 10 import java.awt.event.ActionEvent; 10 11 import java.awt.event.ActionListener; … … 14 15 import javax.swing.JLabel; 15 16 import javax.swing.SwingConstants; 17 import javax.swing.SwingUtilities; 16 18 import javax.swing.event.HyperlinkEvent; 19 import javax.swing.event.HyperlinkEvent.EventType; 17 20 import javax.swing.event.HyperlinkListener; 18 import javax.swing.event.HyperlinkEvent.EventType;19 21 20 22 import org.openstreetmap.josm.gui.widgets.HtmlPanel; … … 27 29 28 30 public PluginListPanel() { 29 model = new PluginPreferencesModel(); 30 setLayout(new GridBagLayout()); 31 this(new PluginPreferencesModel()); 31 32 } 32 33 … … 83 84 84 85 public void refreshView() { 86 final Rectangle visibleRect = getVisibleRect(); 85 87 List<PluginInformation> displayedPlugins = model.getDisplayedPlugins(); 86 88 removeAll(); … … 145 147 revalidate(); 146 148 repaint(); 149 if (visibleRect != null && visibleRect.width > 0 && visibleRect.height > 0) { 150 SwingUtilities.invokeLater(new Runnable() { 151 @Override 152 public void run() { 153 scrollRectToVisible(visibleRect); 154 } 155 }); 156 } 147 157 } 148 158 }
Note:
See TracChangeset
for help on using the changeset viewer.