Buttons not rendering [message #1385929] |
Thu, 12 June 2014 10:06 |
Swapnil Basak Messages: 12 Registered: June 2014 |
Junior Member |
|
|
In my CreateControl class
DefaultGridLayer gridLayer = new DefaultGridLayer (bodyDataProvider,columnHeaderDataProvider,rowHeaderDataProvider);
DefaultBodyLayerStack bodyLayer = gridLayer.getBodyLayer();
// Grid
RiskReportCustomLabel cellLabelAccumulator = new RiskReportCustomLabel(bodyLayer);
bodyLayer.setConfigLabelAccumulator(cellLabelAccumulator);
NatTable natTable = new NatTable(parent, gridLayer, false);
cellLabelAccumulator assigns RiskEditable.REFRESH to a particular cell. Then I add the config
natTable.addConfiguration(natTableConfiguration);
natTable.addConfiguration(rowStyleConfiguration);
natTable.addConfiguration(selectionStyle);
natTable.addConfiguration(new CopyPasteBindings());
natTable.addConfiguration(new RiskEditorConfiguration());
natTable.configure();
RiskEditorConfiguration calls this method
private void registerRefresh(IConfigRegistry configRegistry) {
Style style = new Style();
style.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, GUIHelper.COLOR_WHITE);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, style, DisplayMode.NORMAL, RiskEditable.REFRESH);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, style, DisplayMode.SELECT, RiskEditable.REFRESH);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER,new ButtonCellPainter(new CellPainterDecorator(new TextPainter(), CellEdgeEnum.RIGHT, new ImagePainter(GUIHelper.getImage("preferences")))),RiskEditable.REFRESH);
}
Now the particular cell doesn't render the button at all. However, the architecture is correct (changing it to GUIHelper.COLOR_BLACK makes the cell black).
Any help on this? I've spent a lot of time trying this out.
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03979 seconds