• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java IDataProvider类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.nebula.widgets.nattable.data.IDataProvider的典型用法代码示例。如果您正苦于以下问题:Java IDataProvider类的具体用法?Java IDataProvider怎么用?Java IDataProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IDataProvider类属于org.eclipse.nebula.widgets.nattable.data包,在下文中一共展示了IDataProvider类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: GlazedListsColumnHeaderLayerStack

import org.eclipse.nebula.widgets.nattable.data.IDataProvider; //导入依赖的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);
}
 
开发者ID:xored,项目名称:q7.quality.mockups,代码行数:18,代码来源:GlazedListsColumnHeaderLayerStack.java


示例2: getAskPriceValidator

import org.eclipse.nebula.widgets.nattable.data.IDataProvider; //导入依赖的package包/类
/**
 * Validate: Ask price > Bid Price
 */
private static IDataValidator getAskPriceValidator(
        final IDataProvider dataProvider) {

    return new DataValidator() {

        @Override
        public boolean validate(int columnIndex, int rowIndex,
                Object newValue) {
            try {
                int indexOfBidPrice = RowDataListFixture
                        .getColumnIndexOfProperty(RowDataListFixture.BID_PRICE_PROP_NAME);
                double bidPrice = ((Double) dataProvider.getDataValue(
                        indexOfBidPrice, rowIndex)).doubleValue();
                double askPrice = Double
                        .valueOf(newValue.toString())
                        .doubleValue();
                return askPrice > bidPrice;
            } catch (Exception ex) {
                return false;
            }
        }
    };
}
 
开发者ID:xored,项目名称:q7.quality.mockups,代码行数:27,代码来源:EditableGridExample.java


示例3: DataTableGridLayerStack

import org.eclipse.nebula.widgets.nattable.data.IDataProvider; //导入依赖的package包/类
/**
 * Creates a new instance.
 *
 * @param bodyDataProvider
 * @param table
 * @param context
 * @param parent
 */
