Changeset 3137 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2010-03-15T14:18:45+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java
r3083 r3137 22 22 import org.openstreetmap.josm.command.SequenceCommand; 23 23 import org.openstreetmap.josm.data.osm.OsmPrimitive; 24 import org.openstreetmap.josm.data.osm.TagCollection; 24 25 import org.openstreetmap.josm.data.osm.Tagged; 25 26 … … 331 332 332 333 /** 334 * Initializes the model with the tags in a tag collection. Removes 335 * all tags if {@code tags} is null. 336 * 337 * @param tags the tags 338 */ 339 public void initFromTags(TagCollection tags) { 340 clear(); 341 if (tags == null){ 342 setDirty(false); 343 return; 344 } 345 for (String key : tags.getKeys()) { 346 String value = tags.getJoinedValues(key); 347 add(key,value); 348 } 349 sort(); 350 // add an empty row 351 TagModel tag = new TagModel(); 352 this.tags.add(tag); 353 setDirty(false); 354 } 355 356 /** 333 357 * applies the current state of the tag editor model to a primitive 334 358 * … … 370 394 applyToTags(tags); 371 395 return tags; 396 } 397 398 /** 399 * Replies the the tags in this tag editor model as {@see TagCollection}. 400 * 401 * @return the the tags in this tag editor model as {@see TagCollection} 402 */ 403 public TagCollection getTagCollection() { 404 return TagCollection.from(getTags()); 372 405 } 373 406
Note:
See TracChangeset
for help on using the changeset viewer.