Class CopyPasteHandler
java.lang.Object
com.inductiveautomation.ignition.designer.model.AbstractEditActionHandler
com.inductiveautomation.factorypmi.designer.workspace.CopyPasteHandler
- All Implemented Interfaces:
EditActionHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class com.inductiveautomation.ignition.designer.model.AbstractEditActionHandler
listenerList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCopyPasteListener(CopyPasteListener listener) voidCancels and pending paste requests.booleancanCopy()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.booleanCan 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.booleanCan this action handler handle a paste given the data flavors currently available in the clipboard?booleancanPaste(Transferable data) booleanCan this action handler handle the rename action, given its current selection.voiddispose()doCopy()Performs a copy operation on the current selection, returning the serialized XML results as aStringSelectionvoidPerforms a copy operation on the current selection, using the system clipboard to store the XML serialized data.doCut()Performs a cut operation on the current selection, returning the serialized XML results as aStringSelection.voidPerforms a cut operation on the current selection, using the system clipboard to store the XML serialized data.voiddoDelete()Called when the delete action is performedvoidCopies and then PasteImmediates the selection.voiddoPaste(VisionContainer dropContainer, Point dropLocation) voiddoPaste(VisionContainer dropContainer, Point dropLocation, boolean pasteAgain) voidCalled when the paste action is performedbooleanvoiddoRename()Called when the rename action is performedbooleanReturns whether or not a past is pending, which is caused by calling startPaste(), but not yet calling doPaste()voidremoveCopyPasteListener(CopyPasteListener listener) protected voidsetPastePending(boolean b) voidstartLegacyPaste(String xml, boolean isWindow, boolean interactive) voidstartPaste(boolean interactive) Starts a paste using the contents of the clipboard.voidstartPaste(InputStream data, String dataType, boolean interactive) Starts a paste operation using the data in the input stream.voidstartPaste(String xml, boolean interactive) Methods inherited from class com.inductiveautomation.ignition.designer.model.AbstractEditActionHandler
addChangeListener, fireChangeEvent, removeChangeListener
-
Field Details
-
ARCHIVE_TYPE_KEY
- See Also:
-
ARCHIVE_TYPE_WINDOW
- See Also:
-
ARCHIVE_TYPE_TEMPLATE
- See Also:
-
ARCHIVE_TYPE_COMPONENTS
- See Also:
-
-
Constructor Details
-
CopyPasteHandler
-
-
Method Details
-
dispose
public void dispose() -
canDelete
public boolean canDelete()Description copied from interface:EditActionHandlerCan 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:EditActionHandlerCan 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
Description copied from interface:EditActionHandlerCan this action handler handle a paste given the data flavors currently available in the clipboard? -
canPaste
-
startLegacyPaste
-
startPaste
public void startPaste(boolean interactive) Starts a paste using the contents of the clipboard. -
startPaste
-
doPaste
-
doPaste
-
startPaste
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:EditActionHandlerCalled 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
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
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
Description copied from interface:EditActionHandlerCalled when the paste action is performed- Parameters:
t- The current contents of the clipboard to paste.
-
doPasteImpl
-
addCopyPasteListener
-
removeCopyPasteListener
-
canRename
public boolean canRename()Description copied from interface:EditActionHandlerCan this action handler handle the rename action, given its current selection.- Returns:
- true, if the node can be renamed
-
doRename
public void doRename()Description copied from interface:EditActionHandlerCalled when the rename action is performed
-