| java.lang.Object com.jidesoft.swing.DefaultSelectable
DefaultSelectable | public class DefaultSelectable implements Selectable(Code) | | The element used by CheckBoxList's ListModel. In order to allow check box
in JList without messing up when list model changes, we use this class
to store the object itself and a boolean to indicated if the row is selected.
|
Method Summary | |
public boolean | equals(Object obj) | public Object | getObject() Gets the actual element. | public int | hashCode() Overrides to consider the hash code of the object only. | public void | invertSelected() Inverts the selection status. | public boolean | isEnabled() Checks if selection change is allowed. | public boolean | isSelected() Gets the selected status.
true if it is selected. | public void | setEnabled(boolean enabled) Enabled selection change. | public void | setObject(Object object) Sets the actual element. | public void | setSelected(boolean selected) Sets it as selected. | public String | toString() Overrides to consider the toString() of object only. |
_enabled | protected boolean _enabled(Code) | | |
_selected | protected boolean _selected(Code) | | |
DefaultSelectable | public DefaultSelectable(Object object)(Code) | | Creates CheckBoxListElement with an actual object. In the case of CheckBoxList,
instead of add the object directly to ListModel, you should wrap it in CheckBoxListElement and
add CheckBoxListElement into ListModel.
Parameters: object - the actual object |
getObject | public Object getObject()(Code) | | Gets the actual element.
the actual element. |
hashCode | public int hashCode()(Code) | | Overrides to consider the hash code of the object only. From outside point of view,
this class should behave just like object itself. That's why we override hashCode.
the hash code. |
invertSelected | public void invertSelected()(Code) | | Inverts the selection status.
|
isEnabled | public boolean isEnabled()(Code) | | Checks if selection change is allowed.
true if selection change is allowed. |
isSelected | public boolean isSelected()(Code) | | Gets the selected status.
true if it is selected. Otherwise, false. |
setEnabled | public void setEnabled(boolean enabled)(Code) | | Enabled selection change. Enabled false doesn't mean selected is false. If it is selected before,
setEnable(false) won't make selected beceome false. In the other word, setEnabled won't change the
the value of isSelected().
Parameters: enabled - |
setObject | public void setObject(Object object)(Code) | | Sets the actual element.
Parameters: object - |
setSelected | public void setSelected(boolean selected)(Code) | | Sets it as selected.
Parameters: selected - |
toString | public String toString()(Code) | | Overrides to consider the toString() of object only. From outside point of view,
this class should behave just like object itself. That's why we override toString.
toString() of object. |
|
|