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 String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static 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 CellPainterFactory
void
initTextPainter
(AbstractTextPainter painter, Map<String, Object> painterProperties) Initialize the givenAbstractTextPainter
with the values in the given properties map.boolean
Check the given key if it represents a background painter.boolean
Check the given key if it represents a content painter.boolean
Check the given key if it represents a decorator painter.void
registerBackgroundPainter
(String key, CellPainterWrapperCreator creator) Register aCellPainterWrapperCreator
to create a background painter for a given key.void
registerContentPainter
(String key, CellPainterCreator creator) Registers aCellPainterCreator
to create a content painter for a given key.void
registerDecoratorPainter
(String key, CellPainterWrapperCreator creator) Registers aCellPainterWrapperCreator
to 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
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 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
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
- TheICellPainter
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
- theICellPainter
that 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 givenAbstractTextPainter
with the values in the given properties map.- Parameters:
painter
- TheAbstractTextPainter
to 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:
true
if the given key represents a background painter,false
if not.
-
isDecoratorPainterKey
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
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
Register aCellPainterWrapperCreator
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
- TheCellPainterWrapperCreator
that should be registered for the given key.
-
registerDecoratorPainter
Registers aCellPainterWrapperCreator
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
- TheCellPainterWrapperCreator
that should be registered for the given key.
-
registerContentPainter
Registers aCellPainterCreator
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
- TheCellPainterCreator
that should be registered for the given key.
-