Changeset 14476 in josm
- Timestamp:
- 2018-12-01T15:58:46+01:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r14470 r14476 96 96 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetType; 97 97 import org.openstreetmap.josm.gui.util.HighlightHelper; 98 import org.openstreetmap.josm.gui.util.TableHelper; 98 99 import org.openstreetmap.josm.gui.widgets.CompileSearchTextDecorator; 99 100 import org.openstreetmap.josm.gui.widgets.DisableShortcutsOnFocusGainedTextField; … … 309 310 tagData.setColumnIdentifiers(new String[]{tr("Key"), tr("Value")}); 310 311 tagTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); 312 tagTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); 311 313 tagTable.getTableHeader().setReorderingAllowed(false); 312 314 … … 333 335 membershipData.setColumnIdentifiers(new String[]{tr("Member Of"), tr("Role"), tr("Position")}); 334 336 membershipTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); 337 membershipTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); 335 338 336 339 TableColumnModel mod = membershipTable.getColumnModel(); … … 670 673 pluginHook.setVisible(hasSelection); 671 674 675 // resize tables to fit content 676 TableHelper.computeColumnsWidth(tagTable); 677 TableHelper.computeColumnsWidth(membershipTable); 678 672 679 int selectedIndex; 673 680 if (selectedTag != null && (selectedIndex = findViewRow(tagTable, tagData, selectedTag)) != -1) { -
trunk/src/org/openstreetmap/josm/gui/util/TableHelper.java
r9231 r14476 17 17 18 18 /** 19 * (originally from @class org.openstreetmap.josm.gui.preferences.SourceEditor)20 19 * adjust the preferred width of column col to the maximum preferred width of the cells 21 20 * requires JTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); … … 34 33 tbl.getColumnModel().getColumn(col).setPreferredWidth(Math.min(maxwidth+10, maxColumnWidth)); 35 34 } 35 36 /** 37 * adjust the table's columns to fit their content best 38 * requires JTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); 39 * @param tbl table 40 * @since 14476 41 */ 42 public static void computeColumnsWidth(JTable tbl) { 43 for (int column = 0; column < tbl.getColumnCount(); column++) { 44 adjustColumnWidth(tbl, column, Integer.MAX_VALUE); 45 } 46 } 36 47 }
Note:
See TracChangeset
for help on using the changeset viewer.