Class Container

All Implemented Interfaces:
Animatable<Container>, CanDrop<Container>, Clickable<Container>, Draggable<Container>, HandleMouseEvents<Container>, Scrollable<Container>, Touchable<Container>
Direct Known Subclasses:
BasePage, UI.RootLayout

Container component

The component's doesn't have a visual representation on the page, it's only used to group individual components together, so that they can be managed as a single component. The component appears as a div tag in the HTML DOM.

Supported Events:
AnimationStart AnimationEnd, Click, DoubleClick, MouseDown, MouseDown, MouseLeave, MouseMove, MouseOver, MouseOut, MouseUp, Wheel, Scrollable TouchCancel, TouchEnd, TouchMove, TouchStart, Drop, DragStart, DragEnd
Since:
4.0
  • Constructor Details

    • Container

      public Container(Component<?>... components)
      Creates a container with the specified component in it.
      Parameters:
      components - The components that will be in the container
      Throws:
      IllegalStateException - If the component is set to be both Private and Public, through an annotation.
    • Container

      public Container(String id, Component<?>... components)
      Creates a container with the specified component in it.
      Parameters:
      id - The component ID. The ID specified here will appear in the HTML tag as an ID attribute. If there are multiple components displayed, that have the same ID, the ID numbers will be numbered, in the order they are displayed. (For example, if the ID is 'COMPONENT' then it will be numbered like this: COMPONENT, COMPONENT_1, COMPONENT_2 etc.)
      components - The components that will be in the container
      Throws:
      IllegalStateException - If the component is set to be both Private and Public, through an annotation.
    • Container

      public Container(ContainerType type, Component<?>... components)
      Creates a container with the specified component in it.
      Parameters:
      components - The components that will be in the container
      type - The container type. For the applicable container types, see the ContainerType enum. If set null the container is default type container.
      Throws:
      IllegalStateException - If the component is set to be both Private and Public, through an annotation.
    • Container

      public Container(String id, ContainerType type, Component<?>... components)
      Creates a container with the specified component in it.
      Parameters:
      id - The component ID. The ID specified here will appear in the HTML tag as an ID attribute. If there are multiple components displayed, that have the same ID, the ID numbers will be numbered, in the order they are displayed. (For example, if the ID is 'COMPONENT' then it will be numbered like this: COMPONENT, COMPONENT_1, COMPONENT_2 etc.)
      components - The components that will be in the container
      type - The container type. For the applicable container types, see the ContainerType enum. If set null the container is default type container.
      Throws:
      IllegalStateException - If the component is set to be both Private and Public, through an annotation.
  • Method Details

    • setType

      public Container setType(ContainerType type)
      Sets the container type.
      Parameters:
      type - The container type. For the applicable container types, see the ContainerType enum,
      Returns:
      The container component
    • getType

      public ContainerType getType()
      Gtes the container type
      Returns:
      The container type
    • setAlignItems

      public Container setAlignItems(StyleAlign... aligns)
      Sets the container content aligament.
      Parameters:
      aligns - The aligaments. For the applicable content aliaments see the VerticalAlign and the HorizontalAlign enums.
      Returns:
      The container component
    • writeHTML

      public boolean writeHTML(StringWriter writer)
      Description copied from class: Component
      Creates the component's HTML equivalent

      This method doesn't need to be used during application development. This method is used when developing a custom component. When creating a custom component, this method needs to be implemented. In the parameter (StringWriter class) the component's HTML equivalent must be specified, and the method has to return with a Boolean value. This boolean value determines if the component was drawn. If the user doesn't have access right to the component, or if the component couldn't be drawn, it should return with false. Otherwise, it must return with true.

      Specified by:
      writeHTML in class Component<Container>
      Returns:
      If the componentwas drawn, true, otherwise false