Class AbstractSelection<E>
- java.lang.Object
-
- com.macrofocus.selection.implementation.AbstractSelection<E>
-
- All Implemented Interfaces:
Selection<E>
,java.lang.Iterable<E>
- Direct Known Subclasses:
AbstractMutableSelection
public abstract class AbstractSelection<E> extends java.lang.Object implements Selection<E>
This class provides a skeletal implementation of the Selection interface to minimize the effort required to implement this interface.
-
-
Constructor Summary
Constructors Constructor Description AbstractSelection()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSelectionListener(SelectionListener<E> listener)
Add a listener to the list that's notified each time a change to the selection occurs.void
addWeakSelectionListener(SelectionListener<E> listener)
Add a listener to the list that's notified each time a change to the selection occurs.boolean
isEnabled()
protected void
notifySelectedChanged(SelectionEvent<E> event)
void
removeSelectionListener(SelectionListener<E> listener)
Remove a listener to the list that's notified each time a change to the selection occurs.void
removeSelectionListeners()
Remove all listeners to the list that's notified each time a change to the selection occurs.protected void
setEnabled(boolean enabled)
-
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.Selection
getSelectedCount, getSelectedSet, isActive, isSelected
-
-
-
-
Method Detail
-
setEnabled
protected void setEnabled(boolean enabled)
-
addSelectionListener
public void addSelectionListener(SelectionListener<E> listener)
Description copied from interface:Selection
Add a listener to the list that's notified each time a change to the selection occurs.- Specified by:
addSelectionListener
in interfaceSelection<E>
- Parameters:
listener
- the SelectionListener
-
addWeakSelectionListener
public void addWeakSelectionListener(SelectionListener<E> listener)
Description copied from interface:Selection
Add a listener to the list that's notified each time a change to the selection occurs. The listener will automatically be disposed of should no other object have a reference to it.- Specified by:
addWeakSelectionListener
in interfaceSelection<E>
- Parameters:
listener
- the SelectionListener
-
removeSelectionListener
public void removeSelectionListener(SelectionListener<E> listener)
Description copied from interface:Selection
Remove a listener to the list that's notified each time a change to the selection occurs.- Specified by:
removeSelectionListener
in interfaceSelection<E>
- Parameters:
listener
- the SelectionListener
-
removeSelectionListeners
public void removeSelectionListeners()
Description copied from interface:Selection
Remove all listeners to the list that's notified each time a change to the selection occurs.- Specified by:
removeSelectionListeners
in interfaceSelection<E>
-
notifySelectedChanged
protected void notifySelectedChanged(SelectionEvent<E> event)
-
-