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

Java ViewportLayer类代码示例

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

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



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

示例1: construct

import org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer; //导入依赖的package包/类
@Override
public Control construct(Composite parent) {
	Composite content = new Composite(parent, SWT.NONE);
	GridDataFactory.fillDefaults().grab(true, true).applyTo(content);
	GridLayoutFactory.fillDefaults().numColumns(1).applyTo(content);

	CompositeLayer layer = new CompositeLayer(1, 1);
	layer.setChildLayer(GridRegion.BODY,
			new ViewportLayer(
					new SelectionLayer(new SpanningDataLayer(new DummySpanningBodyDataProvider(1000000, 1000000)))),
			0, 0);
	NatTable table = new NatTable(content, layer);
	
	GridDataFactory.fillDefaults().grab(true, true).applyTo(table);

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


示例2: init

import org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer; //导入依赖的package包/类
public void init(){
		rowCount=1;
		
		bodyDataProvider=new DodyDataProvider();
		bodyDataLayer=new DataLayer(bodyDataProvider, colWidth, rowHeight);
		selectionLayer = new SelectionLayer(bodyDataLayer);
		selectionLayer.addConfiguration(new DefaultSelectionLayerConfiguration());
		selectionLayer.addLayerListener(layerListener);
		viewportLayer = new ViewportLayer(selectionLayer);
		viewportLayer.setRegionName(GridRegion.BODY);
		
		columnSpanHeaderDataProvider=new ColumnSpanHeaderDataProvider();
		columnSpanHeaderDataLayer=new SpanningDataLayer(columnSpanHeaderDataProvider, colWidth, rowHeight);
//		columnHeaderLayer = new ColumnSpanHeaderLayer(columnSpanHeaderDataLayer, viewportLayer, selectionLayer, false);
		columnSpanHeaderSelectionLayer=new SelectionLayer(columnSpanHeaderDataLayer);
		columnHeaderLayer = new ColumnSpanHeaderLayer(columnSpanHeaderSelectionLayer, viewportLayer, selectionLayer, false);
		
		rowSpanHeaderDataProvider=new RowSpanHeaderDataProvider();
		rowSpanHeaderDataLayer=new SpanningDataLayer(rowSpanHeaderDataProvider, colWidth*2, rowHeight);
		rowHeaderLayer = new RowSpanHeaderLayer(rowSpanHeaderDataLayer, viewportLayer, selectionLayer, false);
		
		cornerDataProvider = new DefaultCornerDataProvider(columnSpanHeaderDataProvider, rowSpanHeaderDataProvider);
		cornerDataLayer = new DataLayer(cornerDataProvider, colWidth, rowHeight);
		cornerLayer = new CornerLayer(cornerDataLayer, rowHeaderLayer, columnHeaderLayer);
		
		gridLayer = new GridLayer(viewportLayer, columnHeaderLayer, rowHeaderLayer, cornerLayer);
	}
 
开发者ID:HoratiusTang,项目名称:EsperDist,代码行数:28,代码来源:InstanceTable.java


示例3: getVisibleRows

import org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer; //导入依赖的package包/类
@Override
public Interval<Integer> getVisibleRows() {
    final ViewportLayer viewPort = tableLayers.getViewPortLayer();
    final int originY = viewPort.getOrigin().getY();
    final int firstRow = viewPort.getRowPositionByY(originY);
    final int lastRow = viewPort.getRowPositionByY(originY + viewPort.getClientAreaHeight());
    return new Interval<Integer>(getWrapperInteger(firstRow), getWrapperInteger(lastRow));
}
 
开发者ID:jo-source,项目名称:jo-widgets,代码行数:9,代码来源:NatTableImplSpi.java


示例4: BodyLayerStack

import org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer; //导入依赖的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


示例5: BodyLayerStack

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


示例6: SelectionExampleBodyLayerStack

import org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer; //导入依赖的package包/类
public SelectionExampleBodyLayerStack(IUniqueIndexLayer underlyingLayer) {
    this.columnReorderLayer = new ColumnReorderLayer(underlyingLayer);
    this.columnHideShowLayer = new ColumnHideShowLayer(this.columnReorderLayer);

    // No autoconfig on selection layer
    this.selectionLayer = new SelectionLayer(this.columnHideShowLayer, false);

    this.viewportLayer = new ViewportLayer(this.selectionLayer);
    setUnderlyingLayer(this.viewportLayer);

    registerCommandHandler(new CopyDataCommandHandler(this.selectionLayer));
}
 
开发者ID:xored,项目名称:q7.quality.mockups,代码行数:13,代码来源:SelectionExampleBodyLayerStack.java


示例7: scrollToRow

import org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer; //导入依赖的package包/类
@Override
public void scrollToRow(final int rowIndex) {
    final ViewportLayer viewPort = tableLayers.getViewPortLayer();
    viewPort.moveRowPositionIntoViewport(rowIndex);
}
 
开发者ID:jo-source,项目名称:jo-widgets,代码行数:6,代码来源:NatTableImplSpi.java


示例8: getViewPortLayer

import org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer; //导入依赖的package包/类
public ViewportLayer getViewPortLayer() {
    return viewPortLayer;
}
 
开发者ID:jo-source,项目名称:jo-widgets,代码行数:4,代码来源:NatTableLayers.java


示例9: getViewportLayer

import org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer; //导入依赖的package包/类
ViewportLayer getViewportLayer() {
    return viewportLayer;
}
 
开发者ID:jo-source,项目名称:jo-widgets,代码行数:4,代码来源:BodyLayerStack.java


示例10: PathCompositeLayer

import org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer; //导入依赖的package包/类
/**
 * Constructor
 *
 * @param rootPath
 * @param eventBroker
 */
public PathCompositeLayer(Path rootPath, IEventBroker eventBroker) {
    super(1, 2);

    this.rootPath = rootPath;
    fillContentList(rootPath);

    // TODO
    propertyToLabelMap.put(PathFixture.FIELD_NAME, "Name");
    propertyToLabelMap.put(PathFixture.FIELD_SIZE, "Size");
    propertyToLabelMap.put(PathFixture.FIELD_ATTRS, "Attr");

    columnPropertyAccessor = new PathColumnPropertyAccessor(propertyToLabelMap, rootPath);
    bodyDataProvider = new ListDataProvider<PathFixture>(this.contentlist, columnPropertyAccessor);

    bodyDataLayer = new DataLayer(bodyDataProvider);

    // set columns fixed percentage sizing
    bodyDataLayer.setColumnWidthPercentageByPosition(0, 80);
    bodyDataLayer.setColumnWidthPercentageByPosition(1, 10);
    bodyDataLayer.setColumnWidthPercentageByPosition(2, 10);

    selectionLayer = new SelectionLayer(bodyDataLayer, false);
    ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);

    // use a RowSelectionModel that will perform row selections and is able
    // to identify a row via unique ID
    selectionLayer.setSelectionModel(new RowSelectionModel<PathFixture>(selectionLayer, bodyDataProvider,
            new PathFixtureRowIdAccessor(this.contentlist)));

    // register different selection move command handler that always moves
    // by row
    selectionLayer.addConfiguration(new RowOnlySelectionConfiguration<PathFixture>());

    // register path handler
    OpenPathHandler pathHandler = new OpenPathHandler(selectionLayer, bodyDataProvider, eventBroker);
    viewportLayer.registerCommandHandler(pathHandler);

    // register selection bindings that will perform row selections instead
    // of cell selections
    // registering the bindings on a layer that is above the SelectionLayer
    // will consume the
    // commands before they are handled by the SelectionLayer
    viewportLayer.addConfiguration(new PathSelectionUiBinding());

    ILayer columnHeaderLayer = new ColumnHeaderLayer(new DataLayer(new SimpleColumnHeaderDataProvider(
            propertyToLabelMap)), viewportLayer, selectionLayer);

    setChildLayer(GridRegion.COLUMN_HEADER, columnHeaderLayer, 0, 0);
    setChildLayer(GridRegion.BODY, viewportLayer, 0, 1);

}
 
