Class BeanSingleSelection<E>
- java.lang.Object
-
- com.macrofocus.selection.implementation.AbstractSelection<E>
-
- com.macrofocus.selection.implementation.AbstractMutableSelection<E>
-
- com.macrofocus.selection.implementation.AbstractMutableSingleSelection<E>
-
- com.macrofocus.selection.implementation.BeanSingleSelection<E>
-
- All Implemented Interfaces:
MutableSelection<E>,MutableSingleSelection<E>,Selection<E>,SingleSelection<E>,java.lang.Iterable<E>
public class BeanSingleSelection<E> extends AbstractMutableSingleSelection<E> implements MutableSingleSelection<E>
-
-
Constructor Summary
Constructors Constructor Description BeanSingleSelection(java.lang.Object o, java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanclearSelection()Change the selection to the empty set.EgetSelected()intgetSelectedCount()Returns the number of elements currently selected.java.util.Set<E>getSelectedSet()Returns the selected elements as a Set.booleanisActive()Indicates whether at least one element is currently selected.booleanisSelected(E element)Indicates whether a given element is selected or not.java.util.Iterator<E>iterator()booleansetSelected(boolean selected, E... elements)Set the selection state.voidsetSelected(E element)Change the selection to the given element.voidsetSelected(E element, boolean selected)booleansetSelected(java.lang.Iterable<E> element, boolean selected)Set the selection state.voidsetSelectedElements(E... elements)voidsetSelectedIterable(java.lang.Iterable<E> elements)-
Methods inherited from class com.macrofocus.selection.implementation.AbstractMutableSingleSelection
addSingleSelectionListener, addWeakSingleSelectionListener, notifySingleSelectedChanged, removeSingleSelectionListener
-
Methods inherited from class com.macrofocus.selection.implementation.AbstractMutableSelection
setEnabled
-
Methods inherited from class com.macrofocus.selection.implementation.AbstractSelection
addSelectionListener, addWeakSelectionListener, isEnabled, notifySelectedChanged, removeSelectionListener, removeSelectionListeners
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.macrofocus.selection.MutableSelection
setEnabled
-
Methods inherited from interface com.macrofocus.selection.Selection
addSelectionListener, addWeakSelectionListener, isEnabled, removeSelectionListener, removeSelectionListeners
-
Methods inherited from interface com.macrofocus.selection.SingleSelection
addSingleSelectionListener, addWeakSingleSelectionListener, removeSingleSelectionListener
-
-
-
-
Method Detail
-
clearSelection
public boolean clearSelection()
Description copied from interface:MutableSelectionChange the selection to the empty set. If this represents a change to the current selection then notify each listener.- Specified by:
clearSelectionin interfaceMutableSelection<E>- Returns:
- true, if the set of selected elements was changed.
-
isActive
public boolean isActive()
Description copied from interface:SelectionIndicates whether at least one element is currently selected.
-
isSelected
public boolean isSelected(E element)
Description copied from interface:SelectionIndicates whether a given element is selected or not.- Specified by:
isSelectedin interfaceSelection<E>- Parameters:
element- the element to be tested- Returns:
- true if the element is selected, false otherwise
-
setSelected
public void setSelected(E element, boolean selected)
- Specified by:
setSelectedin interfaceMutableSelection<E>
-
setSelected
public boolean setSelected(java.lang.Iterable<E> element, boolean selected)
Description copied from interface:MutableSelectionSet the selection state.- Specified by:
setSelectedin interfaceMutableSelection<E>- Parameters:
element- the elements to changeselected- true to have the elements selected, false otherwise- Returns:
- true, if the set of selected elements was changed.
-
setSelected
public boolean setSelected(boolean selected, E... elements)Description copied from interface:MutableSelectionSet the selection state.- Specified by:
setSelectedin interfaceMutableSelection<E>- Parameters:
selected- true to have the elements selected, false otherwiseelements- the elements to change- Returns:
- true, if the set of selected elements was changed.
-
setSelectedElements
public void setSelectedElements(E... elements)
- Specified by:
setSelectedElementsin interfaceMutableSelection<E>
-
setSelectedIterable
public void setSelectedIterable(java.lang.Iterable<E> elements)
- Specified by:
setSelectedIterablein interfaceMutableSelection<E>
-
getSelected
public E getSelected()
- Specified by:
getSelectedin interfaceSingleSelection<E>
-
setSelected
public void setSelected(E element)
Description copied from interface:MutableSingleSelectionChange the selection to the given element.- Specified by:
setSelectedin interfaceMutableSelection<E>- Specified by:
setSelectedin interfaceMutableSingleSelection<E>- Parameters:
element- the element to replace the current selection.
-
getSelectedCount
public int getSelectedCount()
Description copied from interface:SelectionReturns the number of elements currently selected.- Specified by:
getSelectedCountin interfaceSelection<E>- Returns:
- the number of selected elements.
-
getSelectedSet
public java.util.Set<E> getSelectedSet()
Description copied from interface:SelectionReturns the selected elements as a Set.- Specified by:
getSelectedSetin interfaceSelection<E>- Returns:
- the Set of selected elements.
-
-