private static void removePathFromActionsTree(@NotNull JTree tree, @NotNull ActionUrl url) {
    Object component = url.getComponent();
    if (component == null) return;
    TreePath treePath = CustomizationUtil.getTreePath(tree, url);
    if (treePath == null) return;
    DefaultMutableTreeNode node = (DefaultMutableTreeNode)treePath.getLastPathComponent();
    int absolutePosition = url.getAbsolutePosition();
    if (node.getChildCount() > absolutePosition && absolutePosition >= 0) {
      DefaultMutableTreeNode child = (DefaultMutableTreeNode)node.getChildAt(absolutePosition);
      Object userObj = child.getUserObject();
      if (component.equals(userObj instanceof Pair<?, ?> pair ? pair.first : userObj)) {
        node.remove(child);
      }
    }
  }
private static void removePathFromActionsTree(@NotNull JTree tree, @NotNull ActionUrl url)