Search in sources :

Example 1 with GradientBackgroundPainter

use of org.eclipse.nebula.widgets.nattable.painter.cell.GradientBackgroundPainter in project nebula.widgets.nattable by eclipse.

the class TextPainter_Examples method createExampleControl.

@Override
public Control createExampleControl(Composite parent) {
    parent.setLayout(new GridLayout(1, false));
    GridDataFactory.fillDefaults().grab(true, true).applyTo(parent);
    Composite tableContainer = new Composite(parent, SWT.NONE);
    tableContainer.setLayout(new GridLayout(6, true));
    GridDataFactory.fillDefaults().grab(true, true).applyTo(tableContainer);
    createNatTable(tableContainer, new GradientBackgroundPainter(new TextPainter(false, false, false), true));
    createNatTable(tableContainer, new TextPainter(true, true, false));
    createNatTable(tableContainer, new TextPainter(false, true, true));
    createNatTable(tableContainer, new TextPainter(true, true, true));
    createNatTable(tableContainer, new TextPainter(true, true, 5, true));
    createNatTable(tableContainer, new PaddingDecorator(new TextPainter(true, true, 5, true), 5));
    createVerticalHeaderNatTable(tableContainer, new VerticalTextPainter(false, true, false));
    createVerticalHeaderNatTable(tableContainer, new VerticalTextPainter(true, true, false));
    createVerticalHeaderNatTable(tableContainer, new GradientBackgroundPainter(new VerticalTextPainter(false, false, true)));
    createVerticalHeaderNatTable(tableContainer, new VerticalTextPainter(true, true, true));
    createVerticalHeaderNatTable(tableContainer, new VerticalTextPainter(true, true, 5, true));
    createVerticalHeaderNatTable(tableContainer, new PaddingDecorator(new VerticalTextPainter(true, true, 5, true), 5));
    TextPainter underlineTextPainer = new TextPainter();
    underlineTextPainer.setUnderline(true);
    createNatTable2(tableContainer, underlineTextPainer);
    TextPainter strikethroughTextPainer = new TextPainter();
    strikethroughTextPainer.setStrikethrough(true);
    createNatTable2(tableContainer, strikethroughTextPainer);
    TextPainter underlineStrikethroughTextPainer = new TextPainter();
    underlineStrikethroughTextPainer.setUnderline(true);
    underlineStrikethroughTextPainer.setStrikethrough(true);
    createNatTable2(tableContainer, underlineStrikethroughTextPainer);
    VerticalTextPainter vunderlineTextPainer = new VerticalTextPainter(true, true, true);
    vunderlineTextPainer.setUnderline(true);
    createVerticalHeaderNatTable(tableContainer, vunderlineTextPainer);
    VerticalTextPainter vstrikethroughTextPainer = new VerticalTextPainter(true, true, true);
    vstrikethroughTextPainer.setStrikethrough(true);
    createVerticalHeaderNatTable(tableContainer, vstrikethroughTextPainer);
    VerticalTextPainter vunderlineStrikethroughTextPainer = new VerticalTextPainter(true, true, true);
    vunderlineStrikethroughTextPainer.setUnderline(true);
    vunderlineStrikethroughTextPainer.setStrikethrough(true);
    createVerticalHeaderNatTable(tableContainer, vunderlineStrikethroughTextPainer);
    return tableContainer;
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) PaddingDecorator(org.eclipse.nebula.widgets.nattable.painter.cell.decorator.PaddingDecorator) VerticalTextPainter(org.eclipse.nebula.widgets.nattable.painter.cell.VerticalTextPainter) TextPainter(org.eclipse.nebula.widgets.nattable.painter.cell.TextPainter) GradientBackgroundPainter(org.eclipse.nebula.widgets.nattable.painter.cell.GradientBackgroundPainter) VerticalTextPainter(org.eclipse.nebula.widgets.nattable.painter.cell.VerticalTextPainter)

Aggregations

GradientBackgroundPainter (org.eclipse.nebula.widgets.nattable.painter.cell.GradientBackgroundPainter)1 TextPainter (org.eclipse.nebula.widgets.nattable.painter.cell.TextPainter)1 VerticalTextPainter (org.eclipse.nebula.widgets.nattable.painter.cell.VerticalTextPainter)1 PaddingDecorator (org.eclipse.nebula.widgets.nattable.painter.cell.decorator.PaddingDecorator)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Composite (org.eclipse.swt.widgets.Composite)1