flexycakes
    Preparing search index...

    Class Model

    Class containing the Tree of Nodes used by the FlexLayout component

    Index

    Properties

    MAIN_WINDOW_ID: string = "__main_window_id__"

    Methods

    • Parameters

      • listener: (action: Action) => void

      Returns void

    • Update the node tree by performing the given action, Actions should be generated via static methods on the Actions class

      Parameters

      • action: Action

        the action to perform

      Returns any

      added Node for Actions.addNode, windowId for createWindow

    • Get the currently active tabset node

      Parameters

      • windowId: string = Model.MAIN_WINDOW_ID

      Returns undefined | TabSetNode

    • Finds the first/top left tab set of the given node.

      Parameters

      • node: Node = ...

        The top node you want to begin searching from, deafults to the root node

      Returns TabSetNode

      The first Tab Set

    • Get the currently maximized tabset node

      Parameters

      • windowId: string = Model.MAIN_WINDOW_ID

      Returns undefined | TabSetNode

    • Gets a node by its id

      Parameters

      • id: string

        the id to find

      Returns undefined | Node

    • Gets the root RowNode of the model

      Parameters

      • windowId: string = Model.MAIN_WINDOW_ID

      Returns RowNode

    • Returns number

    • Returns number

    • Parameters

      • windowId: string

      Returns number

    • Returns boolean

    • Returns boolean

    • Returns boolean

    • Returns boolean

    • Parameters

      • listener: (action: Action) => void

      Returns void

    • Sets a function to allow/deny dropping a node

      Parameters

      • onAllowDrop: (dragNode: Node, dropInfo: DropInfo) => boolean

        function that takes the drag node and DropInfo and returns true if the drop is allowed

      Returns void

    • set callback called when a new TabSet is created. The tabNode can be undefined if it's the auto created first tabset in the root row (when the last tab is deleted, the root tabset can be recreated)

      Parameters

      Returns void

    • Converts the model to a json object

      Returns IJsonModel

      json object that represents this model

    • Returns string

    • Visits all the nodes in the model and calls the given function for each

      Parameters

      • fn: (node: Node, level: number) => void

        a function that takes visited node and a integer level as parameters

      Returns void

    • Parameters

      • windowId: string
      • fn: (node: Node, level: number) => void

      Returns void

    • Loads the model from the given json object

      Parameters

      Returns Model

      a new Model object

    • Returns void