class LinkNodes extends BasicNodesManipulator {

    private static boolean directed;
    private static GraphModel graphModel;
    private Node[] nodes;
    private Node sourceNode;

    @Override
    public void setup(Node[] nodes, Node clickedNode) {<FILL_FUNCTION_BODY>}

    @Override
    public void execute() {
        if (nodes.length > 1) {
            GraphElementsController gec = Lookup.getDefault().lookup(GraphElementsController.class);
            gec.createEdges(sourceNode, nodes, directed);
        } else {
            AddEdgeToGraph manipulator = new AddEdgeToGraph();
            manipulator.setSource(sourceNode);
            DataLaboratoryHelper.getDefault().executeManipulator(manipulator);
        }
    }

    @Override
    public String getName() {
        return NbBundle.getMessage(LinkNodes.class, "LinkNodes.name");
    }

    @Override
    public String getDescription() {
        return NbBundle.getMessage(LinkNodes.class, "LinkNodes.description");
    }

    @Override
    public boolean canExecute() {
        return true;
    }

    @Override
    public ManipulatorUI getUI() {
        return nodes.length > 1 ? new LinkNodesUI() :
            null;//Use link nodes UI if more than one node selected, otherwise add edge to graph action will be called in execute.
    }

    @Override
    public int getType() {
        return 500;
    }

    @Override
    public int getPosition() {
        return 100;
    }

    @Override
    public Icon getIcon() {
        return ImageUtilities.loadImageIcon("DataLaboratoryPlugin/edge.png", false);
    }

    public Node[] getNodes() {
        return nodes;
    }

    public Node getSourceNode() {
        return sourceNode;
    }

    public void setSourceNode(Node sourceNode) {
        this.sourceNode = sourceNode;
    }

    public boolean isDirected() {
        return directed;
    }

    public void setDirected(boolean directed) {
        LinkNodes.directed = directed;
    }
}

        this.nodes = nodes;
        this.sourceNode =
            clickedNode;//Choose clicked node as source by default (but the user can select it or other one in the UI)

        GraphModel currentGraphModel = Lookup.getDefault().lookup(GraphController.class).getGraphModel();
        if (graphModel !=
            currentGraphModel) {//If graph model has changed since last execution, change default mode for edges to create in UI, else keep this parameter across calls
            directed = currentGraphModel.isDirected() ||
                currentGraphModel.isMixed();//Get graph directed state. Set to true if graph is directed or mixed
            graphModel = currentGraphModel;
        }
    
<methods>public non-sealed void <init>() ,public java.lang.Integer getMnemonicKey() ,public org.gephi.datalab.spi.ContextMenuItemManipulator[] getSubItems() ,public boolean isAvailable() <variables>