use of org.eclipse.nebula.widgets.nattable.hideshow.ColumnHideShowLayer in project nebula.widgets.nattable by eclipse.
the class ColumnChooserUtilsTest method getVisibleColumnEntries.
@Test
public void getVisibleColumnEntries() throws Exception {
DefaultGridLayer gridLayer = new DefaultGridLayer(RowDataListFixture.getList(), RowDataListFixture.getPropertyNames(), RowDataListFixture.getPropertyToLabelMap());
ColumnHideShowLayer columnHideShowLayer = gridLayer.getBodyLayer().getColumnHideShowLayer();
ColumnHeaderLayer columnHeaderLayer = gridLayer.getColumnHeaderLayer();
DataLayer columnHeaderDataLayer = (DataLayer) gridLayer.getColumnHeaderDataLayer();
List<ColumnEntry> visibleEntries = ColumnChooserUtils.getVisibleColumnsEntries(columnHideShowLayer, columnHeaderLayer, columnHeaderDataLayer);
// All columns shown
assertEquals(RowDataListFixture.getPropertyNames().length, visibleEntries.size());
// Hide a few columns
gridLayer.getBodyLayer().getColumnHideShowLayer().hideColumnPositions(Arrays.asList(1, 2, 3));
visibleEntries = ColumnChooserUtils.getVisibleColumnsEntries(columnHideShowLayer, columnHeaderLayer, columnHeaderDataLayer);
assertEquals(RowDataListFixture.getPropertyNames().length - 3, visibleEntries.size());
// Check the hidden entries
List<ColumnEntry> hiddenEntries = ColumnChooserUtils.getHiddenColumnEntries(columnHideShowLayer, columnHeaderLayer, columnHeaderDataLayer);
assertEquals(3, hiddenEntries.size());
}
use of org.eclipse.nebula.widgets.nattable.hideshow.ColumnHideShowLayer 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.hideshow.ColumnHideShowLayer 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.hideshow.ColumnHideShowLayer 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.hideshow.ColumnHideShowLayer in project nebula.widgets.nattable by eclipse.
the class HideSelectedColumnsTest method setUp.
@Before
public void setUp() {
this.columnHideShowLayer = new ColumnHideShowLayer(new DataLayerFixture());
this.selectionLayer = new SelectionLayer(this.columnHideShowLayer);
}
Aggregations