Changeset 14520 in osm for applications/editors/josm
- Timestamp:
- 2009-04-16T11:04:20+02:00 (16 years ago)
- Location:
- applications/editors/josm/plugins/tageditor
- Files:
-
- 149 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/tageditor/build.number
r14426 r14520 1 1 #Build Number for ANT. Do not edit! 2 # Wed Apr 08 11:49:48CEST 20093 build.number= 1862 #Thu Apr 16 11:00:52 CEST 2009 3 build.number=204 -
applications/editors/josm/plugins/tageditor/build.xml
r14429 r14520 38 38 <property name="plugin.description" value="Provides a dialog for editing tags in a tabular grid."/> 39 39 <property name="plugin.doc.url" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/TagEditor"/> 40 <property name="plugin.main.version" value=" 0.7"/>40 <property name="plugin.main.version" value="1515"/> 41 41 <property name="plugin.jar.name" value="${ant.project.name}.jar"/> 42 42 … … 73 73 </exec> 74 74 <mkdir dir="${plugin.build.dir}"/> 75 </target> 75 </target> 76 76 77 77 <!-- -
applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TableCellEditor.java
r14416 r14520 34 34 private TagFieldEditor editor = null; 35 35 private TagModel currentTag = null; 36 private TagEditorModel tagEditorModel = null; 36 37 private int currentColumn = 0; 37 38 … … 194 195 @Override 195 196 public boolean stopCellEditing() { 197 if (tagEditorModel == null) { 198 logger.warning("no tag editor model set. Can't update edited values. Please set tag editor model first"); 199 return super.stopCellEditing(); 200 } 196 201 197 202 if (currentColumn == 0) { 198 currentTag.setName(editor.getText());203 tagEditorModel.updateTagName(currentTag, editor.getText()); 199 204 } else if (currentColumn == 1){ 200 205 if (currentTag.getValueCount() > 1 && ! editor.getText().equals("")) { 201 currentTag.setValue(editor.getText());206 tagEditorModel.updateTagValue(currentTag, editor.getText()); 202 207 } else if (currentTag.getValueCount() <= 1) { 203 currentTag.setValue(editor.getText());208 tagEditorModel.updateTagValue(currentTag, editor.getText()); 204 209 } 205 210 } … … 243 248 } 244 249 250 /** 251 * sets the tag editor model 252 * 253 * @param tagEditorModel the tag editor model 254 */ 255 public void setTagEditorModel(TagEditorModel tagEditorModel) { 256 this.tagEditorModel = tagEditorModel; 257 } 258 245 259 } -
applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagEditor.java
r14338 r14520 10 10 import javax.swing.JScrollPane; 11 11 import javax.swing.ScrollPaneConstants; 12 import javax.swing.table.TableCellEditor; 12 13 13 14 14 import org.openstreetmap.josm.plugins.tageditor.ac.AutoCompletionCache; … … 103 103 // creates a default model and a default cache 104 104 // 105 tagEditorModel = new TagEditorModel(); 106 105 tagEditorModel = new TagEditorModel(); 107 106 108 107 build(); … … 125 124 public void setTagEditorModel(TagEditorModel tagEditorModel) { 126 125 tblTagEditor.setModel(tagEditorModel); 126 for (int i=0; i<=1; i++) { 127 TableCellEditor editor = (TableCellEditor)tblTagEditor.getColumnModel().getColumn(i).getCellEditor(); 128 if (editor != null) { 129 editor.setTagEditorModel(tagEditorModel); 130 } 131 } 127 132 presetManager.setModel(tagEditorModel); 128 133 } … … 145 150 146 151 public void stopEditing() { 147 TableCellEditor editor = tblTagEditor.getCellEditor();152 TableCellEditor editor = (TableCellEditor) tblTagEditor.getCellEditor(); 148 153 if (editor != null) { 149 154 editor.stopCellEditing(); -
applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagEditorModel.java
r14416 r14520 13 13 14 14 import javax.swing.DefaultComboBoxModel; 15 import javax.swing.SwingUtilities; 15 16 import javax.swing.table.AbstractTableModel; 16 17 … … 67 68 } 68 69 69 protected void fireDirtyStateChanged( boolean oldValue,boolean newValue) {70 protected void fireDirtyStateChanged(final boolean oldValue, final boolean newValue) { 70 71 propChangeSupport.firePropertyChange(PROP_DIRTY, oldValue, newValue); 71 72 } … … 534 535 535 536 537 /** 538 * updates the name of a tag and sets the dirty state to true if 539 * the new name is different from the old name. 540 * 541 * @param tag the tag 542 * @param newName the new name 543 */ 536 544 public void updateTagName(TagModel tag, String newName) { 537 545 String oldName = tag.getName(); … … 542 550 } 543 551 552 /** 553 * updates the value value of a tag and sets the dirty state to true if the 554 * new name is different from the old name 555 * 556 * @param tag the tag 557 * @param newValue the new value 558 */ 544 559 public void updateTagValue(TagModel tag, String newValue) { 545 560 String oldValue = tag.getValue(); -
applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagTable.java
r14338 r14520 340 340 // 341 341 editor = new TableCellEditor(); 342 editor.setTagEditorModel((TagEditorModel)getModel()); 342 343 getColumnModel().getColumn(0).setCellEditor(editor); 343 344 getColumnModel().getColumn(1).setCellEditor(editor); … … 468 469 469 470 } 470 471 471 472 472 473 473 }
Note:
See TracChangeset
for help on using the changeset viewer.