Ignore:
Timestamp:
2010-01-08T22:15:11+01:00 (14 years ago)
Author:
mjulius
Message:

fixes #4253 - Combine way conflict dialog - check box for "Show tags with multiple values only"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolverModel.java

    r2512 r2779  
    2828    private PropertyChangeSupport support;
    2929    private boolean showTagsWithConflictsOnly = false;
     30    private boolean showTagsWithMultiValuesOnly = false;
    3031
    3132    public TagConflictResolverModel() {
     
    9192        if (showTagsWithConflictsOnly) {
    9293            keys.retainAll(keysWithConflicts);
     94            if (showTagsWithMultiValuesOnly) {
     95                Set<String> keysWithMultiValues = new HashSet<String>();
     96                for (String key: keys) {
     97                    if (decisions.get(key).canKeepAll()) {
     98                        keysWithMultiValues.add(key);
     99                    }
     100                }
     101                keys.retainAll(keysWithMultiValues);
     102            }
    93103            for (String key: tags.getKeys()) {
    94104                if (!decisions.get(key).isDecided() && !keys.contains(key)) {
     
    144154            MultiValueDecisionType type = (MultiValueDecisionType)value;
    145155            switch(type) {
    146                 case KEEP_NONE:
    147                     decision.keepNone();
    148                     break;
    149                 case KEEP_ALL:
    150                     decision.keepAll();
    151                     break;
     156            case KEEP_NONE:
     157                decision.keepNone();
     158                break;
     159            case KEEP_ALL:
     160                decision.keepAll();
     161                break;
    152162            }
    153163        }
     
    193203    public void setShowTagsWithConflictsOnly(boolean showTagsWithConflictsOnly) {
    194204        this.showTagsWithConflictsOnly = showTagsWithConflictsOnly;
     205        rebuild();
     206    }
     207
     208    /**
     209     * Sets whether all conflicts or only conflicts with multiple values are displayed
     210     *
     211     * @param showTagsWithMultiValuesOnly if true, only tags with multiple values are displayed
     212     */
     213    public void setShowTagsWithMultiValuesOnly(boolean showTagsWithMultiValuesOnly) {
     214        this.showTagsWithMultiValuesOnly = showTagsWithMultiValuesOnly;
    195215        rebuild();
    196216    }
Note: See TracChangeset for help on using the changeset viewer.