|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.9.0) E52944-01 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
javax.swing.AbstractListModel
oracle.ide.controls.checkboxlist.CheckBoxListModel
public class CheckBoxListModel
| Field Summary |
|---|
| Fields inherited from class javax.swing.AbstractListModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
CheckBoxListModel() |
|
CheckBoxListModel(java.lang.Object[] userObjects)Creates CheckBoxListCellData objects for each element of the userObjects array with no icon, no checkbox, and a label set to whatever is returned by userObject.toString() |
|
CheckBoxListModel(java.lang.Object[] userObjects, boolean hasCheckBox)Creates CheckBoxListCellData objects for each element of the userObjects array with no icon and a checkbox initially set to false |
|
CheckBoxListModel(java.lang.Object[] userObjects, boolean hasCheckBox, boolean checkBoxState)Creates CheckBoxListCellData objects for each element of the userObjects array with no icon and a checkbox initially set to the value of checkBoxState |
|
CheckBoxListModel(java.lang.Object[] userObjects, javax.swing.Icon icon, boolean hasCheckBox)Creates CheckBoxListCellData objects for each element of the userObjects array with the specified icon and a checkbox if hasCheckBox is true. |
|
CheckBoxListModel(java.lang.Object[] userObjects, javax.swing.Icon icon, boolean hasCheckBox, boolean checkBoxState)Creates CheckBoxListCellData objects for each element of the userObjects array with the specified icon and a checkbox if hasCheckBox is true and an the checkbox is intialized to checkBoxState. |
|
| Method Summary | |
|---|---|
void |
addCheckBoxStateListener(CheckBoxListItemStateListener listener)Adds the listener to each element in the list. |
void |
addElement(java.lang.Object userObject, javax.swing.Icon icon, boolean hasCheckBox, boolean checkBoxState)Adds an element to the model with the specified userObject and icon. |
void |
addElement(java.lang.Object userObject, javax.swing.Icon icon, boolean hasCheckBox, boolean checkBoxState, java.lang.String label)Adds an element to the model with the specified userObject and icon. |
void |
addElement(java.lang.Object userObject, javax.swing.Icon icon, boolean hasCheckBox, boolean checkBoxState, java.lang.String label, java.lang.String toolTipText)Adds an element to the model with the specified userObject and icon. |
void |
addElement(java.lang.Object userObject, javax.swing.Icon icon, boolean hasCheckBox, boolean checkBoxState, java.lang.String groupId, java.lang.String label, java.lang.String toolTipText) |
void |
addElement(java.lang.Object userObject, javax.swing.Icon icon, java.lang.String groupId, boolean hasCheckBox, boolean checkBoxState, boolean isGroupTitle, java.lang.String toolTip) |
void |
addElement(java.lang.Object userObject, javax.swing.Icon icon, java.lang.String label, java.lang.String toolTipText)Adds an element to the model with the specified userObject, icon, label and toolTipText. |
void |
addElementAt(int position, java.lang.Object userObject, javax.swing.Icon icon, boolean hasCheckBox, boolean checkBoxState) |
void |
addElementAt(int position, java.lang.Object userObject, javax.swing.Icon icon, boolean hasCheckBox, boolean checkBoxState, java.lang.String label) |
void |
addElementAt(int position, java.lang.Object userObject, javax.swing.Icon icon, boolean hasCheckBox, boolean checkBoxState, java.lang.String label, java.lang.String toolTipText) |
void |
addElementAt(int position, java.lang.Object userObject, javax.swing.Icon icon, boolean hasCheckBox, boolean checkBoxState, java.lang.String groupId, java.lang.String label, java.lang.String toolTipText) |
void |
addElementAt(int position, java.lang.Object userObject, javax.swing.Icon icon, java.lang.String groupId, boolean hasCheckBox, boolean checkBoxState, boolean isGroupTitle, java.lang.String toolTip) |
void |
addElementAt(int position, java.lang.Object userObject, javax.swing.Icon icon, java.lang.String label, java.lang.String toolTipText) |
void |
clear()Remove all elements from this ListModel |
java.lang.Object |
copyTo(java.lang.Object target)Copies the internal state of this object to the specified copy. |
protected void |
copyToImpl(CheckBoxListModel copy) |
void |
deselectAll()Sets the state of the checkbox to unchecked for all rows in the model. |
void |
deselectAllSelectables()Sets the state of the checkbox to unchecked for all rows in the model (only for checkboxes that are actually selectable.) |
int |
elementsWithCheckBoxCount() |
boolean |
equals(java.lang.Object o) |
protected boolean |
equalsImpl(CheckBoxListModel other) |
int |
findElementByText(java.lang.String value)Returns the index of the element with label equals to the specified value. |
java.lang.String |
findTextForElement(int index)Returns the String for the specified element. |
void |
findUserObjectAndMark(java.lang.Object findObject, boolean selectObject)Searches the model for a userObject that equals the specified findObject and sets the state of the checkbox for that element to checked or unchecked based on the value of selectObject. |
java.lang.Object |
getElementAt(int index)Gets the object at the specified index. |
java.util.List |
getSelectionList()This method should be called to get a list of userObjects for rows that have been selected in the CheckBoxList. |
int |
getSize()The number of elements in the model. |
java.lang.String |
getToolTipTextForElement(int index)Gets the string used to represent the tooltip for the specified element. |
java.lang.Object |
getUserObjectAt(int index)Returns the userObject from the model element at the specified index. |
boolean |
isElementSelected(int index)Returns true of the element at the specified index has been checked. |
void |
putCheckBoxListCellDataAt(int index, CheckBoxListCellData data) |
void |
removeElementByIndex(int index)Removes the element from the model with the index specified by index. |
void |
removeElementByText(java.lang.String value)Removes the element from the model where the label equals the specified value. |
void |
selectAll()Sets the state of the checkbox to checked for all rows in the model. |
void |
selectAllSelectables()Sets the state of the checkbox to checked for all rows in the model (only for checkboxes that are actually selectable.) |
void |
setCheckBoxVisible(boolean checkboxVisible, boolean checkboxState)Goes through the model and sets each element to make the checkbox displayed or not based on the value of checkboxVisible. |
void |
setElementSelected(int index)Sets the element at the specified index to checked. |
void |
sort()Sorts the elements in the model according to the label. |
| Methods inherited from class javax.swing.AbstractListModel |
|---|
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CheckBoxListModel()
public CheckBoxListModel(java.lang.Object[] userObjects)
userObjects - the array of objects to store in the CheckBoxListModel
public CheckBoxListModel(java.lang.Object[] userObjects,
javax.swing.Icon icon,
boolean hasCheckBox)
userObjects - the array of objects to store in the CheckBoxListModelicon - the Icon to display for all the entrieshasCheckBox - true if a checkbox should be displayed; false otherwise
public CheckBoxListModel(java.lang.Object[] userObjects,
javax.swing.Icon icon,
boolean hasCheckBox,
boolean checkBoxState)
userObjects - the array of objects to store in the CheckBoxListModelicon - the Icon to display for all the entrieshasCheckBox - true if a checkbox should be displayed; false otherwisecheckBoxState - the initial state of the checkbox
public CheckBoxListModel(java.lang.Object[] userObjects,
boolean hasCheckBox)
userObjects - the array of objects to store in the CheckBoxListModelhasCheckBox - true if a checkbox should be displayed; false otherwise
public CheckBoxListModel(java.lang.Object[] userObjects,
boolean hasCheckBox,
boolean checkBoxState)
userObjects - the array of objects to store in the CheckBoxListModelhasCheckBox - true if a checkbox should be displayed; false otherwisecheckBoxState - the initial state fo the checkbox| Method Detail |
|---|
public void addElement(java.lang.Object userObject,
javax.swing.Icon icon,
java.lang.String label,
java.lang.String toolTipText)
userObject - the userObject portion of the dataicon - the Icon to displaylabel - the String to display in the CheckBoxListtoolTipText - the text to display as a tooltip
public void addElementAt(int position,
java.lang.Object userObject,
javax.swing.Icon icon,
java.lang.String label,
java.lang.String toolTipText)
public void addElement(java.lang.Object userObject,
javax.swing.Icon icon,
boolean hasCheckBox,
boolean checkBoxState)
userObject - the userObject portion of the dataicon - the Icon to displayhasCheckBox - true if a checkbox is to be displayed; false otherwisecheckBoxState - true if the checkbox should initially be checked; false otherwise.
public void addElement(java.lang.Object userObject,
javax.swing.Icon icon,
java.lang.String groupId,
boolean hasCheckBox,
boolean checkBoxState,
boolean isGroupTitle,
java.lang.String toolTip)
public void addElementAt(int position,
java.lang.Object userObject,
javax.swing.Icon icon,
java.lang.String groupId,
boolean hasCheckBox,
boolean checkBoxState,
boolean isGroupTitle,
java.lang.String toolTip)
public void addElementAt(int position,
java.lang.Object userObject,
javax.swing.Icon icon,
boolean hasCheckBox,
boolean checkBoxState)
public void addElement(java.lang.Object userObject,
javax.swing.Icon icon,
boolean hasCheckBox,
boolean checkBoxState,
java.lang.String label)
userObject - the userObject portion of the dataicon - the Icon to displayhasCheckBox - true if a checkbox is to be displayed; false otherwisecheckBoxState - true if the checkbox should initially be checked; false otherwise.label - the label to display in the CheckBoxList
public void addElementAt(int position,
java.lang.Object userObject,
javax.swing.Icon icon,
boolean hasCheckBox,
boolean checkBoxState,
java.lang.String label)
public void addElement(java.lang.Object userObject,
javax.swing.Icon icon,
boolean hasCheckBox,
boolean checkBoxState,
java.lang.String label,
java.lang.String toolTipText)
userObject - the userObject portion of the dataicon - the Icon to displayhasCheckBox - true if a checkbox is to be displayed; false otherwisecheckBoxState - true if the checkbox should initially be checked; false otherwise.label - the label to display in the CheckBoxListtoolTipText - the text to display as a tooltip
public void addElement(java.lang.Object userObject,
javax.swing.Icon icon,
boolean hasCheckBox,
boolean checkBoxState,
java.lang.String groupId,
java.lang.String label,
java.lang.String toolTipText)
public void addElementAt(int position,
java.lang.Object userObject,
javax.swing.Icon icon,
boolean hasCheckBox,
boolean checkBoxState,
java.lang.String label,
java.lang.String toolTipText)
public void addElementAt(int position,
java.lang.Object userObject,
javax.swing.Icon icon,
boolean hasCheckBox,
boolean checkBoxState,
java.lang.String groupId,
java.lang.String label,
java.lang.String toolTipText)
public void addCheckBoxStateListener(CheckBoxListItemStateListener listener)
public void selectAll()
public void selectAllSelectables()
public void deselectAll()
public void deselectAllSelectables()
public java.util.List getSelectionList()
public int elementsWithCheckBoxCount()
public void findUserObjectAndMark(java.lang.Object findObject,
boolean selectObject)
findObject - the userObject to find in the modelselectObject - true if the row should be marked as checked; false otherwise.public boolean isElementSelected(int index)
index - the index of the element that should be tested to see if it's marked as checkedpublic void setElementSelected(int index)
index - the index of the element that should be marked as checkedpublic java.lang.Object getUserObjectAt(int index)
index - the index of the element in the CheckBoxList
public void setCheckBoxVisible(boolean checkboxVisible,
boolean checkboxState)
checkboxVisible - true if checkboxes should be displayed in the CheckBoxList; false otherwisecheckboxState - true if the checkbox should be checked; false otherwisepublic void sort()
public void clear()
public void removeElementByText(java.lang.String value)
value - the String representation of the element to be removed from the CheckBoxListModelpublic void removeElementByIndex(int index)
index - the index of the element that should be removed from the CheckBoxListModelpublic int findElementByText(java.lang.String value)
value - the displayed string to find in the CheckBoxListModelpublic java.lang.String findTextForElement(int index)
index - the index of the elementpublic java.lang.String getToolTipTextForElement(int index)
index - the position of the element to find the tooltip forpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectprotected final boolean equalsImpl(CheckBoxListModel other)
public void putCheckBoxListCellDataAt(int index,
CheckBoxListCellData data)
public java.lang.Object getElementAt(int index)
getElementAt in interface javax.swing.ListModelindex - the position of the value to be foundpublic int getSize()
getSize in interface javax.swing.ListModelpublic java.lang.Object copyTo(java.lang.Object target)
Copyablethis 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:
public 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>
}
The parameter passed into the 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 Copyabletarget - 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(CheckBoxListModel copy)
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.9.0) E52944-01 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||