Class AbstractToolItemRenderer

    • Field Detail

      • sizeType

        private int sizeType
      • DEFAULT

        public static final int DEFAULT
        Defines that item should be rendered in its default way:
        • Icon+Text if both defined
        • Icon if Text is null
        • Text if Icon is null
        See Also:
        Constant Field Values
      • MIN

        public static final int MIN
        Defines that item should be rendered in its minimal way:
        • Icon only if both defined
        • Icon if Text is null
        • Text if Icon is null
        See Also:
        Constant Field Values
    • Constructor Detail

      • AbstractToolItemRenderer

        public AbstractToolItemRenderer()
    • Method Detail

      • setSizeType

        public void setSizeType​(int sizeType)
        Set the size type
        Parameters:
        sizeType - the sizeType
        See Also:
        DEFAULT, MIN
      • getSizeType

        public int getSizeType()
        Get the size type
        Returns:
        the current size type
      • paint

        public abstract void paint​(org.eclipse.swt.graphics.GC gc,
                                   java.lang.Object value)
        Specified by:
        paint in class AbstractRenderer
      • computeSize

        public abstract org.eclipse.swt.graphics.Point computeSize​(org.eclipse.swt.graphics.GC gc,
                                                                   PGroupToolItem item,
                                                                   int sizeType)
        Computes the size needed for the toolitem
        Parameters:
        gc - the gc
        item - the toolitem
        sizeType - size type
        Returns:
        the computed size for the toolitem and sizeType
        See Also:
        DEFAULT, MIN
      • computeDropDownArea

        public abstract org.eclipse.swt.graphics.Rectangle computeDropDownArea​(org.eclipse.swt.graphics.Rectangle totalRect)
        Computes the area where the DropDown-Icon is shown in case of SWT.DROP_DOWN
        Parameters:
        totalRect - the total area the item is drawn
        Returns: