Class CellPainterFactory
java.lang.Object
org.eclipse.nebula.widgets.nattable.extension.e4.painterfactory.CellPainterFactory
Factory that creates
ICellPainter for a specified key in combination
with a configuration map.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Method Summary
Modifier and TypeMethodDescriptiongetBackgroundPainter(String key, Map<String, Object> painterProperties, ICellPainter underlying) Create the background painter for the given key and properties.getCellPainter(String backgroundKey, List<String> decoratorKeys, String contentKey, Map<String, Object> painterProperties) getContentPainter(String key, Map<String, Object> painterProperties) Create the content painter for the given key and properties.getDecoratorPainter(String key, Map<String, Object> painterProperties, ICellPainter underlying) Create the decorator painter for the given key and properties.static CellPainterFactoryvoidinitTextPainter(AbstractTextPainter painter, Map<String, Object> painterProperties) Initialize the givenAbstractTextPainterwith the values in the given properties map.booleanCheck the given key if it represents a background painter.booleanCheck the given key if it represents a content painter.booleanCheck the given key if it represents a decorator painter.voidregisterBackgroundPainter(String key, CellPainterWrapperCreator creator) Register aCellPainterWrapperCreatorto create a background painter for a given key.voidregisterContentPainter(String key, CellPainterCreator creator) Registers aCellPainterCreatorto create a content painter for a given key.voidregisterDecoratorPainter(String key, CellPainterWrapperCreator creator) Registers aCellPainterWrapperCreatorto create a decorator painter for a given key.
-
Field Details
-
BACKGROUND_PAINTER_KEY
- See Also:
-
BACKGROUND_IMAGE_PAINTER_KEY
- See Also:
-
GRADIENT_BACKGROUND_PAINTER_KEY
- See Also:
-
DECORATOR_KEY
- See Also:
-
LINE_BORDER_DECORATOR_KEY
- See Also:
-
CUSTOM_LINE_BORDER_DECORATOR_KEY
- See Also:
-
BEVELED_BORDER_DECORATOR_KEY
- See Also:
-
PADDING_DECORATOR_KEY
- See Also:
-
SORTABLE_HEADER_KEY
- See Also:
-
COLUMN_GROUP_HEADER_KEY
- See Also:
-
ROW_GROUP_HEADER_KEY
- See Also:
-
TREE_STRUCTURE_KEY
- See Also:
-
CHECKBOX_PAINTER_KEY
- See Also:
-
COMBOBOX_PAINTER_KEY
- See Also:
-
IMAGE_PAINTER_KEY
- See Also:
-
PASSWORD_PAINTER_KEY
- See Also:
-
PERCENTAGEBAR_PAINTER_KEY
- See Also:
-
TABLE_PAINTER_KEY
- See Also:
-
TEXT_PAINTER_KEY
- See Also:
-
NONE
- See Also:
-
-
Method Details
-
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
ICellPainterconstruct 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 usedecoratorKeys- The list of keys of decorator painter to usecontentKey- The key of the content painter to usepainterProperties- The properties to set to the painters- Returns:
- The
ICellPainterconstruct 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- TheICellPainterthat 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- theICellPainterthat should be applied as wrapped painter to the created decorator.- Returns:
- The decorator painter to use
-
getContentPainter
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
Initialize the givenAbstractTextPainterwith the values in the given properties map.- Parameters:
painter- TheAbstractTextPainterto initialize.painterProperties- The painter properties to apply.
-
isBackgroundPainterKey
Check the given key if it represents a background painter.- Parameters:
key- The key to check.- Returns:
trueif the given key represents a background painter,falseif not.
-
isDecoratorPainterKey
Check the given key if it represents a decorator painter.- Parameters:
key- The key to check.- Returns:
trueif the given key represents a decorator painter,falseif not.
-
isContentPainterKey
Check the given key if it represents a content painter.- Parameters:
key- The key to check.- Returns:
trueif the given key represents a content painter,falseif not.
-
registerBackgroundPainter
Register aCellPainterWrapperCreatorto 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- TheCellPainterWrapperCreatorthat should be registered for the given key.
-
registerDecoratorPainter
Registers aCellPainterWrapperCreatorto 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- TheCellPainterWrapperCreatorthat should be registered for the given key.
-
registerContentPainter
Registers aCellPainterCreatorto 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- TheCellPainterCreatorthat should be registered for the given key.
-