Class ClipboardAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.openstreetmap.josm.plugins.streetside.gui.imageinfo.ClipboardAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.io.Serializable,java.lang.Cloneable,java.util.EventListener,javax.swing.Action
public class ClipboardAction extends javax.swing.AbstractAction
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.awt.datatransfer.TransferablecontentsThe contents that are transfered into the clipboard when the action is executed.private longlastPopupShowTimeThe UNIX epoch time when the popup for this action was shown the last timeprivate javax.swing.JPopupMenupopupA small popup that shows up when the key has been moved to the clipboardprivate static longPOPUP_DURATIONThe duration in milliseconds for which the popup will be shownprivate java.awt.ComponentpopupParentThe component which is used as parent of the shown popup.private static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description ClipboardAction(java.lang.String name, java.awt.datatransfer.Transferable contents)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(java.awt.event.ActionEvent e)voidsetContents(java.awt.datatransfer.Transferable contents)voidsetPopupParent(java.awt.Component popupParent)Sets the component, under which the popup will be shown, which indicates that the key was copied to the clipboard.-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
POPUP_DURATION
private static final long POPUP_DURATION
The duration in milliseconds for which the popup will be shown- See Also:
- Constant Field Values
-
popup
private final javax.swing.JPopupMenu popup
A small popup that shows up when the key has been moved to the clipboard
-
popupParent
private java.awt.Component popupParent
The component which is used as parent of the shown popup. If this isnull, no popup will be shown.
-
lastPopupShowTime
private long lastPopupShowTime
The UNIX epoch time when the popup for this action was shown the last time
-
contents
private java.awt.datatransfer.Transferable contents
The contents that are transfered into the clipboard when the action is executed. If this isnull, the clipboard won't be changed.
-
-
Constructor Detail
-
ClipboardAction
public ClipboardAction(java.lang.String name, java.awt.datatransfer.Transferable contents)
-
-
Method Detail
-
setContents
public void setContents(java.awt.datatransfer.Transferable contents)
- Parameters:
contents- the contents, which should be copied to the clipboard when theActionis executed
-
setPopupParent
public 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.- Parameters:
popupParent- the component to set as parent of the popup
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
-
-