Class DefaultSelectionManager
- java.lang.Object
-
- com.bc.ceres.swing.selection.support.DefaultSelectionManager
-
- All Implemented Interfaces:
SelectionChangeEmitter,SelectionManager,SelectionSource
public class DefaultSelectionManager extends Object implements SelectionManager
A default implementation of theSelectionManagerinterface.- Since:
- Ceres 0.10
-
-
Constructor Summary
Constructors Constructor Description DefaultSelectionManager()DefaultSelectionManager(Object realEventSource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSelectionChangeListener(SelectionChangeListener listener)Adds a selection change listener to this emitter.ClipboardgetClipboard()SelectiongetSelection()SelectionChangeListener[]getSelectionChangeListeners()Gets all registered selection change listeners.SelectionContextgetSelectionContext()Gets the current selection context.voidremoveSelectionChangeListener(SelectionChangeListener listener)Removes a selection change listener from this emitter.voidsetClipboard(Clipboard clipboard)voidsetSelectionContext(SelectionContext newSelectionContext)Sets a new selection context.
-
-
-
Constructor Detail
-
DefaultSelectionManager
public DefaultSelectionManager()
-
DefaultSelectionManager
public DefaultSelectionManager(Object realEventSource)
-
-
Method Detail
-
getClipboard
public Clipboard getClipboard()
- Specified by:
getClipboardin interfaceSelectionManager- Returns:
- The clipboard used by this selection manager.
- See Also:
Toolkit.getSystemClipboard(),Toolkit.getSystemSelection()
-
setClipboard
public void setClipboard(Clipboard clipboard)
-
getSelectionContext
public SelectionContext getSelectionContext()
Description copied from interface:SelectionManagerGets the current selection context.- Specified by:
getSelectionContextin interfaceSelectionManager- Returns:
- The current selection context, or
null.
-
setSelectionContext
public void setSelectionContext(SelectionContext newSelectionContext)
Description copied from interface:SelectionManagerSets a new selection context.- Specified by:
setSelectionContextin interfaceSelectionManager- Parameters:
newSelectionContext- The new selection context, ornull.
-
getSelection
public Selection getSelection()
- Specified by:
getSelectionin interfaceSelectionSource- Returns:
- The current selection. The selection may be empty, but never
null. - See Also:
Selection.EMPTY,Selection.isEmpty()
-
addSelectionChangeListener
public void addSelectionChangeListener(SelectionChangeListener listener)
Description copied from interface:SelectionChangeEmitterAdds a selection change listener to this emitter.- Specified by:
addSelectionChangeListenerin interfaceSelectionChangeEmitter- Parameters:
listener- The listener.
-
removeSelectionChangeListener
public void removeSelectionChangeListener(SelectionChangeListener listener)
Description copied from interface:SelectionChangeEmitterRemoves a selection change listener from this emitter.- Specified by:
removeSelectionChangeListenerin interfaceSelectionChangeEmitter- Parameters:
listener- The listener.
-
getSelectionChangeListeners
public SelectionChangeListener[] getSelectionChangeListeners()
Description copied from interface:SelectionChangeEmitterGets all registered selection change listeners.- Specified by:
getSelectionChangeListenersin interfaceSelectionChangeEmitter- Returns:
- An array containing all registered listeners.
-
-