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, getComponent
addChangeListener, fireChangeEvent, removeChangeListener
public JTableEditActionHandler(javax.swing.JTable component) throws java.lang.NullPointerException
JTable
component
- The JTable
to injectjava.lang.NullPointerException
- if the provided JTable
is nullpublic boolean canDelete()
EditActionHandler
EditActionHandler.canCopy()
both return true, the cut action will also be enabled.canDelete
in interface EditActionHandler
canDelete
in class CommonEditActionHandler<javax.swing.JTable>
public boolean canCopy()
EditActionHandler
EditActionHandler.canDelete()
both return true, the cut action will also be enabled.canCopy
in interface EditActionHandler
canCopy
in class CommonEditActionHandler<javax.swing.JTable>
public boolean canPaste(java.awt.datatransfer.Clipboard clipboard)
EditActionHandler
canPaste
in interface EditActionHandler
canPaste
in class CommonEditActionHandler<javax.swing.JTable>
public void doDelete()
EditActionHandler
public java.awt.datatransfer.Transferable doCopy()
EditActionHandler
Transferable
, or null if the copy failed. Will be added to
the system clipboard.public void doPaste(java.awt.datatransfer.Transferable clipboardContents)
EditActionHandler
clipboardContents
- The current contents of the clipboard to paste.