当前位置: 首页>>代码示例>>Java>>正文


Java ILayerPainter类代码示例

本文整理汇总了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);
}
 
开发者ID:HoratiusTang,项目名称:EsperDist,代码行数:8,代码来源:InstanceTable.java

示例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);
}
 
开发者ID:HoratiusTang,项目名称:EsperDist,代码行数:7,代码来源:InstanceTable.java

示例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);

}
 
开发者ID:jo-source,项目名称:jo-widgets,代码行数:49,代码来源:JoNatTableConfigurator.java

示例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;
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:51,代码来源:NatTableFactory.java


注:本文中的org.eclipse.nebula.widgets.nattable.painter.layer.ILayerPainter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。