Changeset 8510 in josm for trunk/src/org/openstreetmap/josm/gui/preferences/plugin
- Timestamp:
- 2015-06-20T23:42:21+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/preferences/plugin
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginListPanel.java
r8426 r8510 92 92 gbc.anchor = GridBagConstraints.CENTER; 93 93 gbc.fill = GridBagConstraints.BOTH; 94 gbc.insets = new Insets(40, 0,40,0);94 gbc.insets = new Insets(40, 0, 40, 0); 95 95 gbc.weightx = 1.0; 96 96 gbc.weighty = 1.0; … … 111 111 private class JPluginCheckBox extends JCheckBox { 112 112 public final transient PluginInformation pi; 113 113 114 public JPluginCheckBox(final PluginInformation pi, boolean selected) { 114 115 this.pi = pi; … … 125 126 private class PluginCbActionListener implements ActionListener { 126 127 private final JPluginCheckBox cb; 128 127 129 public PluginCbActionListener(JPluginCheckBox cb) { 128 130 this.cb = cb; 129 131 } 132 130 133 protected void selectRequiredPlugins(PluginInformation info) { 131 134 if (info != null && info.requires != null) { … … 138 141 } 139 142 } 143 140 144 @Override 141 145 public void actionPerformed(ActionEvent e) { … … 237 241 gbc.gridx = 0; 238 242 gbc.gridy = ++row; 239 gbc.insets = new Insets(5, 5,0,5);243 gbc.insets = new Insets(5, 5, 0, 5); 240 244 gbc.weighty = 0.0; 241 245 gbc.weightx = 0.0; … … 251 255 @Override 252 256 public void hyperlinkUpdate(HyperlinkEvent e) { 253 if (e.getEventType() == EventType.ACTIVATED) {257 if (e.getEventType() == EventType.ACTIVATED) { 254 258 OpenBrowser.displayUrl(e.getURL().toString()); 255 259 } … … 260 264 gbc.gridx = 1; 261 265 gbc.gridy = ++row; 262 gbc.insets = new Insets(3, 25,5,5);266 gbc.insets = new Insets(3, 25, 5, 5); 263 267 gbc.weighty = 1.0; 264 268 add(description, gbc); -
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java
r8471 r8510 94 94 )); 95 95 sb.append("<ul>"); 96 for (PluginInformation pi: downloaded) {96 for (PluginInformation pi: downloaded) { 97 97 sb.append("<li>").append(pi.name).append(" (").append(pi.version).append(")</li>"); 98 98 } … … 107 107 )); 108 108 sb.append("<ul>"); 109 for (PluginInformation pi: failed) {109 for (PluginInformation pi: failed) { 110 110 sb.append("<li>").append(pi.name).append("</li>"); 111 111 } … … 159 159 protected JPanel buildSearchFieldPanel() { 160 160 JPanel pnl = new JPanel(new GridBagLayout()); 161 pnl.setBorder(BorderFactory.createEmptyBorder(5, 5,5,5));161 pnl.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); 162 162 GridBagConstraints gc = new GridBagConstraints(); 163 163 … … 165 165 gc.fill = GridBagConstraints.HORIZONTAL; 166 166 gc.weightx = 0.0; 167 gc.insets = new Insets(0, 0,0,3);167 gc.insets = new Insets(0, 0, 0, 3); 168 168 pnl.add(new JLabel(tr("Search:")), gc); 169 169 … … 179 179 180 180 protected JPanel buildActionPanel() { 181 JPanel pnl = new JPanel(new GridLayout(1, 3));181 JPanel pnl = new JPanel(new GridLayout(1, 3)); 182 182 183 183 pnl.add(new JButton(new DownloadAvailablePluginsAction())); … … 194 194 spPluginPreferences = GuiHelper.embedInVerticalScrollPane(pnlPluginPreferences); 195 195 spPluginPreferences.getVerticalScrollBar().addComponentListener( 196 new ComponentAdapter() {196 new ComponentAdapter() { 197 197 @Override 198 198 public void componentShown(ComponentEvent e) { 199 199 spPluginPreferences.setBorder(UIManager.getBorder("ScrollPane.border")); 200 200 } 201 201 202 @Override 202 203 public void componentHidden(ComponentEvent e) { … … 329 330 */ 330 331 public DownloadAvailablePluginsAction() { 331 putValue(NAME, tr("Download list"));332 putValue(NAME, tr("Download list")); 332 333 putValue(SHORT_DESCRIPTION, tr("Download the list of available plugins")); 333 334 putValue(SMALL_ICON, ImageProvider.get("download")); … … 365 366 class UpdateSelectedPluginsAction extends AbstractAction { 366 367 public UpdateSelectedPluginsAction() { 367 putValue(NAME, tr("Update plugins"));368 putValue(NAME, tr("Update plugins")); 368 369 putValue(SHORT_DESCRIPTION, tr("Update the selected plugins")); 369 370 putValue(SMALL_ICON, ImageProvider.get("dialogs", "refresh")); … … 467 468 class ConfigureSitesAction extends AbstractAction { 468 469 public ConfigureSitesAction() { 469 putValue(NAME, tr("Configure sites..."));470 putValue(NAME, tr("Configure sites...")); 470 471 putValue(SHORT_DESCRIPTION, tr("Configure the list of sites where plugins are downloaded from")); 471 472 putValue(SMALL_ICON, ImageProvider.get("dialogs", "settings")); … … 522 523 add(new JScrollPane(list), GBC.std().fill()); 523 524 JPanel buttons = new JPanel(new GridBagLayout()); 524 buttons.add(new JButton(new AbstractAction(tr("Add")) {525 buttons.add(new JButton(new AbstractAction(tr("Add")) { 525 526 @Override 526 527 public void actionPerformed(ActionEvent e) { … … 536 537 } 537 538 }), GBC.eol().fill(GBC.HORIZONTAL)); 538 buttons.add(new JButton(new AbstractAction(tr("Edit")) {539 buttons.add(new JButton(new AbstractAction(tr("Edit")) { 539 540 @Override 540 541 public void actionPerformed(ActionEvent e) { … … 548 549 return; 549 550 } 550 String s = (String) JOptionPane.showInputDialog(551 String s = (String) JOptionPane.showInputDialog( 551 552 Main.parent, 552 553 tr("Edit JOSM Plugin description URL."), … … 562 563 } 563 564 }), GBC.eol().fill(GBC.HORIZONTAL)); 564 buttons.add(new JButton(new AbstractAction(tr("Delete")) {565 buttons.add(new JButton(new AbstractAction(tr("Delete")) { 565 566 @Override 566 567 public void actionPerformed(ActionEvent event) { … … 587 588 if (model.getSize() == 0) return Collections.emptyList(); 588 589 List<String> ret = new ArrayList<>(model.getSize()); 589 for (int i =0; i< model.getSize();i++){590 for (int i = 0; i < model.getSize(); i++) { 590 591 ret.add(model.get(i)); 591 592 } … … 593 594 } 594 595 } 595 596 597 596 } -
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferencesModel.java
r8444 r8510 364 364 } 365 365 oldinfo.updateLocalInfo(newinfo); 366 } catch (PluginException e) {366 } catch (PluginException e) { 367 367 Main.error(e); 368 368 } -
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginUpdatePolicyPanel.java
r8509 r8510 66 66 gc.anchor = GridBagConstraints.NORTHWEST; 67 67 gc.fill = GridBagConstraints.HORIZONTAL; 68 gc.weightx =1.0;68 gc.weightx = 1.0; 69 69 70 70 ButtonGroup bgVersionBasedUpdatePolicy = new ButtonGroup(); … … 84 84 JMultilineLabel lbl = new JMultilineLabel( 85 85 tr("Please decide whether JOSM shall automatically update active plugins at startup after an update of JOSM itself.")); 86 gc.gridy =0;86 gc.gridy = 0; 87 87 pnl.add(lbl, gc); 88 88 for (Policy p: Policy.values()) { … … 107 107 gc.anchor = GridBagConstraints.NORTHWEST; 108 108 gc.fill = GridBagConstraints.HORIZONTAL; 109 gc.weightx =1.0;109 gc.weightx = 1.0; 110 110 111 111 TimeBasedPolicyChangeListener changeListener = new TimeBasedPolicyChangeListener(); … … 130 130 JMultilineLabel lbl = new JMultilineLabel( 131 131 tr("Please decide whether JOSM shall automatically update active plugins after a certain period of time.")); 132 gc.gridy =0;132 gc.gridy = 0; 133 133 pnl.add(lbl, gc); 134 134 for (Policy p: Policy.values()) { … … 146 146 gc.anchor = GridBagConstraints.NORTHWEST; 147 147 gc.fill = GridBagConstraints.HORIZONTAL; 148 gc.weightx =1.0;149 gc.insets = new Insets(5, 5,10,5);148 gc.weightx = 1.0; 149 gc.insets = new Insets(5, 5, 10, 5); 150 150 151 151 add(buildVersionBasedUpdatePolicyPanel(), gc); … … 194 194 try { 195 195 days = Integer.parseInt(pref); 196 } catch (NumberFormatException e) {196 } catch (NumberFormatException e) { 197 197 // ignore - load from preference pluginmanager.time-based-update.interval 198 198 } … … 238 238 days = PluginHandler.DEFAULT_TIME_BASED_UPDATE_INTERVAL; 239 239 } 240 } catch (NumberFormatException e) {240 } catch (NumberFormatException e) { 241 241 days = PluginHandler.DEFAULT_TIME_BASED_UPDATE_INTERVAL; 242 242 }
Note:
See TracChangeset
for help on using the changeset viewer.