public class ClipboardAction extends javax.swing.AbstractAction
| Modifier and Type | Field and Description |
|---|---|
private java.awt.datatransfer.Transferable |
contents
The contents that are transfered into the clipboard when the action is executed.
|
private long |
lastPopupShowTime
The UNIX epoch time when the popup for this action was shown the last time
|
private javax.swing.JPopupMenu |
popup
A small popup that shows up when the key has been moved to the clipboard
|
private static long |
POPUP_DURATION
The duration in milliseconds for which the popup will be shown
|
private java.awt.Component |
popupParent
The component which is used as parent of the shown popup.
|
private static long |
serialVersionUID |
| Constructor and Description |
|---|
ClipboardAction(java.lang.String name,
java.awt.datatransfer.Transferable contents) |
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e) |
void |
setContents(java.awt.datatransfer.Transferable contents) |
void |
setPopupParent(java.awt.Component popupParent)
Sets the component, under which the popup will be shown, which indicates that the key was copied to the clipboard.
|
private static final long serialVersionUID
private static final long POPUP_DURATION
private final javax.swing.JPopupMenu popup
private java.awt.Component popupParent
null, no popup will be shown.private long lastPopupShowTime
private java.awt.datatransfer.Transferable contents
null, the clipboard won't be changed.public ClipboardAction(java.lang.String name, java.awt.datatransfer.Transferable contents)
public void setContents(java.awt.datatransfer.Transferable contents)
contents - the contents, which should be copied to the clipboard when the Action is executedpublic void setPopupParent(java.awt.Component popupParent)
popupParent - the component to set as parent of the popuppublic void actionPerformed(java.awt.event.ActionEvent e)