Changeset 6437 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2013-12-04T22:20:16+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/tagging
- Files:
-
- 5 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java
r6425 r6437 49 49 import org.openstreetmap.josm.data.preferences.BooleanProperty; 50 50 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingTextField; 51 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionItemPri tority;51 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionItemPriority; 52 52 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionList; 53 53 import org.openstreetmap.josm.gui.widgets.JosmComboBox; … … 1169 1169 AutoCompletionList acList = tf.getAutoCompletionList(); 1170 1170 if (acList != null) { 1171 acList.add(getDisplayValues(), AutoCompletionItemPri tority.IS_IN_STANDARD);1171 acList.add(getDisplayValues(), AutoCompletionItemPriority.IS_IN_STANDARD); 1172 1172 } 1173 1173 combo.setEditor(tf); -
trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingComboBox.java
r6380 r6437 230 230 } 231 231 } 232 super.setSelectedItem(new AutoCompletionListItem(s, AutoCompletionItemPri tority.UNKNOWN));232 super.setSelectedItem(new AutoCompletionListItem(s, AutoCompletionItemPriority.UNKNOWN)); 233 233 } else 234 234 throw new IllegalArgumentException(); … … 243 243 model.removeAllElements(); 244 244 for (String elem : elems) { 245 model.addElement(new AutoCompletionListItem(elem, AutoCompletionItemPri tority.UNKNOWN));245 model.addElement(new AutoCompletionListItem(elem, AutoCompletionItemPriority.UNKNOWN)); 246 246 } 247 247 // disable autocomplete to prevent unnecessary actions in -
trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionItemPriority.java
r6435 r6437 8 8 * Instances of this class are not modifiable. 9 9 */ 10 public class AutoCompletionItemPri tority implements Comparable<AutoCompletionItemPritority> {10 public class AutoCompletionItemPriority implements Comparable<AutoCompletionItemPriority> { 11 11 12 12 /** … … 15 15 * usually not used by the user. 16 16 */ 17 public static final AutoCompletionItemPri tority IS_IN_STANDARD_AND_IN_DATASET = new AutoCompletionItemPritority(true, true, false);17 public static final AutoCompletionItemPriority IS_IN_STANDARD_AND_IN_DATASET = new AutoCompletionItemPriority(true, true, false); 18 18 19 19 /** … … 21 21 * the value of a tag name=*. 22 22 */ 23 public static final AutoCompletionItemPri tority IS_IN_DATASET = new AutoCompletionItemPritority(true, false, false);23 public static final AutoCompletionItemPriority IS_IN_DATASET = new AutoCompletionItemPriority(true, false, false); 24 24 25 25 /** … … 27 27 * or a standard value for a given tag name (from the presets). 28 28 */ 29 public static final AutoCompletionItemPri tority IS_IN_STANDARD = new AutoCompletionItemPritority(false, true, false);29 public static final AutoCompletionItemPriority IS_IN_STANDARD = new AutoCompletionItemPriority(false, true, false); 30 30 31 31 /** 32 32 * Indicates that this is a value from a selected object. 33 33 */ 34 public static final AutoCompletionItemPri tority IS_IN_SELECTION = new AutoCompletionItemPritority(false, false, true);34 public static final AutoCompletionItemPriority IS_IN_SELECTION = new AutoCompletionItemPriority(false, false, true); 35 35 36 36 /** Unknown priority. This is the lowest priority. */ 37 public static final AutoCompletionItemPri tority UNKNOWN = new AutoCompletionItemPritority(false, false, false);37 public static final AutoCompletionItemPriority UNKNOWN = new AutoCompletionItemPriority(false, false, false); 38 38 39 39 private final boolean inDataSet; … … 41 41 private final boolean selected; 42 42 43 public AutoCompletionItemPri tority(boolean inDataSet, boolean inStandard, boolean selected) {43 public AutoCompletionItemPriority(boolean inDataSet, boolean inStandard, boolean selected) { 44 44 this.inDataSet = inDataSet; 45 45 this.inStandard = inStandard; … … 64 64 */ 65 65 @Override 66 public int compareTo(AutoCompletionItemPri tority other) {66 public int compareTo(AutoCompletionItemPriority other) { 67 67 int sel = Boolean.valueOf(selected).compareTo(other.selected); 68 68 if (sel != 0) return sel; … … 81 81 * The resulting priority is always >= the original ones. 82 82 */ 83 public AutoCompletionItemPri tority mergeWith(AutoCompletionItemPritority other) {84 return new AutoCompletionItemPri tority(83 public AutoCompletionItemPriority mergeWith(AutoCompletionItemPriority other) { 84 return new AutoCompletionItemPriority( 85 85 inDataSet || other.inDataSet, 86 86 inStandard || other.inStandard, -
trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionList.java
r6317 r6437 135 135 * @param priority the priority to use 136 136 */ 137 public void add(Collection<String> values, AutoCompletionItemPri tority priority) {137 public void add(Collection<String> values, AutoCompletionItemPriority priority) { 138 138 if (values == null) return; 139 139 for (String value: values) { -
trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionListItem.java
r6084 r6437 10 10 * in an auto completion list for tag names, standard tag names would be assigned a higher 11 11 * priority than arbitrary tag names present in the current data set. There are three priority levels, 12 * {@link AutoCompletionItemPri tority}.12 * {@link AutoCompletionItemPriority}. 13 13 * 14 14 * The value is a string which will be displayed in the auto completion list. … … 18 18 19 19 /** the pritority of this item */ 20 private AutoCompletionItemPri tority priority;20 private AutoCompletionItemPriority priority; 21 21 /** the value of this item */ 22 22 private String value; 23 23 24 24 /** 25 * constructor 25 * Constructs a new {@code AutoCompletionListItem} with the given value and priority. 26 * @param value The value 27 * @param priority The priority 26 28 */ 27 public AutoCompletionListItem(String value, AutoCompletionItemPri tority priority) {29 public AutoCompletionListItem(String value, AutoCompletionItemPriority priority) { 28 30 this.value = value; 29 31 this.priority = priority; 30 32 } 31 33 34 /** 35 * Constructs a new {@code AutoCompletionListItem} with the given value and unknown priority. 36 * @param value The value 37 */ 32 38 public AutoCompletionListItem(String value) { 33 39 this.value = value; 34 priority = AutoCompletionItemPri tority.UNKNOWN;40 priority = AutoCompletionItemPriority.UNKNOWN; 35 41 } 36 42 43 /** 44 * Constructs a new {@code AutoCompletionListItem}. 45 */ 37 46 public AutoCompletionListItem() { 38 47 value = ""; 39 priority = AutoCompletionItemPri tority.UNKNOWN;48 priority = AutoCompletionItemPriority.UNKNOWN; 40 49 } 41 50 42 43 51 /** 44 * 52 * Returns the priority. 45 53 * @return the priority 46 54 */ 47 public AutoCompletionItemPri tority getPriority() {55 public AutoCompletionItemPriority getPriority() { 48 56 return priority; 49 57 } 50 58 51 59 /** 52 * sets the priority60 * Sets the priority. 53 61 * @param priority the priority 54 62 */ 55 public void setPriority(AutoCompletionItemPri tority priority) {63 public void setPriority(AutoCompletionItemPriority priority) { 56 64 this.priority = priority; 57 65 } 58 66 59 67 /** 60 * 68 * Returns the value. 61 69 * @return the value 62 70 */ -
trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManager.java
r6248 r6437 216 216 */ 217 217 public void populateWithMemberRoles(AutoCompletionList list) { 218 list.add(presetRoleCache, AutoCompletionItemPritority.IS_IN_STANDARD); 219 list.add(getRoleCache(), AutoCompletionItemPritority.IS_IN_DATASET); 220 } 221 222 /** 223 * Populates the an {@link AutoCompletionList} with the currently cached 224 * tag keys 218 list.add(presetRoleCache, AutoCompletionItemPriority.IS_IN_STANDARD); 219 list.add(getRoleCache(), AutoCompletionItemPriority.IS_IN_DATASET); 220 } 221 222 /** 223 * Populates the an {@link AutoCompletionList} with the currently cached tag keys 225 224 * 226 225 * @param list the list to populate 227 226 */ 228 227 public void populateWithKeys(AutoCompletionList list) { 229 list.add(getPresetKeys(), AutoCompletionItemPritority.IS_IN_STANDARD); 230 list.add(getDataKeys(), AutoCompletionItemPritority.IS_IN_DATASET); 228 list.add(getPresetKeys(), AutoCompletionItemPriority.IS_IN_STANDARD); 229 list.add(new AutoCompletionListItem("source", AutoCompletionItemPriority.IS_IN_STANDARD)); 230 list.add(getDataKeys(), AutoCompletionItemPriority.IS_IN_DATASET); 231 231 } 232 232 … … 251 251 public void populateWithTagValues(AutoCompletionList list, List<String> keys) { 252 252 for (String key : keys) { 253 list.add(getPresetValues(key), AutoCompletionItemPri tority.IS_IN_STANDARD);254 list.add(getDataValues(key), AutoCompletionItemPri tority.IS_IN_DATASET);253 list.add(getPresetValues(key), AutoCompletionItemPriority.IS_IN_STANDARD); 254 list.add(getDataValues(key), AutoCompletionItemPriority.IS_IN_DATASET); 255 255 } 256 256 }
Note:
See TracChangeset
for help on using the changeset viewer.