Search in sources :

Example 16 with DummyGridLayerStack

use of org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack in project nebula.widgets.nattable by eclipse.

the class PersistenceIntegrationTest method setup.

@Before
public void setup() {
    this.natTableFixture = new NatTableFixture(new Shell(), new DummyGridLayerStack() {

        @Override
        protected void init(IUniqueIndexLayer bodyDataLayer, IUniqueIndexLayer columnHeaderDataLayer, IUniqueIndexLayer rowHeaderDataLayer, IUniqueIndexLayer cornerDataLayer) {
            RowReorderLayer rowReorderLayer = new RowReorderLayer(bodyDataLayer);
            super.init(rowReorderLayer, columnHeaderDataLayer, rowHeaderDataLayer, cornerDataLayer);
        }
    });
    this.properties = new Properties();
}
Also used : Shell(org.eclipse.swt.widgets.Shell) DummyGridLayerStack(org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack) NatTableFixture(org.eclipse.nebula.widgets.nattable.test.fixture.NatTableFixture) IUniqueIndexLayer(org.eclipse.nebula.widgets.nattable.layer.IUniqueIndexLayer) Properties(java.util.Properties) RowReorderLayer(org.eclipse.nebula.widgets.nattable.reorder.RowReorderLayer) Before(org.junit.Before)

Example 17 with DummyGridLayerStack

use of org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack in project nebula.widgets.nattable by eclipse.

the class SelectionIntegrationTest method setup.

@Before
public void setup() {
    this.layerStack = new DummyGridLayerStack(10, 5);
    this.selectionLayer = this.layerStack.getBodyLayer().getSelectionLayer();
    this.natTable = new NatTableFixture(this.layerStack, 1000, 200, true);
}
Also used : DummyGridLayerStack(org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack) NatTableFixture(org.eclipse.nebula.widgets.nattable.test.fixture.NatTableFixture) Before(org.junit.Before)

Example 18 with DummyGridLayerStack

use of org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack in project nebula.widgets.nattable by eclipse.

the class CellLabelMouseEventMatcherTest method setUpCustomCellLabel.

@Before
public void setUpCustomCellLabel() {
    DummyGridLayerStack gridLayerStack = new DummyGridLayerStack(5, 5);
    this.natTableFixture = new NatTableFixture(gridLayerStack);
    // Register custom label
    DataLayer bodyDataLayer = (DataLayer) gridLayerStack.getBodyDataLayer();
    this.natTableFixture.registerLabelOnColumn(bodyDataLayer, 0, TEST_LABEL);
}
Also used : DataLayer(org.eclipse.nebula.widgets.nattable.layer.DataLayer) DummyGridLayerStack(org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack) NatTableFixture(org.eclipse.nebula.widgets.nattable.test.fixture.NatTableFixture) Before(org.junit.Before)

Example 19 with DummyGridLayerStack

use of org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack in project nebula.widgets.nattable by eclipse.

the class _000_Styled_grid method setup.

