use of org.eclipse.nebula.widgets.nattable.util.IClientAreaProvider 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 }));
}
use of org.eclipse.nebula.widgets.nattable.util.IClientAreaProvider 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 }));
}
use of org.eclipse.nebula.widgets.nattable.util.IClientAreaProvider 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);
}
});
}
use of org.eclipse.nebula.widgets.nattable.util.IClientAreaProvider in project nebula.widgets.nattable by eclipse.
the class FreezeHandlerTest method testFreezeRowResize.
@Test
public void testFreezeRowResize() {
this.compositeFreezeLayer.setClientAreaProvider(new IClientAreaProvider() {
@Override
public Rectangle getClientArea() {
return new Rectangle(0, 0, 1500, 400);
}
});
// Fire this command so that the viewport can be initialized
this.compositeFreezeLayer.doCommand(new ClientAreaResizeCommand(new Shell(Display.getDefault(), SWT.H_SCROLL | SWT.V_SCROLL)));
this.compositeFreezeLayer.doCommand(new FreezeRowCommand(this.compositeFreezeLayer, 2));
assertEquals(3, this.freezeLayer.getRowCount());
assertEquals(7, this.viewportLayer.getRowCount());
assertEquals(60, this.viewportLayer.getOrigin().getY());
this.compositeFreezeLayer.doCommand(new RowResizeCommand(this.freezeLayer, 2, 120));
assertEquals(3, this.freezeLayer.getRowCount());
assertEquals(7, this.viewportLayer.getRowCount());
assertEquals(160, this.viewportLayer.getOrigin().getY());
}
use of org.eclipse.nebula.widgets.nattable.util.IClientAreaProvider in project nebula.widgets.nattable by eclipse.
the class FreezeHandlerTest method setUp.
@Before
public void setUp() {
final DataLayer bodyDataLayer = new DataLayer(new DummyBodyDataProvider(10, 10));
final DefaultBodyLayerStack bodyLayer = new DefaultBodyLayerStack(bodyDataLayer);
this.selectionLayer = bodyLayer.getSelectionLayer();
this.freezeLayer = new FreezeLayer(this.selectionLayer);
this.compositeFreezeLayer = new CompositeFreezeLayer(this.freezeLayer, bodyLayer.getViewportLayer(), bodyLayer.getSelectionLayer());
this.viewportLayer = bodyLayer.getViewportLayer();
this.commandHandler = new FreezeCommandHandler(this.freezeLayer, this.viewportLayer, this.selectionLayer);
this.compositeFreezeLayer.registerCommandHandler(this.commandHandler);
this.compositeFreezeLayer.setClientAreaProvider(new IClientAreaProvider() {
@Override
public Rectangle getClientArea() {
return new Rectangle(0, 0, 600, 400);
}
});
// Shoot this command so that the viewport can be initialized
this.compositeFreezeLayer.doCommand(new ClientAreaResizeCommand(new Shell(Display.getDefault(), SWT.H_SCROLL | SWT.V_SCROLL)));
}
Aggregations