/** * Toggle the selection. If the new selection is different to the old selection an {@link * ItemEvent} is raised. */ public void setSelected(boolean selected) { if (model.isSelected() != selected) { model.setSelected(selected); fireStateChanged(); reload(); } }
public boolean isSelected() { return model.isSelected(); }
/** Returns the selected items or null if no items are selected. */ public Object[] getSelectedObjects() { return model.isSelected() ? new Object[] {this} : null; }