use of org.eclipse.nebula.widgets.nattable.config.ConfigRegistry in project nebula.widgets.nattable by eclipse.
the class AutoResizeColumnsTest method setUp.
@Before
public void setUp() {
this.configRegistry = new ConfigRegistry();
new DefaultNatTableStyleConfiguration().configureRegistry(this.configRegistry);
this.img = new Image(Display.getDefault(), new Rectangle(0, 0, 200, 150));
this.gcFactory = new GCFactory(this.img);
// Use a common, foxed width font to avoid failing the test on a
// different platform
Font normalFont = GUIHelper.getFont(new FontData("Courier", 8, SWT.NORMAL));
Style cellStyle = new Style();
cellStyle.setAttributeValue(CellStyleAttributes.FONT, normalFont);
this.configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyle, DisplayMode.NORMAL);
}
use of org.eclipse.nebula.widgets.nattable.config.ConfigRegistry in project nebula.widgets.nattable by eclipse.
the class RowSearchStrategyTest method setUp.
@Before
public void setUp() {
this.gridLayer = new GridLayerFixture();
this.layer = this.gridLayer.getBodyLayer().getSelectionLayer();
this.configRegistry = new ConfigRegistry();
new DefaultNatTableStyleConfiguration().configureRegistry(this.configRegistry);
}
use of org.eclipse.nebula.widgets.nattable.config.ConfigRegistry in project nebula.widgets.nattable by eclipse.
the class SelectionSearchStrategyTest method setUp.
@Before
public void setUp() {
this.bodyDataProvider = new IDataProvider() {
@Override
public int getColumnCount() {
return GridLayerFixture.bodyDataProvider.getColumnCount();
}
@Override
public int getRowCount() {
return GridLayerFixture.bodyDataProvider.getRowCount();
}
@Override
public Object getDataValue(int columnIndex, int rowIndex) {
if (columnIndex == 0 || columnIndex == 9) {
return CELL_VALUE;
}
return GridLayerFixture.bodyDataProvider.getDataValue(columnIndex, rowIndex);
}
@Override
public void setDataValue(int columnIndex, int rowIndex, Object newValue) {
throw new UnsupportedOperationException();
}
};
this.gridLayer = new DefaultGridLayer(this.bodyDataProvider, GridLayerFixture.colHeaderDataProvider, GridLayerFixture.rowHeaderDataProvider, GridLayerFixture.cornerDataProvider);
this.gridLayer.setClientAreaProvider(new IClientAreaProvider() {
@Override
public Rectangle getClientArea() {
return new Rectangle(0, 0, 1050, 250);
}
});
this.gridLayer.doCommand(new ClientAreaResizeCommand(new Shell(Display.getDefault(), SWT.V_SCROLL | SWT.H_SCROLL)));
this.selectionLayer = this.gridLayer.getBodyLayer().getSelectionLayer();
this.configRegistry = new ConfigRegistry();
new DefaultNatTableStyleConfiguration().configureRegistry(this.configRegistry);
}
use of org.eclipse.nebula.widgets.nattable.config.ConfigRegistry in project nebula.widgets.nattable by eclipse.
the class SummaryRowIntegrationTest method initLayerStackWithSummaryRow.
@Before
public void initLayerStackWithSummaryRow() {
this.dataList = RowDataListFixture.getList().subList(0, 4);
// Rows 0, 1, 2, 3; Summary row would be position 4
assertEquals(4, this.dataList.size());
this.dataProvider = new ListDataProvider<RowDataFixture>(this.dataList, new ReflectiveColumnPropertyAccessor<RowDataFixture>(RowDataListFixture.getPropertyNames()));
IConfigRegistry configRegistry = new ConfigRegistry();
this.dataLayer = new DataLayer(this.dataProvider);
this.summaryRowLayer = new SummaryRowLayer(this.dataLayer, configRegistry);
IUniqueIndexLayer columnReorderLayer = new ColumnReorderLayer(this.summaryRowLayer);
IUniqueIndexLayer columnHideShowLayer = new ColumnHideShowLayer(columnReorderLayer);
IUniqueIndexLayer selectionLayer = new SelectionLayer(columnHideShowLayer);
this.layerStackWithSummary = new ViewportLayer(selectionLayer);
// NatTableFixture initializes the client area
this.natTable = new NatTableFixture(this.layerStackWithSummary, false);
this.natTable.setConfigRegistry(configRegistry);
this.natTable.addConfiguration(new TestSummaryRowConfiguration());
this.natTable.configure();
}
use of org.eclipse.nebula.widgets.nattable.config.ConfigRegistry in project nebula.widgets.nattable by eclipse.
the class TickUpdateCommandHandlerTest method setup.
@Before
public void setup() {
DataLayerFixture bodyDataLayer = new DataLayerFixture();
this.selectionLayer = new SelectionLayer(bodyDataLayer);
this.selectionLayer.setSelectedCell(1, 1);
this.testConfigRegistry = new ConfigRegistry();
this.testConfigRegistry.registerConfigAttribute(TickUpdateConfigAttributes.UPDATE_HANDLER, new TickUpdateHandlerFixture());
this.testConfigRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITABLE_RULE, IEditableRule.ALWAYS_EDITABLE);
registerCellStyleAccumulators(bodyDataLayer);
this.commandHandler = new TickUpdateCommandHandler(this.selectionLayer);
}
Aggregations