Class CellPainterFactory
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.extension.e4.painterfactory.CellPainterFactory
-
public class CellPainterFactory extends Object
Factory that createsICellPainter
for a specified key in combination with a configuration map.
-
-
Field Summary
Fields Modifier and Type Field Description static String
BACKGROUND_IMAGE_PAINTER_KEY
static String
BACKGROUND_PAINTER_KEY
static String
BEVELED_BORDER_DECORATOR_KEY
static String
CHECKBOX_PAINTER_KEY
static String
COLUMN_GROUP_HEADER_KEY
static String
COMBOBOX_PAINTER_KEY
static String
CUSTOM_LINE_BORDER_DECORATOR_KEY
static String
DECORATOR_KEY
static String
GRADIENT_BACKGROUND_PAINTER_KEY
static String
IMAGE_PAINTER_KEY
static String
LINE_BORDER_DECORATOR_KEY
static String
NONE
static String
PADDING_DECORATOR_KEY
static String
PASSWORD_PAINTER_KEY
static String
PERCENTAGEBAR_PAINTER_KEY
static String
ROW_GROUP_HEADER_KEY
static String
SORTABLE_HEADER_KEY
static String
TABLE_PAINTER_KEY
static String
TEXT_PAINTER_KEY
static String
TREE_STRUCTURE_KEY
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CellPainterWrapper
getBackgroundPainter(String key, Map<String,Object> painterProperties, ICellPainter underlying)
Create the background painter for the given key and properties.ICellPainter
getCellPainter(String backgroundKey, List<String> decoratorKeys, String contentKey, Map<String,Object> painterProperties)
ICellPainter
getCellPainter(List<String> painterValues, Map<String,Object> painterProperties)
ICellPainter
getContentPainter(String key, Map<String,Object> painterProperties)
Create the content painter for the given key and properties.CellPainterWrapper
getDecoratorPainter(String key, Map<String,Object> painterProperties, ICellPainter underlying)
Create the decorator painter for the given key and properties.static CellPainterFactory
getInstance()
void
initTextPainter(AbstractTextPainter painter, Map<String,Object> painterProperties)
Initialize the givenAbstractTextPainter
with the values in the given properties map.boolean
isBackgroundPainterKey(String key)
Check the given key if it represents a background painter.boolean
isContentPainterKey(String key)
Check the given key if it represents a content painter.boolean
isDecoratorPainterKey(String key)
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 Detail
-
BACKGROUND_PAINTER_KEY
public static final String BACKGROUND_PAINTER_KEY
- See Also:
- Constant Field Values
-
BACKGROUND_IMAGE_PAINTER_KEY
public static final String BACKGROUND_IMAGE_PAINTER_KEY
- See Also:
- Constant Field Values
-
GRADIENT_BACKGROUND_PAINTER_KEY
public static final String GRADIENT_BACKGROUND_PAINTER_KEY
- See Also:
- Constant Field Values
-
DECORATOR_KEY
public static final String DECORATOR_KEY
- See Also:
- Constant Field Values
-
LINE_BORDER_DECORATOR_KEY
public static final String LINE_BORDER_DECORATOR_KEY
- See Also:
- Constant Field Values
-
CUSTOM_LINE_BORDER_DECORATOR_KEY
public static final String CUSTOM_LINE_BORDER_DECORATOR_KEY
- See Also:
- Constant Field Values
-
BEVELED_BORDER_DECORATOR_KEY
public static final String BEVELED_BORDER_DECORATOR_KEY
- See Also:
- Constant Field Values
-
PADDING_DECORATOR_KEY
public static final String PADDING_DECORATOR_KEY
- See Also:
- Constant Field Values
-
SORTABLE_HEADER_KEY
public static final String SORTABLE_HEADER_KEY
- See Also:
- Constant Field Values
-
COLUMN_GROUP_HEADER_KEY
public static final String COLUMN_GROUP_HEADER_KEY
- See Also:
- Constant Field Values
-
ROW_GROUP_HEADER_KEY
public static final String ROW_GROUP_HEADER_KEY
- See Also:
- Constant Field Values
-
TREE_STRUCTURE_KEY
public static final String TREE_STRUCTURE_KEY
- See Also:
- Constant Field Values
-
CHECKBOX_PAINTER_KEY
public static final String CHECKBOX_PAINTER_KEY
- See Also:
- Constant Field Values
-
COMBOBOX_PAINTER_KEY
public static final String COMBOBOX_PAINTER_KEY
- See Also:
- Constant Field Values
-
IMAGE_PAINTER_KEY
public static final String IMAGE_PAINTER_KEY
- See Also:
- Constant Field Values
-
PASSWORD_PAINTER_KEY
public static final String PASSWORD_PAINTER_KEY
- See Also:
- Constant Field Values
-
PERCENTAGEBAR_PAINTER_KEY
public static final String PERCENTAGEBAR_PAINTER_KEY
- See Also:
- Constant Field Values
-
TABLE_PAINTER_KEY
public static final String TABLE_PAINTER_KEY
- See Also:
- Constant Field Values
-
TEXT_PAINTER_KEY
public static final String TEXT_PAINTER_KEY
- See Also:
- Constant Field Values
-
NONE
public static final String NONE
- See Also:
- Constant Field Values
-
-
Method Detail
-
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 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
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 givenAbstractTextPainter
with the values in the given properties map.- Parameters:
painter
- TheAbstractTextPainter
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 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
public void registerDecoratorPainter(String key, CellPainterWrapperCreator creator)
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
public void registerContentPainter(String key, CellPainterCreator creator)
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.
-
-