de.lessvoid.nifty.controls.listbox
Interface ListBoxSelectionMode<T>

Type Parameters:
T -
All Known Implementing Classes:
ListBoxSelectionModeDisabled, ListBoxSelectionModeMulti, ListBoxSelectionModeSingle

public interface ListBoxSelectionMode<T>

ListBoxSelectionMode is a selection mode for Nifty ListBox controls. Different selection policies exist which will implement the ListBoxSelectionMode interface.

Author:
void

Method Summary
 void add(T item)
          Add a new element to the selection.
 void clear()
          Clear the selection.
 void enableRequiresSelection(boolean enable)
          When this is set to true the selection can't be completely de selected.
 List<T> getSelection()
          Get the selection.
 void remove(T item)
          Remove the given element from the selection.
 void removeForced(T item)
          Remove the given element from the selection.
 boolean requiresAutoSelection()
          Returns if this Selection Mode requires a selection.
 

Method Detail

clear

void clear()
Clear the selection.


getSelection

List<T> getSelection()
Get the selection.

Returns:
list of items

add

void add(T item)
Add a new element to the selection.

Parameters:
item -

remove

void remove(T item)
Remove the given element from the selection.

Parameters:
item -

removeForced

void removeForced(T item)
Remove the given element from the selection. This will remove the item even when requiresSelection is turned on. It's called when the actual item gets removed and therefore we can't keep the selection.

Parameters:
item -

enableRequiresSelection

void enableRequiresSelection(boolean enable)
When this is set to true the selection can't be completely de selected. There has to be at least a single selection.

Parameters:
enable - true when the requires selection mode should be enabled

requiresAutoSelection

boolean requiresAutoSelection()
Returns if this Selection Mode requires a selection.

Returns:
true this selection mode requires a selection


Copyright © 2011. All Rights Reserved.