Class AbstractToolItemRenderer

java.lang.Object
org.eclipse.nebula.widgets.pgroup.AbstractRenderer
org.eclipse.nebula.widgets.pgroup.AbstractToolItemRenderer
Direct Known Subclasses:
SimpleToolItemRenderer

public abstract class AbstractToolItemRenderer
extends AbstractRenderer
Base implementation for rendering ToolItems in the header
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static 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
    static 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
  • Constructor Summary

    Constructors 
    Constructor Description
    AbstractToolItemRenderer()  
  • Method Summary

    Modifier and Type Method Description
    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
    abstract org.eclipse.swt.graphics.Point computeSize​(org.eclipse.swt.graphics.GC gc, PGroupToolItem item, int sizeType)
    Computes the size needed for the toolitem
    int getSizeType()
    Get the size type
    abstract void paint​(org.eclipse.swt.graphics.GC gc, java.lang.Object value)  
    void setSizeType​(int sizeType)
    Set the size type

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • 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 Details

  • Method Details

    • 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: