public void configureRegistry(IConfigRegistry configRegistry) {
      // Register cell style
      Style cellStyle = new Style();
      cellStyle.setAttributeValue(
          CellStyleAttributes.HORIZONTAL_ALIGNMENT, HorizontalAlignmentEnum.CENTER);
      cellStyle.setAttributeValue(
          CellStyleAttributes.VERTICAL_ALIGNMENT, VerticalAlignmentEnum.MIDDLE);

      cellStyle.setAttributeValue(
          PercentageBarDecorator.PERCENTAGE_BAR_COMPLETE_REGION_START_COLOR,
          GUIHelper.getColor(new RGB(251, 149, 123)));
      cellStyle.setAttributeValue(
          PercentageBarDecorator.PERCENTAGE_BAR_COMPLETE_REGION_END_COLOR,
          GUIHelper.getColor(new RGB(248, 253, 219)));
      cellStyle.setAttributeValue(
          PercentageBarDecorator.PERCENTAGE_BAR_INCOMPLETE_REGION_COLOR,
          GUIHelper.getColor(new RGB(236, 217, 255)));

      configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyle);

      // Register custom painter, paints bars
      configRegistry.registerConfigAttribute(
          CellConfigAttributes.CELL_PAINTER,
          new PercentageBarCellPainter(),
          DisplayMode.NORMAL,
          GridRegion.BODY.toString());

      // Register custom converter, converts to percentage
      configRegistry.registerConfigAttribute(
          CellConfigAttributes.DISPLAY_CONVERTER,
          new PercentageDisplayConverter(),
          DisplayMode.NORMAL,
          GridRegion.BODY.toString());
    }
示例#2
0
 public ComboBoxPainter() {
   setWrappedPainter(
       new CellPainterDecorator(
           new TextPainter(),
           CellEdgeEnum.RIGHT,
           new ImagePainter(GUIHelper.getImage("down_2")))); // $NON-NLS-1$
 }
  private void registerButton(IConfigRegistry configRegistry) {

    String CUSTOM_CELL_LABEL = "LABEL4";

    buttonPainter =
        new ButtonCellPainter(
            new CellPainterDecorator(
                new TextPainter(),
                CellEdgeEnum.RIGHT,
                new ImagePainter(GUIHelper.getImage("preferences"))));

    configRegistry.registerConfigAttribute(
        CellConfigAttributes.CELL_PAINTER, buttonPainter, DisplayMode.NORMAL, CUSTOM_CELL_LABEL);

    // Add your listener to the button
    //		buttonPainter.addClickListener(new MyMouseAction());

    // Set the color of the cell. This is picked up by the button painter to style the button
    Style style = new Style();
    style.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, GUIHelper.COLOR_GREEN);

    configRegistry.registerConfigAttribute(
        CellConfigAttributes.CELL_STYLE, style, DisplayMode.NORMAL, CUSTOM_CELL_LABEL);
    configRegistry.registerConfigAttribute(
        CellConfigAttributes.CELL_STYLE, style, DisplayMode.SELECT, CUSTOM_CELL_LABEL);
  }
/**
 * Style config for fill layouts.
 *
 * @author Fabian Prasser
 */
public class DataTableFillLayoutStyle extends AbstractRegistryConfiguration {

  /** TODO */
  public static final String DEFAULT_FILL_LAYOUT_CELL_CONFIG_LABEL =
      "FillLayoutCell_"; //$NON-NLS-1$

  /** TODO */
  private BorderStyle borderStyle =
      new BorderStyle(0, GUIHelper.getColor(240, 240, 240), LineStyleEnum.SOLID);

  /** TODO */
  private Color fgColor = GUIHelper.COLOR_BLACK;

  /** TODO */
  private Color bgColor = GUIHelper.getColor(245, 245, 245);

  /** TODO */
  private Font font;

  /** @param control */
  public DataTableFillLayoutStyle(Control control) {
    font = control.getFont();
  }

  @Override
  public void configureRegistry(IConfigRegistry configRegistry) {
    addFillLayoutStyleConfig(configRegistry);
  }

  /** @param configRegistry */
  protected void addFillLayoutStyleConfig(IConfigRegistry configRegistry) {
    Style cellStyle = new Style();
    cellStyle.setAttributeValue(CellStyleAttributes.FONT, font);
    cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, bgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, fgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, borderStyle);
    configRegistry.registerConfigAttribute(
        CellConfigAttributes.CELL_STYLE,
        cellStyle,
        DisplayMode.NORMAL,
        DEFAULT_FILL_LAYOUT_CELL_CONFIG_LABEL);
  }
}
/** Sets up rendering style used for selected areas and the selection anchor. */
public class DefaultSelectionStyleConfiguration extends AbstractRegistryConfiguration {

