Class ViewNode

All Implemented Interfaces:
BrickListener, ViewNodeContainer, DataListener

public class ViewNode extends BeanNode<Component> implements ViewNodeContainer
brick which represents a view
  • Field Details

  • Constructor Details

  • Method Details

    • getInstance

      public static ViewNode getInstance(DataAdaptor adaptor)
      generator
    • getPrototypeBean

      protected Component getPrototypeBean(BeanProxy<Component> beanProxy)
      get the bean instance
      Overrides:
      getPrototypeBean in class BeanNode<Component>
    • getView

      public Component getView()
      Get the view.
      Returns:
      the view
    • getViewProxy

      public ViewProxy<Component> getViewProxy()
      Get the view proxy
      Returns:
      the view proxy
    • getViewIndex

      public int getViewIndex(ViewNode node)
      Get the index of the view node in the container
      Parameters:
      node - the node to locate
      Returns:
      the index of the view in the container or -1 if it isn't contained in this node
    • isWindow

      public boolean isWindow()
      Determine if the underlying view is a window
      Returns:
      true if the view is a window and false if not
    • getContainer

      public Container getContainer()
      Get the container.
      Returns:
      the view as a container
    • canAdd

      public boolean canAdd(BeanProxy<?> beanProxy)
      Determine if the brick can add the specified view
      Specified by:
      canAdd in interface ViewNodeContainer
      Specified by:
      canAdd in class Brick
      Returns:
      true if it can add the specified view and false if not
    • add

      public void add(List<BeanProxy<?>> beanProxies)
      Add the beans to this node
      Specified by:
      add in interface ViewNodeContainer
      Parameters:
      beanProxies - the beans to add to this node
    • addNodes

      public void addNodes(List<BeanNode<?>> nodes)
      Add the views nodes to this node
      Specified by:
      addNodes in interface ViewNodeContainer
      Parameters:
      nodes - the nodes to add to this node
    • insertSiblings

      public void insertSiblings(List<BeanProxy<?>> beanProxies)
      Insert the views in this node beginning at the specified index
      Specified by:
      insertSiblings in interface ViewNodeContainer
      Parameters:
      beanProxies - the views to add to this node
    • getTreeIndexOffsetFromViewIndex

      public int getTreeIndexOffsetFromViewIndex()
      Get the tree index offset from the view index
      Specified by:
      getTreeIndexOffsetFromViewIndex in interface ViewNodeContainer
      Returns:
      the tree index offset
    • insertViewNode

      public void insertViewNode(ViewNode node, int viewIndex)
      Insert the view node in this node beginning at the specified index
      Specified by:
      insertViewNode in interface ViewNodeContainer
      Parameters:
      node - the node to add to this node
      viewIndex - the initial index at which to insert the node
    • insertSiblingNodes

      public void insertSiblingNodes(List<BeanNode<?>> nodes)
      Insert the specified view nodes immediately above this node
      Specified by:
      insertSiblingNodes in interface ViewNodeContainer
      Parameters:
      nodes - the nodes to add to this node
    • moveDownNodes

      public void moveDownNodes(List<BeanNode<?>> nodes)
      Move the specified nodes down
      Specified by:
      moveDownNodes in interface ViewNodeContainer
    • moveUpNodes

      public void moveUpNodes(List<BeanNode<?>> nodes)
      Move the specified nodes up
      Specified by:
      moveUpNodes in interface ViewNodeContainer
    • removeNode

      public void removeNode(BeanNode<?> node)
      Remove the view node from this container
      Specified by:
      removeNode in interface ViewNodeContainer
      Parameters:
      node - the node to remove
    • removeNodes

      public void removeNodes(List<BeanNode<?>> nodes)
      Remove the view nodes from this container
      Specified by:
      removeNodes in interface ViewNodeContainer
      Parameters:
      nodes - the nodes to remove
    • getBorderNode

      protected BorderNode getBorderNode()
      get the border node
    • setBorderNode

      protected void setBorderNode(BorderNode node)
      set the border node
    • getWindow

      public Window getWindow()
      get the containing or being the view
    • refreshDisplay

      public void refreshDisplay()
      refresh display
      Overrides:
      refreshDisplay in class BeanNode<Component>
    • nodesAdded

      public void nodesAdded(Object source, Brick container, List<BeanNode<?>> nodes)
      Handle the event in which nodes have been added to a container
      Specified by:
      nodesAdded in interface BrickListener
      Parameters:
      source - the source of the event
      container - the node to which nodes have been added
      nodes - the nodes which have been added
    • nodesRemoved

      public void nodesRemoved(Object source, Brick container, List<BeanNode<?>> nodes)
      Handle the event in which nodes have been removed from a container
      Specified by:
      nodesRemoved in interface BrickListener
      Parameters:
      source - the source of the event
      container - the node from which nodes have been removed
      nodes - the nodes which have been removed
    • propertyChanged

      public void propertyChanged(BeanNode<?> beanNode, PropertyDescriptor propertyDescriptor, Object value)
      Handle the event in which a bean's property has been changed
      Specified by:
      propertyChanged in interface BrickListener
      Parameters:
      beanNode - the node whose property has changed
      propertyDescriptor - the property which has changed
      value - the new value
    • treeNeedsRefresh

      public void treeNeedsRefresh(Object source, Brick brick)
      Handle the event in which a brick's tree path needs refresh
      Specified by:
      treeNeedsRefresh in interface BrickListener
      Parameters:
      source - the source of the event
      brick - the brick at which the refresh needs to be done
    • removeFromParent

      public void removeFromParent()
      Remove this brick from its parent
      Specified by:
      removeFromParent in class Brick
    • display

      public void display()
      Display the bean's window
      Overrides:
      display in class BeanNode<Component>
    • dataLabel

      public String dataLabel()
      Provides the name used to identify the class in an external data source.
      Specified by:
      dataLabel in interface DataListener
      Specified by:
      dataLabel in class BeanNode<Component>
      Returns:
      a tag that identifies the receiver's type
    • update

      public void update(DataAdaptor adaptor)
      Update the data based on the information provided by the data provider.
      Specified by:
      update in interface DataListener
      Overrides:
      update in class BeanNode<Component>
      Parameters:
      adaptor - The adaptor from which to update the data
    • write

      public void write(DataAdaptor adaptor)
      Write data to the data adaptor for storage.
      Specified by:
      write in interface DataListener
      Overrides:
      write in class BeanNode<Component>
      Parameters:
      adaptor - The adaptor to which the receiver's data is written