Search in sources :

Example 1 with PasteFromWorkflowPersistorCommand

use of org.knime.workbench.editor2.commands.PasteFromWorkflowPersistorCommand in project knime-core by knime.

the class PasteAction method runOnNodes.

/**
 * {@inheritDoc}
 */
@Override
public void runOnNodes(final NodeContainerEditPart[] nodeParts) {
    ClipboardObject clipObject = getEditor().getClipboardContent();
    ShiftCalculator shiftCalculator = newShiftCalculator();
    PasteFromWorkflowPersistorCommand pasteCommand = new PasteFromWorkflowPersistorCommand(getEditor(), clipObject, shiftCalculator);
    // enables undo
    getCommandStack().execute(pasteCommand);
    // update the actions
    getEditor().updateActions();
    // Give focus to the editor again. Otherwise the actions (selection)
    // is not updated correctly.
    getWorkbenchPart().getSite().getPage().activate(getWorkbenchPart());
}
Also used : ClipboardObject(org.knime.workbench.editor2.ClipboardObject) PasteFromWorkflowPersistorCommand(org.knime.workbench.editor2.commands.PasteFromWorkflowPersistorCommand) ShiftCalculator(org.knime.workbench.editor2.commands.PasteFromWorkflowPersistorCommand.ShiftCalculator)

Aggregations

ClipboardObject (org.knime.workbench.editor2.ClipboardObject)1 PasteFromWorkflowPersistorCommand (org.knime.workbench.editor2.commands.PasteFromWorkflowPersistorCommand)1 ShiftCalculator (org.knime.workbench.editor2.commands.PasteFromWorkflowPersistorCommand.ShiftCalculator)1