本文整理汇总了Java中org.eclipse.nebula.widgets.nattable.layer.DataLayer类的典型用法代码示例。如果您正苦于以下问题:Java DataLayer类的具体用法?Java DataLayer怎么用?Java DataLayer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataLayer类属于org.eclipse.nebula.widgets.nattable.layer包,在下文中一共展示了DataLayer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setData
import org.eclipse.nebula.widgets.nattable.layer.DataLayer; //导入依赖的package包/类
/**
* Sets the displayed data.
*
* @param handle
*/
public void setData(final DataHandle handle) {
this.table.setRedraw(false);
this.context.setHandle(handle);
this.gridLayer = new DataTableGridLayerStack(new DataTableHandleDataProvider(context), table, context, parent);
this.table.setLayer(gridLayer);
this.table.refresh();
this.gridLayer.getBodyLayer().getViewportLayer().recalculateScrollBars();
((DataLayer)this.gridLayer.getBodyDataLayer()).setColumnWidthByPosition(0, 18);
((DataLayer)this.gridLayer.getBodyDataLayer()).setColumnPositionResizable(0, false);
this.table.getVerticalBar().setVisible(false);
this.table.getHorizontalBar().setVisible(false);
this.table.setRedraw(true);
this.table.redraw();
this.table.setVisible(true);
this.table.getVerticalBar().setVisible(true);
this.table.getHorizontalBar().setVisible(true);
this.table.setVisible(true);
}
示例2: LayerColumnHeader
import org.eclipse.nebula.widgets.nattable.layer.DataLayer; //导入依赖的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);
}
示例3: setColumnWidthFromModel
import org.eclipse.nebula.widgets.nattable.layer.DataLayer; //导入依赖的package包/类
private void setColumnWidthFromModel(final int columnIndex) {
final DataLayer dataLayer = tableLayers.getDataLayer();
final int width = columnModel.getColumn(columnIndex).getWidth();
if (width >= 0) {
//the data layer is not reordered so the index must be used here instead
//of position (index and position are the same in this layer)
if (width != dataLayer.getColumnWidthByPosition(columnIndex)) {
dataLayer.setColumnWidthByPosition(columnIndex, width);
}
}
}
示例4: NatTableLayers
import org.eclipse.nebula.widgets.nattable.layer.DataLayer; //导入依赖的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);
}
示例5: BodyLayerStack
import org.eclipse.nebula.widgets.nattable.layer.DataLayer; //导入依赖的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);
}
示例6: BodyLayerStack
import org.eclipse.nebula.widgets.nattable.layer.DataLayer; //导入依赖的package包/类
public BodyLayerStack(List<T> values,
IColumnPropertyAccessor<T> columnPropertyAccessor,
ColumnGroupModel... columnGroupModel) {
// wrapping of the list to show into GlazedLists
// see http://publicobject.com/glazedlists/ for further information
EventList<T> eventList = GlazedLists.eventList(values);
TransformedList<T, T> rowObjectsGlazedList = GlazedLists.threadSafeList(eventList);
// use the SortedList constructor with 'null' for the Comparator
// because the Comparator will be set by configuration
this.sortedList = new SortedList<T>(rowObjectsGlazedList, null);
// wrap the SortedList with the FilterList
this.filterList = new FilterList<T>(getSortedList());
this.bodyDataProvider =
new ListDataProvider<T>(this.filterList, columnPropertyAccessor);
DataLayer bodyDataLayer = new DataLayer(this.bodyDataProvider);
// layer for event handling of GlazedLists and PropertyChanges
GlazedListsEventLayer<T> glazedListsEventLayer =
new GlazedListsEventLayer<T>(bodyDataLayer, this.filterList);
this.columnReorderLayer = new ColumnReorderLayer(glazedListsEventLayer);
this.columnGroupReorderLayer =
new ColumnGroupReorderLayer(this.columnReorderLayer, columnGroupModel[columnGroupModel.length - 1]);
this.columnHideShowLayer = new ColumnHideShowLayer(this.columnGroupReorderLayer);
this.columnGroupExpandCollapseLayer =
new ColumnGroupExpandCollapseLayer(this.columnHideShowLayer, columnGroupModel);
this.selectionLayer = new SelectionLayer(this.columnGroupExpandCollapseLayer);
this.viewportLayer = new ViewportLayer(this.selectionLayer);
final FreezeLayer freezeLayer = new FreezeLayer(this.selectionLayer);
final CompositeFreezeLayer compositeFreezeLayer =
new CompositeFreezeLayer(freezeLayer, this.viewportLayer, this.selectionLayer);
setUnderlyingLayer(compositeFreezeLayer);
}
示例7: createExampleControl
import org.eclipse.nebula.widgets.nattable.layer.DataLayer; //导入依赖的package包/类
public Control createExampleControl(Composite parent) {
SelectionExampleGridLayer gridLayer = new SelectionExampleGridLayer();
NatTable natTable = new NatTable(parent, gridLayer, false);
DataLayer bodyDataLayer = gridLayer.getBodyDataLayer();
// Label accumulator - adds labels to all cells with the given data
// value
CellOverrideLabelAccumulator<RowDataFixture> cellLabelAccumulator =
new CellOverrideLabelAccumulator<RowDataFixture>(gridLayer.getBodyDataProvider());
cellLabelAccumulator.registerOverride("AAA", 2, CELL_LABEL);
// Register your cell style, against the label applied to the cell
// Other configuration which can be added (apart from style) include
// CellConfigAttributes, EditConfigAttributes, SortConfigAttributes etc.
IConfigRegistry configRegistry = new ConfigRegistry();
addColumnHighlight(configRegistry);
// Register label accumulator
bodyDataLayer.setConfigLabelAccumulator(cellLabelAccumulator);
gridLayer.getSelectionLayer().addConfiguration(new DefaultSelectionLayerConfiguration());
natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
natTable.setConfigRegistry(configRegistry);
natTable.configure();
return natTable;
}
示例8: init
import org.eclipse.nebula.widgets.nattable.layer.DataLayer; //导入依赖的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);
}
示例9: doCommand
import org.eclipse.nebula.widgets.nattable.layer.DataLayer; //导入依赖的package包/类
@Override
public boolean doCommand(ILayerCommand command) {
if (command instanceof FillLayerResetCommand) {
this.modified = false;
this.ignore = true;
for (int i = 0; i < getColumnCount(); i++) {
ColumnResizeCommand resize = new ColumnResizeCommand(this, i, DataLayer.DEFAULT_COLUMN_WIDTH);
underlyingLayer.doCommand(resize);
}
this.ignore = false;
}
return super.doCommand(command);
}
示例10: LayerRowHeader
import org.eclipse.nebula.widgets.nattable.layer.DataLayer; //导入依赖的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);
}
示例11: LayerBody
import org.eclipse.nebula.widgets.nattable.layer.DataLayer; //导入依赖的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);
}
示例12: getDataLayer
import org.eclipse.nebula.widgets.nattable.layer.DataLayer; //导入依赖的package包/类
public DataLayer getDataLayer() {
return dataLayer;
}
示例13: RowHeaderLayerStack
import org.eclipse.nebula.widgets.nattable.layer.DataLayer; //导入依赖的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);
}
示例14: ColumnHeaderLayerStack
import org.eclipse.nebula.widgets.nattable.layer.DataLayer; //导入依赖的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()));
}
示例15: getDataLayer
import org.eclipse.nebula.widgets.nattable.layer.DataLayer; //导入依赖的package包/类
DataLayer getDataLayer() {
return dataLayer;
}