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

Variable Index

 o listenerList

Constructor Index

 o AbstractSelection()
Default constructor
 o AbstractSelection(Object, String)
Construct a selection.
 o AbstractSelection(Selection)
Copy constructor.

Method Index

 o addSelectionChangeListener(SelectionChangeListener)
Add a listener to subscribe for SelectionChange Events.
 o canDelete()
Can the selection be deleted?
 o canPasteFrom(Transferable)
Can objects be pasted into the selection?
 o clearSelection()
Clear selection, convenience function to deselect all data.
 o clone()
Clone the selection.
 o delete()
Delete selection data.
 o deselectAll()
Deselect all data.
 o fireSelectionChangeEvent(Object)
Send a SelectionChangeEvent to the registered listeners to notify them of any state change.
 o getData()
Returns selection data
 o getPresentationName()
Return the selection's presentation name.
 o getState()
Return the selection's state: EMPTY, NOT_EMPTY
 o getTransferData(DataFlavor)
Return an object which represents the data to be transferred.
 o getTransferDataFlavors()
Return an array of DataFlavor objects indicating the flavors the data can be provided in.
 o isDataFlavorSupported(DataFlavor)
Return whether or not the specified data flavor is supported for this object.
 o isEmpty()
Is the model selection empty?
 o isNotEmpty()
Is the model selection not empty?
 o isStringSelection()
Temporary workaround for JDK 1.1 beta bug.
 o lostOwnership(Clipboard, Transferable)
Invoked when this is no longer the owner of the clipboard contents.
 o notify(Selection)
Notify of new selection.
 o pasteFrom(Transferable)
Paste objects into the selection.
 o removeSelectionChangeListener(SelectionChangeListener)
Remove a listener to un-subscribe for SelectionChange Events.
 o selectAll()
Select all data.
 o setData(Object)
This sets selection data.
 o setEmpty()
Set the selection state to empty.This fires a selection change event
 o setNotEmpty()
Set the model selection state to not empty.This fires a selection change event
 o setPresentationName(String)
Set Presentation Name
 o setState(int)
Set the selection's state: EMPTY, NOT_EMPTY
 o undoDelete(Object)
Undo the delete operation.
 o undoPaste(Object)
Undo paste operation.

Variables

 o listenerList
 protected transient EventListenerList listenerList

Constructors

 o AbstractSelection
 public AbstractSelection()
Default constructor

 o AbstractSelection
 public AbstractSelection(Object data,
                          String presentationName)
Construct a selection.

Parameters:
data - - selected data
 o AbstractSelection
 public AbstractSelection(Selection selection)
Copy constructor.

Methods

 o getPresentationName
 public String getPresentationName()
Return the selection's presentation name.

 o setPresentationName
 public void setPresentationName(String presentationName)
Set Presentation Name

 o clone
 public abstract Object clone()
Clone the selection. You must implement this to clone your own selection

Overrides:
clone in class Object
 o notify
 public void notify(Selection selection)
Notify of new selection.

 o getData
 public Object getData()
Returns selection data

 o setData
 protected void setData(Object data)
This sets selection data. Fires a selection change event

 o 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.

 o getState
 public int getState()
Return the selection's state: EMPTY, NOT_EMPTY

 o setState
 public void setState(int newState) throws IllegalSelectionStateException
Set the selection's state: EMPTY, NOT_EMPTY

 o selectAll
 public void selectAll()
Select all data. Invokes setNotEmpty() which fires a selection change event

 o deselectAll
 public void deselectAll()
Deselect all data. Invokes setEmpty() which fires a selection change event

 o clearSelection
 public void clearSelection()
Clear selection, convenience function to deselect all data. Invokes setEmpty() which fires a selection change event

 o setEmpty
 public void setEmpty()
Set the selection state to empty.This fires a selection change event

 o setNotEmpty
 public void setNotEmpty()
Set the model selection state to not empty.This fires a selection change event

 o isEmpty
 public boolean isEmpty()
Is the model selection empty?

 o isNotEmpty
 public boolean isNotEmpty()
Is the model selection not empty?

 o canDelete
 public boolean canDelete()
Can the selection be deleted?

 o delete
 public Object delete()
Delete selection data.

Returns:
Return data that allows the delete to be undone.
 o undoDelete
 public void undoDelete(Object undoData)
Undo the delete operation.

Parameters:
undoData - data for undoing the previous delete.
 o canPasteFrom
 public boolean canPasteFrom(Transferable contents)
Can objects be pasted into the selection?

Parameters:
contents - clipboard contents
 o 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.
 o undoPaste
 public void undoPaste(Object undoData)
Undo paste operation.

Parameters:
undoData - data for undoing the previous paste.
 o 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
 o 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
 o 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
 o addSelectionChangeListener
 public void addSelectionChangeListener(SelectionChangeListener l)
Add a listener to subscribe for SelectionChange Events.

 o removeSelectionChangeListener
 public void removeSelectionChangeListener(SelectionChangeListener l)
Remove a listener to un-subscribe for SelectionChange Events.

 o fireSelectionChangeEvent
 public void fireSelectionChangeEvent(Object eventData)
Send a SelectionChangeEvent to the registered listeners to notify them of any state change.

 o 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