All Implemented Interfaces:
Animatable<IBox>, CanDrop<IBox>, Clickable<IBox>, Draggable<IBox>, HandleMouseEvents<IBox>, Scrollable<IBox>, Touchable<IBox>

IBox component

The component displays a box with a header. The box can have other components inside it. The box and the header will be white, thus the components will be grouped. The ibox can be a simple box, or a collapsible box. If set to be collapsible, an icon will appear on the right side of the header, that when clicked on, opens/closes the box. If a box is closed, the box will have the size of the header height, thus freeing space on the interface.

Component(s) can be placed on the IBox header, thus allowing the placement of additional buttons, icons, that can have custom functionalities.

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
Author:
JBStrap
  • Constructor Details

    • IBox

      public IBox()
      Creates an empty IBox component
    • IBox

      public IBox(String id)
      Creates an empty IBox component with the specified ID
      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.)
    • IBox

      public IBox(boolean showHeader)
      Creates an empty IBox component, with an optional header. By default, the header is visible
      Parameters:
      showHeader - Determines if the header is shown. If true it is shown. Default to true.
    • IBox

      public IBox(String id, boolean showHeader)
      Creates an empty IBox component, with an optional header. By default, the header is visible
      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.)
      showHeader - Determines if the header is shown. If true it is shown. Default to true.
  • Method Details

    • setCollapsible

      public IBox setCollapsible(boolean collapsible)
      Sets the collapsibility of the IBox. By default, it is not collapsible.
      Parameters:
      collapsible - If true the component will be collapsible. By default, the component is not collapsible.
      Returns:
      The IBox component
    • setCollapseIcon

      public IBox setCollapseIcon(Icon icon)
      Sets the A IBox collapse icon
      Parameters:
      icon - The icon that will be on the header, that when clicked on, the IBox will collapse. The default value is Icon.CHEVRON_UP For the other icons, see the Icon enum.
      Returns:
      The IBox component
    • setTitle

      public IBox setTitle(String title)
      Sets the IBox header title
      Parameters:
      title - The IBox header title
      Returns:
      The IBox component
    • addTitleComponent

      public IBox addTitleComponent(Component<?> component)
      Adds a component to the IBox header
      Parameters:
      component - The component to be added to the header
      Returns:
      The IBox component
    • removeTitleComponent

      public IBox removeTitleComponent(Component<?> component)
      Removes the component from the header
      Parameters:
      component - The component to be removed
      Returns:
      The IBox component
    • addComponent

      public IBox addComponent(Component<?> component)
      Description copied from class: Component
      Adds the specified component as a subcomponent, and redraws the component immediately
      Overrides:
      addComponent in class Component<IBox>
      Parameters:
      component - The component to be added
      Returns:
      The component
    • removeComponent

      public IBox removeComponent(Component<?> component)
      Description copied from class: Component
      Removes the specified subcomponent.
      Overrides:
      removeComponent in class Component<IBox>
      Parameters:
      component - The component instance
      Returns:
      The 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<IBox>
      Returns:
      If the componentwas drawn, true, otherwise false