Don't do anything if legacy column already in right state
This commit is contained in:
parent
9d6d8f25b7
commit
d6b5034764
@ -251,10 +251,17 @@ public class ComponentPresetChooserDialog extends JDialog {
|
||||
showLegacyCheckBox.addItemListener(new ItemListener() {
|
||||
@Override
|
||||
public void itemStateChanged(ItemEvent e) {
|
||||
updateFilters();
|
||||
tm.setColumnVisible(legacyColumn, showLegacyCheckBox.isSelected());
|
||||
boolean selected = e != null && e.getStateChange() == ItemEvent.SELECTED;
|
||||
if (tm.isColumnVisible(legacyColumn) == selected) {
|
||||
// No change
|
||||
return;
|
||||
}
|
||||
|
||||
if (showLegacyCheckBox.isSelected()) {
|
||||
updateFilters();
|
||||
|
||||
tm.setColumnVisible(legacyColumn, selected);
|
||||
|
||||
if (selected) {
|
||||
// Let's say the optimal width is 100 (you can adjust this as needed)
|
||||
int optimalWidth = 50;
|
||||
legacyColumn.setPreferredWidth(optimalWidth);
|
||||
|
Loading…
x
Reference in New Issue
Block a user