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 TypeMethodDescriptionvoidaddSelectionListener(SelectionListener<E> listener) Add a listener to the list that's notified each time a change to the selection occurs.voidaddWeakSelectionListener(SelectionListener<E> listener) Add a listener to the list that's notified each time a change to the selection occurs.booleanprotected voidnotifySelectedChanged(SelectionEvent<E> event) voidremoveSelectionListener(SelectionListener<E> listener) Remove a listener to the list that's notified each time a change to the selection occurs.voidRemove all listeners to the list that's notified each time a change to the selection occurs.protected voidsetEnabled(boolean enabled) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods 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:SelectionAdd a listener to the list that's notified each time a change to the selection occurs.- Specified by:
addSelectionListenerin interfaceSelection<E>- Parameters:
listener- the SelectionListener
-
addWeakSelectionListener
Description copied from interface:SelectionAdd 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:
addWeakSelectionListenerin interfaceSelection<E>- Parameters:
listener- the SelectionListener
-
removeSelectionListener
Description copied from interface:SelectionRemove a listener to the list that's notified each time a change to the selection occurs.- Specified by:
removeSelectionListenerin interfaceSelection<E>- Parameters:
listener- the SelectionListener
-
removeSelectionListeners
public void removeSelectionListeners()Description copied from interface:SelectionRemove all listeners to the list that's notified each time a change to the selection occurs.- Specified by:
removeSelectionListenersin interfaceSelection<E>
-
notifySelectedChanged
-