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
FieldsModifier and TypeFieldDescriptionorg.eclipse.swt.graphics.Colororg.eclipse.swt.graphics.Colororg.eclipse.swt.graphics.Fontorg.eclipse.swt.graphics.Colororg.eclipse.swt.graphics.Colororg.eclipse.swt.graphics.Imageorg.eclipse.swt.graphics.Colororg.eclipse.swt.graphics.Colororg.eclipse.swt.graphics.Fontorg.eclipse.swt.graphics.Colororg.eclipse.swt.graphics.Colororg.eclipse.swt.graphics.Imageorg.eclipse.swt.graphics.Colororg.eclipse.swt.graphics.Colororg.eclipse.swt.graphics.Fontorg.eclipse.swt.graphics.Colororg.eclipse.swt.graphics.Colororg.eclipse.swt.graphics.Imageorg.eclipse.swt.graphics.Colororg.eclipse.swt.graphics.Colororg.eclipse.swt.graphics.Fontorg.eclipse.swt.graphics.Colororg.eclipse.swt.graphics.Colororg.eclipse.swt.graphics.Imageorg.eclipse.swt.graphics.Colororg.eclipse.swt.graphics.Colororg.eclipse.swt.graphics.Fontorg.eclipse.swt.graphics.Colororg.eclipse.swt.graphics.Colororg.eclipse.swt.graphics.Imageorg.eclipse.swt.graphics.Colororg.eclipse.swt.graphics.Colororg.eclipse.swt.graphics.Fontorg.eclipse.swt.graphics.Colororg.eclipse.swt.graphics.Colororg.eclipse.swt.graphics.Imageorg.eclipse.swt.graphics.Colororg.eclipse.swt.graphics.Colororg.eclipse.swt.graphics.Fontorg.eclipse.swt.graphics.Colororg.eclipse.swt.graphics.Colororg.eclipse.swt.graphics.Image -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidconfigureAlternatingRowStyle(IConfigRegistry configRegistry) When creating aHierarchicalTreeLayer, using theDefaultHierarchicalTreeLayerConfiguration, theHierarchicalTreeAlternatingRowConfigLabelAccumulatoris configured for the body region to apply labels for alternating rows.protected voidconfigureDefaultStyle(IConfigRegistry configRegistry) Register default style configurations.protected voidconfigureLevelHeaderStyle(IConfigRegistry configRegistry) By default the levels in aHierarchicalTreeLayerare separated by additional level header columns.protected voidconfigureTreeStyle(IConfigRegistry configRegistry) This method is used to register style configurations for a tree representation.voidMethod that is used to create the painter instances that should be registered for styling.protected ICellPainterReturns theICellPainterthat should be used to render the content in cells of collapsed childs, e.g.protected ICellPainterReturns the defaultICellPainterthat is used to render the NatTable.protected IStyleprotected ICellPainterReturns theICellPainterthat should be used to render alternating rows.protected IStyleReturns theIStylethat should be used to render alternating rows.protected ICellPainterReturns theICellPainterthat should be used to render the tree column cells in a NatTable.protected ICellPainterReturns theICellPainterthat should be used to render the selected level header column cells in a NatTable.protected IStyleReturns theIStylethat should be used to render the selected level header column cells in a NatTable.protected IStyleReturns theIStylethat should be used to render the level header column cells in a NatTable.protected ICellPainterReturns theICellPainterthat should be used to render alternating rows.protected IStyleReturns theIStylethat should be used to render alternating rows.protected ICellPainterReturns theICellPainterthat should be used to render the tree column cells in a NatTable.protected ICellPainterReturns theICellPainterthat should be used to render the selected tree column cells in a NatTable.protected IStyleReturns theIStylethat should be used to render the selected tree column cells in a NatTable.protected ICellPainterReturns theICellPainterthat should be used to render the tree structure in a NatTable.protected ICellPainterReturns theICellPainterthat should be used to render the selected tree structure in a NatTable.protected IStyleReturns theIStylethat should be used to render the tree column cells in a NatTable.voidregisterStyles(IConfigRegistry configRegistry) Register the style configurations that should be added by this IThemeExtension.voidunregisterStyles(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:IThemeExtensionMethod that is used to create the painter instances that should be registered for styling. Needed to update painters in case zoom operations- Specified by:
createPainterInstancesin interfaceIThemeExtension
-
registerStyles
Description copied from interface:IThemeExtensionRegister the style configurations that should be added by this IThemeExtension.- Specified by:
registerStylesin 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
ThemeConfigurationto 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
IStylethat should be used by default to render NatTable.
-
getDefaultCellPainter
Returns the defaultICellPainterthat is used to render the NatTable.Typically this
ICellPainteris used to render the body region and is overridden for other regions or other custom styling configurations based on labels.- Returns:
- The
ICellPainterthat 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_CELLto 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 aHierarchicalTreeLayerare 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, theHierarchicalTreeAlternatingRowConfigLabelAccumulatoris 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_TYPEAlternatingRowConfigLabelAccumulator.EVEN_ROW_CONFIG_TYPE
HierarchicalTreeAlternatingRowConfigLabelAccumulatoris 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 theICellPainterthat should be used to render the tree column cells in a NatTable.That means this
ICellPainteris registered againstDisplayMode.NORMALand the configuration labelTreeLayer.TREE_COLUMN_CELL.- Returns:
- The
ICellPainterthat should be used to render the tree column in a NatTable.
-
getTreeSelectionCellPainter
Returns theICellPainterthat should be used to render the selected tree column cells in a NatTable.That means this
ICellPainteris registered againstDisplayMode.SELECTand the configuration labelTreeLayer.TREE_COLUMN_CELL.- Returns:
- The
ICellPainterthat should be used to render the selected tree column in a NatTable.
-
getTreeStructurePainter
Returns theICellPainterthat should be used to render the tree structure in a NatTable. It needs to be anIndentedTreeImagePainterto show the expand/collapsed state aswell as the indentation for the tree level. It that can be wrapped with severalCellPainterWrapper. If there is noIndentedTreeImagePainterin the painter hierarchy, this configuration attribute will be ignored by the TreeLayer.- Returns:
- The
IndentedTreeImagePainterthat should be used to render the tree structure in a NatTable.
-
getTreeStructureSelectionPainter
Returns theICellPainterthat should be used to render the selected tree structure in a NatTable. It needs to be anIndentedTreeImagePainterto show the expand/collapsed state aswell as the indentation for the tree level. It that can be wrapped with severalCellPainterWrapper. If there is noIndentedTreeImagePainterin the painter hierarchy, this configuration attribute will be ignored by the TreeLayer.- Returns:
- The
IndentedTreeImagePainterthat should be used to render the selected tree structure in a NatTable.
-
getCollapsedChildPainter
Returns theICellPainterthat should be used to render the content in cells of collapsed childs, e.g. an empty painter to paint empty cells.That means this
ICellPainteris registered againstDisplayMode.NORMALand the configuration labelHierarchicalTreeLayer.COLLAPSED_CHILD.- Returns:
- The
ICellPainterthat should be used to render the tree column in a NatTable.
-
getTreeStyle
Returns theIStylethat should be used to render the tree column cells in a NatTable.That means this
IStyleis registered againstDisplayMode.NORMALand 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
IStylethat should be used to render the tree column in a NatTable.
-
getTreeSelectionStyle
Returns theIStylethat should be used to render the selected tree column cells in a NatTable.That means this
IStyleis registered againstDisplayMode.SELECTand 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
IStylethat should be used to render the selected tree column in a NatTable.
-
getLevelHeaderStyle
Returns theIStylethat should be used to render the level header column cells in a NatTable.That means this
IStyleis registered againstDisplayMode.NORMALand 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
IStylethat should be used to render the tree column in a NatTable.
-
getLevelHeaderCellPainter
Returns theICellPainterthat should be used to render the tree column cells in a NatTable.That means this
ICellPainteris registered againstDisplayMode.NORMALand the configuration labelHierarchicalTreeLayer.LEVEL_HEADER_CELL.- Returns:
- The
ICellPainterthat should be used to render the tree column in a NatTable.
-
getLevelHeaderSelectionStyle
Returns theIStylethat should be used to render the selected level header column cells in a NatTable.That means this
IStyleis registered againstDisplayMode.SELECTand 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
IStylethat should be used to render the selected tree column in a NatTable.
-
getLevelHeaderSelectionCellPainter
Returns theICellPainterthat should be used to render the selected level header column cells in a NatTable.That means this
ICellPainteris registered againstDisplayMode.SELECTand the configuration labelHierarchicalTreeLayer.LEVEL_HEADER_CELL.- Returns:
- The
ICellPainterthat should be used to render the selected tree column in a NatTable.
-
getEvenRowStyle
Returns theIStylethat should be used to render alternating rows.That means this
IStyleis 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
IStylethat is used to render rows that contain the labelAlternatingRowConfigLabelAccumulator.EVEN_ROW_CONFIG_TYPEin the label stack.
-
getEvenRowCellPainter
Returns theICellPainterthat should be used to render alternating rows.That means this
ICellPainteris 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
ICellPainterthat is used to render rows that contain the labelAlternatingRowConfigLabelAccumulator.EVEN_ROW_CONFIG_TYPEin the label stack.
-
getOddRowStyle
Returns theIStylethat should be used to render alternating rows.That means this
IStyleis 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
IStylethat is used to render rows that contain the labelAlternatingRowConfigLabelAccumulator.ODD_ROW_CONFIG_TYPEin the label stack.
-
getOddRowCellPainter
Returns theICellPainterthat should be used to render alternating rows.That means this
ICellPainteris 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
ICellPainterthat is used to render rows that contain the labelAlternatingRowConfigLabelAccumulator.ODD_ROW_CONFIG_TYPEin the label stack.
-
unregisterStyles
Description copied from interface:IThemeExtensionUnregister the style configurations that were registered by this IThemeExtension.- Specified by:
unregisterStylesin interfaceIThemeExtension- Parameters:
configRegistry- The IConfigRegistry that is used by the NatTable instance to which the style configurations were applied to.
-