@Override public void itemStateChanged(final ItemEvent e) { if (canControlColumn()) { if ((e.getStateChange() == ItemEvent.DESELECTED) //JW: guarding against 1 leads to #212-swingx: setting // column visibility programatically fails if // the current column is the second last visible // guarding against 0 leads to hiding all columns // by deselecting the menu item. && (table.getColumnCount() <= 1) // JW Fixed #212: basically implemented Rob's idea to distinguish // event sources instead of unconditionally reselect // not entirely sure if the state transitions are completely // defined but all related tests are passing now. && !fromColumn) { reselect(); } else { setSelected(e.getStateChange() == ItemEvent.SELECTED); } } }
@Override public void itemStateChanged(final ItemEvent e) { if (canControlColumn()) { if ((e.getStateChange() == ItemEvent.DESELECTED) //JW: guarding against 1 leads to #212-swingx: setting // column visibility programatically fails if // the current column is the second last visible // guarding against 0 leads to hiding all columns // by deselecting the menu item. && (table.getColumnCount() <= 1) // JW Fixed #212: basically implemented Rob's idea to distinguish // event sources instead of unconditionally reselect // not entirely sure if the state transitions are completely // defined but all related tests are passing now. && !fromColumn) { reselect(); } else { setSelected(e.getStateChange() == ItemEvent.SELECTED); } } }
@Override public void itemStateChanged(final ItemEvent e) { if (canControlColumn()) { if ((e.getStateChange() == ItemEvent.DESELECTED) //JW: guarding against 1 leads to #212-swingx: setting // column visibility programatically fails if // the current column is the second last visible // guarding against 0 leads to hiding all columns // by deselecting the menu item. && (table.getColumnCount() <= 1) // JW Fixed #212: basically implemented Rob's idea to distinguish // event sources instead of unconditionally reselect // not entirely sure if the state transitions are completely // defined but all related tests are passing now. && !fromColumn) { reselect(); } else { setSelected(e.getStateChange() == ItemEvent.SELECTED); } } }
@Override public void itemStateChanged(final ItemEvent e) { if (canControlColumn()) { if ((e.getStateChange() == ItemEvent.DESELECTED) //JW: guarding against 1 leads to #212-swingx: setting // column visibility programatically fails if // the current column is the second last visible // guarding against 0 leads to hiding all columns // by deselecting the menu item. && (table.getColumnCount() <= 1) // JW Fixed #212: basically implemented Rob's idea to distinguish // event sources instead of unconditionally reselect // not entirely sure if the state transitions are completely // defined but all related tests are passing now. && !fromColumn) { reselect(); } else { setSelected(e.getStateChange() == ItemEvent.SELECTED); } } }
@Override public void itemStateChanged(final ItemEvent e) { if (canControlColumn()) { if ((e.getStateChange() == ItemEvent.DESELECTED) //JW: guarding against 1 leads to #212-swingx: setting // column visibility programatically fails if // the current column is the second last visible // guarding against 0 leads to hiding all columns // by deselecting the menu item. && (table.getColumnCount() <= 1) // JW Fixed #212: basically implemented Rob's idea to distinguish // event sources instead of unconditionally reselect // not entirely sure if the state transitions are completely // defined but all related tests are passing now. && !fromColumn) { reselect(); } else { setSelected(e.getStateChange() == ItemEvent.SELECTED); } } }