本文整理匯總了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;
}