public class StripeSelection extends Object implements IStripeSelection, IEnumerable<IStripe>
IStripeSelection
interface.EMPTY
Constructor and Description |
---|
StripeSelection()
Default constructor that creates empty selection models.
|
Modifier and Type | Method and Description |
---|---|
void |
addItemSelectionChangedListener(IEventHandler<ItemSelectionChangedEventArgs<IStripe>> itemSelectionChangedEvent)
Adds the given listener for the
ItemSelectionChanged event that occurs when an item changed its selection state
from selected to unselected or vice versa. |
void |
clear()
Clears the selection.
|
IEnumerator<IStripe> |
enumerator()
Returns an
IEnumerator over a set of elements of type T. |
ISelectionModel<IColumn> |
getSelectedColumns()
An
ISelectionModel of the selected columns. |
ISelectionModel<IRow> |
getSelectedRows()
An
ISelectionModel of the selected rows. |
boolean |
isCrossTableSelectionAllowed()
Whether to allow the selection to span multiple table instances.
|
boolean |
isMixedSelectionAllowed()
Whether to allow mixed row/column selections.
|
boolean |
isSelected(IStripe stripe)
Return whether
stripe is currently selected. |
protected void |
onItemSelectionChanged(ItemSelectionChangedEventArgs<IStripe> args)
Raises the
ItemSelectionChanged event. |
void |
removeItemSelectionChangedListener(IEventHandler<ItemSelectionChangedEventArgs<IStripe>> itemSelectionChangedEvent)
Removes the given listener for the
ItemSelectionChanged event that occurs when an item changed its selection
state from selected to unselected or vice versa. |
void |
setCrossTableSelectionAllowed(boolean value)
Whether to allow the selection to span multiple table instances.
|
void |
setMixedSelectionAllowed(boolean value)
Whether to allow mixed row/column selections.
|
void |
setSelected(IStripe item,
boolean selected)
Sets the selection state of an item.
|
int |
size()
Returns the number of selected items.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
concat, concat, create, create, iterator, parallelStream, stream
forEach, spliterator
public StripeSelection()
public final void addItemSelectionChangedListener(IEventHandler<ItemSelectionChangedEventArgs<IStripe>> itemSelectionChangedEvent)
ISelectionModel
ItemSelectionChanged
event that occurs when an item changed its selection state
from selected to unselected or vice versa.addItemSelectionChangedListener
in interface ISelectionModel<IStripe>
itemSelectionChangedEvent
- The listener to add.ISelectionModel.setSelected(java.lang.Object, boolean)
,
ISelectionModel.removeItemSelectionChangedListener(IEventHandler)
public final void clear()
ISelectionModel
This is a convenience method that will set the selection state of all elements to unselected.
clear
in interface ISelectionModel<IStripe>
ISelectionModel.addItemSelectionChangedListener(IEventHandler)
public final IEnumerator<IStripe> enumerator()
IEnumerable
IEnumerator
over a set of elements of type T.enumerator
in interface IEnumerable<IStripe>
IEnumerator
.public final ISelectionModel<IColumn> getSelectedColumns()
IStripeSelection
ISelectionModel
of the selected columns.
This is the column part of the selection that this instance is a composite of.
getSelectedColumns
in interface IStripeSelection
public final ISelectionModel<IRow> getSelectedRows()
IStripeSelection
ISelectionModel
of the selected rows.
This is the row part of the selection that this instance is a composite of.
getSelectedRows
in interface IStripeSelection
public final boolean isCrossTableSelectionAllowed()
The default is true
isCrossTableSelectionAllowed
in interface IStripeSelection
setCrossTableSelectionAllowed(boolean)
public final boolean isMixedSelectionAllowed()
The default is false
isMixedSelectionAllowed
in interface IStripeSelection
setMixedSelectionAllowed(boolean)
public final boolean isSelected(IStripe stripe)
stripe
is currently selected.isSelected
in interface ISelectionModel<IStripe>
stripe
- The stripe to testtrue
iff stripe
is currently selectedprotected void onItemSelectionChanged(ItemSelectionChangedEventArgs<IStripe> args)
ItemSelectionChanged
event.args
- The parameters for the eventpublic final void removeItemSelectionChangedListener(IEventHandler<ItemSelectionChangedEventArgs<IStripe>> itemSelectionChangedEvent)
ISelectionModel
ItemSelectionChanged
event that occurs when an item changed its selection
state from selected to unselected or vice versa.removeItemSelectionChangedListener
in interface ISelectionModel<IStripe>
itemSelectionChangedEvent
- The listener to remove.ISelectionModel.setSelected(java.lang.Object, boolean)
,
ISelectionModel.addItemSelectionChangedListener(IEventHandler)
public final void setCrossTableSelectionAllowed(boolean value)
The default is true
setCrossTableSelectionAllowed
in interface IStripeSelection
value
- The CrossTableSelectionAllowed to set.isCrossTableSelectionAllowed()
public final void setMixedSelectionAllowed(boolean value)
The default is false
setMixedSelectionAllowed
in interface IStripeSelection
value
- The MixedSelectionAllowed to set.isMixedSelectionAllowed()
public final void setSelected(IStripe item, boolean selected)
ISelectionModel
If the state changes, this will trigger the ItemSelectionChanged
event.
setSelected
in interface ISelectionModel<IStripe>
item
- The item to set the selection state for.selected
- Whether to select the object.public final int size()
ISelectionModel
size
in interface ISelectionModel<IStripe>