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() {
|
showLegacyCheckBox.addItemListener(new ItemListener() {
|
||||||
@Override
|
@Override
|
||||||
public void itemStateChanged(ItemEvent e) {
|
public void itemStateChanged(ItemEvent e) {
|
||||||
updateFilters();
|
boolean selected = e != null && e.getStateChange() == ItemEvent.SELECTED;
|
||||||
tm.setColumnVisible(legacyColumn, showLegacyCheckBox.isSelected());
|
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)
|
// Let's say the optimal width is 100 (you can adjust this as needed)
|
||||||
int optimalWidth = 50;
|
int optimalWidth = 50;
|
||||||
legacyColumn.setPreferredWidth(optimalWidth);
|
legacyColumn.setPreferredWidth(optimalWidth);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user