Search in sources :

Example 1 with StatusPainter

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);
}
Also used : StatusPainter(net.heartsome.cat.ts.ui.xliffeditor.nattable.painter.StatusPainter) FontData(org.eclipse.swt.graphics.FontData) TagStyle(net.heartsome.cat.common.innertag.TagStyle) Style(net.sourceforge.nattable.style.Style)

Aggregations

TagStyle (net.heartsome.cat.common.innertag.TagStyle)1 StatusPainter (net.heartsome.cat.ts.ui.xliffeditor.nattable.painter.StatusPainter)1 Style (net.sourceforge.nattable.style.Style)1 FontData (org.eclipse.swt.graphics.FontData)1