Klasse UiListPanel.Item

java.lang.Object
org.obrel.core.RelatedObject
Alle implementierten Schnittstellen:
org.obrel.core.Relatable
Umschließende Klasse:
UiListPanel

public class UiListPanel.Item extends UiComposite<UiListPanel.Item>
The container for a single list item. The builder returned from the item is used to create the item content. In the case of expandable lists the item header can be created with the builder of the header panel returned by getHeader().
  • Methodendetails

    • clearContent

      public void clearContent()
      Removes the content components from this item.
    • createHeaderPanel

      public final UiBuilder<?> createHeaderPanel(UiLayout layout)
      Helper method to create a new header panel with a certain layout in the item header returned by getHeader(). This method should only be invoked once or else additional panels will be added to the header. Invoking this method mainly makes sense if an expandable list style is used. Otherwise it will just add an additional panel to the item.
      Parameter:
      layout - The header panel layout
      Gibt zurück:
      The builder of the new header panel with the given layout
    • getHeader

      public final UiBuilder<?> getHeader()
      Returns the builder of this item's header panel. If the list has a simple style this method returns the item's builder so that it can be used to build the content in it.

      Depending on the underlying implementation the item header may use a special layout. Therefore it is recommended to add only a single component with this builder (typically some panel with it's own layout). Otherwise the resulting rendering can be unexpected.

      Gibt zurück:
      The item header container
    • isSelected

      public boolean isSelected()
      Returns the selected state of this item.
      Gibt zurück:
      The selected state
    • onSelection

      public UiListPanel.Item onSelection(Consumer<UiListPanel.Item> selectionHandler)
      Sets the handler for selection events of this item.
      Parameter:
      selectionHandler - The selection handler
      Gibt zurück:
      This instance for fluent invocations
    • remove

      public void remove(UiComponent<?,?> component)
      Overridden to be public
      Setzt außer Kraft:
      remove in Klasse UiContainer<UiListPanel.Item>
      Parameter:
      component - The component to remove
      Siehe auch:
    • setSelected

      public void setSelected(boolean selected)
      Sets the selected state of this item.
      Parameter:
      selected - The new selected state
    • getComponentStyleName

      protected String getComponentStyleName()
      Returns the style name for this component. By default this is the simple class name of this component. Subclasses should override this if the class name is ambiguous and needs further specification. This is typically the case for non-static inner classes of composites which often have names that start without the 'Ui' prefix.
      Setzt außer Kraft:
      getComponentStyleName in Klasse UiComponent<List<org.obrel.core.RelationType<?>>,UiListPanel.Item>
      Gibt zurück:
      The component style name