java.lang.Object
org.eclipse.nebula.widgets.nattable.extension.e4.painterfactory.CellPainterFactory

public class CellPainterFactory extends Object
Factory that creates ICellPainter for a specified key in combination with a configuration map.
  • Field Details

  • Method Details

    • getInstance

      public static CellPainterFactory getInstance()
      Returns:
      The singleton instance of CellPainterFactory
    • getCellPainter

      public ICellPainter getCellPainter(List<String> painterValues, Map<String,Object> painterProperties)
      Parameters:
      painterValues - The list of all painter representation values in correct order.
      painterProperties - The properties to set to the painters
      Returns:
      The ICellPainter construct that should be used for rendering
    • getCellPainter

      public ICellPainter getCellPainter(String backgroundKey, List<String> decoratorKeys, String contentKey, Map<String,Object> painterProperties)
      Parameters:
      backgroundKey - The key of the background painter to use
      decoratorKeys - The list of keys of decorator painter to use
      contentKey - The key of the content painter to use
      painterProperties - The properties to set to the painters
      Returns:
      The ICellPainter construct that should be used for rendering
    • getBackgroundPainter

      public CellPainterWrapper getBackgroundPainter(String key, Map<String,Object> painterProperties, ICellPainter underlying)
      Create the background painter for the given key and properties.
      Parameters:
      key - The background painter key.
      painterProperties - The painter properties for painter initialization.
      underlying - The ICellPainter that should be applied as wrapped painter to the created decorator.
      Returns:
      The background painter to use
    • getDecoratorPainter

      public CellPainterWrapper getDecoratorPainter(String key, Map<String,Object> painterProperties, ICellPainter underlying)
      Create the decorator painter for the given key and properties.
      Parameters:
      key - The decorator painter key.
      painterProperties - The painter properties for painter initialization.
      underlying - the ICellPainter that should be applied as wrapped painter to the created decorator.
      Returns:
      The decorator painter to use
    • getContentPainter

      public ICellPainter getContentPainter(String key, Map<String,Object> painterProperties)
      Create the content painter for the given key and properties.
      Parameters:
      key - The content painter key.
      painterProperties - The painter properties for painter initialization.
      Returns:
      The content painter to use
    • initTextPainter

      public void initTextPainter(AbstractTextPainter painter, Map<String,Object> painterProperties)
      Initialize the given AbstractTextPainter with the values in the given properties map.
      Parameters:
      painter - The AbstractTextPainter to initialize.
      painterProperties - The painter properties to apply.
    • isBackgroundPainterKey

      public boolean isBackgroundPainterKey(String key)
      Check the given key if it represents a background painter.
      Parameters:
      key - The key to check.
      Returns:
      true if the given key represents a background painter, false if not.
    • isDecoratorPainterKey

      public boolean isDecoratorPainterKey(String key)
      Check the given key if it represents a decorator painter.
      Parameters:
      key - The key to check.
      Returns:
      true if the given key represents a decorator painter, false if not.
    • isContentPainterKey

      public boolean isContentPainterKey(String key)
      Check the given key if it represents a content painter.
      Parameters:
      key - The key to check.
      Returns:
      true if the given key represents a content painter, false if not.
    • registerBackgroundPainter

      public void registerBackgroundPainter(String key, CellPainterWrapperCreator creator)
      Register a CellPainterWrapperCreator to create a background painter for a given key. This way custom painters can be registered with the NatTable CSS mechanism.
      Parameters:
      key - The key for which the background painter should be created.
      creator - The CellPainterWrapperCreator that should be registered for the given key.
    • registerDecoratorPainter

      public void registerDecoratorPainter(String key, CellPainterWrapperCreator creator)
      Registers a CellPainterWrapperCreator to create a decorator painter for a given key. This way custom painters can be registered with the NatTable CSS mechanism.
      Parameters:
      key - The key for which the decorator painter should be created.
      creator - The CellPainterWrapperCreator that should be registered for the given key.
    • registerContentPainter

      public void registerContentPainter(String key, CellPainterCreator creator)
      Registers a CellPainterCreator to create a content painter for a given key. This way custom painters can be registered with the NatTable CSS mechanism.
      Parameters:
      key - The key for which the content painter should be created.
      creator - The CellPainterCreator that should be registered for the given key.