Search in sources :

Example 1 with ViewportLayer

use of org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer in project nebula.widgets.nattable by eclipse.

the class ShowColumnPositionsEventDiffTest method before.

@Before
public void before() {
    this.dataLayer = new DataLayerFixture(20, 20, 100, 40);
    this.hideShowLayer = new ColumnHideShowLayer(this.dataLayer);
    this.viewportLayer = new ViewportLayer(this.hideShowLayer);
    this.viewportLayer.setClientAreaProvider(new IClientAreaProvider() {

        @Override
        public Rectangle getClientArea() {
            return new Rectangle(0, 0, 800, 400);
        }
    });
    this.viewportLayer.setOriginX(this.viewportLayer.getStartXOfColumnPosition(2));
    this.viewportLayer.setOriginY(this.viewportLayer.getStartYOfRowPosition(2));
    this.event = new ShowColumnPositionsEvent(this.dataLayer, Arrays.asList(new Integer[] { 2, 4, 7, 8, 9 }));
}
Also used : IClientAreaProvider(org.eclipse.nebula.widgets.nattable.util.IClientAreaProvider) DataLayerFixture(org.eclipse.nebula.widgets.nattable.test.fixture.layer.DataLayerFixture) Rectangle(org.eclipse.swt.graphics.Rectangle) ColumnHideShowLayer(org.eclipse.nebula.widgets.nattable.hideshow.ColumnHideShowLayer) ViewportLayer(org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer) ShowColumnPositionsEvent(org.eclipse.nebula.widgets.nattable.hideshow.event.ShowColumnPositionsEvent) Before(org.junit.Before)

Example 2 with ViewportLayer

use of org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer in project nebula.widgets.nattable by eclipse.

the class ShowRowPositionsEventDiffTest method before.

@Before
public void before() {
    this.dataLayer = new DataLayerFixture(20, 20, 100, 40);
    this.hideShowLayer = new RowHideShowLayer(this.dataLayer);
    this.viewportLayer = new ViewportLayer(this.hideShowLayer);
    this.viewportLayer.setClientAreaProvider(new IClientAreaProvider() {

        @Override
        public Rectangle getClientArea() {
            return new Rectangle(0, 0, 800, 400);
        }
    });
    this.viewportLayer.setOriginX(this.viewportLayer.getStartXOfColumnPosition(2));
    this.viewportLayer.setOriginY(this.viewportLayer.getStartYOfRowPosition(2));
    this.event = new ShowRowPositionsEvent(this.dataLayer, Arrays.asList(new Integer[] { 2, 4, 7, 8, 9 }));
}
Also used : IClientAreaProvider(org.eclipse.nebula.widgets.nattable.util.IClientAreaProvider) DataLayerFixture(org.eclipse.nebula.widgets.nattable.test.fixture.layer.DataLayerFixture) Rectangle(org.eclipse.swt.graphics.Rectangle) ViewportLayer(org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer) RowHideShowLayer(org.eclipse.nebula.widgets.nattable.hideshow.RowHideShowLayer) Before(org.junit.Before)

Example 3 with ViewportLayer

use of org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer in project nebula.widgets.nattable by eclipse.

the class CompositeFreezeLayerHideShowTest method setup.

@Before
public void setup() {
    this.dataLayer = new DataLayer(this.testDataProvider);
    this.reorderLayer = new ColumnReorderLayer(this.dataLayer);
    this.rowHideShowLayer = new RowHideShowLayer(this.reorderLayer);
    this.columnHideShowLayer = new ColumnHideShowLayer(this.rowHideShowLayer);
    this.selectionLayer = new SelectionLayer(this.columnHideShowLayer);
    this.viewportLayer = new ViewportLayer(this.selectionLayer);
    this.freezeLayer = new FreezeLayer(this.selectionLayer);
    this.compositeFreezeLayer = new CompositeFreezeLayer(this.freezeLayer, this.viewportLayer, this.selectionLayer);
    this.compositeFreezeLayer.setClientAreaProvider(new IClientAreaProvider() {

        @Override
        public Rectangle getClientArea() {
            return new Rectangle(0, 0, 600, 150);
        }
    });
}
Also used : DataLayer(org.eclipse.nebula.widgets.nattable.layer.DataLayer) IClientAreaProvider(org.eclipse.nebula.widgets.nattable.util.IClientAreaProvider) SelectionLayer(org.eclipse.nebula.widgets.nattable.selection.SelectionLayer) Rectangle(org.eclipse.swt.graphics.Rectangle) ColumnReorderLayer(org.eclipse.nebula.widgets.nattable.reorder.ColumnReorderLayer) ColumnHideShowLayer(org.eclipse.nebula.widgets.nattable.hideshow.ColumnHideShowLayer) ViewportLayer(org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer) RowHideShowLayer(org.eclipse.nebula.widgets.nattable.hideshow.RowHideShowLayer) Before(org.junit.Before)

Example 4 with ViewportLayer