开发者ID:e4c,项目名称:EclipseCommander,代码行数:58,代码来源:PathCompositeLayer.java


示例11: getViewportLayer

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


示例12: createSingleColumnTable

import org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer; //导入依赖的package包/类
/**
 * Create a single column {@link NatTableWrapper}. The {@link IRowDataProvider} parameter is not
 * optional, the {@link AbstractRegistryConfiguration} is optional.
 * 
 * @param parent
 * @param dataProvider
 * @param customConfiguration
 * @return
 */
@SuppressWarnings("unchecked")
public static NatTableWrapper createSingleColumnTable(Composite parent,
	IRowDataProvider<? extends Object> dataProvider,
	AbstractRegistryConfiguration customConfiguration){
	
	NatTableWrapper natTableWrapper = new NatTableWrapper();
	
	DataLayer bodyDataLayer = new DataLayer(dataProvider);
	// disable drawing cells lines
	SelectionLayer selectionLayer = new SelectionLayer(bodyDataLayer) {
		private CellLayerPainter painter = new CellLayerPainter();
		
		@Override
		public ILayerPainter getLayerPainter(){
			return painter;
		}
	};
	ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);
	viewportLayer.setRegionName(GridRegion.BODY);
	
	NatTable natTable =
		new NatTable(parent, NatTable.DEFAULT_STYLE_OPTIONS | SWT.BORDER, viewportLayer, false);
	natTable.setBackground(natTable.getDisplay().getSystemColor(SWT.COLOR_WHITE));
	natTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	natTable.addConfiguration(new DefaultSingleColumnStyleConfiguration());
	if (customConfiguration != null) {
		natTable.addConfiguration(customConfiguration);
	}
	natTableWrapper.setNatTable(natTable);
	natTableWrapper.setDataProvider((IRowDataProvider<Object>) dataProvider);
	natTableWrapper.setSelectionLayer(selectionLayer);
	
	natTableWrapper.configure();
	// workaround for setting column with to 100% as this is currently broken due to a SWT update of Elexis
	// TODO revert after NatTable / Target update for Elexis 3.3
	// bodyDataLayer.setColumnPercentageSizing(true);
	// bodyDataLayer.setColumnWidthPercentageByPosition(0, 100);
	natTable.addControlListener(new ResizeColumnListener(bodyDataLayer));
	
	return natTableWrapper;
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:51,代码来源:NatTableFactory.java


示例13: getViewportLayer

import org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer; //导入依赖的package包/类
/**
 * Returns the viewport layer.
 *
 * @return
 */
public ViewportLayer getViewportLayer() {
    return this.gridLayer.getBodyLayer().getViewportLayer();
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:9,代码来源:ComponentDataTable.java


示例14: getViewportLayer

import org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer; //导入依赖的package包/类
/**
 * Returns the viewport layer.
 *
 * @return
 */
public ViewportLayer getViewportLayer() {
    return viewportLayer;
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:9,代码来源:DataTableBodyLayerStack.java


示例15: getViewportLayer

import org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer; //导入依赖的package包/类
/**
 * Returns the NatTable viewport layer.
 *
 * @return
 */
public ViewportLayer getViewportLayer() {
    return table.getViewportLayer();
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:9,代码来源:ViewData.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java UnivariateOptimizer类代码示例发布时间:2022-05-23
下一篇:
Java SmaliHelpFormatter类代码示例发布时间: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