Search in sources :

Example 1 with XLIFFEditorCompositeLayerConfiguration

use of net.heartsome.cat.ts.ui.xliffeditor.nattable.config.XLIFFEditorCompositeLayerConfiguration in project translationstudio8 by heartsome.

the class XLIFFEditorImplWithNatTable method addRowBackgroundColor.

// /**
// * 处理首选项改变事件
// * @see
// org.eclipse.ui.texteditor.AbstractTextEditor#handlePreferenceStoreChanged(org.eclipse.jface.util.PropertyChangeEvent)
// */
// protected void handlePreferenceStoreChanged(org.eclipse.jface.util.PropertyChangeEvent event) {
// String property = event.getProperty();
//
// if (IPreferenceConstants.CONTEXTBG1.equals(property) || IPreferenceConstants.CONTEXTBG2.equals(property)) {
// CompositeLayer compositeLayer = (CompositeLayer) table.getLayer();
// // compositeLayer.clearConfiguration();
// addRowBackgroundColor(compositeLayer);
// table.configure();
// }
// }
/**
	 * 添加行背景色(奇数行和偶数行不同)
	 * @param compositeLayer
	 *            ;
	 */
private void addRowBackgroundColor(CompositeLayer compositeLayer) {
    // Color evenRowBgColor = GUIHelper.getColor(238, 248, 255);
    // Color oddRowBgColor = GUIHelper.getColor(255, 255, 255);
    Style oddStyle = new Style();
    oddStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, GUIHelper.COLOR_WHITE);
    Style evenStyle = new Style();
    evenStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, GUIHelper.COLOR_WHITE);
    XLIFFEditorCompositeLayerConfiguration compositeLayerConfiguraion = new XLIFFEditorCompositeLayerConfiguration(compositeLayer, oddStyle, evenStyle, this);
    compositeLayer.addConfiguration(compositeLayerConfiguraion);
}
Also used : XLIFFEditorCompositeLayerConfiguration(net.heartsome.cat.ts.ui.xliffeditor.nattable.config.XLIFFEditorCompositeLayerConfiguration) TagStyle(net.heartsome.cat.common.innertag.TagStyle) Style(net.sourceforge.nattable.style.Style)

Aggregations

TagStyle (net.heartsome.cat.common.innertag.TagStyle)1 XLIFFEditorCompositeLayerConfiguration (net.heartsome.cat.ts.ui.xliffeditor.nattable.config.XLIFFEditorCompositeLayerConfiguration)1 Style (net.sourceforge.nattable.style.Style)1