use of net.sourceforge.nattable.style.Style 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);
}
use of net.sourceforge.nattable.style.Style in project translationstudio8 by heartsome.
the class DefaultRowStyleConfiguration method configureEvenRowStyle.
protected void configureEvenRowStyle(IConfigRegistry configRegistry) {
Style cellStyle = new Style();
cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, evenRowBgColor);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyle, DisplayMode.NORMAL, AlternatingRowConfigLabelAccumulator.ODD_ROW_CONFIG_TYPE);
}
use of net.sourceforge.nattable.style.Style in project translationstudio8 by heartsome.
the class DefaultRowStyleConfiguration method configureOddRowStyle.
protected void configureOddRowStyle(IConfigRegistry configRegistry) {
Style cellStyle = new Style();
cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, oddRowBgColor);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyle, DisplayMode.NORMAL, AlternatingRowConfigLabelAccumulator.EVEN_ROW_CONFIG_TYPE);
}
use of net.sourceforge.nattable.style.Style in project translationstudio8 by heartsome.
the class DefaultNatTableStyleConfiguration method configureRegistry.
public void configureRegistry(IConfigRegistry configRegistry) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, cellPainter);
Style cellStyle = new Style();
cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, bgColor);
cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, fgColor);
cellStyle.setAttributeValue(CellStyleAttributes.FONT, font);
cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT, hAlign);
cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT, vAlign);
cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, borderStyle);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyle);
configRegistry.registerConfigAttribute(CellConfigAttributes.DISPLAY_CONVERTER, new DefaultDisplayConverter());
}
use of net.sourceforge.nattable.style.Style in project translationstudio8 by heartsome.
the class DisplayColumnStyleEditorCommandHandler method loadState.
public void loadState(String prefix, Properties properties) {
prefix = prefix + DOT + PERSISTENCE_PREFIX;
Set<Object> keySet = properties.keySet();
for (Object key : keySet) {
String keyString = (String) key;
// Relevant Key
if (keyString.contains(PERSISTENCE_PREFIX)) {
int colIndex = parseColumnIndexFromKey(keyString);
// Has the config label been processed
if (!stylesToPersist.keySet().contains(getConfigLabel(colIndex))) {
Style savedStyle = StylePersistor.loadStyle(prefix + DOT + getConfigLabel(colIndex), properties);
configRegistry.registerConfigAttribute(CELL_STYLE, savedStyle, NORMAL, getConfigLabel(colIndex));
stylesToPersist.put(getConfigLabel(colIndex), savedStyle);
}
}
}
}
Aggregations