class NodePopup {

    protected static final Set<Class<? extends Manipulator>> excludedManipulators = Set.copyOf(List.of(
        MergeNodes.class,
        LinkNodes.class,
        CopyNodeDataToOtherNodes.class));

    protected static final Set<Class<? extends Manipulator>> graphManipulators = Set.copyOf(List.of(
        SelectOnGraph.class));

    protected static final Set<Class<? extends Manipulator>> datalabManipulators = Set.copyOf(List.of(
        SelectNeighboursOnTable.class,
        SelectEdgesOnTable.class));

    protected static JPopupMenu createPopup(Node selectedElement) {<FILL_FUNCTION_BODY>}
}

        boolean graphOpened = SearchDialog.isGraphOpened();
        boolean datalabOpened = SearchDialog.isDataLabOpened();

        JPopupMenu contextMenu = new JPopupMenu();

        DataLaboratoryHelper dlh = DataLaboratoryHelper.getDefault();
        Integer lastManipulatorType = null;
        for (NodesManipulator em : dlh.getNodesManipulators()) {
            if (!excludedManipulators.contains(em.getClass())) {
                if (!graphOpened && graphManipulators.contains(em.getClass())) {
                    continue;
                }
                if (!datalabOpened && datalabManipulators.contains(em.getClass())) {
                    continue;
                }
                em.setup(new Node[] {selectedElement}, selectedElement);
                if (lastManipulatorType == null) {
                    lastManipulatorType = em.getType();
                }
                if (lastManipulatorType != em.getType()) {
                    contextMenu.addSeparator();
                }
                lastManipulatorType = em.getType();
                if (em.isAvailable()) {
                    contextMenu.add(PopupMenuUtils
                        .createMenuItemFromNodesManipulator(em, selectedElement, new Node[] {selectedElement}));
                }
            }
        }

        return contextMenu;
    
<no_super_class>