Changeset 14677 in josm


Ignore:
Timestamp:
2019-01-12T16:58:10+01:00 (2 months ago)
Author:
Don-vip
Message:

see #14666 - add propertiesdialog.autoresizeTagsTable option, disabled by default (patch by bagage)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

    r14673 r14677  
    8181import org.openstreetmap.josm.data.osm.search.SearchCompiler;
    8282import org.openstreetmap.josm.data.osm.search.SearchSetting;
     83import org.openstreetmap.josm.data.preferences.BooleanProperty;
    8384import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil;
    8485import org.openstreetmap.josm.gui.ExtendedDialog;
     
    243244    private final transient TaggingPresetHandler presetHandler = new TaggingPresetCommandHandler();
    244245
     246    private static final BooleanProperty PROP_AUTORESIZE_TAGS_TABLE = new BooleanProperty("propertiesdialog.autoresizeTagsTable", false);
     247
    245248    /**
    246249     * Create a new PropertiesDialog
     
    311314        tagData.setColumnIdentifiers(new String[]{tr("Key"), tr("Value")});
    312315        tagTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    313         tagTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    314316        tagTable.getTableHeader().setReorderingAllowed(false);
    315317
     
    673675        pluginHook.setVisible(hasSelection);
    674676
    675         // resize tables to fit content
    676         TableHelper.computeColumnsWidth(tagTable);
     677        autoresizeTagTable();
    677678
    678679        int selectedIndex;
     
    697698        } else {
    698699            setTitle(tr("Tags/Memberships"));
     700        }
     701    }
     702
     703    private void autoresizeTagTable() {
     704        if (PROP_AUTORESIZE_TAGS_TABLE.get()) {
     705            // resize table's columns to fit content
     706            TableHelper.computeColumnsWidth(tagTable);
    699707        }
    700708    }
Note: See TracChangeset for help on using the changeset viewer.