  // Selection style
  public Font selectionFont =
      GUIHelper.getFont(new FontData("Verdana", 8, SWT.BOLD | SWT.ITALIC)); // $NON-NLS-1$
  public Color selectionBgColor = GUIHelper.COLOR_TITLE_INACTIVE_BACKGROUND;
  public Color selectionFgColor = GUIHelper.COLOR_BLACK;

  // Anchor style
  public Color anchorBorderColor = GUIHelper.COLOR_DARK_GRAY;
  public BorderStyle anchorBorderStyle =
      new BorderStyle(1, this.anchorBorderColor, LineStyleEnum.SOLID);
  public Color anchorBgColor = GUIHelper.COLOR_GRAY;
  public Color anchorFgColor = GUIHelper.COLOR_WHITE;

  // Selected headers style
  public Color selectedHeaderBgColor = GUIHelper.COLOR_GRAY;
  public Color selectedHeaderFgColor = GUIHelper.COLOR_WHITE;
  public Font selectedHeaderFont =
      GUIHelper.getFont(new FontData("Verdana", 10, SWT.BOLD)); // $NON-NLS-1$
  public BorderStyle selectedHeaderBorderStyle =
      new BorderStyle(-1, this.selectedHeaderFgColor, LineStyleEnum.SOLID);

  public Color fullySelectedHeaderBgColor = GUIHelper.COLOR_WIDGET_NORMAL_SHADOW;

  // Anchor grid line style
  public Color anchorGridBorderColor = GUIHelper.COLOR_BLACK;
  public BorderStyle anchorGridBorderStyle =
      new BorderStyle(1, this.anchorGridBorderColor, LineStyleEnum.DOTTED);

  @Override
  public void configureRegistry(IConfigRegistry configRegistry) {
    configureSelectionStyle(configRegistry);
    configureSelectionAnchorStyle(configRegistry);
    configureSelectionAnchorGridLineStyle(configRegistry);
    configureHeaderHasSelectionStyle(configRegistry);
    configureHeaderFullySelectedStyle(configRegistry);
  }

  protected void configureSelectionStyle(IConfigRegistry configRegistry) {
    Style cellStyle = new Style();
    cellStyle.setAttributeValue(CellStyleAttributes.FONT, this.selectionFont);
    cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, this.selectionBgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, this.selectionFgColor);

