Class GUIItemList<T extends GUIItemItem>

Type Parameters:
T - the type of the list elements
All Implemented Interfaces:
GUIElement, GUIScrollable, ImageObserver, MenuContainer, Serializable
Direct Known Subclasses:
GUIFloorList, GUIInventoryList, GUIKnowledgeList, GUIKnowledgeTypeList, GUIQuestList, GUISpellList, GUISpellSkillList

public abstract class GUIItemList<T extends GUIItemItem> extends GUIList<T>
A GUIList instance that displays GUIItemItem instances.
See Also:
  • Constructor Details

    • GUIItemList

      protected GUIItemList(@NotNull @NotNull TooltipManager tooltipManager, @NotNull @NotNull GUIElementListener elementListener, @NotNull @NotNull String name, int cellWidth, int cellHeight, @NotNull @NotNull ItemView itemView, @Nullable @Nullable AbstractLabel currentItem, @NotNull @NotNull GUIItemItem templateItem, @NotNull @NotNull GuiFactory guiFactory)
      Creates a new instance.
      Parameters:
      tooltipManager - the tooltip manager to update
      elementListener - the element listener to notify
      name - the name of this element
      cellWidth - the width of cells
      cellHeight - the height of cells
      itemView - the item view to monitor
      currentItem - the label to update with information about the selected item.
      templateItem - the template item for painting the list
      guiFactory - the global GUI factory instance
  • Method Details

    • dispose

      public void dispose()
      Description copied from interface: GUIElement
      Releases all allocated resources.
      Specified by:
      dispose in interface GUIElement
      Overrides:
      dispose in class GUIList<T extends GUIItemItem>
    • selectionChanged

      protected void selectionChanged(int selectedIndex)
      Description copied from class: GUIList
      Called whenever the selected list entry has changed.
      Specified by:
      selectionChanged in class GUIList<T extends GUIItemItem>
      Parameters:
      selectedIndex - the selected list entry
    • activeChanged

      protected void activeChanged()
      Description copied from class: ActivatableGUIElement
      Will be called whenever the active state has changed.
      Specified by:
      activeChanged in class ActivatableGUIElement
    • mouseClicked

      public void mouseClicked(@NotNull @NotNull MouseEvent e)
      Description copied from interface: GUIElement
      Will be called when the user has clicked (pressed+released) this element. This event will be delivered after GUIElement.mouseReleased(MouseEvent).
      Specified by:
      mouseClicked in interface GUIElement
      Overrides:
      mouseClicked in class GUIList<T extends GUIItemItem>
      Parameters:
      e - the mouse event relative to this element
    • getSelectedItem

      @Nullable public @Nullable GUIItemItem getSelectedItem()
      Returns the selected GUIItemItem instance.
      Returns:
      the selected instance or null if none is selected
    • newItem

      @NotNull protected abstract T newItem(int index)
      Creates a new GUIElement instance.
      Parameters:
      index - the item inventory's index
      Returns:
      the new instance