本文整理汇总了Java中org.eclipse.nebula.widgets.nattable.painter.layer.ILayerPainter类的典型用法代码示例。如果您正苦于以下问题:Java ILayerPainter类的具体用法?Java ILayerPainter怎么用?Java ILayerPainter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ILayerPainter类属于org.eclipse.nebula.widgets.nattable.painter.layer包,在下文中一共展示了ILayerPainter类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ColumnSpanHeaderLayer
import org.eclipse.nebula.widgets.nattable.painter.layer.ILayerPainter; //导入依赖的package包/类
public ColumnSpanHeaderLayer(IUniqueIndexLayer baseLayer,
ILayer horizontalLayerDependency,
SelectionLayer selectionLayer, boolean useDefaultConfiguration,
ILayerPainter layerPainter) {
super(baseLayer, horizontalLayerDependency, selectionLayer,
useDefaultConfiguration, layerPainter);
}
示例2: RowSpanHeaderLayer
import org.eclipse.nebula.widgets.nattable.painter.layer.ILayerPainter; //导入依赖的package包/类
public RowSpanHeaderLayer(IUniqueIndexLayer baseLayer,
ILayer verticalLayerDependency, SelectionLayer selectionLayer,
boolean useDefaultConfiguration, ILayerPainter layerPainter) {
super(baseLayer, verticalLayerDependency, selectionLayer,
useDefaultConfiguration, layerPainter);
}
示例3: configureNatTable
import org.eclipse.nebula.widgets.nattable.painter.layer.ILayerPainter; //导入依赖的package包/类
public static void configureNatTable(
final NatTable table,
final ITableColumnModelSpi columnModel,
final SwtImageRegistry imageRegistry) {
final IConfigRegistry config = table.getConfigRegistry();
//use modern theme as base theme (so fonts look like win 7 and win 10)
final ThemeConfiguration modernTheme = new ModernNatTableThemeConfiguration();
table.setTheme(modernTheme);
//use white background instead of grey to be more close to the swt win7 table
table.setBackground(ColorCache.getInstance().getColor(Colors.WHITE));
//use grid color from the swt table under win7
final Color gridColor = ColorCache.getInstance().getColor(GRID_COLOR);
config.registerConfigAttribute(CellConfigAttributes.GRID_LINE_COLOR, gridColor, DisplayMode.NORMAL, GridRegion.BODY);
//use grid for remainder space to be more close to the swt win7 table
final ILayerPainter gridPainter = new JoNatTableGridLayerPainter(table, gridColor, CellConstants.DEFAULT_ROW_HEIGHT);
table.setLayerPainter(gridPainter);
//set table header painter
final ICellPainter headerPainter = CellPainterFactory.createHeaderPainter(imageRegistry);
config.registerConfigAttribute(
CellConfigAttributes.CELL_PAINTER,
headerPainter,
DisplayMode.NORMAL,
GridRegion.COLUMN_HEADER);
//disable grid because header painter paints grid by itself to allow hovered and clicked grid colors
config.registerConfigAttribute(
CellConfigAttributes.RENDER_GRID_LINES,
false,
DisplayMode.NORMAL,
GridRegion.COLUMN_HEADER);
//set cell painter
final ICellPainter cellPainter = CellPainterFactory.createCellPainter(columnModel, imageRegistry);
config.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, cellPainter, DisplayMode.NORMAL, GridRegion.BODY);
//do not render dotted line for selected cell because this is ugly and selected cell can be determined by selected background
config.registerConfigAttribute(
SelectionConfigAttributes.SELECTION_GRID_LINE_STYLE,
new BorderStyle(1, gridColor, LineStyleEnum.SOLID),
DisplayMode.SELECT);
}
示例4: createSingleColumnTable
import org.eclipse.nebula.widgets.nattable.painter.layer.ILayerPainter; //导入依赖的package包/类
/**
* Create a single column {@link NatTableWrapper}. The {@link IRowDataProvider} parameter is not
* optional, the {@link AbstractRegistryConfiguration} is optional.
*
* @param parent
* @param dataProvider
* @param customConfiguration
* @return
*/
@SuppressWarnings("unchecked")
public static NatTableWrapper createSingleColumnTable(Composite parent,
IRowDataProvider<? extends Object> dataProvider,
AbstractRegistryConfiguration customConfiguration){
NatTableWrapper natTableWrapper = new NatTableWrapper();
DataLayer bodyDataLayer = new DataLayer(dataProvider);
// disable drawing cells lines
SelectionLayer selectionLayer = new SelectionLayer(bodyDataLayer) {
private CellLayerPainter painter = new CellLayerPainter();
@Override
public ILayerPainter getLayerPainter(){
return painter;
}
};
ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);
viewportLayer.setRegionName(GridRegion.BODY);
NatTable natTable =
new NatTable(parent, NatTable.DEFAULT_STYLE_OPTIONS | SWT.BORDER, viewportLayer, false);
natTable.setBackground(natTable.getDisplay().getSystemColor(SWT.COLOR_WHITE));
natTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
natTable.addConfiguration(new DefaultSingleColumnStyleConfiguration());
if (customConfiguration != null) {
natTable.addConfiguration(customConfiguration);
}
natTableWrapper.setNatTable(natTable);
natTableWrapper.setDataProvider((IRowDataProvider<Object>) dataProvider);
natTableWrapper.setSelectionLayer(selectionLayer);
natTableWrapper.configure();
// workaround for setting column with to 100% as this is currently broken due to a SWT update of Elexis
// TODO revert after NatTable / Target update for Elexis 3.3
// bodyDataLayer.setColumnPercentageSizing(true);
// bodyDataLayer.setColumnWidthPercentageByPosition(0, 100);
natTable.addControlListener(new ResizeColumnListener(bodyDataLayer));
return natTableWrapper;
}