Class ListItem

All Implemented Interfaces:
Animatable<ListItem>, CanDrop<ListItem>, Clickable<ListItem>, Draggable<ListItem>, Focusable<ListItem>, HandleHotKey<ListItem>, HandleMouseEvents<ListItem>, Scrollable<ListItem>, Touchable<ListItem>
Direct Known Subclasses:
NavBarItem, TreeviewNode

List item component, to be placed on the list component

This component is not a standalone component to be displayed on the interface, it can only be added to a list component.

Supported evens:

AnimationStart AnimationEnd, Focus FocusOut FocusIn LosesFocus Click, DoubleClick, MouseDown, MouseDown, MouseLeave, MouseMove, MouseOver, MouseOut, MouseUp, Wheel, Scrollable TouchCancel, TouchEnd, TouchMove, TouchStart, Drop, DragStart, DragEnd HotKey

Since:
4.0
Author:
JBStrap
See Also:
  • Constructor Details

    • ListItem

      public ListItem()
      Creates an empty list item component
    • ListItem

      public ListItem(String text)
      Creates a list item component with the given text content
      Parameters:
      text - The text content we want to display in the list item
    • ListItem

      public ListItem(String id, String text)
      Creates a list item component with the given text content
      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.)
      text - The text content we want to display in the list item
    • ListItem

      public ListItem(Component<?> component)
      Creates a list item component, with another component as content. The given component is displayed on the interface as the list item component.
      Parameters:
      component - An instance of the component we want to display in the list item
    • ListItem

      public ListItem(String id, Component<?> component)
      Creates a list item component, with another component as content. The given component is displayed on the interface as the list item component.
      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.)
      component - An instance of the component we want to display in the list item
  • Method Details

    • 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<ListItem>
      Returns:
      If the componentwas drawn, true, otherwise false