use of org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer in project nebula.widgets.nattable by eclipse.

the class RowSelectionTraversalTest method setUp.

@Before
public void setUp() {
    // only use 10 columns to make the test cases easier
    String[] propertyNames = Arrays.copyOfRange(RowDataListFixture.getPropertyNames(), 0, 10);
    IRowDataProvider<RowDataFixture> bodyDataProvider = new ListDataProvider<RowDataFixture>(RowDataListFixture.getList(10), new ReflectiveColumnPropertyAccessor<RowDataFixture>(propertyNames));
    this.selectionLayer = new SelectionLayer(new DataLayer(bodyDataProvider));
    this.selectionLayer.setSelectionModel(new RowSelectionModel<RowDataFixture>(this.selectionLayer, bodyDataProvider, new IRowIdAccessor<RowDataFixture>() {

        @Override
        public Serializable getRowId(RowDataFixture rowObject) {
            return rowObject.getSecurity_id();
        }
    }));
    this.viewportLayer = new ViewportLayer(this.selectionLayer);
}
Also used : IRowIdAccessor(org.eclipse.nebula.widgets.nattable.data.IRowIdAccessor) ListDataProvider(org.eclipse.nebula.widgets.nattable.data.ListDataProvider) DataLayer(org.eclipse.nebula.widgets.nattable.layer.DataLayer) ViewportLayer(org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer) RowDataFixture(org.eclipse.nebula.widgets.nattable.dataset.fixture.data.RowDataFixture) Before(org.junit.Before)

Example 5 with ViewportLayer

use of org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer in project nebula.widgets.nattable by eclipse.

the class ResizeEventDiffTest method before.

@Before
public void before() {
    DataLayerFixture dataLayer = new DataLayerFixture(20, 20, 100, 40);
    this.viewportLayer = new ViewportLayer(dataLayer);
    this.viewportLayer.setClientAreaProvider(new IClientAreaProvider() {

        @Override
        public Rectangle getClientArea() {
            return new Rectangle(0, 0, 400, 400);
        }
    });
    this.viewportLayer.setOriginX(this.viewportLayer.getStartXOfColumnPosition(2));
    this.viewportLayer.setOriginY(this.viewportLayer.getStartYOfRowPosition(2));
    this.event = new ColumnResizeEvent(dataLayer, 2);
}
Also used : IClientAreaProvider(org.eclipse.nebula.widgets.nattable.util.IClientAreaProvider) DataLayerFixture(org.eclipse.nebula.widgets.nattable.test.fixture.layer.DataLayerFixture) Rectangle(org.eclipse.swt.graphics.Rectangle) ColumnResizeEvent(org.eclipse.nebula.widgets.nattable.resize.event.ColumnResizeEvent) ViewportLayer(org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer) Before(org.junit.Before)

Aggregations

ViewportLayer (org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer)96 DataLayer (org.eclipse.nebula.widgets.nattable.layer.DataLayer)77 NatTable (org.eclipse.nebula.widgets.nattable.NatTable)71 SelectionLayer (org.eclipse.nebula.widgets.nattable.selection.SelectionLayer)71 IDataProvider (org.eclipse.nebula.widgets.nattable.data.IDataProvider)56 ColumnHeaderLayer (org.eclipse.nebula.widgets.nattable.grid.layer.ColumnHeaderLayer)53 ILayer (org.eclipse.nebula.widgets.nattable.layer.ILayer)48 DefaultRowHeaderDataProvider (org.eclipse.nebula.widgets.nattable.grid.data.DefaultRowHeaderDataProvider)41 RowHeaderLayer (org.eclipse.nebula.widgets.nattable.grid.layer.RowHeaderLayer)41 DefaultNatTableStyleConfiguration (org.eclipse.nebula.widgets.nattable.config.DefaultNatTableStyleConfiguration)40 DefaultColumnHeaderDataProvider (org.eclipse.nebula.widgets.nattable.grid.data.DefaultColumnHeaderDataProvider)39 DefaultCornerDataProvider (org.eclipse.nebula.widgets.nattable.grid.data.DefaultCornerDataProvider)39 CornerLayer (org.eclipse.nebula.widgets.nattable.grid.layer.CornerLayer)39 GridLayer (org.eclipse.nebula.widgets.nattable.grid.layer.GridLayer)39 HashMap (java.util.HashMap)38 ListDataProvider (org.eclipse.nebula.widgets.nattable.data.ListDataProvider)34 DefaultRowHeaderDataLayer (org.eclipse.nebula.widgets.nattable.grid.layer.DefaultRowHeaderDataLayer)34 DefaultColumnHeaderDataLayer (org.eclipse.nebula.widgets.nattable.grid.layer.DefaultColumnHeaderDataLayer)31 CompositeLayer (org.eclipse.nebula.widgets.nattable.layer.CompositeLayer)25 ColumnReorderLayer (org.eclipse.nebula.widgets.nattable.reorder.ColumnReorderLayer)25