Modifier and Type | Field and Description |
---|---|
protected TriStateBoolean |
_checkBoxState
If there is a check box, this variable reports its state.
|
protected boolean |
_hasCheckBox
If
true , then the cell renderer should include a checkbox; if false then no checkbox. |
protected int |
_heightAdj
Used to adjust the height of an individual node.
|
protected javax.swing.Icon |
_icon
The icon shown with the text.
|
protected boolean |
_isArmed
If
true , indicates that the check box is partially committed. |
protected boolean |
_isCheckBoxEnabled
This should be
true if the list's checkbox should have a visual appearance of being enabled. |
protected boolean |
_isCheckBoxSelectable
This should be
true if the list's checkbox is selectable (i.e. |
protected boolean |
_isPressed
If
true , indicates that the check box should be rendered as being pressed down. |
protected boolean |
_isTextEnabled
This should be
true if the list's text is drawn as enabled; false otherwise. |
protected boolean |
_isTextSelectable
This should be
true if the list's text is selectable; false otherwise. |
protected java.lang.String |
_text
The string label that is shown in the list.
|
protected java.lang.String |
_toolTipText
The tooltip to show in the list
|
protected java.lang.Object |
_userObject
Can be used to hold additional user information.
|
Constructor and Description |
---|
CheckBoxListCellData(javax.swing.Icon icon, java.lang.String text, boolean hasCheckBox, java.lang.Object userObject)
A
CheckBoxListCellData with an icon, text label, and checkbox whose state is initially TriStateBoolean.FALSE . |
CheckBoxListCellData(javax.swing.Icon icon, java.lang.String text, boolean hasCheckBox, TriStateBoolean checkBoxState, java.lang.Object userObject)
A
CheckBoxListCellData with an icon, text label, a checkbox whose state is initially set to checkBoxState. |
CheckBoxListCellData(javax.swing.Icon icon, java.lang.String text, boolean hasCheckBox, TriStateBoolean checkBoxState, java.lang.Object userObject, java.lang.String toolTipText)
A
CheckBoxListCellData with an icon, text label, a checkbox whose state is initially set to checkBoxState. |
CheckBoxListCellData(javax.swing.Icon icon, java.lang.String text, java.lang.Object userObject)
A
CheckBoxListCellData with an icon and a text label; there is no checkbox. |
CheckBoxListCellData(javax.swing.Icon icon, java.lang.String text, java.lang.Object userObject, java.lang.String toolTipText)
A
CheckBoxListCellData with an icon, a text label, and a tooltip; there is no checkbox. |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(CheckBoxListCellData otherData) |
int |
compareTo(java.lang.Object object) |
java.lang.Object |
copyTo(java.lang.Object target)
Copies the internal state of
this object to the specified copy . |
protected void |
copyToImpl(CheckBoxListCellData copy) |
protected void |
fireChanged(java.lang.Object source) |
TriStateBoolean |
getCheckBoxState() |
java.lang.Object |
getGroupId() |
boolean |
getHasCheckBox() |
int |
getHeightAdjustment() |
javax.swing.Icon |
getIcon() |
java.lang.String |
getText() |
java.lang.String |
getToolTipText() |
java.lang.Object |
getUserObject() |
boolean |
isArmed() |
boolean |
isCheckBoxEnabled() |
boolean |
isCheckBoxSelectable() |
boolean |
isEnabled()
Convenience method.
|
boolean |
isGroupTitle() |
boolean |
isPressed() |
boolean |
isTextEnabled() |
boolean |
isTextSelectable() |
void |
setArmed(boolean isArmed) |
void |
setCheckBoxEnabled(boolean isCheckBoxEnabled) |
void |
setCheckBoxSelectable(boolean isCheckBoxSelectable) |
void |
setCheckBoxState(boolean checkBoxState)
Convenience method.
|
void |
setCheckBoxState(TriStateBoolean checkBoxState) |
void |
setCheckBoxStateWithoutFiring(TriStateBoolean checkBoxState)
Sets the state of the checkbox without firing any change event.
|
void |
setEnabled(boolean isEnabled)
Convenience method.
|
void |
setEnabled(boolean isEnabled, boolean isTextSelectable)
Convenience method.
|
void |
setGroupId(java.lang.Object groupId) |
void |
setGroupTitle(boolean groupTitle) |
void |
setHasCheckBox(boolean hasCheckBox) |
void |
setHeightAdjustment(int heightAdj) |
void |
setIcon(javax.swing.Icon icon) |
void |
setPressed(boolean isPressed) |
void |
setStateListener(CheckBoxListItemStateListener listener) |
void |
setText(java.lang.String text) |
void |
setTextEnabled(boolean isTextEnabled) |
void |
setTextSelectable(boolean isTextSelectable) |
void |
setToolTipText(java.lang.String toolTipText) |
void |
setUserObject(java.lang.Object userObject) |
protected java.lang.String _text
protected boolean _isTextEnabled
true
if the list's text is drawn as enabled; false
otherwise.protected boolean _isTextSelectable
true
if the list's text is selectable; false
otherwise. Usually, you should allow the text to be selected even if the label itself is disabled. This at least lets the user know that the selection is acknowledged, but no action is permitted.protected javax.swing.Icon _icon
null
, no icon is shown.protected boolean _hasCheckBox
true
, then the cell renderer should include a checkbox; if false
then no checkbox. The checkbox is a a tri-state checkbox. To set the checkbox to the third state call setCheckBoxState(null)
.protected TriStateBoolean _checkBoxState
protected boolean _isCheckBoxEnabled
true
if the list's checkbox should have a visual appearance of being enabled.protected boolean _isCheckBoxSelectable
true
if the list's checkbox is selectable (i.e. if it can be toggled). If false
, any attempt to change the checkbox should be ignored.protected boolean _isArmed
true
, indicates that the check box is partially committed.protected boolean _isPressed
true
, indicates that the check box should be rendered as being pressed down.protected java.lang.Object _userObject
protected java.lang.String _toolTipText
protected int _heightAdj
public CheckBoxListCellData(javax.swing.Icon icon, java.lang.String text, java.lang.Object userObject)
CheckBoxListCellData
with an icon and a text label; there is no checkbox.icon
- The icon to display in the CheckBoxListtext
- The text to display in the CheckBoxListuserObject
- the user-data to storepublic CheckBoxListCellData(javax.swing.Icon icon, java.lang.String text, java.lang.Object userObject, java.lang.String toolTipText)
CheckBoxListCellData
with an icon, a text label, and a tooltip; there is no checkbox.icon
- The icon to display in the CheckBoxListtext
- The text to display in the CheckBoxListuserObject
- the user-data to storetoolTipText
- the text to display as a tooltippublic CheckBoxListCellData(javax.swing.Icon icon, java.lang.String text, boolean hasCheckBox, java.lang.Object userObject)
CheckBoxListCellData
with an icon, text label, and checkbox whose state is initially TriStateBoolean.FALSE
.icon
- The icon to display in the CheckBoxListtext
- The text to display in the CheckBoxListhasCheckBox
- true if a checkbox is to be displayed; false otherwiseuserObject
- the user-data to storepublic CheckBoxListCellData(javax.swing.Icon icon, java.lang.String text, boolean hasCheckBox, TriStateBoolean checkBoxState, java.lang.Object userObject)
CheckBoxListCellData
with an icon, text label, a checkbox whose state is initially set to checkBoxState. The CheckBoxListCellData has the specified userObject and no tooltip.icon
- The icon to display in the CheckBoxListtext
- The text to display in the CheckBoxListhasCheckBox
- true if a checkbox is to be displayed; false otherwisecheckBoxState
- the initial value to display in the checkboxuserObject
- the user-data to storepublic CheckBoxListCellData(javax.swing.Icon icon, java.lang.String text, boolean hasCheckBox, TriStateBoolean checkBoxState, java.lang.Object userObject, java.lang.String toolTipText)
CheckBoxListCellData
with an icon, text label, a checkbox whose state is initially set to checkBoxState. The CheckBoxListCellData has the specified userObject and a tooltip set.icon
- The icon to display in the CheckBoxListtext
- The text to display in the CheckBoxListhasCheckBox
- true if a checkbox is to be displayed; false otherwisecheckBoxState
- the initial value to display in the checkboxuserObject
- the user-data to storetoolTipText
- the text to display as a tooltippublic void setStateListener(CheckBoxListItemStateListener listener)
protected void fireChanged(java.lang.Object source)
public int compareTo(java.lang.Object object)
compareTo
in interface java.lang.Comparable
public int compareTo(CheckBoxListCellData otherData)
public void setEnabled(boolean isEnabled)
public void setEnabled(boolean isEnabled, boolean isTextSelectable)
public boolean isEnabled()
public java.lang.String getText()
public void setText(java.lang.String text)
public boolean isTextEnabled()
public void setTextEnabled(boolean isTextEnabled)
public boolean isTextSelectable()
public void setTextSelectable(boolean isTextSelectable)
public javax.swing.Icon getIcon()
public void setIcon(javax.swing.Icon icon)
public boolean getHasCheckBox()
public void setHasCheckBox(boolean hasCheckBox)
public TriStateBoolean getCheckBoxState()
public void setCheckBoxState(TriStateBoolean checkBoxState)
public void setCheckBoxStateWithoutFiring(TriStateBoolean checkBoxState)
checkBoxState
- the new state to set.public void setCheckBoxState(boolean checkBoxState)
public boolean isCheckBoxEnabled()
public void setCheckBoxEnabled(boolean isCheckBoxEnabled)
public boolean isCheckBoxSelectable()
public void setCheckBoxSelectable(boolean isCheckBoxSelectable)
public boolean isArmed()
public void setArmed(boolean isArmed)
public boolean isPressed()
public void setPressed(boolean isPressed)
public java.lang.Object getUserObject()
public void setUserObject(java.lang.Object userObject)
public java.lang.String getToolTipText()
public void setToolTipText(java.lang.String toolTipText)
public int getHeightAdjustment()
public void setHeightAdjustment(int heightAdj)
public java.lang.Object copyTo(java.lang.Object target)
Copyable
this
object to the specified copy
. If copy
is null
, then this method should create a new instance of this
class and proceed to copy the internal state to the newly created object. Generally, only the persistent state of the object should be copied, but whether or not it is appropriate to copy transient properties is at the discretion of the individual implementor.
Regardless of whether the copy occurs to an existing object or to a newly created object, the return value is object to which this
object's state was copied.
There is a standard implementation pattern for the copyTo
method that helps avoid problems that arise when a Copyable
object is subclassed. The pattern is:
The parameter passed into thepublic Object copyTo( Object target ) { final <this_class> copy = target != null ? (<this_class>) target : new <this_class>(); copyToImpl( copy ); return copy; } protected final void copyToImpl( <this_class> copy ) { super.copyToImpl( copy ); // if necessary // put code here for copying the properties of <this_class> }
copyToImpl
method is the same type of this
class. The responsibility of copyToImpl
is to copy the state of this
class through direct access of the fields. The copyToImpl
method should not use getters and setters since these may be overridden, causing the state of this
class to be incompletely copied.copyTo
in interface Copyable
target
- The target object to which the state of this
object should be copied. If target
is null
, then the copyTo
method will return a new instance of this
class.this
object was copied. If the target
was non-null
, then the return value is the same as the target
object that was passed in; otherwise, the return value is a new instance of this
class.protected final void copyToImpl(CheckBoxListCellData copy)
public void setGroupId(java.lang.Object groupId)
public java.lang.Object getGroupId()
public boolean isGroupTitle()
public void setGroupTitle(boolean groupTitle)