class EditToolTopComponent extends TopComponent {

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel propertySheet;
    // End of variables declaration//GEN-END:variables

    public EditToolTopComponent() {
        initComponents();
        setName(NbBundle.getMessage(EditToolTopComponent.class, "CTL_EditToolTopComponent"));

        putClientProperty(TopComponent.PROP_MAXIMIZATION_DISABLED, Boolean.TRUE);
        ((PropertySheet) propertySheet).setDescriptionAreaVisible(false);

        Lookup.getDefault().lookup(ProjectController.class).addWorkspaceListener(new WorkspaceListener() {

            @Override
            public void initialize(Workspace workspace) {
            }

            @Override
            public void select(Workspace workspace) {
                SwingUtilities.invokeLater(() -> {
                    propertySheet.setEnabled(true);
                });
            }

            @Override
            public void unselect(Workspace workspace) {
                disableEdit();
            }

            @Override
            public void close(Workspace workspace) {
            }

            @Override
            public void disable() {
                SwingUtilities.invokeLater(() -> {
                    propertySheet.setEnabled(false);
                    EditToolTopComponent.this.close();
                });
            }
        });
    }

    public void editNode(Node node) {
        ((PropertySheet) propertySheet).setNodes(new org.openide.nodes.Node[] {new EditNodes(node)});
    }

    public void editNodes(Node[] nodes) {
        ((PropertySheet) propertySheet).setNodes(new org.openide.nodes.Node[] {new EditNodes(nodes)});
    }

    public void editEdge(Edge edge) {
        ((PropertySheet) propertySheet).setNodes(new org.openide.nodes.Node[] {new EditEdges(edge)});
    }

    public void editEdges(Edge[] edges) {
        ((PropertySheet) propertySheet).setNodes(new org.openide.nodes.Node[] {new EditEdges(edges)});
    }

    public void disableEdit() {
        ((PropertySheet) propertySheet).setNodes(new org.openide.nodes.Node[] {});
    }

    /**
     * This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;

        propertySheet = new PropertySheet();

        setLayout(new java.awt.GridBagLayout());
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 1.0;
        gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
        add(propertySheet, gridBagConstraints);
    }// </editor-fold>//GEN-END:initComponents

    @Override
    public void componentOpened() {
        // TODO add custom code on component opening
    }

    @Override
    public void componentClosed() {
        // TODO add custom code on component closing
    }

    void writeProperties(java.util.Properties p) {
        // better to version settings since initial version as advocated at
        // http://wiki.apidesign.org/wiki/PropertyFiles
        p.setProperty("version", "1.0");
        // TODO store your settings
    }

    void readProperties(java.util.Properties p) {<FILL_FUNCTION_BODY>}
}

        String version = p.getProperty("version");
        // TODO read your settings according to their version
    
<no_super_class>