Class DefaultHierarchicalTreeLayerThemeExtension
- All Implemented Interfaces:
IThemeExtension
- Direct Known Subclasses:
ModernHierarchicalTreeLayerThemeExtension
IThemeExtension
that adds styling configurations for the
HierarchicalTreeLayer
.
The theme styling for the HierarchicalTreeLayer
is implemented as a
IThemeExtension
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
Modifier and TypeFieldDescriptionorg.eclipse.swt.graphics.Color
org.eclipse.swt.graphics.Color
org.eclipse.swt.graphics.Font
org.eclipse.swt.graphics.Color
org.eclipse.swt.graphics.Color
org.eclipse.swt.graphics.Image
org.eclipse.swt.graphics.Color
org.eclipse.swt.graphics.Color
org.eclipse.swt.graphics.Font
org.eclipse.swt.graphics.Color
org.eclipse.swt.graphics.Color
org.eclipse.swt.graphics.Image
org.eclipse.swt.graphics.Color
org.eclipse.swt.graphics.Color
org.eclipse.swt.graphics.Font
org.eclipse.swt.graphics.Color
org.eclipse.swt.graphics.Color
org.eclipse.swt.graphics.Image
org.eclipse.swt.graphics.Color
org.eclipse.swt.graphics.Color
org.eclipse.swt.graphics.Font
org.eclipse.swt.graphics.Color
org.eclipse.swt.graphics.Color
org.eclipse.swt.graphics.Image
org.eclipse.swt.graphics.Color
org.eclipse.swt.graphics.Color
org.eclipse.swt.graphics.Font
org.eclipse.swt.graphics.Color
org.eclipse.swt.graphics.Color
org.eclipse.swt.graphics.Image
org.eclipse.swt.graphics.Color
org.eclipse.swt.graphics.Color
org.eclipse.swt.graphics.Font
org.eclipse.swt.graphics.Color
org.eclipse.swt.graphics.Color
org.eclipse.swt.graphics.Image
org.eclipse.swt.graphics.Color
org.eclipse.swt.graphics.Color
org.eclipse.swt.graphics.Font
org.eclipse.swt.graphics.Color
org.eclipse.swt.graphics.Color
org.eclipse.swt.graphics.Image
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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
Method that is used to create the painter instances that should be registered for styling.protected ICellPainter
Returns theICellPainter
that should be used to render the content in cells of collapsed childs, e.g.protected ICellPainter
Returns the defaultICellPainter
that is used to render the NatTable.protected IStyle
protected ICellPainter
Returns theICellPainter
that should be used to render alternating rows.protected IStyle
Returns theIStyle
that should be used to render alternating rows.protected ICellPainter
Returns theICellPainter
that should be used to render the tree column cells in a NatTable.protected ICellPainter
Returns theICellPainter
that should be used to render the selected level header column cells in a NatTable.protected IStyle
Returns theIStyle
that should be used to render the selected level header column cells in a NatTable.protected IStyle
Returns theIStyle
that should be used to render the level header column cells in a NatTable.protected ICellPainter
Returns theICellPainter
that should be used to render alternating rows.protected IStyle
Returns theIStyle
that should be used to render alternating rows.protected ICellPainter
Returns theICellPainter
that should be used to render the tree column cells in a NatTable.protected ICellPainter
Returns theICellPainter
that should be used to render the selected tree column cells in a NatTable.protected IStyle
Returns theIStyle
that should be used to render the selected tree column cells in a NatTable.protected ICellPainter
Returns theICellPainter
that should be used to render the tree structure in a NatTable.protected ICellPainter
Returns theICellPainter
that should be used to render the selected tree structure in a NatTable.protected IStyle
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 Details
-
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
-
defaultVAlign
-
defaultFont
public org.eclipse.swt.graphics.Font defaultFont -
defaultImage
public org.eclipse.swt.graphics.Image defaultImage -
defaultBorderStyle
-
defaultPWEchoChar
-
defaultTextDecoration
-
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
-
treeVAlign
-
treeFont
public org.eclipse.swt.graphics.Font treeFont -
treeImage
public org.eclipse.swt.graphics.Image treeImage -
treeBorderStyle
-
treePWEchoChar
-
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
-
treeSelectionVAlign
-
treeSelectionFont
public org.eclipse.swt.graphics.Font treeSelectionFont -
treeSelectionImage
public org.eclipse.swt.graphics.Image treeSelectionImage -
treeSelectionBorderStyle
-
treeSelectionPWEchoChar
-
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
-
levelHeaderVAlign
-
levelHeaderFont
public org.eclipse.swt.graphics.Font levelHeaderFont -
levelHeaderImage
public org.eclipse.swt.graphics.Image levelHeaderImage -
levelHeaderBorderStyle
-
levelHeaderPWEchoChar
-
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
-
levelHeaderSelectionVAlign
-
levelHeaderSelectionFont
public org.eclipse.swt.graphics.Font levelHeaderSelectionFont -
levelHeaderSelectionImage
public org.eclipse.swt.graphics.Image levelHeaderSelectionImage -
levelHeaderSelectionBorderStyle
-
levelHeaderSelectionPWEchoChar
-
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
-
evenRowVAlign
-
evenRowFont
public org.eclipse.swt.graphics.Font evenRowFont -
evenRowImage
public org.eclipse.swt.graphics.Image evenRowImage -
evenRowBorderStyle
-
evenRowPWEchoChar
-
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
-
oddRowVAlign
-
oddRowFont
public org.eclipse.swt.graphics.Font oddRowFont -
oddRowImage
public org.eclipse.swt.graphics.Image oddRowImage -
oddRowBorderStyle
-
oddRowPWEchoChar
-
oddRowTextDecoration
-
treeCellPainter
-
treeSelectionCellPainter
-
treeStructurePainter
-
treeStructureSelectionPainter
-
collapsedChildPainter
-
levelHeaderCellPainter
-
levelHeaderSelectionCellPainter
-
evenRowCellPainter
-
oddRowCellPainter
-
-
Constructor Details
-
DefaultHierarchicalTreeLayerThemeExtension
public DefaultHierarchicalTreeLayerThemeExtension()
-
-
Method Details
-
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
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
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
- Returns:
- The
IStyle
that should be used by default to render NatTable.
-
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
-