public class JTableEditActionHandler extends CommonEditActionHandler<javax.swing.JTable>
EditActionHandler for JTables which takes care of
the basic Copy / Cut / Paste / Delete actions.listenerList| Constructor and Description |
|---|
JTableEditActionHandler(javax.swing.JTable component)
Constructor for injecting the
JTable |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canCopy()
Can this edit action handler handle the copy action, given its current selection? Note that if this and
EditActionHandler.canDelete() both return true, the cut action will also be enabled. |
boolean |
canDelete()
Can this edit action handler handle the delete action, given its current selection? Note that if this and
EditActionHandler.canCopy() both return true, the cut action will also be enabled. |
boolean |
canPaste(java.awt.datatransfer.Clipboard clipboard)
Can this action handler handle a paste given the data flavors currently available in the clipboard?
|
java.awt.datatransfer.Transferable |
doCopy()
Called when the copy action is performed.
|
void |
doDelete()
Called when the delete action is performed
|
void |
doPaste(java.awt.datatransfer.Transferable clipboardContents)
Called when the paste action is performed
|
doCut, getComponentaddChangeListener, fireChangeEvent, removeChangeListenerpublic JTableEditActionHandler(javax.swing.JTable component)
throws java.lang.NullPointerException
JTablecomponent - The JTable to injectjava.lang.NullPointerException - if the provided JTable is nullpublic boolean canDelete()
EditActionHandlerEditActionHandler.canCopy() both return true, the cut action will also be enabled.canDelete in interface EditActionHandlercanDelete in class CommonEditActionHandler<javax.swing.JTable>public boolean canCopy()
EditActionHandlerEditActionHandler.canDelete() both return true, the cut action will also be enabled.canCopy in interface EditActionHandlercanCopy in class CommonEditActionHandler<javax.swing.JTable>public boolean canPaste(java.awt.datatransfer.Clipboard clipboard)
EditActionHandlercanPaste in interface EditActionHandlercanPaste in class CommonEditActionHandler<javax.swing.JTable>public void doDelete()
EditActionHandlerpublic java.awt.datatransfer.Transferable doCopy()
EditActionHandlerTransferable, or null if the copy failed. Will be added to
the system clipboard.public void doPaste(java.awt.datatransfer.Transferable clipboardContents)
EditActionHandlerclipboardContents - The current contents of the clipboard to paste.