use of org.eclipse.nebula.widgets.nattable.reorder.ColumnReorderLayer in project nebula.widgets.nattable by eclipse.
the class HierarchicalTreeLayerTest method setup.
@Before
public void setup() {
// de-normalize the object graph without parent structure objects
this.data = HierarchicalHelper.deNormalize(CarService.getInput(), false, CarService.PROPERTY_NAMES_COMPACT);
HierarchicalReflectiveColumnPropertyAccessor columnPropertyAccessor = new HierarchicalReflectiveColumnPropertyAccessor(CarService.PROPERTY_NAMES_COMPACT);
this.bodyDataProvider = new ListDataProvider<>(this.data, columnPropertyAccessor);
HierarchicalSpanningDataProvider spanningDataProvider = new HierarchicalSpanningDataProvider(this.bodyDataProvider, CarService.PROPERTY_NAMES_COMPACT);
this.bodyDataLayer = new SpanningDataLayer(spanningDataProvider);
// simply apply labels for every column by index
this.bodyDataLayer.setConfigLabelAccumulator(new ColumnLabelAccumulator());
this.columnReorderLayer = new ColumnReorderLayer(this.bodyDataLayer);
this.selectionLayer = new SelectionLayer(this.columnReorderLayer);
this.treeLayer = new HierarchicalTreeLayer(this.selectionLayer, this.data, CarService.PROPERTY_NAMES_COMPACT);
this.layerListener = new LayerListenerFixture();
this.treeLayer.addLayerListener(this.layerListener);
}
use of org.eclipse.nebula.widgets.nattable.reorder.ColumnReorderLayer 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.reorder.ColumnReorderLayer in project nebula.widgets.nattable by eclipse.
the class FreezeLayerTest method setup.
@Before
public void setup() {
this.reorderLayer = new ColumnReorderLayer(new BaseDataLayerFixture(10, 10));
this.hideShowLayer = new ColumnHideShowLayer(this.reorderLayer);
this.freezeLayer = new FreezeLayer(this.hideShowLayer);
this.freezeLayer.setTopLeftPosition(1, 0);
this.freezeLayer.setBottomRightPosition(3, 3);
}
use of org.eclipse.nebula.widgets.nattable.reorder.ColumnReorderLayer in project nebula.widgets.nattable by eclipse.
the class ColumnGroupReorderLayerTest method setUp.
@Before
public void setUp() {
this.modelFixture = new ColumnGroupModelFixture();
this.reorderLayer = new ColumnReorderLayer(new BaseDataLayerFixture(24, 20));
this.layer = new ColumnGroupReorderLayer(this.reorderLayer, this.modelFixture);
}
use of org.eclipse.nebula.widgets.nattable.reorder.ColumnReorderLayer in project nebula.widgets.nattable by eclipse.
the class MultiColumnResizeCommandTest method getColumnWidthWhenTheColumnPositionsHaveBeenConverted.
@Test
public void getColumnWidthWhenTheColumnPositionsHaveBeenConverted() {
DataLayerFixture dataLayer = new DataLayerFixture();
// Indexes re-ordered: 4 1 0 2 3
ColumnReorderLayer reorderLayerFixture = new ColumnReorderLayerFixture(dataLayer);
MultiColumnResizeCommand resizeCommand = new MultiColumnResizeCommand(reorderLayerFixture, new int[] { 1, 2 }, new int[] { 100, 150 });
reorderLayerFixture.doCommand(resizeCommand);
// As the Commands goes down the stack - positions might get converted
// to entirely different values.
assertEquals(-1, resizeCommand.getCommonColumnWidth());
assertEquals(-1, resizeCommand.getColumnWidth(5));
assertEquals(-1, resizeCommand.getColumnWidth(12));
assertEquals(100, resizeCommand.getColumnWidth(1));
assertEquals(150, resizeCommand.getColumnWidth(0));
}
Aggregations