Changeset 7005 in josm for trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferencesModel.java
- Timestamp:
- 2014-04-26T17:39:23+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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) {
Note:
See TracChangeset
for help on using the changeset viewer.