Package com.macrofocus.common.selection
Class AbstractSelection<E>
java.lang.Object
com.macrofocus.common.selection.AbstractSelection<E>
- Direct Known Subclasses:
AbstractMutableSelection
This class provides a skeletal implementation of the Selection interface to minimize the effort required to implement
this interface.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
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
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 java.lang.Iterable
forEach, iterator, spliterator
Methods inherited from interface com.macrofocus.common.selection.Selection
getSelectedCount, getSelectedSet, isActive, isSelected
-
Constructor Details
-
AbstractSelection
public AbstractSelection()
-
-
Method Details
-
isEnabled
public boolean isEnabled() -
setEnabled
protected void setEnabled(boolean enabled) -
addSelectionListener
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
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
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
-