java.lang.Object
com.ultikits.ultitools.abstracts.gui.declarative.core.Element
com.ultikits.ultitools.abstracts.gui.declarative.widgets.ContainerElement

public class ContainerElement extends Element
Container 对应的 Element。
Since:
6.2.0
Version:
1.0.0
Author:
UltiTools Team
  • Field Details

    • childElements

      private final List<Element> childElements
  • Constructor Details

    • ContainerElement

      public ContainerElement(@NotNull @NotNull Container container)
  • Method Details

    • mount

      public void mount(@Nullable @Nullable Element parent)
      Description copied from class: Element
      将此 Element 挂载到树中。

      这个方法在 Element 首次插入树中时调用。 子类应该在此处执行初始化工作,并挂载子 Element。

      Overrides:
      mount in class Element
      Parameters:
      parent - 父 Element,如果为 null 表示这是根 Element
    • update

      public void update(@NotNull @NotNull Widget newWidget)
      Description copied from class: Element
      使用新的 Widget 更新此 Element。

      这个方法在 Widget 重建时被调用。 子类应该更新对 Widget 的引用,并执行必要的更新。

      Overrides:
      update in class Element
      Parameters:
      newWidget - 新的 Widget 实例
    • performRebuild

      public void performRebuild()
      Description copied from class: Element
      执行重建。

      子类应该实现此方法来构建或重建 Widget 树。

      Specified by:
      performRebuild in class Element
    • unmount

      public void unmount()
      Description copied from class: Element
      从树中移除此 Element。

      这个方法在 Element 不再需要时被调用。 子类应该在此处执行清理工作,并卸载子 Element。

      Overrides:
      unmount in class Element
    • getChildren

      @NotNull public @NotNull List<Element> getChildren()
      Description copied from class: Element
      获取子 Element 列表。
      Overrides:
      getChildren in class Element
      Returns:
      子 Element 列表,如果没有则返回空列表
    • mountChildren

      private void mountChildren()
    • updateChildren

      private void updateChildren()