Class DefaultHierarchicalTreeLayerThemeExtension
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.hierarchical.config.DefaultHierarchicalTreeLayerThemeExtension
-
- All Implemented Interfaces:
IThemeExtension
- Direct Known Subclasses:
ModernHierarchicalTreeLayerThemeExtension
public class DefaultHierarchicalTreeLayerThemeExtension extends Object implements IThemeExtension
IThemeExtension
that adds styling configurations for theHierarchicalTreeLayer
.The theme styling for the
HierarchicalTreeLayer
is implemented as aIThemeExtension
because the styling configurations for trees collide with the default tree styling configurations. It is not possible to combine the styling of a standard tree and a hierarchical tree.- Since:
- 2.0
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description DefaultHierarchicalTreeLayerThemeExtension()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
configureAlternatingRowStyle(IConfigRegistry configRegistry)
When creating aHierarchicalTreeLayer
, using theDefaultHierarchicalTreeLayerConfiguration
, theHierarchicalTreeAlternatingRowConfigLabelAccumulator
is configured for the body region to apply labels for alternating rows.protected void
configureDefaultStyle(IConfigRegistry configRegistry)
Register default style configurations.protected void
configureLevelHeaderStyle(IConfigRegistry configRegistry)
By default the levels in aHierarchicalTreeLayer
are separated by additional level header columns.protected void
configureTreeStyle(IConfigRegistry configRegistry)
This method is used to register style configurations for a tree representation.void
createPainterInstances()
Method that is used to create the painter instances that should be registered for styling.protected ICellPainter
getCollapsedChildPainter()
Returns theICellPainter
that should be used to render the content in cells of collapsed childs, e.g.protected ICellPainter
getDefaultCellPainter()
Returns the defaultICellPainter
that is used to render the NatTable.protected IStyle
getDefaultCellStyle()
protected ICellPainter
getEvenRowCellPainter()
Returns theICellPainter
that should be used to render alternating rows.protected IStyle
getEvenRowStyle()
Returns theIStyle
that should be used to render alternating rows.protected ICellPainter
getLevelHeaderCellPainter()
Returns theICellPainter
that should be used to render the tree column cells in a NatTable.protected ICellPainter
getLevelHeaderSelectionCellPainter()
Returns theICellPainter
that should be used to render the selected level header column cells in a NatTable.protected IStyle
getLevelHeaderSelectionStyle()
Returns theIStyle
that should be used to render the selected level header column cells in a NatTable.protected IStyle
getLevelHeaderStyle()
Returns theIStyle
that should be used to render the level header column cells in a NatTable.protected ICellPainter
getOddRowCellPainter()
Returns theICellPainter
that should be used to render alternating rows.protected IStyle
getOddRowStyle()
Returns theIStyle
that should be used to render alternating rows.protected ICellPainter
getTreeCellPainter()
Returns theICellPainter
that should be used to render the tree column cells in a NatTable.protected ICellPainter
getTreeSelectionCellPainter()
Returns theICellPainter
that should be used to render the selected tree column cells in a NatTable.protected IStyle
getTreeSelectionStyle()
Returns theIStyle
that should be used to render the selected tree column cells in a NatTable.protected ICellPainter
getTreeStructurePainter()
Returns theICellPainter
that should be used to render the tree structure in a NatTable.protected ICellPainter
getTreeStructureSelectionPainter()
Returns theICellPainter
that should be used to render the selected tree structure in a NatTable.protected IStyle
getTreeStyle()
Returns theIStyle
that should be used to render the tree column cells in a NatTable.void
registerStyles(IConfigRegistry configRegistry)
Register the style configurations that should be added by this IThemeExtension.void
unregisterStyles(IConfigRegistry configRegistry)
Unregister the style configurations that were registered by this IThemeExtension.
-
-
-
Field Detail
-
defaultBgColor
public org.eclipse.swt.graphics.Color defaultBgColor
-
defaultFgColor
public org.eclipse.swt.graphics.Color defaultFgColor
-
defaultGradientBgColor
public org.eclipse.swt.graphics.Color defaultGradientBgColor
-
defaultGradientFgColor
public org.eclipse.swt.graphics.Color defaultGradientFgColor
-
defaultHAlign
public HorizontalAlignmentEnum defaultHAlign
-
defaultVAlign
public VerticalAlignmentEnum defaultVAlign
-
defaultFont
public org.eclipse.swt.graphics.Font defaultFont
-
defaultImage
public org.eclipse.swt.graphics.Image defaultImage
-
defaultBorderStyle
public BorderStyle defaultBorderStyle
-
defaultPWEchoChar
public Character defaultPWEchoChar
-
defaultTextDecoration
public TextDecorationEnum defaultTextDecoration
-
defaultCellPainter
public ICellPainter defaultCellPainter
-
treeBgColor
public org.eclipse.swt.graphics.Color treeBgColor
-
treeFgColor
public org.eclipse.swt.graphics.Color treeFgColor
-
treeGradientBgColor
public org.eclipse.swt.graphics.Color treeGradientBgColor
-
treeGradientFgColor
public org.eclipse.swt.graphics.Color treeGradientFgColor
-
treeHAlign
public HorizontalAlignmentEnum treeHAlign
-
treeVAlign
public VerticalAlignmentEnum treeVAlign
-
treeFont
public org.eclipse.swt.graphics.Font treeFont
-
treeImage
public org.eclipse.swt.graphics.Image treeImage
-
treeBorderStyle
public BorderStyle treeBorderStyle
-
treePWEchoChar
public Character treePWEchoChar
-
treeTextDecoration
public TextDecorationEnum treeTextDecoration
-
treeSelectionBgColor
public org.eclipse.swt.graphics.Color treeSelectionBgColor
-
treeSelectionFgColor
public org.eclipse.swt.graphics.Color treeSelectionFgColor
-
treeSelectionGradientBgColor
public org.eclipse.swt.graphics.Color treeSelectionGradientBgColor
-
treeSelectionGradientFgColor
public org.eclipse.swt.graphics.Color treeSelectionGradientFgColor
-
treeSelectionHAlign
public HorizontalAlignmentEnum treeSelectionHAlign
-
treeSelectionVAlign
public VerticalAlignmentEnum treeSelectionVAlign
-
treeSelectionFont
public org.eclipse.swt.graphics.Font treeSelectionFont
-
treeSelectionImage
public org.eclipse.swt.graphics.Image treeSelectionImage
-
treeSelectionBorderStyle
public BorderStyle treeSelectionBorderStyle
-
treeSelectionPWEchoChar
public Character treeSelectionPWEchoChar
-
treeSelectionTextDecoration
public TextDecorationEnum treeSelectionTextDecoration
-
levelHeaderBgColor
public org.eclipse.swt.graphics.Color levelHeaderBgColor
-
levelHeaderFgColor
public org.eclipse.swt.graphics.Color levelHeaderFgColor
-
levelHeaderGradientBgColor
public org.eclipse.swt.graphics.Color levelHeaderGradientBgColor
-
levelHeaderGradientFgColor
public org.eclipse.swt.graphics.Color levelHeaderGradientFgColor
-
levelHeaderHAlign
public HorizontalAlignmentEnum levelHeaderHAlign
-
levelHeaderVAlign
public VerticalAlignmentEnum levelHeaderVAlign
-
levelHeaderFont
public org.eclipse.swt.graphics.Font levelHeaderFont
-
levelHeaderImage
public org.eclipse.swt.graphics.Image levelHeaderImage
-
levelHeaderBorderStyle
public BorderStyle levelHeaderBorderStyle
-
levelHeaderPWEchoChar
public Character levelHeaderPWEchoChar
-
levelHeaderTextDecoration
public TextDecorationEnum levelHeaderTextDecoration
-
levelHeaderSelectionBgColor
public org.eclipse.swt.graphics.Color levelHeaderSelectionBgColor
-
levelHeaderSelectionFgColor
public org.eclipse.swt.graphics.Color levelHeaderSelectionFgColor
-
levelHeaderSelectionGradientBgColor
public org.eclipse.swt.graphics.Color levelHeaderSelectionGradientBgColor
-
levelHeaderSelectionGradientFgColor
public org.eclipse.swt.graphics.Color levelHeaderSelectionGradientFgColor
-
levelHeaderSelectionHAlign
public HorizontalAlignmentEnum levelHeaderSelectionHAlign
-
levelHeaderSelectionVAlign
public VerticalAlignmentEnum levelHeaderSelectionVAlign
-
levelHeaderSelectionFont
public org.eclipse.swt.graphics.Font levelHeaderSelectionFont
-
levelHeaderSelectionImage
public org.eclipse.swt.graphics.Image levelHeaderSelectionImage
-
levelHeaderSelectionBorderStyle
public BorderStyle levelHeaderSelectionBorderStyle
-
levelHeaderSelectionPWEchoChar
public Character levelHeaderSelectionPWEchoChar
-
levelHeaderSelectionTextDecoration
public TextDecorationEnum levelHeaderSelectionTextDecoration
-
evenRowBgColor
public org.eclipse.swt.graphics.Color evenRowBgColor
-
evenRowFgColor
public org.eclipse.swt.graphics.Color evenRowFgColor
-
evenRowGradientBgColor
public org.eclipse.swt.graphics.Color evenRowGradientBgColor
-
evenRowGradientFgColor
public org.eclipse.swt.graphics.Color evenRowGradientFgColor
-
evenRowHAlign
public HorizontalAlignmentEnum evenRowHAlign
-
evenRowVAlign
public VerticalAlignmentEnum evenRowVAlign
-
evenRowFont
public org.eclipse.swt.graphics.Font evenRowFont
-
evenRowImage
public org.eclipse.swt.graphics.Image evenRowImage
-
evenRowBorderStyle
public BorderStyle evenRowBorderStyle
-
evenRowPWEchoChar
public Character evenRowPWEchoChar
-
evenRowTextDecoration
public TextDecorationEnum evenRowTextDecoration
-
oddRowBgColor
public org.eclipse.swt.graphics.Color oddRowBgColor
-
oddRowFgColor
public org.eclipse.swt.graphics.Color oddRowFgColor
-
oddRowGradientBgColor
public org.eclipse.swt.graphics.Color oddRowGradientBgColor
-
oddRowGradientFgColor
public org.eclipse.swt.graphics.Color oddRowGradientFgColor
-
oddRowHAlign
public HorizontalAlignmentEnum oddRowHAlign
-
oddRowVAlign
public VerticalAlignmentEnum oddRowVAlign
-
oddRowFont
public org.eclipse.swt.graphics.Font oddRowFont
-
oddRowImage
public org.eclipse.swt.graphics.Image oddRowImage
-
oddRowBorderStyle
public BorderStyle oddRowBorderStyle
-
oddRowPWEchoChar
public Character oddRowPWEchoChar
-
oddRowTextDecoration
public TextDecorationEnum oddRowTextDecoration
-
treeCellPainter
public ICellPainter treeCellPainter
-
treeSelectionCellPainter
public ICellPainter treeSelectionCellPainter
-
treeStructurePainter
public ICellPainter treeStructurePainter
-
treeStructureSelectionPainter
public ICellPainter treeStructureSelectionPainter
-
collapsedChildPainter
public ICellPainter collapsedChildPainter
-
levelHeaderCellPainter
public ICellPainter levelHeaderCellPainter
-
levelHeaderSelectionCellPainter
public ICellPainter levelHeaderSelectionCellPainter
-
evenRowCellPainter
public ICellPainter evenRowCellPainter
-
oddRowCellPainter
public ICellPainter oddRowCellPainter
-
-
Method Detail
-
createPainterInstances
public void createPainterInstances()
Description copied from interface:IThemeExtension
Method that is used to create the painter instances that should be registered for styling. Needed to update painters in case zoom operations- Specified by:
createPainterInstances
in interfaceIThemeExtension
-
registerStyles
public void registerStyles(IConfigRegistry configRegistry)
Description copied from interface:IThemeExtension
Register the style configurations that should be added by this IThemeExtension.- Specified by:
registerStyles
in interfaceIThemeExtension
- Parameters:
configRegistry
- The IConfigRegistry that is used by the NatTable instance to which the style configurations should be registered.
-
configureDefaultStyle
protected void configureDefaultStyle(IConfigRegistry configRegistry)
Register default style configurations. Typically these configurations are used be the body region and will be overridden by more specific configurations of the header regions or custom styling based on labels.It is necessary to override the default configuration provided by the base
ThemeConfiguration
to render the hierarchical representation correctly. Especially the horizontal and vertical alignment need to be adjusted from the default.- Parameters:
configRegistry
- The IConfigRegistry that is used by the NatTable instance to which the style configuration should be applied to.
-
getDefaultCellStyle
protected IStyle getDefaultCellStyle()
- Returns:
- The
IStyle
that should be used by default to render NatTable.
-
getDefaultCellPainter
protected ICellPainter getDefaultCellPainter()
Returns the defaultICellPainter
that is used to render the NatTable.Typically this
ICellPainter
is used to render the body region and is overridden for other regions or other custom styling configurations based on labels.- Returns:
- The
ICellPainter
that should be used by default to render NatTable.
-
configureTreeStyle
protected void configureTreeStyle(IConfigRegistry configRegistry)
This method is used to register style configurations for a tree representation. It will only be applied in case a TreeLayer is involved, which adds the configuration labelTreeLayer.TREE_COLUMN_CELL
to the tree column.- Parameters:
configRegistry
- The IConfigRegistry that is used by the NatTable instance to which the style configuration should be applied to.
-
configureLevelHeaderStyle
protected void configureLevelHeaderStyle(IConfigRegistry configRegistry)
By default the levels in aHierarchicalTreeLayer
are separated by additional level header columns. Those columns are marked with the labelHierarchicalTreeLayer.LEVEL_HEADER_CELL
. In this method the styling for those cells can be configured.- Parameters:
configRegistry
- The IConfigRegistry that is used by the NatTable instance to which the style configuration should be applied to.
-
configureAlternatingRowStyle
protected void configureAlternatingRowStyle(IConfigRegistry configRegistry)
When creating aHierarchicalTreeLayer
, using theDefaultHierarchicalTreeLayerConfiguration
, theHierarchicalTreeAlternatingRowConfigLabelAccumulator
is configured for the body region to apply labels for alternating rows. It applies the following labels for which this method registers styles:AlternatingRowConfigLabelAccumulator.EVEN_ROW_CONFIG_TYPE
AlternatingRowConfigLabelAccumulator.EVEN_ROW_CONFIG_TYPE
HierarchicalTreeAlternatingRowConfigLabelAccumulator
is not configured, this style configuration will have no effect.- Parameters:
configRegistry
- The IConfigRegistry that is used by the NatTable instance to which the style configuration should be applied to.
-
getTreeCellPainter
protected ICellPainter getTreeCellPainter()
Returns theICellPainter
that should be used to render the tree column cells in a NatTable.That means this
ICellPainter
is registered againstDisplayMode.NORMAL
and the configuration labelTreeLayer.TREE_COLUMN_CELL
.- Returns:
- The
ICellPainter
that should be used to render the tree column in a NatTable.
-
getTreeSelectionCellPainter
protected ICellPainter getTreeSelectionCellPainter()
Returns theICellPainter
that should be used to render the selected tree column cells in a NatTable.That means this
ICellPainter
is registered againstDisplayMode.SELECT
and the configuration labelTreeLayer.TREE_COLUMN_CELL
.- Returns:
- The
ICellPainter
that should be used to render the selected tree column in a NatTable.
-
getTreeStructurePainter
protected ICellPainter getTreeStructurePainter()
Returns theICellPainter
that should be used to render the tree structure in a NatTable. It needs to be anIndentedTreeImagePainter
to show the expand/collapsed state aswell as the indentation for the tree level. It that can be wrapped with severalCellPainterWrapper
. If there is noIndentedTreeImagePainter
in the painter hierarchy, this configuration attribute will be ignored by the TreeLayer.- Returns:
- The
IndentedTreeImagePainter
that should be used to render the tree structure in a NatTable.
-
getTreeStructureSelectionPainter
protected ICellPainter getTreeStructureSelectionPainter()
Returns theICellPainter
that should be used to render the selected tree structure in a NatTable. It needs to be anIndentedTreeImagePainter
to show the expand/collapsed state aswell as the indentation for the tree level. It that can be wrapped with severalCellPainterWrapper
. If there is noIndentedTreeImagePainter
in the painter hierarchy, this configuration attribute will be ignored by the TreeLayer.- Returns:
- The
IndentedTreeImagePainter
that should be used to render the selected tree structure in a NatTable.
-
getCollapsedChildPainter
protected ICellPainter getCollapsedChildPainter()
Returns theICellPainter
that should be used to render the content in cells of collapsed childs, e.g. an empty painter to paint empty cells.That means this
ICellPainter
is registered againstDisplayMode.NORMAL
and the configuration labelHierarchicalTreeLayer.COLLAPSED_CHILD
.- Returns:
- The
ICellPainter
that should be used to render the tree column in a NatTable.
-
getTreeStyle
protected IStyle getTreeStyle()
Returns theIStyle
that should be used to render the tree column cells in a NatTable.That means this
IStyle
is registered againstDisplayMode.NORMAL
and the configuration labelTreeLayer.TREE_COLUMN_CELL
.If this method returns
null
, no value will be registered to keep the IConfigRegistry clean. The result would be the same, as if no value is found in the IConfigRegistry. In this case the rendering will fallback to the default configuration.- Returns:
- The
IStyle
that should be used to render the tree column in a NatTable.
-
getTreeSelectionStyle
protected IStyle getTreeSelectionStyle()
Returns theIStyle
that should be used to render the selected tree column cells in a NatTable.That means this
IStyle
is registered againstDisplayMode.SELECT
and the configuration labelTreeLayer.TREE_COLUMN_CELL
.If this method returns
null
, no value will be registered to keep the IConfigRegistry clean. The result would be the same, as if no value is found in the IConfigRegistry. In this case the rendering will fallback to the default configuration.- Returns:
- The
IStyle
that should be used to render the selected tree column in a NatTable.
-
getLevelHeaderStyle
protected IStyle getLevelHeaderStyle()
Returns theIStyle
that should be used to render the level header column cells in a NatTable.That means this
IStyle
is registered againstDisplayMode.NORMAL
and the configuration labelHierarchicalTreeLayer.LEVEL_HEADER_CELL
.If this method returns
null
, no value will be registered to keep the IConfigRegistry clean. The result would be the same, as if no value is found in the IConfigRegistry. In this case the rendering will fallback to the default configuration.- Returns:
- The
IStyle
that should be used to render the tree column in a NatTable.
-
getLevelHeaderCellPainter
protected ICellPainter getLevelHeaderCellPainter()
Returns theICellPainter
that should be used to render the tree column cells in a NatTable.That means this
ICellPainter
is registered againstDisplayMode.NORMAL
and the configuration labelHierarchicalTreeLayer.LEVEL_HEADER_CELL
.- Returns:
- The
ICellPainter
that should be used to render the tree column in a NatTable.
-
getLevelHeaderSelectionStyle
protected IStyle getLevelHeaderSelectionStyle()
Returns theIStyle
that should be used to render the selected level header column cells in a NatTable.That means this
IStyle
is registered againstDisplayMode.SELECT
and the configuration labelHierarchicalTreeLayer.LEVEL_HEADER_CELL
.If this method returns
null
, no value will be registered to keep the IConfigRegistry clean. The result would be the same, as if no value is found in the IConfigRegistry. In this case the rendering will fallback to the default configuration.- Returns:
- The
IStyle
that should be used to render the selected tree column in a NatTable.
-
getLevelHeaderSelectionCellPainter
protected ICellPainter getLevelHeaderSelectionCellPainter()
Returns theICellPainter
that should be used to render the selected level header column cells in a NatTable.That means this
ICellPainter
is registered againstDisplayMode.SELECT
and the configuration labelHierarchicalTreeLayer.LEVEL_HEADER_CELL
.- Returns:
- The
ICellPainter
that should be used to render the selected tree column in a NatTable.
-
getEvenRowStyle
protected IStyle getEvenRowStyle()
Returns theIStyle
that should be used to render alternating rows.That means this
IStyle
is registered against the labelAlternatingRowConfigLabelAccumulator.EVEN_ROW_CONFIG_TYPE
.If this method returns
null
, no value will be registered to keep the IConfigRegistry clean. The result would be the same, as if no value is found in the IConfigRegistry. In this case the rendering will fallback to the default configuration.- Returns:
- The
IStyle
that is used to render rows that contain the labelAlternatingRowConfigLabelAccumulator.EVEN_ROW_CONFIG_TYPE
in the label stack.
-
getEvenRowCellPainter
protected ICellPainter getEvenRowCellPainter()
Returns theICellPainter
that should be used to render alternating rows.That means this
ICellPainter
is registered against the labelAlternatingRowConfigLabelAccumulator.EVEN_ROW_CONFIG_TYPE
.If this method returns
null
, no value will be registered to keep the IConfigRegistry clean. The result would be the same, as if no value is found in the IConfigRegistry. In this case the rendering will fallback to the default configuration.- Returns:
- The
ICellPainter
that is used to render rows that contain the labelAlternatingRowConfigLabelAccumulator.EVEN_ROW_CONFIG_TYPE
in the label stack.
-
getOddRowStyle
protected IStyle getOddRowStyle()
Returns theIStyle
that should be used to render alternating rows.That means this
IStyle
is registered against the labelAlternatingRowConfigLabelAccumulator.ODD_ROW_CONFIG_TYPE
.If this method returns
null
, no value will be registered to keep the IConfigRegistry clean. The result would be the same, as if no value is found in the IConfigRegistry. In this case the rendering will fallback to the default configuration.- Returns:
- The
IStyle
that is used to render rows that contain the labelAlternatingRowConfigLabelAccumulator.ODD_ROW_CONFIG_TYPE
in the label stack.
-
getOddRowCellPainter
protected ICellPainter getOddRowCellPainter()
Returns theICellPainter
that should be used to render alternating rows.That means this
ICellPainter
is registered against the labelAlternatingRowConfigLabelAccumulator.ODD_ROW_CONFIG_TYPE
.If this method returns
null
, no value will be registered to keep the IConfigRegistry clean. The result would be the same, as if no value is found in the IConfigRegistry. In this case the rendering will fallback to the default configuration.- Returns:
- The
ICellPainter
that is used to render rows that contain the labelAlternatingRowConfigLabelAccumulator.ODD_ROW_CONFIG_TYPE
in the label stack.
-
unregisterStyles
public void unregisterStyles(IConfigRegistry configRegistry)
Description copied from interface:IThemeExtension
Unregister the style configurations that were registered by this IThemeExtension.- Specified by:
unregisterStyles
in interfaceIThemeExtension
- Parameters:
configRegistry
- The IConfigRegistry that is used by the NatTable instance to which the style configurations were applied to.
-
-