public DataTableGridLayerStack(final IDataProvider bodyDataProvider, NatTable table, DataTableContext context, Control parent) {
    super(true, table, context);
    List<String> lcolumns = new ArrayList<String>();
    RowSet rows = context.getRows();
    DataHandle handle = context.getHandle();
    if (bodyDataProvider.getColumnCount() != 0) {
        if (rows != null) {
            lcolumns.add(""); //$NON-NLS-1$
        }
        if (handle != null) {
            for (int i = 0; i < handle.getNumColumns(); i++) {
                lcolumns.add(handle.getAttributeName(i));
            }
        } 
    }
    String[] columns = lcolumns.toArray(new String[] {});
    final IDataProvider columnHeaderDataProvider = new DataTableDataProvider(new DefaultColumnHeaderDataProvider(columns));
    final IDataProvider rowHeaderDataProvider = new DataTableDataProvider(new DefaultRowHeaderDataProvider(bodyDataProvider));
    final IDataProvider cornerDataProvider = new DataTableDataProvider(new DefaultCornerDataProvider(columnHeaderDataProvider,
                                                                           rowHeaderDataProvider));
    init(bodyDataProvider, columnHeaderDataProvider, rowHeaderDataProvider, cornerDataProvider, parent);
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:31,代码来源:DataTableGridLayerStack.java


示例4: setData

import org.eclipse.nebula.widgets.nattable.data.IDataProvider; //导入依赖的package包/类
/**
 * Updates the underlying table.
 *
 * @param data
 * @param rows
 * @param columns
 */
public void setData(IDataProvider data, 
                    IDataProvider rows,
                    IDataProvider columns) {
    // Disable redrawing
    this.root.setRedraw(false);
    
    this.table.doCommand(new FillLayerResetCommand());
    this.dataProviderBody.setData(data);
    this.dataProviderColumnHeader.setData(columns);
    this.dataProviderRowHeader.setData(rows);
    this.table.refresh();
    
    // Redraw
    this.root.setRedraw(true);
    this.root.layout(true);
    
    // Reset state
    this.selectedRow = null;
    this.selectedColumn = null;
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:28,代码来源:ComponentTable.java


示例5: LayerColumnHeader

import org.eclipse.nebula.widgets.nattable.data.IDataProvider; //导入依赖的package包/类
/**
 * Creates a new instance.
 *
 * @param parent
 * @param dataProvider
 * @param bodyLayer
 * @param config
 * @param context
 */
public LayerColumnHeader(Composite parent,
                              IDataProvider dataProvider,
                              LayerBody bodyLayer,
                              CTConfiguration config, CTContext context) {
    super(config, context);
    
    DataLayer dataLayer = new DataLayer(dataProvider);
    ColumnHeaderLayer colHeaderLayer = new ColumnHeaderLayer(dataLayer,
                                                             bodyLayer,
                                                             bodyLayer.getSelectionLayer(),
                                                             false);
    colHeaderLayer.addConfiguration(new StyleConfigurationHeader(parent, GridRegion.COLUMN_HEADER, config));
    colHeaderLayer.addConfiguration(new DefaultColumnResizeBindings());
    setUnderlyingLayer(colHeaderLayer);
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:25,代码来源:LayerColumnHeader.java


示例6: NatTableLayers

import org.eclipse.nebula.widgets.nattable.data.IDataProvider; //导入依赖的package包/类
public NatTableLayers(
    final ITableDataModel dataModel,
    final ITableColumnModelSpi columnModel,
    final boolean columsResizable,
    final boolean columnsMoveable,
    final TableSelectionPolicy selectionPolicy) {

    Assert.paramNotNull(dataModel, "dataModel");
    Assert.paramNotNull(columnModel, "columnModel");
    Assert.paramNotNull(selectionPolicy, "selectionPolicy");

    final IDataProvider dataProvider = new DefaultDataProvider(dataModel, columnModel);
    final IDataProvider rowDataProvider = new DefaultRowDataProvider();
    final IDataProvider columnDataProvider = new DefaultColumnDataProvider(columnModel);

    final BodyLayerStack bodyLayer = new BodyLayerStack(dataProvider, columsResizable, columnsMoveable, selectionPolicy);
    this.dataLayer = bodyLayer.getDataLayer();
    this.selectionModel = bodyLayer.getSelectionModel();
    this.selectionLayer = bodyLayer.getSelectionLayer();
    this.columnReorderLayer = bodyLayer.getColumnReorderLayer();
    this.viewPortLayer = bodyLayer.getViewportLayer();

    this.columnHeaderLayer = new ColumnHeaderLayerStack(columnDataProvider, bodyLayer);
    final RowHeaderLayerStack rowHeaderLayer = new RowHeaderLayerStack(rowDataProvider, bodyLayer);

    final DefaultCornerDataProvider cornerDataProvider = new DefaultCornerDataProvider(columnDataProvider, rowDataProvider);
    final CornerLayer cornerLayer = new CornerLayer(new DataLayer(cornerDataProvider), rowHeaderLayer, columnHeaderLayer);

    //remark: false also disable editing, but when editing is enabled selection drag mode is enabled and must
    //be disabled to allow drag and drop on tables
    this.gridLayer = new GridLayer(bodyLayer, columnHeaderLayer, rowHeaderLayer, cornerLayer, false);
}
 
开发者ID:jo-source,项目名称:jo-widgets,代码行数:33,代码来源:NatTableLayers.java


示例7: BodyLayerStack

import org.eclipse.nebula.widgets.nattable.data.IDataProvider; //导入依赖的package包/类
BodyLayerStack(
    final IDataProvider dataProvider,
    final boolean columsResizable,
    final boolean columnsMoveable,
    final TableSelectionPolicy selectionPolicy) {

    this.dataLayer = new DataLayer(dataProvider);
    dataLayer.setDefaultRowHeight(CellConstants.DEFAULT_ROW_HEIGHT);
    dataLayer.setColumnsResizableByDefault(columsResizable);

    this.columnReorderLayer = new JoColumnReorderLayer(dataLayer);
    if (columnsMoveable) {
        this.selectionLayer = new JoSelectionLayer(columnReorderLayer);
    }
    else {
        this.selectionLayer = new JoSelectionLayer(dataLayer);
    }

    if (TableSelectionPolicy.NO_SELECTION.equals(selectionPolicy)) {
        this.selectionModel = new NoSelectionRowSelectionModel();
    }
    else {
        this.selectionModel = new RowIndexSelectionModel(dataProvider, selectionLayer);
        if (TableSelectionPolicy.SINGLE_ROW_SELECTION.equals(selectionPolicy)) {
            selectionModel.setMultipleSelectionAllowed(false);
        }
    }
    selectionLayer.setSelectionModel(selectionModel);
    selectionLayer.clearConfiguration();
    selectionLayer.addConfiguration(new SelectionLayerConfiguration());

    this.viewportLayer = new ViewportLayer(selectionLayer);
    setUnderlyingLayer(viewportLayer);
}
 
开发者ID:jo-source,项目名称:jo-widgets,代码行数:35,代码来源:BodyLayerStack.java


示例8: editableGridConfiguration

import org.eclipse.nebula.widgets.nattable.data.IDataProvider; //导入依赖的package包/类
public static AbstractRegistryConfiguration editableGridConfiguration(
        final ColumnOverrideLabelAccumulator columnLabelAccumulator,
        final IDataProvider dataProvider) {

    return new AbstractRegistryConfiguration() {

        @Override
        public void configureRegistry(IConfigRegistry configRegistry) {

            EditableGridExample.registerConfigLabelsOnColumns(columnLabelAccumulator);

            registerISINValidator(configRegistry);
            registerAskPriceValidator(configRegistry, dataProvider);
            registerBidPriceValidator(configRegistry);

            registerSecurityDescriptionCellStyle(configRegistry);
            registerPricingCellStyle(configRegistry);

            registerPriceFormatter(configRegistry);
            registerDateFormatter(configRegistry);
            registerLotSizeFormatter(configRegistry);

            registerCheckBoxEditor(configRegistry, new CheckBoxPainter(),
                    new CheckBoxCellEditor());
            registerComboBox(
                    configRegistry,
                    new ComboBoxPainter(),
                    new ComboBoxCellEditor(
                            Arrays.asList(
                                    new PricingTypeBean("MN"),
                                    new PricingTypeBean("AT"))));

            registerEditableRules(configRegistry, dataProvider);
        }

    };
}
 
开发者ID:xored,项目名称:q7.quality.mockups,代码行数:38,代码来源:EditableGridExample.java


示例9: registerAskPriceValidator

import org.eclipse.nebula.widgets.nattable.data.IDataProvider; //导入依赖的package包/类
private static void registerAskPriceValidator(
        IConfigRegistry configRegistry, IDataProvider dataProvider) {
    configRegistry.registerConfigAttribute(
            EditConfigAttributes.DATA_VALIDATOR,
            getAskPriceValidator(dataProvider), DisplayMode.EDIT,
            ASK_PRICE_CONFIG_LABEL);
    configRegistry.registerConfigAttribute(
            EditConfigAttributes.DATA_VALIDATOR,
            getAskPriceValidator(dataProvider), DisplayMode.NORMAL,
            ASK_PRICE_CONFIG_LABEL);
}
 
开发者ID:xored,项目名称:q7.quality.mockups,代码行数:12,代码来源:EditableGridExample.java


示例10: registerEditableRules

import org.eclipse.nebula.widgets.nattable.data.IDataProvider; //导入依赖的package包/类
private static void registerEditableRules(IConfigRegistry configRegistry,
        IDataProvider dataProvider) {
    configRegistry.registerConfigAttribute(
            EditConfigAttributes.CELL_EDITABLE_RULE,
            IEditableRule.ALWAYS_EDITABLE, DisplayMode.EDIT,
            SECURITY_ID_CONFIG_LABEL);
    configRegistry.registerConfigAttribute(
            EditConfigAttributes.CELL_EDITABLE_RULE,
            IEditableRule.ALWAYS_EDITABLE, DisplayMode.EDIT,
            COMBO_BOX_CONFIG_LABEL);
    configRegistry.registerConfigAttribute(
            EditConfigAttributes.CELL_EDITABLE_RULE,
            IEditableRule.ALWAYS_EDITABLE, DisplayMode.EDIT,
            CHECK_BOX_CONFIG_LABEL);

    configRegistry.registerConfigAttribute(
            EditConfigAttributes.CELL_EDITABLE_RULE,
            getEditRule(dataProvider), DisplayMode.EDIT,
            ASK_PRICE_CONFIG_LABEL);
    configRegistry.registerConfigAttribute(
            EditConfigAttributes.CELL_EDITABLE_RULE,
            getEditRule(dataProvider), DisplayMode.EDIT,
            BID_PRICE_CONFIG_LABEL);
    configRegistry.registerConfigAttribute(
            EditConfigAttributes.CELL_EDITABLE_RULE,
            getEditRule(dataProvider), DisplayMode.EDIT,
            LOT_SIZE_CONFIG_LABEL);
    configRegistry.registerConfigAttribute(
            EditConfigAttributes.CELL_EDITABLE_RULE,
            IEditableRule.NEVER_EDITABLE, DisplayMode.EDIT,
            SPREAD_CONFIG_LABEL);
}
 
开发者ID:xored,项目名称:q7.quality.mockups,代码行数:33,代码来源:EditableGridExample.java


示例11: getEditRule

import org.eclipse.nebula.widgets.nattable.data.IDataProvider; //导入依赖的package包/类
/**
 * Edit rule: If publish flag is true - bid, ask and size can be edited.
 */
private static IEditableRule getEditRule(final IDataProvider dataProvider) {
    return new EditableRule() {
        @Override
        public boolean isEditable(int columnIndex, int rowIndex) {
            int columnIndexOfPublishFlag = RowDataListFixture
                    .getColumnIndexOfProperty(RowDataListFixture.PUBLISH_FLAG_PROP_NAME);
            return ((Boolean) dataProvider.getDataValue(
                    columnIndexOfPublishFlag, rowIndex)).booleanValue();
        }
    };
}
 
开发者ID:xored,项目名称:q7.quality.mockups,代码行数:15,代码来源:EditableGridExample.java


示例12: init

import org.eclipse.nebula.widgets.nattable.data.IDataProvider; //导入依赖的package包/类
/**
 * Initialize.
 *
 * @param bodyDataProvider
 * @param columnHeaderDataProvider
 * @param rowHeaderDataProvider
 * @param cornerDataProvider
 * @param parent
 */
protected void init(IDataProvider bodyDataProvider,
                    IDataProvider columnHeaderDataProvider,
                    IDataProvider rowHeaderDataProvider,
                    IDataProvider cornerDataProvider,
                    Control parent) {
    init(new DataLayer(bodyDataProvider),
         new DefaultColumnHeaderDataLayer(columnHeaderDataProvider),
         new DefaultRowHeaderDataLayer(rowHeaderDataProvider),
         new DataLayer(cornerDataProvider),
         parent);
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:21,代码来源:DataTableGridLayer.java


示例13: LayerRowHeader

import org.eclipse.nebula.widgets.nattable.data.IDataProvider; //导入依赖的package包/类
/**
 * Creates a new instance.
 *
 * @param parent
 * @param dataProvider
 * @param bodyLayer
 * @param config
 * @param context
 */
public LayerRowHeader(Composite parent,
                           IDataProvider dataProvider,
                           LayerBody bodyLayer,
                           CTConfiguration config, CTContext context) {
    super(config, context);
    DataLayer dataLayer = new DataLayer(dataProvider, 50, 20);
    RowHeaderLayer rowHeaderLayer = new RowHeaderLayer(dataLayer, bodyLayer, bodyLayer.getSelectionLayer(), false);
    rowHeaderLayer.addConfiguration(new StyleConfigurationHeader(parent, GridRegion.ROW_HEADER, config));
    rowHeaderLayer.addConfiguration(new DefaultRowResizeBindings());
    setUnderlyingLayer(rowHeaderLayer);
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:21,代码来源:LayerRowHeader.java


示例14: LayerBody

import org.eclipse.nebula.widgets.nattable.data.IDataProvider; //导入依赖的package包/类
/**
 * Creates a new instance.
 *
 * @param dataProvider
 * @param config
 * @param context
 */
public LayerBody(IDataProvider dataProvider, CTConfiguration config, CTContext context) {
    super(config, context);
    
    dataLayer = new DataLayer(dataProvider);

    selectionLayer = new LayerSelection(dataLayer, config);
    selectionLayer.addConfiguration(new StyleConfigurationSelection(config));
    IUniqueIndexLayer layer = selectionLayer;
    
    switch(config.getColumnHeaderLayout()){
        case CTConfiguration.COLUMN_HEADER_LAYOUT_FILL:
            layer = new LayerColumnFillLayout(layer, config, context);
            break;
        case CTConfiguration.COLUMN_HEADER_LAYOUT_FILL_EQUAL:
            layer = new LayerColumnFillLayout(layer, config, context, true);
            break;
    }
 
    switch(config.getRowHeaderLayout()){
        case CTConfiguration.ROW_HEADER_LAYOUT_FILL:
            layer = new LayerRowFillLayout(layer, config, context);
            break;
    }
    
    viewportLayer = new LayerViewport(layer, context);
    setUnderlyingLayer(viewportLayer);
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:35,代码来源:LayerBody.java


示例15: RowIndexSelectionModel

import org.eclipse.nebula.widgets.nattable.data.IDataProvider; //导入依赖的package包/类
RowIndexSelectionModel(final IDataProvider dataProvider, final SelectionLayer selectionLayer) {
    super(selectionLayer, new RowIndexDataProvider(dataProvider), new RowIndexAccessor());
}
 
开发者ID:jo-source,项目名称:jo-widgets,代码行数:4,代码来源:RowIndexSelectionModel.java


示例16: RowHeaderLayerStack

import org.eclipse.nebula.widgets.nattable.data.IDataProvider; //导入依赖的package包/类
RowHeaderLayerStack(final IDataProvider dataProvider, final BodyLayerStack bodyLayer) {
	final DataLayer dataLayer = new DataLayer(dataProvider);
	final RowHeaderLayer rowHeaderLayer = new RowHeaderLayer(dataLayer, bodyLayer, bodyLayer.getSelectionLayer());
	setUnderlyingLayer(rowHeaderLayer);
}
 
开发者ID:jo-source,项目名称:jo-widgets,代码行数:6,代码来源:RowHeaderLayerStack.java


示例17: ColumnHeaderLayerStack

import org.eclipse.nebula.widgets.nattable.data.IDataProvider; //导入依赖的package包/类
ColumnHeaderLayerStack(final IDataProvider dataProvider, final BodyLayerStack bodyLayer) {
    final DataLayer dataLayer = new DataLayer(dataProvider);
    dataLayer.setDefaultRowHeight(CellConstants.COLUMN_HEADER_HEIGHT);
    setUnderlyingLayer(new ColumnHeaderLayer(dataLayer, bodyLayer, bodyLayer.getSelectionLayer()));
}
 
开发者ID:jo-source,项目名称:jo-widgets,代码行数:6,代码来源:ColumnHeaderLayerStack.java


示例18: RowIndexDataProvider

import org.eclipse.nebula.widgets.nattable.data.IDataProvider; //导入依赖的package包/类
RowIndexDataProvider(final IDataProvider original) {
	super(original);
}
 
开发者ID:jo-source,项目名称:jo-widgets,代码行数:4,代码来源:RowIndexDataProvider.java


示例19: DataProviderWrapper

import org.eclipse.nebula.widgets.nattable.data.IDataProvider; //导入依赖的package包/类
DataProviderWrapper(final IDataProvider original) {
	Assert.paramNotNull(original, "original");
	this.original = original;
}
 
开发者ID:jo-source,项目名称:jo-widgets,代码行数:5,代码来源:DataProviderWrapper.java


示例20: getDataProvider

import org.eclipse.nebula.widgets.nattable.data.IDataProvider; //导入依赖的package包/类
public IDataProvider getDataProvider() {
    return this.dataProvider;
}
 
开发者ID:xored,项目名称:q7.quality.mockups,代码行数:4,代码来源:GlazedListsColumnHeaderLayerStack.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java LogstashMarker类代码示例发布时间:2022-05-23
下一篇:
Java S1BPacketEntityAttach类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap