Ignore:
Timestamp:
2015-09-14T22:44:28+02:00 (9 years ago)
Author:
simon04
Message:

fix #11686 - Error by uploading changeset with too long tag

Changeset tags table: limit key/value length to allowed maximum of API

File:
1 edited

Legend:

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

    r8540 r8760  
    393393    /**
    394394     * initialize the table
    395      */
    396     protected final void init() {
     395     * @param maxCharacters maximum number of characters allowed for keys and values, 0 for unlimited
     396     */
     397    protected final void init(final int maxCharacters) {
    397398        setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    398399        setRowSelectionAllowed(true);
     
    426427        // create the table cell editor and set it to key and value columns
    427428        //
    428         TagCellEditor tmpEditor = new TagCellEditor();
     429        TagCellEditor tmpEditor = new TagCellEditor(maxCharacters);
    429430        setRowHeight(tmpEditor.getEditor().getPreferredSize().height);
    430431        setTagCellEditor(tmpEditor);
     
    435436     *
    436437     * @param model the tag editor model
    437      */
    438     public TagTable(TagEditorModel model) {
     438     * @param maxCharacters maximum number of characters allowed for keys and values, 0 for unlimited
     439     */
     440    public TagTable(TagEditorModel model, final int maxCharacters) {
    439441        super(model, new TagTableColumnModel(model.getColumnSelectionModel()), model.getRowSelectionModel());
    440442        this.model = model;
    441         init();
     443        init(maxCharacters);
    442444    }
    443445
Note: See TracChangeset for help on using the changeset viewer.