use of net.heartsome.cat.ts.ui.xliffeditor.nattable.painter.StatusPainter in project translationstudio8 by heartsome.
the class XLIFFEditorImplWithNatTable method addFlagLableToColumn.
/**
* 配置标签列的显示效果
* @param configRegistry
* 配置注册表
*/
private void addFlagLableToColumn(IConfigRegistry configRegistry) {
// Edit by Leakey 实现状态图片的动态显示
StatusPainter painter = new StatusPainter(bodyDataProvider);
// CellPainterDecorator flagPainter = new CellPainterDecorator(new BackgroundPainter(), CellEdgeEnum.RIGHT,
// painter);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, painter, DisplayMode.NORMAL, FLAG_CELL_LABEL);
// Set the color of the cell. This is picked up by the button painter to style the button
Style style = new Style();
FontData fd = GUIHelper.DEFAULT_FONT.getFontData()[0];
fd.setStyle(SWT.BOLD);
style.setAttributeValue(CellStyleAttributes.FONT, GUIHelper.getFont(fd));
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, style, DisplayMode.NORMAL, FLAG_CELL_LABEL);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, style, DisplayMode.SELECT, FLAG_CELL_LABEL);
}
Aggregations