public static ActionUrl getActionUrl(final TreePath treePath,
                                       @MagicConstant(intValues = {ActionUrl.ADDED, ActionUrl.DELETED, ActionUrl.MOVE}) int actionType) {
    ActionUrl url = new ActionUrl();
    for (int i = 0; i < treePath.getPath().length - 1; i++) {
      Group group = getGroupForNode((DefaultMutableTreeNode)treePath.getPath()[i]);
      if (group != null) {
        url.getGroupPath().add(group.getName());
      }
    }

    final DefaultMutableTreeNode component = ((DefaultMutableTreeNode)treePath.getLastPathComponent());
    Object userObj = component.getUserObject();
    url.setComponent(userObj instanceof Pair<?, ?> pair ? pair.first : userObj);
    final TreeNode parent = component.getParent();
    url.setAbsolutePosition(parent != null ? parent.getIndex(component) : 0);
    url.setActionType(actionType);
    return url;
  }
public static ActionUrl getActionUrl(final TreePath treePath,
                                       @MagicConstant(intValues = {ActionUrl.ADDED, ActionUrl.DELETED, ActionUrl.MOVE}) int actionType)