Changeset 7005 in josm for trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
- Timestamp:
- 2014-04-26T17:39:23+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
r7001 r7005 127 127 DefaultListSelectionModel selectionModel = new DefaultListSelectionModel(); 128 128 this.availableSourcesModel = new AvailableSourcesListModel(selectionModel); 129 this.lstAvailableSources = new JList< ExtendedSourceEntry>(availableSourcesModel);129 this.lstAvailableSources = new JList<>(availableSourcesModel); 130 130 this.lstAvailableSources.setSelectionModel(selectionModel); 131 131 this.lstAvailableSources.setCellRenderer(new SourceEntryListCellRenderer()); … … 446 446 447 447 public AvailableSourcesListModel(DefaultListSelectionModel selectionModel) { 448 data = new ArrayList< ExtendedSourceEntry>();448 data = new ArrayList<>(); 449 449 this.selectionModel = selectionModel; 450 450 } … … 483 483 484 484 public List<ExtendedSourceEntry> getSelected() { 485 List<ExtendedSourceEntry> ret = new ArrayList< ExtendedSourceEntry>();485 List<ExtendedSourceEntry> ret = new ArrayList<>(); 486 486 for(int i=0; i<data.size();i++) { 487 487 if (selectionModel.isSelectedIndex(i)) { … … 499 499 public ActiveSourcesModel(DefaultListSelectionModel selectionModel) { 500 500 this.selectionModel = selectionModel; 501 this.data = new ArrayList< SourceEntry>();501 this.data = new ArrayList<>(); 502 502 } 503 503 … … 575 575 576 576 public void removeIdxs(Collection<Integer> idxs) { 577 List<SourceEntry> newData = new ArrayList< SourceEntry>();577 List<SourceEntry> newData = new ArrayList<>(); 578 578 for (int i=0; i<data.size(); ++i) { 579 579 if (!idxs.contains(i)) { … … 601 601 602 602 public List<SourceEntry> getSources() { 603 return new ArrayList< SourceEntry>(data);603 return new ArrayList<>(data); 604 604 } 605 605 … … 983 983 int josmVersion = Version.getInstance().getVersion(); 984 984 if (josmVersion != Version.JOSM_UNKNOWN_VERSION) { 985 Collection<String> messages = new ArrayList< String>();985 Collection<String> messages = new ArrayList<>(); 986 986 for (ExtendedSourceEntry entry : sources) { 987 987 if (entry.minJosmVersion != null && entry.minJosmVersion > josmVersion) { … … 1054 1054 public IconPathTableModel(DefaultListSelectionModel selectionModel) { 1055 1055 this.selectionModel = selectionModel; 1056 this.data = new ArrayList< String>();1056 this.data = new ArrayList<>(); 1057 1057 } 1058 1058 … … 1145 1145 1146 1146 public List<String> getIconPaths() { 1147 return new ArrayList< String>(data);1147 return new ArrayList<>(data); 1148 1148 } 1149 1149 } … … 1237 1237 private BufferedReader reader; 1238 1238 private boolean canceled; 1239 private final List<ExtendedSourceEntry> sources = new ArrayList< ExtendedSourceEntry>();1239 private final List<ExtendedSourceEntry> sources = new ArrayList<>(); 1240 1240 1241 1241 public SourceLoader(String url, List<SourceProvider> sourceProviders) { … … 1423 1423 public FileOrUrlCellEditor(boolean isFile) { 1424 1424 this.isFile = isFile; 1425 listeners = new CopyOnWriteArrayList< CellEditorListener>();1425 listeners = new CopyOnWriteArrayList<>(); 1426 1426 build(); 1427 1427 } … … 1575 1575 return new ArrayList<SourceEntry>(getDefault()); 1576 1576 1577 List<SourceEntry> entries = new ArrayList< SourceEntry>();1577 List<SourceEntry> entries = new ArrayList<>(); 1578 1578 for (Map<String, String> sourcePref : src) { 1579 SourceEntry e = deserialize(new HashMap< String, String>(sourcePref));1579 SourceEntry e = deserialize(new HashMap<>(sourcePref)); 1580 1580 if (e != null) { 1581 1581 entries.add(e); … … 1586 1586 1587 1587 public boolean put(Collection<? extends SourceEntry> entries) { 1588 Collection<Map<String, String>> setting = new ArrayList< Map<String, String>>(entries.size());1588 Collection<Map<String, String>> setting = new ArrayList<>(entries.size()); 1589 1589 for (SourceEntry e : entries) { 1590 1590 setting.add(serialize(e)); … … 1598 1598 */ 1599 1599 public final Set<String> getActiveUrls() { 1600 Set<String> urls = new HashSet< String>();1600 Set<String> urls = new HashSet<>(); 1601 1601 for (SourceEntry e : get()) { 1602 1602 if (e.active) {
Note:
See TracChangeset
for help on using the changeset viewer.