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 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 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

      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
  • 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 interface IThemeExtension
    • 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 interface IThemeExtension
      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 default ICellPainter 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 label TreeLayer.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 a HierarchicalTreeLayer are separated by additional level header columns. Those columns are marked with the label HierarchicalTreeLayer.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 a HierarchicalTreeLayer, using the DefaultHierarchicalTreeLayerConfiguration, the HierarchicalTreeAlternatingRowConfigLabelAccumulator is configured for the body region to apply labels for alternating rows. It applies the following labels for which this method registers styles: If the 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 the ICellPainter that should be used to render the tree column cells in a NatTable.

      That means this ICellPainter is registered against DisplayMode.NORMAL and the configuration label TreeLayer.TREE_COLUMN_CELL.

      Returns:
      The ICellPainter that should be used to render the tree column in a NatTable.
    • getTreeSelectionCellPainter

      protected ICellPainter getTreeSelectionCellPainter()
      Returns the ICellPainter that should be used to render the selected tree column cells in a NatTable.

      That means this ICellPainter is registered against DisplayMode.SELECT and the configuration label TreeLayer.TREE_COLUMN_CELL.

      Returns:
      The ICellPainter that should be used to render the selected tree column in a NatTable.
    • getTreeStructurePainter

      protected ICellPainter getTreeStructurePainter()
      Returns the ICellPainter that should be used to render the tree structure in a NatTable. It needs to be an IndentedTreeImagePainter to show the expand/collapsed state aswell as the indentation for the tree level. It that can be wrapped with several CellPainterWrapper. If there is no IndentedTreeImagePainter 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 the ICellPainter that should be used to render the selected tree structure in a NatTable. It needs to be an IndentedTreeImagePainter to show the expand/collapsed state aswell as the indentation for the tree level. It that can be wrapped with several CellPainterWrapper. If there is no IndentedTreeImagePainter 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 the ICellPainter 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 against DisplayMode.NORMAL and the configuration label HierarchicalTreeLayer.COLLAPSED_CHILD.

      Returns:
      The ICellPainter that should be used to render the tree column in a NatTable.
    • getTreeStyle

      protected IStyle getTreeStyle()
      Returns the IStyle that should be used to render the tree column cells in a NatTable.

      That means this IStyle is registered against DisplayMode.NORMAL and the configuration label TreeLayer.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 the IStyle that should be used to render the selected tree column cells in a NatTable.

      That means this IStyle is registered against DisplayMode.SELECT and the configuration label TreeLayer.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 the IStyle that should be used to render the level header column cells in a NatTable.

      That means this IStyle is registered against DisplayMode.NORMAL and the configuration label HierarchicalTreeLayer.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 the ICellPainter that should be used to render the tree column cells in a NatTable.

      That means this ICellPainter is registered against DisplayMode.NORMAL and the configuration label HierarchicalTreeLayer.LEVEL_HEADER_CELL.

      Returns:
      The ICellPainter that should be used to render the tree column in a NatTable.
    • getLevelHeaderSelectionStyle

      protected IStyle getLevelHeaderSelectionStyle()
      Returns the IStyle that should be used to render the selected level header column cells in a NatTable.

      That means this IStyle is registered against DisplayMode.SELECT and the configuration label HierarchicalTreeLayer.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 the ICellPainter that should be used to render the selected level header column cells in a NatTable.

      That means this ICellPainter is registered against DisplayMode.SELECT and the configuration label HierarchicalTreeLayer.LEVEL_HEADER_CELL.

      Returns:
      The ICellPainter that should be used to render the selected tree column in a NatTable.
    • getEvenRowStyle

      protected IStyle getEvenRowStyle()
      Returns the IStyle that should be used to render alternating rows.

      That means this IStyle is registered against the label AlternatingRowConfigLabelAccumulator.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 label AlternatingRowConfigLabelAccumulator.EVEN_ROW_CONFIG_TYPE in the label stack.
    • getEvenRowCellPainter

      protected ICellPainter getEvenRowCellPainter()
      Returns the ICellPainter that should be used to render alternating rows.

      That means this ICellPainter is registered against the label AlternatingRowConfigLabelAccumulator.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 label AlternatingRowConfigLabelAccumulator.EVEN_ROW_CONFIG_TYPE in the label stack.
    • getOddRowStyle

      protected IStyle getOddRowStyle()
      Returns the IStyle that should be used to render alternating rows.

      That means this IStyle is registered against the label AlternatingRowConfigLabelAccumulator.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 label AlternatingRowConfigLabelAccumulator.ODD_ROW_CONFIG_TYPE in the label stack.
    • getOddRowCellPainter

      protected ICellPainter getOddRowCellPainter()
      Returns the ICellPainter that should be used to render alternating rows.

      That means this ICellPainter is registered against the label AlternatingRowConfigLabelAccumulator.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 label AlternatingRowConfigLabelAccumulator.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 interface IThemeExtension
      Parameters:
      configRegistry - The IConfigRegistry that is used by the NatTable instance to which the style configurations were applied to.