Changeset 7005 in josm for trunk/src/org/openstreetmap/josm/gui/preferences/plugin
- Timestamp:
- 2014-04-26T17:39:23+02:00 (10 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
r6931 r7005 151 151 // If the plugin has been unselected, was it required by other plugins still selected ? 152 152 else if (!cb.isSelected()) { 153 Set<String> otherPlugins = new HashSet< String>();153 Set<String> otherPlugins = new HashSet<>(); 154 154 for (PluginInformation pi : model.getAvailablePlugins()) { 155 155 if (!pi.equals(cb.pi) && pi.requires != null && model.isSelectedPlugin(pi.getName())) { -
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java
r7004 r7005 280 280 pnlPluginUpdatePolicy.rememberInPreferences(); 281 281 if (model.isActivePluginsChanged()) { 282 LinkedList<String> l = new LinkedList< String>(model.getSelectedPluginNames());282 LinkedList<String> l = new LinkedList<>(model.getSelectedPluginNames()); 283 283 Collections.sort(l); 284 284 Main.pref.putCollection("plugins", l); … … 494 494 setLayout(new GridBagLayout()); 495 495 add(new JLabel(tr("Add JOSM Plugin description URL.")), GBC.eol()); 496 model = new DefaultListModel< String>();496 model = new DefaultListModel<>(); 497 497 for (String s : Main.pref.getPluginSites()) { 498 498 model.addElement(s); 499 499 } 500 final JList<String> list = new JList< String>(model);500 final JList<String> list = new JList<>(model); 501 501 add(new JScrollPane(list), GBC.std().fill()); 502 502 JPanel buttons = new JPanel(new GridBagLayout()); … … 565 565 public List<String> getUpdateSites() { 566 566 if (model.getSize() == 0) return Collections.emptyList(); 567 List<String> ret = new ArrayList< String>(model.getSize());567 List<String> ret = new ArrayList<>(model.getSize()); 568 568 for (int i=0; i< model.getSize();i++){ 569 569 ret.add((String)model.get(i)); -
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferencesModel.java
r6906 r7005 25 25 */ 26 26 public class PluginPreferencesModel extends Observable { 27 private final List<PluginInformation> availablePlugins = new ArrayList< PluginInformation>();28 private final List<PluginInformation> displayedPlugins = new ArrayList< PluginInformation>();29 private final Map<PluginInformation, Boolean> selectedPluginsMap = new HashMap< PluginInformation, Boolean>();30 private Set<String> pendingDownloads = new HashSet< String>();27 private final List<PluginInformation> availablePlugins = new ArrayList<>(); 28 private final List<PluginInformation> displayedPlugins = new ArrayList<>(); 29 private final Map<PluginInformation, Boolean> selectedPluginsMap = new HashMap<>(); 30 private Set<String> pendingDownloads = new HashSet<>(); 31 31 private String filterExpression; 32 32 private Set<String> currentActivePlugins; … … 36 36 */ 37 37 public PluginPreferencesModel() { 38 currentActivePlugins = new HashSet< String>();38 currentActivePlugins = new HashSet<>(); 39 39 currentActivePlugins.addAll(Main.pref.getCollection("plugins", currentActivePlugins)); 40 40 } … … 77 77 sort(); 78 78 filterDisplayedPlugins(filterExpression); 79 Set<String> activePlugins = new HashSet< String>();79 Set<String> activePlugins = new HashSet<>(); 80 80 activePlugins.addAll(Main.pref.getCollection("plugins", activePlugins)); 81 81 for (PluginInformation pi: availablePlugins) { … … 119 119 */ 120 120 public List<PluginInformation> getSelectedPlugins() { 121 List<PluginInformation> ret = new LinkedList< PluginInformation>();121 List<PluginInformation> ret = new LinkedList<>(); 122 122 for (PluginInformation pi: availablePlugins) { 123 123 if (selectedPluginsMap.get(pi) == null) { … … 137 137 */ 138 138 public Set<String> getSelectedPluginNames() { 139 Set<String> ret = new HashSet< String>();139 Set<String> ret = new HashSet<>(); 140 140 for (PluginInformation pi: getSelectedPlugins()) { 141 141 ret.add(pi.name); … … 177 177 */ 178 178 public List<PluginInformation> getPluginsScheduledForUpdateOrDownload() { 179 List<PluginInformation> ret = new ArrayList< PluginInformation>();179 List<PluginInformation> ret = new ArrayList<>(); 180 180 for (String plugin: pendingDownloads) { 181 181 PluginInformation pi = getPluginInformation(plugin); … … 274 274 */ 275 275 public List<PluginInformation> getNewlyActivatedPlugins() { 276 List<PluginInformation> ret = new LinkedList< PluginInformation>();276 List<PluginInformation> ret = new LinkedList<>(); 277 277 for (Entry<PluginInformation, Boolean> entry: selectedPluginsMap.entrySet()) { 278 278 PluginInformation pi = entry.getKey(); … … 292 292 */ 293 293 public List<PluginInformation> getNewlyDeactivatedPlugins() { 294 List<PluginInformation> ret = new LinkedList< PluginInformation>();294 List<PluginInformation> ret = new LinkedList<>(); 295 295 for (PluginInformation pi: availablePlugins) { 296 296 if (!currentActivePlugins.contains(pi.name)) { … … 310 310 */ 311 311 public List<PluginInformation> getAvailablePlugins() { 312 return new LinkedList< PluginInformation>(availablePlugins);312 return new LinkedList<>(availablePlugins); 313 313 } 314 314 … … 320 320 */ 321 321 public Set<String> getNewlyActivatedPluginNames() { 322 Set<String> ret = new HashSet< String>();322 Set<String> ret = new HashSet<>(); 323 323 List<PluginInformation> plugins = getNewlyActivatedPlugins(); 324 324 for (PluginInformation pi: plugins) { -
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginUpdatePolicyPanel.java
r6890 r7005 68 68 69 69 ButtonGroup bgVersionBasedUpdatePolicy = new ButtonGroup(); 70 rbVersionBasedUpatePolicy = new HashMap< Policy, JRadioButton>();70 rbVersionBasedUpatePolicy = new HashMap<>(); 71 71 JRadioButton btn = new JRadioButton(tr("Ask before updating")); 72 72 rbVersionBasedUpatePolicy.put(Policy.ASK, btn); … … 109 109 110 110 ButtonGroup bgTimeBasedUpdatePolicy = new ButtonGroup(); 111 rbTimeBasedUpatePolicy = new HashMap< Policy, JRadioButton>();111 rbTimeBasedUpatePolicy = new HashMap<>(); 112 112 JRadioButton btn = new JRadioButton(tr("Ask before updating")); 113 113 btn.addChangeListener(changeListener);
Note:
See TracChangeset
for help on using the changeset viewer.