Skip to content

UINavigationNode

The UINavigationNode class represents a node within a user interface's Navigation View. This class allows interaction with the navigation structure, enabling features like expanding, collapsing, focusing, and managing nodes. Nodes can represent files or applications.

Properties:

  • expanded: boolean
    Indicates whether the node is expanded (children are visible) or collapsed (children are hidden).
  • focused: boolean (read-only)
    A read-only property indicating whether this node is currently focused in the UI.
  • nodes: UINavigationNodes (read-only)
    A read-only collection of child nodes under this node.
  • app: App
    The application associated with this node.
  • file: DocumentFile
    The file associated with this node, if applicable.
  • text: string
    The display text of the node.
  • icon: string | Icon
    The main icon displayed next to the node's text. Value must be the name of an icon in SYS$ICON document class. The best practice is to use Icons.name_of_icon. You can add your own custom icons or change the existing ones via System Management→Icons app.
  • stateIcon: string
    An additional icon that can represent the state of the node (e.g., checked, loading, etc.).
  • overlayIcon: string
    An icon displayed on top of the main icon, often used for overlaying additional status indicators.
  • parent: UINavigationNode (read-only)
    A read-only property representing the parent node of this node. If this node is the root, parent property is null.

Methods:

  • expand(recursive?: boolean)
    Expands the node to display its child nodes.
  • recursive (Optional): If set to true, all child nodes are expanded as well. Defaults to false.
  • collapse(recursive?: boolean)
    Collapses the node to hide its child nodes.
  • recursive (Optional): If set to true, all child nodes are collapsed as well. Defaults to false.
  • focus()
    Focuses this node in the Navigation View.
  • click(handler?: ()=> boolean): any
    Registers a click event on the node or performs click.
  • handler: (Optional) A function that runs when the node is clicked. It should return true or any value to determine the outcome of the event.
  • doubleClick or dblClick(handler?: ()=> boolean): any
    Registers a double-click event on the node or performs double-click.
  • handler: (Optional) A function to handle the double-click event.
  • contextMenu(handler: ()=> boolean): any
    Registers a context menu event (right-click) on the node.
  • handler: A function that handles the context menu event.
  • delete()
    Deletes this node and removes it from the Navigation View.
  • find(appOrClassOrComparer: string | App | Class | ((n: UINavigationNode) => boolean)): UINavigationNode
    Searches for a child node that matches the given app, class, or comparison function. Returns the first matching node.
  • appOrClassOrComparer: The search criteria, which can be an application, class, or a comparison function that evaluates each node.
  • findAll(appOrClassOrComparer: string | App | Class | ((n: UINavigationNode) => boolean)): UINavigationNode[]
    Finds and returns an array of all nodes that match the given app, class, or comparison function.
  • isChildOf(appOrClass: string | App | Class): boolean
    Checks if this node is a child of the given app or class. Returns true if the node is a child, and false otherwise.