com.sas.swing.adapters
Class TableViewClipboardAdapter

com.sas.swing.adapters.TableViewClipboardAdapter
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class TableViewClipboardAdapter

TableViewClipboardAdapter enables Cut-Copy-Paste Clipboard functionality on com.sas.swing.visual.tableview.TableViews. The clipboard data format used by the adapter is compatible with the clipboard format used by Excel. This provides for clipboard interoperability between enabled TableViews and Excel. Security access to the system clipboard must be available in order for this adapter to work.


Field Summary
static java.lang.String RB_KEY
           
protected  TableView table
           
 
Fields inherited from class com.sas.swing.adapters.JTableClipboardAdapter
clipboard, df, stringSelection, UPDATE_MODE, VALIDATE_MODE
 
Constructor Summary
TableViewClipboardAdapter(TableView table)
          The TableViewClipboardAdapter is constructed with a TableView on which it enables Cut-Copy-Paste and acts as a Clipboard listener.
 
Method Summary
static boolean canCopy(TableView table)
          Returns true if the given TableView is in a state where the selected cells, rows, and/or columns are all allowed to be copied to the clipboard, false otherwise.
static boolean canCut(TableView table)
          Returns true if the given TableView is in a state where the selected cells, rows, and/or columns are all allowed to be cut, false otherwise.
static boolean canPaste(TableView table)
          Returns true if the given TableView is in a state where the selected cells, rows, and/or columns are all allowed to be pasted into with the current contents of the clipboard, false otherwise.
protected  void copyCellsToClipboard(boolean replace, java.lang.String replaceString)
           
protected  void displayCutError(java.lang.Object value, int row, int col)
           
protected  void displayPasteError(java.lang.Object value, int row, int col)
           
 void pasteSelectedCells()
           
 
Methods inherited from class com.sas.swing.adapters.JTableClipboardAdapter
actionPerformed, append, copySelectedCells, cutSelectedCells, getClipboard, getTable, getTransform, parseContents, replaceNull, setOrValidateValue, setTable, setTransform, transform
 

Field Detail

RB_KEY

public static final java.lang.String RB_KEY
See Also:
Constant Field Values

table

protected TableView table
Constructor Detail

TableViewClipboardAdapter

public TableViewClipboardAdapter(TableView table)
The TableViewClipboardAdapter is constructed with a TableView on which it enables Cut-Copy-Paste and acts as a Clipboard listener.

Method Detail

canCopy

public static boolean canCopy(TableView table)
Returns true if the given TableView is in a state where the selected cells, rows, and/or columns are all allowed to be copied to the clipboard, false otherwise.

Parameters:
table - The TableView in question of whther a copy is allowed
Returns:
true if a copy of the selected items is allowed, false otherwise

canCut

public static boolean canCut(TableView table)
Returns true if the given TableView is in a state where the selected cells, rows, and/or columns are all allowed to be cut, false otherwise.

Parameters:
table - The TableView in question of whther a cut is allowed
Returns:
true if a cut of the selected items is allowed, false otherwise

canPaste

public static boolean canPaste(TableView table)
Returns true if the given TableView is in a state where the selected cells, rows, and/or columns are all allowed to be pasted into with the current contents of the clipboard, false otherwise.

Parameters:
table - The TableView in question of whther a paste is allowed
Returns:
true if a paste of the selected items is allowed, false otherwise

copyCellsToClipboard

protected void copyCellsToClipboard(boolean replace,
                                    java.lang.String replaceString)
Overrides:
copyCellsToClipboard in class JTableClipboardAdapter

pasteSelectedCells

public void pasteSelectedCells()
Overrides:
pasteSelectedCells in class JTableClipboardAdapter

displayCutError

protected void displayCutError(java.lang.Object value,
                               int row,
                               int col)
Overrides:
displayCutError in class JTableClipboardAdapter

displayPasteError

protected void displayPasteError(java.lang.Object value,
                                 int row,
                                 int col)
Overrides:
displayPasteError in class JTableClipboardAdapter



Copyright © 2009 SAS Institute Inc. All Rights Reserved.