class AddEdgeToGraph implements GeneralActionsManipulator {

    private Node source = null, target = null;
    private boolean directed;
    private Object edgeTypeLabel = null;
    private GraphModel graphModel = null;

    @Override
    public void execute() {
        if (source != null && target != null) {
            Lookup.getDefault().lookup(GraphElementsController.class)
                .createEdge(source, target, directed, edgeTypeLabel);
        }
    }

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

    @Override
    public String getDescription() {
        return "";
    }

    @Override
    public boolean canExecute() {
        return Lookup.getDefault().lookup(GraphElementsController.class).getNodesCount() > 0;//At least 1 nodes
    }

    @Override
    public ManipulatorUI getUI() {<FILL_FUNCTION_BODY>}

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

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

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

    public boolean isDirected() {
        return directed;
    }

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

    public Node getSource() {
        return source;
    }

    public void setSource(Node source) {
        this.source = source;
    }

    public Node getTarget() {
        return target;
    }

    public void setTarget(Node target) {
        this.target = target;
    }

    public Object getEdgeTypeLabel() {
        return edgeTypeLabel;
    }

    public void setEdgeTypeLabel(Object edgeTypeLabel) {
        this.edgeTypeLabel = edgeTypeLabel;
    }
}

        GraphModel currentGraphModel = Lookup.getDefault().lookup(GraphController.class).getGraphModel();
        if (graphModel != null && 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;
            source = null;
        }
        return new AddEdgeToGraphUI();
    
<no_super_class>