Class ListViewItemRenderer

    • Constructor Detail

      • ListViewItemRenderer

        public ListViewItemRenderer()
    • Method Detail

      • render

        public void render​(java.lang.Object item,
                           int index,
                           ListView listView,
                           boolean selected,
                           Button.State state,
                           boolean highlighted,
                           boolean disabled)
        Description copied from interface: ListView.ItemRenderer
        Prepares the renderer for layout or paint.
        Specified by:
        render in interface ListView.ItemRenderer
        Parameters:
        item - The item to render, or null if called to calculate preferred height for skins that assume a fixed renderer height.
        index - The index of the item being rendered, or -1 if item is null.
        listView - The host component.
        selected - If true, the item is selected. the item.
        state - The selected, unselected or mixed state for the checkmark. If tri-state checkmarks are not enabled, this value will either be selected or unselected.
        highlighted - If true, the item is highlighted.
        disabled - If true, the item is disabled.
      • renderStyles

        protected void renderStyles​(ListView listView,
                                    boolean selected,
                                    boolean highlighted,
                                    boolean disabled)
      • toString

        public java.lang.String toString​(java.lang.Object item)
        Description copied from interface: ListView.ItemRenderer
        Converts a list item to a string representation.
        Specified by:
        toString in interface ListView.ItemRenderer
        Parameters:
        item - The particular list item.
        Returns:
        The item's string representation, or null if the item does not have a string representation.

        Note that this method may be called often during keyboard navigation, so implementations should avoid unnecessary string allocations.

      • getIconWidth

        public int getIconWidth()
      • setIconWidth

        public void setIconWidth​(int iconWidth)
      • getIconHeight

        public int getIconHeight()
      • setIconHeight

        public void setIconHeight​(int iconHeight)
      • getShowIcon

        public boolean getShowIcon()
      • setShowIcon

        public void setShowIcon​(boolean showIcon)
      • getFillIcon

        public boolean getFillIcon()
      • setFillIcon

        public void setFillIcon​(boolean fillIcon)
      • getTextBounds

        public Bounds getTextBounds()
        Gets the bounds of the text that is rendered by this renderer.
        Returns:
        The bounds of the rendered text, or null if this renderer did not render any text.