class ClearEdges implements PluginGeneralActionsManipulator {

    public static final String DELETE_DIRECTED_SAVED_PREFERENCES = "ClearEdges_deleteDirected";
    public static final String DELETE_UNDIRECTED_SAVED_PREFERENCES = "ClearEdges_deleteUndirected";
    private boolean deleteDirected, deleteUndirected;

    public ClearEdges() {
        deleteDirected = NbPreferences.forModule(ClearEdges.class).getBoolean(DELETE_DIRECTED_SAVED_PREFERENCES, true);
        deleteUndirected =
            NbPreferences.forModule(ClearEdges.class).getBoolean(DELETE_UNDIRECTED_SAVED_PREFERENCES, true);
    }

    @Override
    public void execute() {<FILL_FUNCTION_BODY>}

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

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

    @Override
    public boolean canExecute() {
        return Lookup.getDefault().lookup(GraphElementsController.class).getEdgesCount() > 0;
    }

    @Override
    public ManipulatorUI getUI() {
        return new ClearEdgesUI();
    }

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

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

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

    public boolean isDeleteDirected() {
        return deleteDirected;
    }

    public void setDeleteDirected(boolean deleteDirected) {
        this.deleteDirected = deleteDirected;
    }

    public boolean isDeleteUndirected() {
        return deleteUndirected;
    }

    public void setDeleteUndirected(boolean deleteUndirected) {
        this.deleteUndirected = deleteUndirected;
    }
}

        GraphElementsController gec = Lookup.getDefault().lookup(GraphElementsController.class);
        Graph graph = Lookup.getDefault().lookup(GraphController.class).getGraphModel().getGraph();

        List<Edge> edges = new ArrayList<>();
        for (Edge edge : graph.getEdges().toArray()) {
            if (edge.isDirected()) {
                if (deleteDirected) {
                    edges.add(edge);
                }
            } else if (deleteUndirected) {
                edges.add(edge);
            }
        }

        gec.deleteEdges(edges.toArray(new Edge[0]));
    
<no_super_class>