Class TreeItem<T,C extends TreeItem<T,C>>

java.lang.Object
org.bgerp.model.base.tree.TreeItem<T,C>
All Implemented Interfaces:
Id<T>, IdTitle<T>, Title, TreeItem<T,C>
Direct Known Subclasses:
IdStringTitleTreeItem, IdTitleTreeItem, InetDevice, InetService, ProcessType

public abstract class TreeItem<T,C extends TreeItem<T,C>> extends Object implements TreeItem<T,C>
  • Field Details

    • id

      protected T id
    • parentId

      protected T parentId
    • title

      protected String title
    • children

      protected List<C extends TreeItem<T,C>> children
  • Constructor Details

    • TreeItem

      public TreeItem()
  • Method Details

    • getId

      public T getId()
      Specified by:
      getId in interface Id<T>
    • setId

      public void setId(T id)
    • getParentId

      public T getParentId()
      Specified by:
      getParentId in interface TreeItem<T,C extends TreeItem<T,C>>
    • setParentId

      public void setParentId(T parentId)
    • getTitle

      public String getTitle()
      Specified by:
      getTitle in interface Title
    • setTitle

      public void setTitle(String value)
    • getChildren

      public List<C> getChildren()
      Specified by:
      getChildren in interface TreeItem<T,C extends TreeItem<T,C>>
    • getChilds

      @Deprecated public List<C> getChilds()
      Deprecated.
    • setChildren

      public void setChildren(List<C> children)
    • addChild

      public C addChild(C child)
    • getChild

      public C getChild(T id)
    • getById

      public TreeItem<T,C> getById(T id)
      Finds node by ID over the node itself and all the children recursively.
      Parameters:
      id - the ID.
      Returns:
      found node or null.
    • getChildCount

      public int getChildCount()
    • getChildIds

      public Set<T> getChildIds()
    • isInSet

      protected boolean isInSet(Set<T> ids)
    • getAllChildIds

      public Set<T> getAllChildIds()
      Returns:
      set with the node ID and all child IDs from all levels.
    • getIcon

      public String getIcon()
      Returns:
      icon HTML.
    • isRootNode

      protected abstract boolean isRootNode()
    • isRootNodeWithIntegerId

      protected boolean isRootNodeWithIntegerId(Integer id, Integer parentId)
    • getTextStyle

      public String getTextStyle()
      Returns:
      style attribute for text span.