Changeset 3015 in josm for trunk


Ignore:
Timestamp:
2010-02-18T12:24:10+01:00 (15 years ago)
Author:
Gubaer
Message:

Possibility to inject a TagCellEditor into a TagTable. Required for cleaning up the tageditor plugin.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/tagging/TagTable.java

    r2997 r3015  
    356356        // create the table cell editor and set it to key and value columns
    357357        //
    358         editor = new TagCellEditor();
    359         getColumnModel().getColumn(0).setCellEditor(editor);
    360         getColumnModel().getColumn(1).setCellEditor(editor);
    361 
    362         getSelectionModel().addListSelectionListener(new ListSelectionListener() {
    363 
    364             public void valueChanged(ListSelectionEvent e) {
    365                 ListSelectionModel rm = getSelectionModel();
    366                 ListSelectionModel cm = getColumnModel().getSelectionModel();
    367             }
    368         });
     358        setTagCellEditor(new TagCellEditor());
    369359    }
    370360
     
    444434            editor.getEditor().addKeyListener(l);
    445435        }
     436    }
     437
     438    /**
     439     * Inject a tag cell editor in the tag table
     440     *
     441     * @param editor
     442     */
     443    public void setTagCellEditor(TagCellEditor editor) {
     444        if (isEditing()) {
     445            this.editor.cancelCellEditing();
     446        }
     447        this.editor = editor;
     448        getColumnModel().getColumn(0).setCellEditor(editor);
     449        getColumnModel().getColumn(1).setCellEditor(editor);
    446450    }
    447451
Note: See TracChangeset for help on using the changeset viewer.