private NatTable setup(Composite parent) {
    DummyGridLayerStack gridLayer = new DummyGridLayerStack();
    final NatTable natTable = new NatTable(parent, gridLayer, false);
    DataLayer bodyDataLayer = (DataLayer) gridLayer.getBodyDataLayer();
    // Add an AggregateConfigLabelAccumulator - we can add other
    // accumulators to this as required
    AggregateConfigLabelAccumulator aggregrateConfigLabelAccumulator = new AggregateConfigLabelAccumulator();
    bodyDataLayer.setConfigLabelAccumulator(aggregrateConfigLabelAccumulator);
    ColumnOverrideLabelAccumulator columnLabelAccumulator = new ColumnOverrideLabelAccumulator(bodyDataLayer);
    ColumnOverrideLabelAccumulator bodyLabelAccumulator = new ColumnOverrideLabelAccumulator(bodyDataLayer);
    aggregrateConfigLabelAccumulator.add(columnLabelAccumulator);
    aggregrateConfigLabelAccumulator.add(bodyLabelAccumulator);
    // Add a label for the highlighted column
    // We will add a style for this label to the config registry in a bit
    bodyLabelAccumulator.registerColumnOverrides(2, BODY_LABEL_1);
    columnLabelAccumulator.registerColumnOverrides(2, COLUMN_LABEL_1);
    // Register a command handler for the StyleEditorDialog
    DisplayColumnStyleEditorCommandHandler styleChooserCommandHandler = new DisplayColumnStyleEditorCommandHandler(gridLayer.getBodyLayer().getSelectionLayer(), columnLabelAccumulator, natTable.getConfigRegistry());
    DefaultBodyLayerStack bodyLayer = gridLayer.getBodyLayer();
    bodyLayer.registerCommandHandler(styleChooserCommandHandler);
    // Register the style editor as persistable
    // This will persist the style applied to the columns when
    // NatTable#saveState is invoked
    bodyLayer.registerPersistable(styleChooserCommandHandler);
    bodyLayer.registerPersistable(columnLabelAccumulator);
    return natTable;
}
Also used : DataLayer(org.eclipse.nebula.widgets.nattable.layer.DataLayer) DummyGridLayerStack(org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack) NatTable(org.eclipse.nebula.widgets.nattable.NatTable) ColumnOverrideLabelAccumulator(org.eclipse.nebula.widgets.nattable.layer.cell.ColumnOverrideLabelAccumulator) DisplayColumnStyleEditorCommandHandler(org.eclipse.nebula.widgets.nattable.style.editor.command.DisplayColumnStyleEditorCommandHandler) DefaultBodyLayerStack(org.eclipse.nebula.widgets.nattable.layer.stack.DefaultBodyLayerStack) AggregateConfigLabelAccumulator(org.eclipse.nebula.widgets.nattable.layer.cell.AggregateConfigLabelAccumulator)

Example 20 with DummyGridLayerStack

use of org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack in project nebula.widgets.nattable by eclipse.

the class ZoomedViewportSelectionDataLayerExample method createExampleControl.

@Override
public Control createExampleControl(Composite parent) {
    ZoomLayer zoomLayer = new ZoomLayer(new DummyGridLayerStack());
    zoomLayer.setZoomFactor(3.0f);
    return new NatTable(parent, zoomLayer);
}
Also used : DummyGridLayerStack(org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack) NatTable(org.eclipse.nebula.widgets.nattable.NatTable) ZoomLayer(org.eclipse.nebula.widgets.nattable.layer.ZoomLayer)

Aggregations

DummyGridLayerStack (org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack)38 Test (org.junit.Test)23 GridLayer (org.eclipse.nebula.widgets.nattable.grid.layer.GridLayer)13 NatTableFixture (org.eclipse.nebula.widgets.nattable.test.fixture.NatTableFixture)13 NatTable (org.eclipse.nebula.widgets.nattable.NatTable)11 DataLayer (org.eclipse.nebula.widgets.nattable.layer.DataLayer)9 AbstractDpiConverter (org.eclipse.nebula.widgets.nattable.layer.AbstractDpiConverter)8 IDpiConverter (org.eclipse.nebula.widgets.nattable.layer.IDpiConverter)8 ConfigureScalingCommand (org.eclipse.nebula.widgets.nattable.layer.command.ConfigureScalingCommand)8 Before (org.junit.Before)6 ViewportLayer (org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer)5 Shell (org.eclipse.swt.widgets.Shell)4 IUniqueIndexLayer (org.eclipse.nebula.widgets.nattable.layer.IUniqueIndexLayer)3 SelectColumnCommand (org.eclipse.nebula.widgets.nattable.selection.command.SelectColumnCommand)3 LayerListenerFixture (org.eclipse.nebula.widgets.nattable.test.fixture.layer.LayerListenerFixture)3 Range (org.eclipse.nebula.widgets.nattable.coordinate.Range)2 RowHideCommand (org.eclipse.nebula.widgets.nattable.hideshow.command.RowHideCommand)2 HideRowPositionsEvent (org.eclipse.nebula.widgets.nattable.hideshow.event.HideRowPositionsEvent)2 ColumnResizeCommand (org.eclipse.nebula.widgets.nattable.resize.command.ColumnResizeCommand)2 SelectRowsCommand (org.eclipse.nebula.widgets.nattable.selection.command.SelectRowsCommand)2