    configRegistry.registerConfigAttribute(
        CellConfigAttributes.CELL_STYLE, cellStyle, DisplayMode.SELECT);
  }

  protected void configureSelectionAnchorStyle(IConfigRegistry configRegistry) {
    // Selection anchor style for normal display mode
    Style cellStyle = new Style();
    cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, this.anchorBorderStyle);
    configRegistry.registerConfigAttribute(
        CellConfigAttributes.CELL_STYLE,
        cellStyle,
        DisplayMode.NORMAL,
        SelectionStyleLabels.SELECTION_ANCHOR_STYLE);

    // Selection anchor style for select display mode
    cellStyle = new Style();
    cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, this.anchorBgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, this.anchorFgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, this.anchorBorderStyle);
    configRegistry.registerConfigAttribute(
        CellConfigAttributes.CELL_STYLE,
        cellStyle,
        DisplayMode.SELECT,
        SelectionStyleLabels.SELECTION_ANCHOR_STYLE);
  }

  protected void configureSelectionAnchorGridLineStyle(IConfigRegistry configRegistry) {
    Style cellStyle = new Style();
    cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, this.anchorGridBorderStyle);
    configRegistry.registerConfigAttribute(
        CellConfigAttributes.CELL_STYLE,
        cellStyle,
        DisplayMode.SELECT,
        SelectionStyleLabels.SELECTION_ANCHOR_GRID_LINE_STYLE);
  }

  protected void configureHeaderHasSelectionStyle(IConfigRegistry configRegistry) {
    Style cellStyle = new Style();

    cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, this.selectedHeaderFgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, this.selectedHeaderBgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.FONT, this.selectedHeaderFont);
    cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, this.selectedHeaderBorderStyle);

    configRegistry.registerConfigAttribute(
        CellConfigAttributes.CELL_STYLE, cellStyle, DisplayMode.SELECT, GridRegion.COLUMN_HEADER);
    configRegistry.registerConfigAttribute(
        CellConfigAttributes.CELL_STYLE, cellStyle, DisplayMode.SELECT, GridRegion.CORNER);
    configRegistry.registerConfigAttribute(
        CellConfigAttributes.CELL_STYLE, cellStyle, DisplayMode.SELECT, GridRegion.ROW_HEADER);
  }

  protected void configureHeaderFullySelectedStyle(IConfigRegistry configRegistry) {
    // Header fully selected
    Style cellStyle = new Style();
    cellStyle.setAttributeValue(
        CellStyleAttributes.BACKGROUND_COLOR, this.fullySelectedHeaderBgColor);

    configRegistry.registerConfigAttribute(
        CellConfigAttributes.CELL_STYLE,
        cellStyle,
        DisplayMode.SELECT,
        SelectionStyleLabels.COLUMN_FULLY_SELECTED_STYLE);
    configRegistry.registerConfigAttribute(
        CellConfigAttributes.CELL_STYLE,
        cellStyle,
        DisplayMode.SELECT,
        SelectionStyleLabels.ROW_FULLY_SELECTED_STYLE);
  }
}
  {
    this.defaultBgColor = GUIHelper.COLOR_BLACK;
    this.defaultFgColor = GUIHelper.COLOR_WIDGET_LIGHT_SHADOW;

    // column header styling
    this.cHeaderFgColor = GUIHelper.COLOR_WIDGET_LIGHT_SHADOW;
    this.cHeaderGradientBgColor = GUIHelper.COLOR_WIDGET_DARK_SHADOW;
    this.cHeaderGradientFgColor = GUIHelper.COLOR_BLACK;
    this.cHeaderCellPainter =
        new GradientBackgroundPainter(
            new PaddingDecorator(new TextPainter(false, false), 0, 5, 0, 5, false), true);

    // column header selection style
    this.cHeaderSelectionFgColor = GUIHelper.COLOR_WIDGET_LIGHT_SHADOW;
    this.cHeaderSelectionGradientBgColor = GUIHelper.COLOR_BLACK;
    this.cHeaderSelectionGradientFgColor = GUIHelper.COLOR_WIDGET_DARK_SHADOW;
    this.cHeaderSelectionCellPainter =
        new GradientBackgroundPainter(
            new PaddingDecorator(new TextPainter(false, false), 0, 5, 0, 5, false), true);

    // row header styling
    this.rHeaderFgColor = GUIHelper.COLOR_WIDGET_LIGHT_SHADOW;
    this.rHeaderGradientBgColor = GUIHelper.COLOR_WIDGET_DARK_SHADOW;
    this.rHeaderGradientFgColor = GUIHelper.COLOR_BLACK;
    this.rHeaderCellPainter = new GradientBackgroundPainter(new TextPainter(false, false));

    // row header selection style
    this.rHeaderSelectionFgColor = GUIHelper.COLOR_WIDGET_LIGHT_SHADOW;
    this.rHeaderSelectionGradientBgColor = GUIHelper.COLOR_BLACK;
    this.rHeaderSelectionGradientFgColor = GUIHelper.COLOR_WIDGET_DARK_SHADOW;
    this.rHeaderSelectionCellPainter = new GradientBackgroundPainter(new TextPainter(false, false));

    // no alternate row styling
    this.evenRowBgColor = GUIHelper.COLOR_BLACK;
    this.oddRowBgColor = GUIHelper.COLOR_BLACK;

    // default selection style
    this.defaultSelectionBgColor = GUIHelper.COLOR_DARK_GRAY;
    this.defaultSelectionFgColor = GUIHelper.COLOR_WIDGET_LIGHT_SHADOW;

    // selection anchor
    this.selectionAnchorSelectionBgColor = GUIHelper.COLOR_WIDGET_DARK_SHADOW;
    this.selectionAnchorSelectionFgColor = GUIHelper.COLOR_WIDGET_LIGHT_SHADOW;
    this.selectionAnchorBorderStyle =
        new BorderStyle(1, GUIHelper.COLOR_DARK_GRAY, LineStyleEnum.SOLID);

    // column/row group header style
    this.cGroupHeaderCellPainter =
        new GradientBackgroundPainter(
            new ColumnGroupHeaderTextPainter(
                new TextPainter(false, false),
                CellEdgeEnum.RIGHT,
                new ColumnGroupExpandCollapseImagePainter(false, true),
                false,
                0,
                false));
    this.rGroupHeaderCellPainter =
        new GradientBackgroundPainter(
            new PaddingDecorator(
                new RowGroupHeaderTextPainter(
                    new VerticalTextPainter(false, false),
                    CellEdgeEnum.BOTTOM,
                    new RowGroupExpandCollapseImagePainter(false, true),
                    false,
                    0,
                    true),
                0,
                0,
                2,
                0,
                false));

    // sort header styling
    this.sortHeaderCellPainter =
        new GradientBackgroundPainter(
            new PaddingDecorator(
                new SortableHeaderTextPainter(
                    new TextPainter(false, false),
                    CellEdgeEnum.RIGHT,
                    new SortIconPainter(false, true),
                    false,
                    0,
                    false),
                0,
                2,
                0,
                5,
                false),
            true);
    this.selectedSortHeaderCellPainter =
        new GradientBackgroundPainter(
            new PaddingDecorator(
                new SortableHeaderTextPainter(
                    new TextPainter(false, false),
                    CellEdgeEnum.RIGHT,
                    new SortIconPainter(false, true),
                    false,
                    0,
                    false),
                0,
                2,
                0,
                5,
                false),
            true);

    TreeImagePainter imagePainter =
        new TreeImagePainter(
            false,
            GUIHelper.getImage("right_inv"), // $NON-NLS-1$
            GUIHelper.getImage("right_down_inv"), // $NON-NLS-1$
            null);
    this.treeStructurePainter =
        new BackgroundPainter(
            new PaddingDecorator(
                new IndentedTreeImagePainter(
                    10, null, CellEdgeEnum.LEFT, imagePainter, false, 2, true),
                0,
                5,
                0,
                5,
                false));

    this.filterRowBgColor = GUIHelper.COLOR_WIDGET_DARK_SHADOW;

    this.summaryRowBgColor = GUIHelper.COLOR_DARK_GRAY;
    this.summaryRowFgColor = GUIHelper.COLOR_WIDGET_LIGHT_SHADOW;

    this.summaryRowSelectionBgColor = GUIHelper.COLOR_WIDGET_DARK_SHADOW;

    this.renderCornerGridLines = true;
    this.renderColumnHeaderGridLines = true;
  }
    @Override
    public void configureRegistry(IConfigRegistry configRegistry) {
      // Configure custom comparator on the rating column
      configRegistry.registerConfigAttribute(
          FilterRowConfigAttributes.FILTER_COMPARATOR,
          getIngnorecaseComparator(),
          DisplayMode.NORMAL,
          FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + 2);

      // If threshold comparison is used we have to convert the string entered by the
      // user to the correct underlying type (double), so that it can be compared

      // Configure Bid column
      configRegistry.registerConfigAttribute(
          FilterRowConfigAttributes.FILTER_DISPLAY_CONVERTER,
          doubleDisplayConverter,
          DisplayMode.NORMAL,
          FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + 5);
      configRegistry.registerConfigAttribute(
          FilterRowConfigAttributes.TEXT_MATCHING_MODE,
          TextMatchingMode.REGULAR_EXPRESSION,
          DisplayMode.NORMAL,
          FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + 5);

      // Configure Ask column
      configRegistry.registerConfigAttribute(
          FilterRowConfigAttributes.FILTER_DISPLAY_CONVERTER,
          doubleDisplayConverter,
          DisplayMode.NORMAL,
          FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + 6);
      configRegistry.registerConfigAttribute(
          FilterRowConfigAttributes.TEXT_MATCHING_MODE,
          TextMatchingMode.REGULAR_EXPRESSION,
          DisplayMode.NORMAL,
          FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + 6);

      // Configure a combo box on the pricing type column

      // Register a combo box editor to be displayed in the filter row cell
      //    when a value is selected from the combo, the object is converted to a string
      //    using the converter (registered below)
      configRegistry.registerConfigAttribute(
          EditConfigAttributes.CELL_EDITOR,
          new ComboBoxCellEditor(
              Arrays.asList(new PricingTypeBean("MN"), new PricingTypeBean("AT"))),
          DisplayMode.NORMAL,
          FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + 4);

      // The pricing bean object in column is converted to using this display converter
      // A 'text' match is then performed against the value from the combo box
      configRegistry.registerConfigAttribute(
          FilterRowConfigAttributes.FILTER_DISPLAY_CONVERTER,
          PricingTypeBean.getDisplayConverter(),
          DisplayMode.NORMAL,
          FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + 4);

      configRegistry.registerConfigAttribute(
          CellConfigAttributes.DISPLAY_CONVERTER,
          PricingTypeBean.getDisplayConverter(),
          DisplayMode.NORMAL,
          FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + 4);

      configRegistry.registerConfigAttribute(
          CellConfigAttributes.DISPLAY_CONVERTER,
          PricingTypeBean.getDisplayConverter(),
          DisplayMode.NORMAL,
          "PRICING_TYPE_PROP_NAME");

      // Shade the row to be slightly darker than the blue background.
      final Style rowStyle = new Style();
      rowStyle.setAttributeValue(
          CellStyleAttributes.BACKGROUND_COLOR, GUIHelper.getColor(197, 212, 231));
      configRegistry.registerConfigAttribute(
          CellConfigAttributes.CELL_STYLE, rowStyle, DisplayMode.NORMAL, GridRegion.FILTER_ROW);
    }
    public void configureRegistry(IConfigRegistry configRegistry) {
      // override the default filter row configuration for painter
      configRegistry.registerConfigAttribute(
          CELL_PAINTER,
          new FilterRowPainter(new FilterIconPainter(GUIHelper.getImage("filter"))),
          NORMAL,
          FILTER_ROW);

      // Configure custom comparator on the rating column
      configRegistry.registerConfigAttribute(
          FilterRowConfigAttributes.FILTER_COMPARATOR,
          getIngnorecaseComparator(),
          DisplayMode.NORMAL,
          FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + 2);

      // If threshold comparison is used we have to convert the string entered by the
      // user to the correct underlying type (double), so that it can be compared

      // Configure Bid column
      configRegistry.registerConfigAttribute(
          FilterRowConfigAttributes.FILTER_DISPLAY_CONVERTER,
          doubleDisplayConverter,
          DisplayMode.NORMAL,
          FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + 5);
      configRegistry.registerConfigAttribute(
          FilterRowConfigAttributes.TEXT_MATCHING_MODE,
          TextMatchingMode.REGULAR_EXPRESSION,
          DisplayMode.NORMAL,
          FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + 5);

      // Configure Ask column
      configRegistry.registerConfigAttribute(
          FilterRowConfigAttributes.FILTER_DISPLAY_CONVERTER,
          doubleDisplayConverter,
          DisplayMode.NORMAL,
          FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + 6);
      configRegistry.registerConfigAttribute(
          FilterRowConfigAttributes.TEXT_MATCHING_MODE,
          TextMatchingMode.REGULAR_EXPRESSION,
          DisplayMode.NORMAL,
          FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + 6);

      // Configure a combo box on the pricing type column

      // Register a combo box editor to be displayed in the filter row cell
      //    when a value is selected from the combo, the object is converted to a string
      //    using the converter (registered below)
      configRegistry.registerConfigAttribute(
          EditConfigAttributes.CELL_EDITOR,
          new ComboBoxCellEditor(
              Arrays.asList(new PricingTypeBean("MN"), new PricingTypeBean("AT"))),
          DisplayMode.NORMAL,
          FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + 4);

      // The pricing bean object in column is converted to using this display converter
      // A 'text' match is then performed against the value from the combo box
      configRegistry.registerConfigAttribute(
          FilterRowConfigAttributes.FILTER_DISPLAY_CONVERTER,
          PricingTypeBean.getDisplayConverter(),
          DisplayMode.NORMAL,
          FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + 4);

      configRegistry.registerConfigAttribute(
          CellConfigAttributes.DISPLAY_CONVERTER,
          PricingTypeBean.getDisplayConverter(),
          DisplayMode.NORMAL,
          FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + 4);

      configRegistry.registerConfigAttribute(
          CellConfigAttributes.DISPLAY_CONVERTER,
          PricingTypeBean.getDisplayConverter(),
          DisplayMode.NORMAL,
          "PRICING_TYPE_PROP_NAME");
    }
  {
    this.defaultHAlign = HorizontalAlignmentEnum.LEFT;
    this.defaultCellPainter =
        new BackgroundPainter(
            new PaddingDecorator(new TextPainter(false, false), 0, 5, 0, 5, false));

    // column header styling
    this.cHeaderHAlign = HorizontalAlignmentEnum.LEFT;
    this.cHeaderFont = GUIHelper.DEFAULT_FONT;
    this.cHeaderCellPainter = new PaddingDecorator(new TextPainter(), 0, 5, 0, 5);

    // column header selection style
    this.cHeaderSelectionFont = GUIHelper.DEFAULT_FONT;
    this.cHeaderSelectionCellPainter =
        new BackgroundPainter(
            new PaddingDecorator(new TextPainter(false, false), 0, 5, 0, 5, false));

    // row header styling
    this.rHeaderFont = GUIHelper.DEFAULT_FONT;

    // row header selection style
    this.rHeaderSelectionFont = GUIHelper.DEFAULT_FONT;
    this.rHeaderSelectionCellPainter = new TextPainter();

    // no alternate row styling
    this.evenRowBgColor = GUIHelper.COLOR_WHITE;
    this.oddRowBgColor = GUIHelper.COLOR_WHITE;

    // default selection style
    this.defaultSelectionBgColor = GUIHelper.COLOR_LIST_SELECTION;
    this.defaultSelectionFgColor = GUIHelper.COLOR_WHITE;
    this.defaultSelectionFont = GUIHelper.DEFAULT_FONT;

    // selection anchor
    this.selectionAnchorSelectionBgColor = GUIHelper.COLOR_LIST_SELECTION;
    this.selectionAnchorSelectionFgColor = GUIHelper.COLOR_WHITE;
    this.selectionAnchorBorderStyle = new BorderStyle(1, GUIHelper.COLOR_BLUE, LineStyleEnum.SOLID);

    // column/row group header style
    this.cGroupHeaderHAlign = HorizontalAlignmentEnum.CENTER;
    this.cGroupHeaderCellPainter = new ColumnGroupHeaderTextPainter();
    this.rGroupHeaderCellPainter =
        new BackgroundPainter(
            new PaddingDecorator(
                new RowGroupHeaderTextPainter(
                    new VerticalTextPainter(false, false), CellEdgeEnum.BOTTOM, false, 2, true),
                0,
                0,
                2,
                0,
                false));

    // sort header styling
    this.sortHeaderCellPainter =
        new BackgroundPainter(
            new PaddingDecorator(
                new SortableHeaderTextPainter(
                    new TextPainter(false, false),
                    CellEdgeEnum.RIGHT,
                    new SortIconPainter(false),
                    false,
                    0,
                    false),
                0,
                2,
                0,
                5,
                false));
    this.selectedSortHeaderCellPainter =
        new BackgroundPainter(
            new PaddingDecorator(
                new SortableHeaderTextPainter(
                    new TextPainter(false, false),
                    CellEdgeEnum.RIGHT,
                    new SortIconPainter(false, true),
                    false,
                    0,
                    false),
                0,
                2,
                0,
                5,
                false));

    TreeImagePainter treeImagePainter =
        new TreeImagePainter(
            false,
            GUIHelper.getImage("right"),
            GUIHelper.getImage("right_down"),
            null); //$NON-NLS-1$//$NON-NLS-2$
    this.treeStructurePainter =
        new BackgroundPainter(
            new PaddingDecorator(
                new IndentedTreeImagePainter(
                    10, null, CellEdgeEnum.LEFT, treeImagePainter, false, 2, true),
                0,
                5,
                0,
                5,
                false));

    TreeImagePainter treeSelectionImagePainter =
        new TreeImagePainter(
            false,
            GUIHelper.getImage("right_inv"),
            GUIHelper.getImage("right_down_inv"),
            null); //$NON-NLS-1$//$NON-NLS-2$
    this.treeStructureSelectionPainter =
        new BackgroundPainter(
            new PaddingDecorator(
                new IndentedTreeImagePainter(
                    10, null, CellEdgeEnum.LEFT, treeSelectionImagePainter, false, 2, true),
                0,
                5,
                0,
                5,
                false));

    FontData summaryRowFontData = GUIHelper.DEFAULT_FONT.getFontData()[0];
    summaryRowFontData.setStyle(SWT.BOLD);
    this.summaryRowFont = GUIHelper.getFont(summaryRowFontData);
    this.summaryRowHAlign = HorizontalAlignmentEnum.RIGHT;
    this.summaryRowBgColor = GUIHelper.COLOR_WIDGET_LIGHT_SHADOW;

    this.summaryRowSelectionFont = GUIHelper.getFont(summaryRowFontData);
    this.summaryRowSelectionBgColor = GUIHelper.COLOR_WIDGET_DARK_SHADOW;

    this.renderCornerGridLines = true;
    this.renderColumnHeaderGridLines = true;
  }