Search in sources :

Example 1 with AddAnnotationCommand

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

the class AddAnnotationAction method runOnNodes.

/**
 * {@inheritDoc}
 */
@Override
public void runOnNodes(final NodeContainerEditPart[] nodeParts) {
    AddAnnotationCommand aac = new AddAnnotationCommand(getManager(), getEditor().getViewer(), new Point(m_x, m_y));
    // enables undo
    getCommandStack().execute(aac);
    // 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 : AddAnnotationCommand(org.knime.workbench.editor2.commands.AddAnnotationCommand) Point(org.eclipse.swt.graphics.Point)

Aggregations

Point (org.eclipse.swt.graphics.Point)1 AddAnnotationCommand (org.knime.workbench.editor2.commands.AddAnnotationCommand)1