Search in sources :

Example 51 with DataLayerFixture

use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.DataLayerFixture in project nebula.widgets.nattable by eclipse.

the class EditTraversalStrategyLeftRightTest method setUp.

@Before
public void setUp() {
    this.dataLayer = new DataLayerFixture(10, 10, 100, 20);
    this.selectionLayer = new SelectionLayer(this.dataLayer);
    this.viewportLayer = new ViewportLayer(this.selectionLayer);
    this.viewportLayer.setRegionName(GridRegion.BODY);
    this.viewportLayer.addConfiguration(new DefaultEditBindings());
    this.viewportLayer.addConfiguration(new DefaultEditConfiguration());
    this.natTable = new NatTableFixture(this.viewportLayer);
    this.natTable.enableEditingOnAllCells();
    this.natTable.getConfigRegistry().registerConfigAttribute(EditConfigAttributes.CELL_EDITABLE_RULE, IEditableRule.NEVER_EDITABLE, DisplayMode.EDIT, NOT_EDITABLE);
    this.natTable.getConfigRegistry().registerConfigAttribute(EditConfigAttributes.OPEN_ADJACENT_EDITOR, Boolean.TRUE);
    this.natTable.registerLabelOnColumn(this.dataLayer, 2, NOT_EDITABLE);
    this.natTable.registerLabelOnColumn(this.dataLayer, 5, NOT_EDITABLE);
    this.natTable.registerLabelOnColumn(this.dataLayer, 6, NOT_EDITABLE);
    this.natTable.registerLabelOnColumn(this.dataLayer, 7, NOT_EDITABLE);
    this.natTable.registerLabelOnColumn(this.dataLayer, 8, NOT_EDITABLE);
    this.natTable.registerLabelOnColumn(this.dataLayer, 9, NOT_EDITABLE);
}
Also used : DefaultEditConfiguration(org.eclipse.nebula.widgets.nattable.edit.config.DefaultEditConfiguration) NatTableFixture(org.eclipse.nebula.widgets.nattable.test.fixture.NatTableFixture) DataLayerFixture(org.eclipse.nebula.widgets.nattable.test.fixture.layer.DataLayerFixture) ViewportLayer(org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer) DefaultEditBindings(org.eclipse.nebula.widgets.nattable.edit.config.DefaultEditBindings) Before(org.junit.Before)

Example 52 with DataLayerFixture

use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.DataLayerFixture in project nebula.widgets.nattable by eclipse.

the class HideSelectedRowsTest method setUp.

@Before
public void setUp() {
    this.rowHideShowLayer = new RowHideShowLayer(new DataLayerFixture());
    this.selectionLayer = new SelectionLayer(this.rowHideShowLayer);
}
Also used : DataLayerFixture(org.eclipse.nebula.widgets.nattable.test.fixture.layer.DataLayerFixture) RowHideShowLayer(org.eclipse.nebula.widgets.nattable.hideshow.RowHideShowLayer) Before(org.junit.Before)

Example 53 with DataLayerFixture

use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.DataLayerFixture in project nebula.widgets.nattable by eclipse.

the class SelectionLayerStructuralChangeEventHandlerTest method setup.

@Before
public void setup() {
    this.dataLayer = new DataLayerFixture(10, 10);
    DefaultBodyLayerStack bodyLayer = new DefaultBodyLayerStack(this.dataLayer);
    this.selectionLayer = bodyLayer.getSelectionLayer();
    this.selectionModel = this.selectionLayer.getSelectionModel();
}
Also used : DataLayerFixture(org.eclipse.nebula.widgets.nattable.test.fixture.layer.DataLayerFixture) DefaultBodyLayerStack(org.eclipse.nebula.widgets.nattable.layer.stack.DefaultBodyLayerStack) Before(org.junit.Before)

Example 54 with DataLayerFixture

use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.DataLayerFixture in project nebula.widgets.nattable by eclipse.

the class SelectionModelTest method before.

@Before
public void before() {
    SelectionLayer selectionLayer = new SelectionLayer(new DataLayerFixture(100, 100, 100, 40));
    this.model = new SelectionModel(selectionLayer);
}
Also used : SelectionLayer(org.eclipse.nebula.widgets.nattable.selection.SelectionLayer) DataLayerFixture(org.eclipse.nebula.widgets.nattable.test.fixture.layer.DataLayerFixture) SelectionModel(org.eclipse.nebula.widgets.nattable.selection.SelectionModel) Before(org.junit.Before)

Example 55 with DataLayerFixture

use of org.eclipse.nebula.widgets.nattable.test.fixture.layer.DataLayerFixture in project nebula.widgets.nattable by eclipse.

the class CellSelectionTraversalTest method setUp.

@Before
public void setUp() {
    this.selectionLayer = new SelectionLayer(new DataLayerFixture(10, 10, 100, 20));
    this.viewportLayer = new ViewportLayer(this.selectionLayer);
}
Also used : DataLayerFixture(org.eclipse.nebula.widgets.nattable.test.fixture.layer.DataLayerFixture) ViewportLayer(org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer) Before(org.junit.Before)

Aggregations

DataLayerFixture (org.eclipse.nebula.widgets.nattable.test.fixture.layer.DataLayerFixture)57 Test (org.junit.Test)28 Before (org.junit.Before)27 BaseDataLayerFixture (org.eclipse.nebula.widgets.nattable.test.fixture.layer.BaseDataLayerFixture)11 LayerListenerFixture (org.eclipse.nebula.widgets.nattable.test.fixture.layer.LayerListenerFixture)7 Rectangle (org.eclipse.swt.graphics.Rectangle)7 DefaultBodyLayerStack (org.eclipse.nebula.widgets.nattable.layer.stack.DefaultBodyLayerStack)6 ViewportLayer (org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer)6 NatTableFixture (org.eclipse.nebula.widgets.nattable.test.fixture.NatTableFixture)5 IClientAreaProvider (org.eclipse.nebula.widgets.nattable.util.IClientAreaProvider)5 SelectionLayer (org.eclipse.nebula.widgets.nattable.selection.SelectionLayer)4 ColumnOverrideLabelAccumulator (org.eclipse.nebula.widgets.nattable.layer.cell.ColumnOverrideLabelAccumulator)3 LayerCommandFixture (org.eclipse.nebula.widgets.nattable.test.fixture.command.LayerCommandFixture)3 ColumnGroupModelFixture (org.eclipse.nebula.widgets.nattable.test.fixture.group.ColumnGroupModelFixture)3 Properties (java.util.Properties)2 IConfigRegistry (org.eclipse.nebula.widgets.nattable.config.IConfigRegistry)2 IDataProvider (org.eclipse.nebula.widgets.nattable.data.IDataProvider)2 RowDataFixture (org.eclipse.nebula.widgets.nattable.dataset.fixture.data.RowDataFixture)2 ColumnHideShowLayer (org.eclipse.nebula.widgets.nattable.hideshow.ColumnHideShowLayer)2 RowHideShowLayer (org.eclipse.nebula.widgets.nattable.hideshow.RowHideShowLayer)2