Package org.eclipse.jface.viewers
Interface ICheckable
- All Known Implementing Classes:
CheckboxTableViewer,CheckboxTreeViewer,ContainerCheckedTreeViewer
public interface ICheckable
Interface for objects that support elements with a checked state.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddCheckStateListener(ICheckStateListener listener) Adds a listener for changes to the checked state of elements in this viewer.booleangetChecked(Object element) Returns the checked state of the given element.voidremoveCheckStateListener(ICheckStateListener listener) Removes the given check state listener from this viewer.booleansetChecked(Object element, boolean state) Sets the checked state for the given element in this viewer.
-
Method Details
-
addCheckStateListener
Adds a listener for changes to the checked state of elements in this viewer. Has no effect if an identical listener is already registered.- Parameters:
listener- a check state listener
-
getChecked
Returns the checked state of the given element.- Parameters:
element- the element- Returns:
trueif the element is checked, andfalseif not checked
-
removeCheckStateListener
Removes the given check state listener from this viewer. Has no effect if an identical listener is not registered.- Parameters:
listener- a check state listener
-
setChecked
Sets the checked state for the given element in this viewer. Does not fire events to check state listeners.- Parameters:
element- the elementstate-trueif the item should be checked, andfalseif it should be unchecked- Returns:
trueif the checked state could be set, andfalseotherwise
-