All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.webrunner.bab.AbstractSelection
java.lang.Object
|
+----com.ibm.webrunner.bab.AbstractSelection
- public abstract class AbstractSelection
- extends Object
- implements Selection
A BAB View bean may optionally define a selection object for its data by
subclassing this class.
This class is the specification of selection data.
It can specify some or all of the data contained in a bean. It has a
state: EMPTY or NOT EMPTY. Selections are cloneable. It also implements the
Transferable interface so that it can be transferred to/from the
clipboard.
Modification(s) History :
05/05/98 - created
- Version:
- 0.1
- See Also:
- Selection
-
listenerList
-
-
AbstractSelection()
- Default constructor
-
AbstractSelection(Object, String)
- Construct a selection.
-
AbstractSelection(Selection)
- Copy constructor.
-
addSelectionChangeListener(SelectionChangeListener)
- Add a listener to subscribe for SelectionChange Events.
-
canDelete()
- Can the selection be deleted?
-
canPasteFrom(Transferable)
- Can objects be pasted into the selection?
-
clearSelection()
- Clear selection, convenience function to deselect all data.
-
clone()
- Clone the selection.
-
delete()
- Delete selection data.
-
deselectAll()
- Deselect all data.
-
fireSelectionChangeEvent(Object)
- Send a SelectionChangeEvent to the registered listeners to notify them
of any state change.
-
getData()
- Returns selection data
-
getPresentationName()
- Return the selection's presentation name.
-
getState()
- Return the selection's state: EMPTY, NOT_EMPTY
-
getTransferData(DataFlavor)
- Return an object which represents the data to be transferred.
-
getTransferDataFlavors()
- Return an array of DataFlavor objects indicating the flavors the
data can be provided in.
-
isDataFlavorSupported(DataFlavor)
- Return whether or not the specified data flavor is supported for
this object.
-
isEmpty()
- Is the model selection empty?
-
isNotEmpty()
- Is the model selection not empty?
-
isStringSelection()
- Temporary workaround for JDK 1.1 beta bug.
-
lostOwnership(Clipboard, Transferable)
- Invoked when this is no longer the owner of the clipboard contents.
-
notify(Selection)
- Notify of new selection.
-
pasteFrom(Transferable)
- Paste objects into the selection.
-
removeSelectionChangeListener(SelectionChangeListener)
- Remove a listener to un-subscribe for SelectionChange Events.
-
selectAll()
- Select all data.
-
setData(Object)
- This sets selection data.
-
setEmpty()
- Set the selection state to empty.This fires a selection change event
-
setNotEmpty()
- Set the model selection state to not empty.This fires a selection change event
-
setPresentationName(String)
- Set Presentation Name
-
setState(int)
-
Set the selection's state: EMPTY, NOT_EMPTY
-
undoDelete(Object)
- Undo the delete operation.
-
undoPaste(Object)
- Undo paste operation.
listenerList
protected transient EventListenerList listenerList
AbstractSelection
public AbstractSelection()
- Default constructor
AbstractSelection
public AbstractSelection(Object data,
String presentationName)
- Construct a selection.
- Parameters:
- data - - selected data
AbstractSelection
public AbstractSelection(Selection selection)
- Copy constructor.
getPresentationName
public String getPresentationName()
- Return the selection's presentation name.
setPresentationName
public void setPresentationName(String presentationName)
- Set Presentation Name
clone
public abstract Object clone()
- Clone the selection. You must implement this to clone your own selection
- Overrides:
- clone in class Object
notify
public void notify(Selection selection)
- Notify of new selection.
getData
public Object getData()
- Returns selection data
setData
protected void setData(Object data)
- This sets selection data. Fires a selection change event
isStringSelection
public boolean isStringSelection()
- Temporary workaround for JDK 1.1 beta bug.
Determine if the selection is a StringSelection, which is the
only Transferable that the clipboard accepts. This implementation returns false.
getState
public int getState()
- Return the selection's state: EMPTY, NOT_EMPTY
setState
public void setState(int newState) throws IllegalSelectionStateException
- Set the selection's state: EMPTY, NOT_EMPTY
selectAll
public void selectAll()
- Select all data. Invokes setNotEmpty() which fires a selection change event
deselectAll
public void deselectAll()
- Deselect all data. Invokes setEmpty() which fires a selection change event
clearSelection
public void clearSelection()
- Clear selection, convenience function to deselect all data. Invokes setEmpty() which fires a selection change event
setEmpty
public void setEmpty()
- Set the selection state to empty.This fires a selection change event
setNotEmpty
public void setNotEmpty()
- Set the model selection state to not empty.This fires a selection change event
isEmpty
public boolean isEmpty()
- Is the model selection empty?
isNotEmpty
public boolean isNotEmpty()
- Is the model selection not empty?
canDelete
public boolean canDelete()
- Can the selection be deleted?
delete
public Object delete()
- Delete selection data.
- Returns:
- Return data that allows the delete to be undone.
undoDelete
public void undoDelete(Object undoData)
- Undo the delete operation.
- Parameters:
- undoData - data for undoing the previous delete.
canPasteFrom
public boolean canPasteFrom(Transferable contents)
- Can objects be pasted into the selection?
- Parameters:
- contents - clipboard contents
pasteFrom
public Object pasteFrom(Transferable contents)
- Paste objects into the selection.
- Parameters:
- contents - clipboard contents
- Returns:
- Return data that allows the paste to be undone.
undoPaste
public void undoPaste(Object undoData)
- Undo paste operation.
- Parameters:
- undoData - data for undoing the previous paste.
getTransferDataFlavors
public synchronized DataFlavor[] getTransferDataFlavors()
- Return an array of DataFlavor objects indicating the flavors the
data can be provided in. The array should be ordered according to
preference for providing the data (from most richly descriptive to
least descriptive).
- Returns:
- an array of data flavors in which this data can be transferred
isDataFlavorSupported
public boolean isDataFlavorSupported(DataFlavor dataFlavor)
- Return whether or not the specified data flavor is supported for
this object.
- Parameters:
- flavor - the requested flavor for the data
- Returns:
- boolean indicating whether or not the data flavor is supported
getTransferData
public synchronized Object getTransferData(DataFlavor dataFlavor) throws IOException, UnsupportedFlavorException
- Return an object which represents the data to be transferred. The
class of the object returned is defined by the representation class
of the flavor. If the requested data flavor is not supported, an
UnsupportedFlavorException is thrown. If the data is no longer
available in the requested flavor, an IOException is thrown
- Parameters:
- flavor - the requested flavor for the data
- Throws: UnsupportedFlavorException
- if the requested data flavor
is not supported
addSelectionChangeListener
public void addSelectionChangeListener(SelectionChangeListener l)
- Add a listener to subscribe for SelectionChange Events.
removeSelectionChangeListener
public void removeSelectionChangeListener(SelectionChangeListener l)
- Remove a listener to un-subscribe for SelectionChange Events.
fireSelectionChangeEvent
public void fireSelectionChangeEvent(Object eventData)
- Send a SelectionChangeEvent to the registered listeners to notify them
of any state change.
lostOwnership
public void lostOwnership(Clipboard clipboard,
Transferable contents)
- Invoked when this is no longer the owner of the clipboard contents.
Default implementation does nothing.
All Packages Class Hierarchy This Package Previous Next Index