Changeset 8760 in josm
- Timestamp:
- 2015-09-14T22:44:28+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetTagsPanel.java
r8510 r8760 26 26 setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); 27 27 model = new TagEditorModel(); 28 TagTable tblTags = new TagTable(model); 28 TagTable tblTags = new TagTable(model, 0); 29 29 tblTags.setEnabled(false); 30 30 add(new JScrollPane(tblTags), BorderLayout.CENTER); -
trunk/src/org/openstreetmap/josm/gui/io/TagSettingsPanel.java
r8510 r8760 22 22 23 23 /** checkbox for selecting whether an atomic upload is to be used */ 24 private final TagEditorPanel pnlTagEditor = new TagEditorPanel(null); 24 private final TagEditorPanel pnlTagEditor = new TagEditorPanel(null, null, Changeset.MAX_CHANGESET_TAG_LENGTH); 25 25 /** the model for the changeset comment */ 26 26 private final transient ChangesetCommentModel changesetCommentModel; -
trunk/src/org/openstreetmap/josm/gui/tagging/TagCellEditor.java
r8510 r8760 30 30 /** 31 31 * constructor 32 * @param maxCharacters maximum number of characters allowed, 0 for unlimited 32 33 */ 33 public TagCellEditor() { 34 public TagCellEditor(final int maxCharacters) { 34 35 editor = new AutoCompletingTextField(0, false); 36 if (maxCharacters > 0) { 37 editor.setMaxChars(maxCharacters); 38 } 35 39 editor.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1)); 36 40 } -
trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorPanel.java
r8510 r8760 36 36 private TagEditorModel model; 37 37 /** the tag table */ 38 private TagTable tagTable; 38 private final TagTable tagTable; 39 39 40 40 private PresetListPanel presetListPanel; … … 48 48 protected JPanel buildTagTableEditorPanel() { 49 49 JPanel pnl = new JPanel(); 50 tagTable = new TagTable(model);51 50 pnl.setLayout(new BorderLayout()); 52 51 pnl.add(new JScrollPane(tagTable), BorderLayout.CENTER); … … 142 141 */ 143 142 public TagEditorPanel(PresetHandler presetHandler) { 144 this(null, presetHandler); 143 this(null, presetHandler, 0); 145 144 } 146 145 … … 150 149 * 151 150 * @param model the tag editor model 152 */ 153 public TagEditorPanel(TagEditorModel model, PresetHandler presetHandler) { 151 * @param maxCharacters maximum number of characters allowed, 0 for unlimited 152 */ 153 public TagEditorPanel(TagEditorModel model, PresetHandler presetHandler, final int maxCharacters) { 154 154 this.model = model; 155 155 this.presetHandler = presetHandler; … … 157 157 this.model = new TagEditorModel(); 158 158 } 159 this.tagTable = new TagTable(this.model, maxCharacters); 159 160 build(); 160 161 } -
trunk/src/org/openstreetmap/josm/gui/tagging/TagTable.java
r8540 r8760 393 393 /** 394 394 * 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) { 397 398 setAutoResizeMode(JTable.AUTO_RESIZE_OFF); 398 399 setRowSelectionAllowed(true); … … 426 427 // create the table cell editor and set it to key and value columns 427 428 // 428 TagCellEditor tmpEditor = new TagCellEditor(); 429 TagCellEditor tmpEditor = new TagCellEditor(maxCharacters); 429 430 setRowHeight(tmpEditor.getEditor().getPreferredSize().height); 430 431 setTagCellEditor(tmpEditor); … … 435 436 * 436 437 * @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) { 439 441 super(model, new TagTableColumnModel(model.getColumnSelectionModel()), model.getRowSelectionModel()); 440 442 this.model = model; 441 init(); 443 init(maxCharacters); 442 444 } 443 445
Note:
See TracChangeset
for help on using the changeset viewer.