本文整理汇总了Java中org.eclipse.nebula.widgets.nattable.grid.GridRegion.BODY属性的典型用法代码示例。如果您正苦于以下问题:Java GridRegion.BODY属性的具体用法?Java GridRegion.BODY怎么用?Java GridRegion.BODY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.nebula.widgets.nattable.grid.GridRegion
的用法示例。
在下文中一共展示了GridRegion.BODY属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: NatTableImplSpi
NatTableImplSpi(
final NatTableLayers tableLayers,
final IGenericWidgetFactory widgetFactory,
final Object parentUiReference,
final ITableSetupSpi setup,
final SwtImageRegistry imageRegistry) {
super(new NatTable((Composite) parentUiReference, getStyle(setup), tableLayers.getGridLayer()), imageRegistry);
this.table = getUiReference();
this.tableLayers = tableLayers;
this.rowSelectionModel = tableLayers.getSelectionModel();
this.widgetFactory = widgetFactory;
this.tableCellObservable = new TableCellObservable();
this.tableCellPopupDetectionObservable = new TableCellPopupDetectionObservable();
this.tableColumnPopupDetectionObservable = new TableColumnPopupDetectionObservable();
this.tableColumnObservable = new TableColumnObservable();
this.tableSelectionObservable = new TableSelectionObservable();
this.tableModelListener = new TableModelListener();
this.tableColumnModelListener = new TableColumnModelListener();
this.columnLayerListener = new ColumnLayerListener();
this.tableSelectionListener = new TableSelectionListener();
this.hoveredColumnLabelAccumulator = new HoveredColumnConfigLabelAccumulator();
this.clickedColumnLabelAccumulator = new ClickedColumnConfigLabelAccumulator();
this.editorCustomWidgetFactory = new EditorCustomWidgetFactory();
this.dataModel = setup.getDataModel();
this.columnModel = setup.getColumnModel();
this.editorFactory = setup.getEditor();
this.editable = true;
this.editRowIndex = -1;
this.editColumnIndex = -1;
final SwtDragSource swtDragSource = (SwtDragSource) super.getDragSource();
this.dragSource = new NatTableDragSource(swtDragSource, this);
setMenuDetectListener(new TableMenuDetectListener());
table.addMouseListener(new CellSelectionListener(table, swtDragSource, rowSelectionModel));
table.addMouseListener(new TableCellMouseListener());
table.addMouseMoveListener(new HeaderHoverMouseMoveListener());
table.addMouseTrackListener(new HeaderHoverAndClickMouseTrackAdapter());
table.addMouseListener(new HeaderMouseClickModeMouseListener());
table.getUiBindingRegistry().registerSingleClickBinding(new TableHeaderMouseEventMatcher(), new TableHeaderClickAction());
table.addDisposeListener(new NatTableDisposeListener());
tableLayers.getSelectionLayer().addLayerListener(tableSelectionListener);
tableLayers.getColumnReorderLayer().addLayerListener(columnLayerListener);
final AggregateConfigLabelAccumulator columnLabelAccumulator = new AggregateConfigLabelAccumulator();
columnLabelAccumulator.add(hoveredColumnLabelAccumulator, clickedColumnLabelAccumulator);
tableLayers.getColumnHeaderLayer().setConfigLabelAccumulator(columnLabelAccumulator);
JoNatTableConfigurator.configureNatTable(table, setup.getColumnModel(), imageRegistry);
JoNatTableConfigurator.registerUiBindingsToNatTable(table, hoveredColumnLabelAccumulator);
final NatTableTooltip tooltip = new NatTableTooltip(
table,
dataModel,
columnModel,
GridRegion.COLUMN_HEADER,
GridRegion.BODY);
table.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(final DisposeEvent e) {
tooltip.dispose();
}
});
}
示例2: createExampleControl
public Control createExampleControl(Composite parent) {
// property names of the Person class
String[] propertyNames = { "firstName", "lastName", "password",
"description", "age", "money", "married", "gender",
"address.street", "address.city", "favouriteFood",
"favouriteDrinks" };
// mapping from property to label, needed for column header labels
Map<String, String> propertyToLabelMap = new HashMap<String, String>();
propertyToLabelMap.put("firstName", "Firstname");
propertyToLabelMap.put("lastName", "Lastname");
propertyToLabelMap.put("password", "Password");
propertyToLabelMap.put("description", "Description");
propertyToLabelMap.put("age", "Age");
propertyToLabelMap.put("money", "Money");
propertyToLabelMap.put("married", "Married");
propertyToLabelMap.put("gender", "Gender");
propertyToLabelMap.put("address.street", "Street");
propertyToLabelMap.put("address.city", "City");
propertyToLabelMap.put("favouriteFood", "Food");
propertyToLabelMap.put("favouriteDrinks", "Drinks");
IDataProvider bodyDataProvider =
new ListDataProvider<ExtendedPersonWithAddress>(
PersonService.getExtendedPersonsWithAddress(10),
new ExtendedReflectiveColumnPropertyAccessor<ExtendedPersonWithAddress>(propertyNames));
DefaultGridLayer gridLayer =
new DefaultGridLayer(bodyDataProvider,
new DefaultColumnHeaderDataProvider(propertyNames, propertyToLabelMap));
final DataLayer bodyDataLayer = (DataLayer) gridLayer.getBodyDataLayer();
final ColumnOverrideLabelAccumulator columnLabelAccumulator =
new ColumnOverrideLabelAccumulator(bodyDataLayer);
bodyDataLayer.setConfigLabelAccumulator(columnLabelAccumulator);
registerColumnLabels(columnLabelAccumulator);
this.natTable = new NatTable(parent, gridLayer, false);
this.natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
this.natTable.addConfiguration(new PainterConfiguration());
this.natTable.configure();
new NatTableContentTooltip(this.natTable, GridRegion.BODY);
return this.natTable;
}