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


Java GridRegion.BODY属性代码示例

本文整理汇总了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();
        }
    });

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

示例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;
}
 
开发者ID:xored,项目名称:q7.quality.mockups,代码行数:47,代码来源:CellPainterExample.java


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