@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); } } }
/** * Returns true if the action is enabled. Returns * true only if the action is enabled and the table * column can be controlled. * * @return true if the action is enabled, false otherwise * @see #canControlColumn() */ @Override public boolean isEnabled() { return super.isEnabled() && canControlColumn(); }
/** * Returns true if the action is enabled. Returns * true only if the action is enabled and the table * column can be controlled. * * @return true if the action is enabled, false otherwise * @see #canControlColumn() */ @Override public boolean isEnabled() { return super.isEnabled() && canControlColumn(); }
@Override public synchronized void setSelected(boolean newValue) { super.setSelected(newValue); if (canControlColumn()) { if (!fromColumn) ((TableColumnExt) column).setVisible(newValue); } }
@Override public synchronized void setSelected(boolean newValue) { super.setSelected(newValue); if (canControlColumn()) { if (!fromColumn) ((TableColumnExt) column).setVisible(newValue); } }
/** * Returns true if the action is enabled. Returns * true only if the action is enabled and the table * column can be controlled. * * @return true if the action is enabled, false otherwise * @see #canControlColumn() */ @Override public boolean isEnabled() { return super.isEnabled() && canControlColumn(); }
/** * Returns true if the action is enabled. Returns * true only if the action is enabled and the table * column can be controlled. * * @return true if the action is enabled, false otherwise * @see #canControlColumn() */ @Override public boolean isEnabled() { return super.isEnabled() && canControlColumn(); }
@Override public synchronized void setSelected(boolean newValue) { super.setSelected(newValue); if (canControlColumn()) { if (!fromColumn) ((TableColumnExt) column).setVisible(newValue); } }
/** * Returns true if the action is enabled. Returns * true only if the action is enabled and the table * column can be controlled. * * @return true if the action is enabled, false otherwise * @see #canControlColumn() */ @Override public boolean isEnabled() { return super.isEnabled() && canControlColumn(); }
@Override public synchronized void setSelected(boolean newValue) { super.setSelected(newValue); if (canControlColumn()) { if (!fromColumn) ((TableColumnExt) column).setVisible(newValue); } }
@Override public synchronized void setSelected(boolean newValue) { super.setSelected(newValue); if (canControlColumn()) { ((TableColumnExt) column).setVisible(newValue); } }