- Timestamp:
- 2016-01-12T00:59:37+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
r9411 r9417 23 23 import java.io.File; 24 24 import java.io.IOException; 25 import java.io.InputStream;26 import java.io.InputStreamReader;27 25 import java.net.MalformedURLException; 28 26 import java.net.URL; 29 import java.nio.charset.StandardCharsets;30 27 import java.util.ArrayList; 31 28 import java.util.Arrays; … … 452 449 } 453 450 451 /** 452 * Determines whether the list of active sources has changed. 453 * @return {@code true} if the list of active sources has changed, {@code false} otherwise 454 */ 454 455 public boolean hasActiveSourcesChanged() { 455 456 Collection<? extends SourceEntry> prev = getInitialSourcesList(); … … 468 469 } 469 470 471 /** 472 * Returns the list of active sources. 473 * @return the list of active sources 474 */ 470 475 public Collection<SourceEntry> getActiveSources() { 471 476 return activeSourcesModel.getSources(); … … 486 491 } 487 492 493 /** 494 * Remove sources associated with given indexes from active list. 495 * @param idxs indexes of sources to remove 496 */ 488 497 public void removeSources(Collection<Integer> idxs) { 489 498 activeSourcesModel.removeIdxs(idxs); … … 696 705 697 706 public static class ExtendedSourceEntry extends SourceEntry implements Comparable<ExtendedSourceEntry> { 707 /** file name used for display */ 698 708 public String simpleFileName; 709 /** version used for display */ 699 710 public String version; 711 /** author name used for display */ 700 712 public String author; 713 /** webpage link used for display */ 701 714 public String link; 715 /** short description used for display */ 702 716 public String description; 703 717 /** Style type: can only have one value: "xml". Used to filter out old XML styles. For MapCSS styles, the value is not set. */ 704 718 public String styleType; 719 /** minimum JOSM version required to enable this source entry */ 705 720 public Integer minJosmVersion; 706 721 722 /** 723 * Constructs a new {@code ExtendedSourceEntry}. 724 * @param simpleFileName file name used for display 725 * @param url URL that {@link org.openstreetmap.josm.io.CachedFile} understands 726 */ 707 727 public ExtendedSourceEntry(String simpleFileName, String url) { 708 728 super(url, null, null, true); … … 721 741 } 722 742 743 /** 744 * Returns a tooltip containing available metadata. 745 * @return a tooltip containing available metadata 746 */ 723 747 public String getTooltip() { 724 748 StringBuilder s = new StringBuilder(); … … 1630 1654 public abstract Collection<ExtendedSourceEntry> getDefault(); 1631 1655 1656 /** 1657 * Serializes the given source entry as a map. 1658 * @param entry source entry to serialize 1659 * @return map (key=value) 1660 */ 1632 1661 public abstract Map<String, String> serialize(SourceEntry entry); 1633 1662 1663 /** 1664 * Deserializes the given map as a source entry. 1665 * @param entryStr map (key=value) 1666 * @return source entry 1667 */ 1634 1668 public abstract SourceEntry deserialize(Map<String, String> entryStr); 1635 1669 … … 1654 1688 } 1655 1689 1690 /** 1691 * Saves a list of sources to JOSM preferences. 1692 * @param entries list of sources 1693 * @return {@code true}, if something has changed (i.e. value is different than before) 1694 */ 1656 1695 public boolean put(Collection<? extends SourceEntry> entries) { 1657 1696 Collection<Map<String, String>> setting = new ArrayList<>(entries.size());
Note:
See TracChangeset
for help on using the changeset viewer.