本文整理汇总了Java中org.eclipse.nebula.widgets.nattable.config.IConfigRegistry类的典型用法代码示例。如果您正苦于以下问题:Java IConfigRegistry类的具体用法?Java IConfigRegistry怎么用?Java IConfigRegistry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IConfigRegistry类属于org.eclipse.nebula.widgets.nattable.config包,在下文中一共展示了IConfigRegistry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addSelectedModeStyling
import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry; //导入依赖的package包/类
/**
* Add selected styling to the registry.
*
* @param configRegistry
*/
private void addSelectedModeStyling(final IConfigRegistry configRegistry) {
final TextPainter txtPainter = new TextPainter(false, false, true, true);
final ICellPainter selectedCellPainter = new DataTableBackgroundImagePainter(txtPainter,
selectedBackground,
GUIHelper.getColor(192, 192, 192));
final CellPainterDecorator selectedHeaderPainter = new CellPainterDecorator(selectedCellPainter,
CellEdgeEnum.LEFT,
new DataTableImagePainter(context));
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER,
selectedHeaderPainter,
DisplayMode.SELECT,
GridRegion.COLUMN_HEADER);
}
示例2: setCellImage
import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry; //导入依赖的package包/类
private void setCellImage(final NatTable natTable) {
final int columnPosition = natTable.getColumnPositionByX(this.currentEvent.x);
final int rowPosition = natTable.getRowPositionByY(this.currentEvent.y);
final ILayerCell cell = natTable.getCellByPosition(columnPosition, rowPosition);
final Rectangle cellBounds = cell.getBounds();
this.xOffset = this.currentEvent.x - cellBounds.x;
final Image image = new Image(natTable.getDisplay(), cellBounds.width, cellBounds.height);
final GC gc = new GC(image);
final IConfigRegistry configRegistry = natTable.getConfigRegistry();
final ICellPainter cellPainter = cell.getLayer().getCellPainter(columnPosition, rowPosition, cell, configRegistry);
if (cellPainter != null) {
cellPainter.paintCell(cell, gc, new Rectangle(0, 0, cellBounds.width, cellBounds.height), configRegistry);
}
gc.dispose();
final ImageData imageData = image.getImageData();
image.dispose();
imageData.alpha = 150;
this.cellImage = new Image(natTable.getDisplay(), imageData);
}
示例3: getBackgroundColour
import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry; //导入依赖的package包/类
@Override
protected Color getBackgroundColour(final ILayerCell cell, final IConfigRegistry configRegistry) {
final ITableCell tableCell = (ITableCell) cell.getDataValue();
if (DisplayMode.NORMAL.equals(cell.getDisplayMode())) {
final IColorConstant backgroundColor = tableCell.getBackgroundColor();
if (backgroundColor != null) {
return backgroundColorCache.getColor(backgroundColor);
}
}
else if (DisplayMode.SELECT.equals(cell.getDisplayMode())) {
IColorConstant selectedBackgroundColor = tableCell.getSelectedBackgroundColor();
if (selectedBackgroundColor == null) {
selectedBackgroundColor = defaultSelectedBackgroundColor;
}
if (selectedBackgroundColor != null) {
return selectedBackgroundColorCache.getColor(selectedBackgroundColor);
}
}
return super.getBackgroundColour(cell, configRegistry);
}
示例4: getTextPainterBounds
import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry; //导入依赖的package包/类
private Rectangle getTextPainterBounds(
final ILayerCell cell,
final GC gc,
final Rectangle adjustedCellBounds,
final IConfigRegistry configRegistry) {
final int preferredIconPainterWidth = this.iconPainter.getPreferredWidth(cell, gc, configRegistry);
int usedSpacing = 0;
if (preferredIconPainterWidth > 0 && adjustedCellBounds.width > 0) {
usedSpacing = spacing;
}
final int grabbedPreferredWidth = adjustedCellBounds.width - preferredIconPainterWidth - usedSpacing;
return new Rectangle(
adjustedCellBounds.x + preferredIconPainterWidth + usedSpacing,
adjustedCellBounds.y,
grabbedPreferredWidth,
adjustedCellBounds.height).intersection(adjustedCellBounds);
}
示例5: getIconPainterBounds
import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry; //导入依赖的package包/类
private Rectangle getIconPainterBounds(
final ILayerCell cell,
final GC gc,
final Rectangle adjustedCellBounds,
final IConfigRegistry configRegistry) {
final int preferredIconPainterWidth = this.iconPainter.getPreferredWidth(cell, gc, configRegistry);
final int preferredIconPainterHeight = this.iconPainter.getPreferredHeight(cell, gc, configRegistry);
return new Rectangle(
adjustedCellBounds.x,
adjustedCellBounds.y + ((adjustedCellBounds.height - preferredIconPainterHeight) / 2),
preferredIconPainterWidth,
preferredIconPainterHeight);
}
示例6: getCellPainterAt
import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry; //导入依赖的package包/类
@Override
public ICellPainter getCellPainterAt(
final int x,
final int y,
final ILayerCell cell,
final GC gc,
final Rectangle adjustedCellBounds,
final IConfigRegistry configRegistry) {
final Rectangle iconPainterBounds = getIconPainterBounds(cell, gc, adjustedCellBounds, configRegistry);
if (this.iconPainter != null && iconPainterBounds.contains(x, y)) {
return this.iconPainter.getCellPainterAt(x, y, cell, gc, iconPainterBounds, configRegistry);
}
else {
final Rectangle textPainterBounds = getTextPainterBounds(cell, gc, adjustedCellBounds, configRegistry);
if (this.textPainter != null && textPainterBounds.contains(x, y)) {
return this.textPainter.getCellPainterAt(x, y, cell, gc, textPainterBounds, configRegistry);
}
}
return this;
}
示例7: paintBackground
import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry; //导入依赖的package包/类
@Override
protected void paintBackground(
final ILayer natLayer,
final GC gc,
final int xOffset,
final int yOffset,
final Rectangle rectangle,
final IConfigRegistry configRegistry) {
//paint the grid
super.paintBackground(natLayer, gc, xOffset, yOffset, rectangle, configRegistry);
//paint the default column header for the full width
final Rectangle headerBackgroundPainterBounds = new Rectangle(
rectangle.x,
0,
rectangle.width,
CellConstants.COLUMN_HEADER_HEIGHT);
backgroundPainter.paintCellDefault(gc, headerBackgroundPainterBounds);
//remove the first grid line under the header because it looks weird and its like in win7 (first grid line is white there too)
gc.setBackground(WHITE.get());
gc.fillRectangle(0, CellConstants.COLUMN_HEADER_HEIGHT - 1, rectangle.width, 1);
}
示例8: paintCell
import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry; //导入依赖的package包/类
@Override
public void paintCell(final ILayerCell cell, final GC gc, final Rectangle rectangle, final IConfigRegistry configRegistry) {
final int contentWidth = Math.min(rectangle.width, getPreferredWidth(cell, gc, configRegistry));
final AlignmentHorizontal horizontalAlignment = getHorizontalAlignment(cell);
final int horizontalAligmentPadding = getHorizontalAlignmentPadding(horizontalAlignment, rectangle, contentWidth);
if (horizontalAligmentPadding > 0) {
super.paintCell(
cell,
gc,
new Rectangle(
rectangle.x + horizontalAligmentPadding,
rectangle.y,
rectangle.width - horizontalAligmentPadding,
rectangle.height),
configRegistry);
}
else {
super.paintCell(cell, gc, rectangle, configRegistry);
}
}
示例9: configureRegistry
import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry; //导入依赖的package包/类
@Override
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.GRADIENT_BACKGROUND_COLOR, gradientBgColor);
cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_FOREGROUND_COLOR, gradientFgColor);
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());
}
示例10: configureRegistry
import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry; //导入依赖的package包/类
@Override
public void configureRegistry(IConfigRegistry configRegistry) {
registry = configRegistry;
// editable
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITABLE_RULE,
IEditableRule.ALWAYS_EDITABLE);
// style for selected cells
Style selectStyle = new Style();
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, selectStyle, DisplayMode.SELECT);
// open adjacent editor when we leave the current one during editing
configRegistry.registerConfigAttribute(EditConfigAttributes.OPEN_ADJACENT_EDITOR, Boolean.TRUE,
DisplayMode.EDIT);
// style for upper left corner
BorderStyle borderStyle = new BorderStyle();
borderStyle.setColor(GUIHelper.COLOR_GRAY);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER,
new LineBorderDecorator(new TextPainter(), borderStyle), DisplayMode.NORMAL, GridRegion.CORNER);
// for each column...
for (int column = 0; column < headingProvider.getColumnCount(); column++)
addColumn(column);
}
示例11: GlazedListsColumnHeaderLayerStack
import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry; //导入依赖的package包/类
public GlazedListsColumnHeaderLayerStack(IDataProvider dataProvider,
SortedList<T> sortedList,
IColumnPropertyAccessor<T> columnPropertyAccessor,
IConfigRegistry configRegistry, DefaultBodyLayerStack bodyLayerStack) {
this.dataProvider = dataProvider;
this.dataLayer = new DefaultColumnHeaderDataLayer(dataProvider);
this.columnHeaderLayer = new ColumnHeaderLayer(this.dataLayer, bodyLayerStack,
bodyLayerStack.getSelectionLayer());
SortHeaderLayer<T> sortHeaderLayer = new SortHeaderLayer<T>(
this.columnHeaderLayer, new GlazedListsSortModel<T>(sortedList,
columnPropertyAccessor, configRegistry, this.dataLayer),
false);
setUnderlyingLayer(sortHeaderLayer);
}
示例12: registerComboBox
import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry; //导入依赖的package包/类
private static void registerComboBox(IConfigRegistry configRegistry,
ICellPainter comboBoxCellPainter, ICellEditor comboBoxCellEditor) {
configRegistry.registerConfigAttribute(
CellConfigAttributes.CELL_PAINTER, comboBoxCellPainter,
DisplayMode.NORMAL, COMBO_BOX_CONFIG_LABEL);
configRegistry.registerConfigAttribute(
EditConfigAttributes.CELL_EDITOR, comboBoxCellEditor,
DisplayMode.NORMAL, COMBO_BOX_EDITOR_CONFIG_LABEL);
configRegistry.registerConfigAttribute(
EditConfigAttributes.CELL_EDITOR, comboBoxCellEditor,
DisplayMode.EDIT, COMBO_BOX_EDITOR_CONFIG_LABEL);
configRegistry.registerConfigAttribute(
CellConfigAttributes.DISPLAY_CONVERTER,
new PricingTypeBeanDisplayConverter(), DisplayMode.NORMAL,
FORMAT_PRICING_TYPE_CONFIG_LABEL);
}
示例13: registerPainters
import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry; //导入依赖的package包/类
private void registerPainters(IConfigRegistry configRegistry) {
// override column header style configuration to make use of the
// BackgroundImagePainter
registerColumnHeaderStyle(configRegistry);
// column one -> default text with no border
// column two -> default text showing a border
registerColumnTwoTextPainterStyle(configRegistry);
// column three -> password painter with gradient background
registerColumnThreePasswordPainter(configRegistry);
registerColumnFourPainter(configRegistry);
registerColumnFivePainter(configRegistry);
registerColumnSixDoublePainter(configRegistry);
registerColumnSevenCheckboxPainter(configRegistry);
registerColumnEightCheckboxPainter(configRegistry);
registerColumnNineComboBox(configRegistry);
registerColumnTenComboBoxPainter(configRegistry);
registerColumnElevenTablePainter(configRegistry);
registerColumnTwelveComboBox(configRegistry);
}
示例14: registerColumnThreePasswordPainter
import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry; //导入依赖的package包/类
private void registerColumnThreePasswordPainter(IConfigRegistry configRegistry) {
Style style = new Style();
style.setAttributeValue(
CellStyleAttributes.GRADIENT_BACKGROUND_COLOR,
GUIHelper.COLOR_WHITE);
style.setAttributeValue(
CellStyleAttributes.GRADIENT_FOREGROUND_COLOR,
GUIHelper.COLOR_RED);
configRegistry.registerConfigAttribute(
CellConfigAttributes.CELL_STYLE,
style,
DisplayMode.NORMAL,
CellPainterExample.COLUMN_THREE_LABEL);
configRegistry.registerConfigAttribute(
CellConfigAttributes.CELL_PAINTER,
new GradientBackgroundPainter(new PasswordTextPainter(false, false)),
DisplayMode.NORMAL,
CellPainterExample.COLUMN_THREE_LABEL);
}
示例15: registerColumnFourPainter
import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry; //导入依赖的package包/类
private void registerColumnFourPainter(IConfigRegistry configRegistry) {
Style style = new Style();
style.setAttributeValue(
CellStyleAttributes.HORIZONTAL_ALIGNMENT,
HorizontalAlignmentEnum.LEFT);
configRegistry.registerConfigAttribute(
CellConfigAttributes.CELL_STYLE,
style,
DisplayMode.NORMAL,
CellPainterExample.COLUMN_FOUR_LABEL);
configRegistry.registerConfigAttribute(
CellConfigAttributes.CELL_PAINTER,
new GradientBackgroundPainter(new TextPainter(false, false, false, true), true),
DisplayMode.NORMAL,
CellPainterExample.COLUMN_FOUR_LABEL);
}