001// License: GPL. For details, see LICENSE file. 002package org.openstreetmap.josm.gui.conflict.tags; 003 004import static org.openstreetmap.josm.tools.I18n.tr; 005 006import javax.swing.JLabel; 007 008/** 009 * This represents the decision a user can make regarding a relation conflict 010 */ 011public enum RelationMemberConflictDecisionType { 012 /** 013 * keep the respective relation member for the target primitive (the target node 014 * in a node merge operation or the target way in a combine way operation) 015 */ 016 KEEP, 017 018 /** 019 * remove the respective relation member 020 */ 021 REMOVE, 022 023 /** 024 * not yet decided 025 */ 026 UNDECIDED; 027 028 /** 029 * Sets the label according to the current decision. 030 * @param decision The decision 031 * @param label The label to set 032 */ 033 public static void prepareLabel(RelationMemberConflictDecisionType decision, JLabel label) { 034 switch(decision) { 035 case REMOVE: 036 label.setText(tr("Remove")); 037 label.setToolTipText(tr("Remove this relation member from the relation")); 038 break; 039 case KEEP: 040 label.setText(tr("Keep")); 041 label.setToolTipText(tr("Keep this relation member for the target object")); 042 break; 043 case UNDECIDED: 044 label.setText(tr("Undecided")); 045 label.setToolTipText(tr("Not decided yet")); 046 break; 047 } 048 } 049}