public void showContextPopupMenu(int x, int y) {
        if (!component.isEnabled()) {
            return;
        }

        for (Component c : contextMenu.getComponents()) {
            if (c instanceof JMenuItem) {
                ((JMenuItem) c).setAction(null);
            }
        }
        contextMenu.removeAll();

        boolean isFirstGroup = true;
        for (List<Action> actionGroup : actionGroupMap.values()) {
            boolean isSeparatorAdded = false;
            for (Action action : actionGroup) {
                if (!Boolean.FALSE.equals(action.getValue("visible"))) {
                    if (!isSeparatorAdded) {
                        if (isFirstGroup) {
                            isFirstGroup = false;
                        } else {
                            contextMenu.addSeparator();
                        }
                        isSeparatorAdded = true;
                    }
                    contextMenu.add(action);
                }
            }
        }
        if (contextMenu.getComponentCount() > 0) {
            contextMenu.show(component, x, y);
        }
    }