Class CopyPasteHandler
- java.lang.Object
-
- com.inductiveautomation.ignition.designer.model.AbstractEditActionHandler
-
- com.inductiveautomation.factorypmi.designer.workspace.CopyPasteHandler
-
- All Implemented Interfaces:
EditActionHandler
public class CopyPasteHandler extends AbstractEditActionHandler
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ARCHIVE_TYPE_COMPONENTS
static java.lang.String
ARCHIVE_TYPE_KEY
static java.lang.String
ARCHIVE_TYPE_TEMPLATE
static java.lang.String
ARCHIVE_TYPE_WINDOW
-
Fields inherited from class com.inductiveautomation.ignition.designer.model.AbstractEditActionHandler
listenerList
-
-
Constructor Summary
Constructors Constructor Description CopyPasteHandler(WindowWorkspace workspace)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCopyPasteListener(CopyPasteListener listener)
void
cancelPaste()
Cancels and pending paste requests.boolean
canCopy()
Can this edit action handler handle the copy action, given its current selection? Note that if this andEditActionHandler.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 andEditActionHandler.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?boolean
canPaste(java.awt.datatransfer.Transferable data)
java.awt.datatransfer.Transferable
doCopy()
Performs a copy operation on the current selection, returning the serialized XML results as aStringSelection
void
doCopyToClipboard()
Performs a copy operation on the current selection, using the system clipboard to store the XML serialized data.java.awt.datatransfer.Transferable
doCut()
Performs a cut operation on the current selection, returning the serialized XML results as aStringSelection
.void
doCutToClipboard()
Performs a cut operation on the current selection, using the system clipboard to store the XML serialized data.void
doDelete()
Called when the delete action is performedvoid
doDuplicateSelection()
Copies and then PasteImmediates the selection.void
doPaste(VisionContainer dropContainer, java.awt.Point dropLocation)
void
doPaste(VisionContainer dropContainer, java.awt.Point dropLocation, boolean pasteAgain)
void
doPaste(java.awt.datatransfer.Transferable t)
Called when the paste action is performedboolean
doPasteImpl(java.awt.datatransfer.Transferable t)
boolean
isPastePending()
Returns whether or not a past is pending, which is caused by calling startPaste(), but not yet calling doPaste()void
removeCopyPasteListener(CopyPasteListener listener)
protected void
setPastePending(boolean b)
void
startLegacyPaste(java.lang.String xml, boolean isWindow, boolean interactive)
void
startPaste(boolean interactive)
Starts a paste using the contents of the clipboard.void
startPaste(java.io.InputStream data, java.lang.String dataType, boolean interactive)
Starts a paste operation using the data in the input stream.void
startPaste(java.lang.String xml, boolean interactive)
-
Methods inherited from class com.inductiveautomation.ignition.designer.model.AbstractEditActionHandler
addChangeListener, fireChangeEvent, removeChangeListener
-
-
-
-
Field Detail
-
ARCHIVE_TYPE_KEY
public static final java.lang.String ARCHIVE_TYPE_KEY
- See Also:
- Constant Field Values
-
ARCHIVE_TYPE_WINDOW
public static final java.lang.String ARCHIVE_TYPE_WINDOW
- See Also:
- Constant Field Values
-
ARCHIVE_TYPE_TEMPLATE
public static final java.lang.String ARCHIVE_TYPE_TEMPLATE
- See Also:
- Constant Field Values
-
ARCHIVE_TYPE_COMPONENTS
public static final java.lang.String ARCHIVE_TYPE_COMPONENTS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CopyPasteHandler
public CopyPasteHandler(WindowWorkspace workspace)
-
-
Method Detail
-
canDelete
public boolean canDelete()
Description copied from interface:EditActionHandler
Can this edit action handler handle the delete action, given its current selection? Note that if this andEditActionHandler.canCopy()
both return true, the cut action will also be enabled.
-
canCopy
public boolean canCopy()
Description copied from interface:EditActionHandler
Can this edit action handler handle the copy action, given its current selection? Note that if this andEditActionHandler.canDelete()
both return true, the cut action will also be enabled.
-
canPaste
public boolean canPaste(java.awt.datatransfer.Clipboard clipboard)
Description copied from interface:EditActionHandler
Can this action handler handle a paste given the data flavors currently available in the clipboard?
-
canPaste
public boolean canPaste(java.awt.datatransfer.Transferable data)
-
startLegacyPaste
public void startLegacyPaste(java.lang.String xml, boolean isWindow, boolean interactive)
-
startPaste
public void startPaste(boolean interactive)
Starts a paste using the contents of the clipboard.
-
startPaste
public void startPaste(java.lang.String xml, boolean interactive)
-
doPaste
public void doPaste(VisionContainer dropContainer, java.awt.Point dropLocation)
-
doPaste
public void doPaste(VisionContainer dropContainer, java.awt.Point dropLocation, boolean pasteAgain)
-
startPaste
public void startPaste(java.io.InputStream data, java.lang.String dataType, boolean interactive)
Starts a paste operation using the data in the input stream.- Parameters:
data
- The data for the past (xml)dataType
- Should be one of:interactive
- If true, the workspace will switch to the paste tool. If not, you should call doPaste after calling startPaste
-
cancelPaste
public void cancelPaste()
Cancels and pending paste requests. Has no effect if not currently paste pending
-
isPastePending
public boolean isPastePending()
Returns whether or not a past is pending, which is caused by calling startPaste(), but not yet calling doPaste()
-
setPastePending
protected void setPastePending(boolean b)
-
doDelete
public void doDelete()
Description copied from interface:EditActionHandler
Called when the delete action is performed
-
doDuplicateSelection
public void doDuplicateSelection()
Copies and then PasteImmediates the selection. Doesn't use the clipboard. Doesn't work on root containers.
-
doCopyToClipboard
public void doCopyToClipboard()
Performs a copy operation on the current selection, using the system clipboard to store the XML serialized data.
-
doCutToClipboard
public void doCutToClipboard()
Performs a cut operation on the current selection, using the system clipboard to store the XML serialized data.
-
doCopy
public java.awt.datatransfer.Transferable doCopy()
Performs a copy operation on the current selection, returning the serialized XML results as aStringSelection
- Returns:
- the current selection as a
Transferable
, or null if the copy failed. Will be added to the system clipboard.
-
doCut
public java.awt.datatransfer.Transferable doCut()
Performs a cut operation on the current selection, returning the serialized XML results as aStringSelection
.- Returns:
- the current selection as a
Transferable
, or null if the cut failed. Will be added to the system clipboard.
-
doPaste
public void doPaste(java.awt.datatransfer.Transferable t)
Description copied from interface:EditActionHandler
Called when the paste action is performed- Parameters:
t
- The current contents of the clipboard to paste.
-
doPasteImpl
public boolean doPasteImpl(java.awt.datatransfer.Transferable t)
-
addCopyPasteListener
public void addCopyPasteListener(CopyPasteListener listener)
-
removeCopyPasteListener
public void removeCopyPasteListener(CopyPasteListener listener)
-
-