Ignore:
Timestamp:
2009-04-07T20:56:18+02:00 (15 years ago)
Author:
guggis
Message:

cosmetics

Location:
applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TableCellEditor.java

    r14338 r14416  
    4242        private AutoCompletionList autoCompletionList = null;
    4343       
     44
    4445        /**
    4546         * constructor
     
    128129                }
    129130               
    130                 logger.info("acCache=" + acCache);
    131131                for (String value : acCache.getValues(forKey)) {
    132132                        autoCompletionList.add(
     
    182182        @Override
    183183        public Object getCellEditorValue() {
    184                 String value = "";
     184                return editor.getText();
     185    }
     186
     187       
     188       
     189        @Override
     190        public void cancelCellEditing() {
     191                super.cancelCellEditing();
     192        }
     193
     194        @Override
     195        public boolean stopCellEditing() {
     196               
    185197                if (currentColumn == 0) {
    186198                        currentTag.setName(editor.getText());
     
    192204                        }
    193205                }
    194             return value;
    195     }
    196 
    197        
    198        
    199         @Override
    200         public void cancelCellEditing() {
    201                 super.cancelCellEditing();
    202         }
    203 
    204         @Override
    205         public boolean stopCellEditing() {
    206                 boolean ret = super.stopCellEditing();
    207                 return ret;
    208                
     206           
     207                return super.stopCellEditing();
    209208        }
    210209
     
    230229                this.acCache = acCache;
    231230        }
     231       
    232232
    233233       
  • applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagEditorModel.java

    r14338 r14416  
    8989        @Override public Object getValueAt(int rowIndex, int columnIndex) {
    9090                if (rowIndex >= getRowCount()) {
    91                         return null;
    92                 }
    93                 if (columnIndex >= getColumnCount()) {
    94                         return null;
     91                        throw new IndexOutOfBoundsException("unexpected rowIndex: rowIndex=" + rowIndex);
    9592                }
    9693               
     
    104101                }               
    105102    }
     103       
    106104       
    107105        /**
     
    534532                fireTableDataChanged();
    535533        }
     534       
     535       
     536        public void updateTagName(TagModel tag, String newName) {
     537                String oldName = tag.getName();
     538                tag.setName(newName);
     539                if (! newName.equals(oldName)) {
     540                        setDirty(true);
     541                }
     542        }
     543       
     544        public void updateTagValue(TagModel tag, String newValue) {
     545                String oldValue = tag.getValue();
     546                tag.setValue(newValue);
     547                if (! newValue.equals(oldValue)) {
     548                        setDirty(true);
     549                }
     550        }
    536551}
Note: See TracChangeset for help on using the changeset viewer.