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

Java NatTable类代码示例

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

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



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

示例1: registerUiBindingsToNatTable

import org.eclipse.nebula.widgets.nattable.NatTable; //导入依赖的package包/类
public static void registerUiBindingsToNatTable(
    final NatTable table,
    final HoveredColumnConfigLabelAccumulator hoveredColumnLabelAccumulator) {

    final UiBindingRegistry uiBindingRegistry = table.getUiBindingRegistry();

    //avoid selection removed on reorder, use swt win style reorder overlay color and
    //do not allow to draw overlay column outside the header
    uiBindingRegistry.unregisterMouseDragMode(MouseEventMatcher.columnHeaderLeftClick(SWT.NONE));
    uiBindingRegistry.registerMouseDragMode(
            MouseEventMatcher.columnHeaderLeftClick(SWT.NONE),
            new AggregateDragMode(
                new JoColumnReorderCellDragMode(),
                new JoColumnReorderDragMode(hoveredColumnLabelAccumulator)));

    //do resize immediate when user changes column width
    uiBindingRegistry.registerFirstMouseDragMode(
            new ColumnResizeEventMatcher(SWT.NONE, GridRegion.COLUMN_HEADER, 1),
            new ResizeImediateDragMode());
}
 
开发者ID:jo-source,项目名称:jo-widgets,代码行数:21,代码来源:JoNatTableConfigurator.java


示例2: setCellImage

import org.eclipse.nebula.widgets.nattable.NatTable; //导入依赖的package包/类
private void setCellImage(final NatTable natTable) {
    final int columnPosition = natTable.getColumnPositionByX(this.currentEvent.x);
    final int rowPosition = natTable.getRowPositionByY(this.currentEvent.y);
    final ILayerCell cell = natTable.getCellByPosition(columnPosition, rowPosition);

    final Rectangle cellBounds = cell.getBounds();
    this.xOffset = this.currentEvent.x - cellBounds.x;
    final Image image = new Image(natTable.getDisplay(), cellBounds.width, cellBounds.height);

    final GC gc = new GC(image);
    final IConfigRegistry configRegistry = natTable.getConfigRegistry();
    final ICellPainter cellPainter = cell.getLayer().getCellPainter(columnPosition, rowPosition, cell, configRegistry);
    if (cellPainter != null) {
        cellPainter.paintCell(cell, gc, new Rectangle(0, 0, cellBounds.width, cellBounds.height), configRegistry);
    }
    gc.dispose();

    final ImageData imageData = image.getImageData();
    image.dispose();
    imageData.alpha = 150;

    this.cellImage = new Image(natTable.getDisplay(), imageData);
}
 
开发者ID:jo-source,项目名称:jo-widgets,代码行数:24,代码来源:JoColumnReorderCellDragMode.java


示例3: NatTableTooltip

import org.eclipse.nebula.widgets.nattable.NatTable; //导入依赖的package包/类
NatTableTooltip(
    final NatTable natTable,
    final ITableDataModel dataModel,
    final ITableColumnModelSpi columnModel,
    final String... tooltipRegions) {

    super(natTable, tooltipRegions);

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

    this.dataModel = dataModel;
    this.columnModel = columnModel;

    this.dummyShell = new Shell(SWT.NONE);
    this.graphicContext = new GC(new Label(dummyShell, SWT.NONE));

    setShift(new Point(0, Y_OFFSET));
}
 
开发者ID:jo-source,项目名称:jo-widgets,代码行数:20,代码来源:NatTableTooltip.java


示例4: construct

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


示例5: DataTableGridLayerStack

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


示例6: CellSelectionListener

import org.eclipse.nebula.widgets.nattable.NatTable; //导入依赖的package包/类
public CellSelectionListener(
    final NatTable natTable,
    final SwtDragSource dragSource,
    final IRowSelectionModel<Integer> rowSelectionModel) {

    Assert.paramNotNull(rowSelectionModel, "rowSelectionModel");
    Assert.paramNotNull(dragSource, "dragSource");
    Assert.paramNotNull(rowSelectionModel, "rowSelectionModel");

    this.natTable = natTable;
    this.dragSource = dragSource;
    this.rowSelectionModel = rowSelectionModel;
}
 
开发者ID:jo-source,项目名称:jo-widgets,代码行数:14,代码来源:CellSelectionListener.java


示例7: mouseDown

import org.eclipse.nebula.widgets.nattable.NatTable; //导入依赖的package包/类
@Override
public void mouseDown(final NatTable natTable, final MouseEvent event) {
    this.natTable = natTable;
    this.initialEvent = event;
    this.currentEvent = this.initialEvent;
    this.dragFromGridColumnPosition = getDragFromGridColumnPosition();

    natTable.addOverlayPainter(this.overlayPainter);
    fireMoveStartCommand(natTable, this.dragFromGridColumnPosition);
}
 
开发者ID:jo-source,项目名称:jo-widgets,代码行数:11,代码来源:JoColumnReorderDragMode.java


示例8: mouseUp

import org.eclipse.nebula.widgets.nattable.NatTable; //导入依赖的package包/类
@Override
public void mouseUp(final NatTable natTable, final MouseEvent event) {
    final int col = natTable.getColumnPositionByX(event.x);
    final int row = natTable.getRowPositionByY(event.y);
    if (row == 0 && col >= 0) {
        hoveredColumnLabelAccumulator.setColumnIndex(col);
    }
    else {
        hoveredColumnLabelAccumulator.clearColumnIndex();
    }
    natTable.removeOverlayPainter(overlayPainter);
    super.mouseUp(natTable, event);
}
 
开发者ID:jo-source,项目名称:jo-widgets,代码行数:14,代码来源:JoColumnReorderDragMode.java


示例9: mouseDown

import org.eclipse.nebula.widgets.nattable.NatTable; //导入依赖的package包/类
@Override
public void mouseDown(final NatTable natTable, final MouseEvent event) {
    this.initialEvent = event;
    this.currentEvent = this.initialEvent;

    setCellImage(natTable);

    natTable.forceFocus();

    natTable.addOverlayPainter(this.cellImageOverlayPainter);
}
 
开发者ID:jo-source,项目名称:jo-widgets,代码行数:12,代码来源:JoColumnReorderCellDragMode.java


示例10: mouseUp

import org.eclipse.nebula.widgets.nattable.NatTable; //导入依赖的package包/类
@Override
public void mouseUp(final NatTable natTable, final MouseEvent event) {
    natTable.removeOverlayPainter(this.cellImageOverlayPainter);
    this.cellImage.dispose();

    natTable.redraw(0, 0, natTable.getWidth(), natTable.getHeight(), false);
}
 
开发者ID:jo-source,项目名称:jo-widgets,代码行数:8,代码来源:JoColumnReorderCellDragMode.java


示例11: run

import org.eclipse.nebula.widgets.nattable.NatTable; //导入依赖的package包/类
@Override
public void run(final NatTable natTable, final MouseEvent e) {
    if (e.button == 1) {
        final int columnPositionByX = table.getColumnPositionByX(e.x);
        final int columnIndex = table.getColumnIndexByPosition(columnPositionByX);
        final Set<Modifier> modifier = MouseUtil.getModifier(e.stateMask);
        tableColumnObservable.fireMouseClicked(new TableColumnMouseEvent(columnIndex, modifier));
    }
}
 
开发者ID:jo-source,项目名称:jo-widgets,代码行数:10,代码来源:NatTableImplSpi.java


示例12: matches

import org.eclipse.nebula.widgets.nattable.NatTable; //导入依赖的package包/类
@Override
public boolean matches(final NatTable natTable, final MouseEvent event, final LabelStack regionLabels) {
    if (regionLabels != null && regionLabels.hasLabel(GridRegion.COLUMN_HEADER)) {
        return true;
    }
    else {
        return false;
    }
}
 
开发者ID:jo-source,项目名称:jo-widgets,代码行数:10,代码来源:NatTableImplSpi.java


示例13: run

import org.eclipse.nebula.widgets.nattable.NatTable; //导入依赖的package包/类
@Override
public void run(NatTable natTable, MouseEvent event) {
    // first row
    int rowPosition = 1;

    // only perform the selection if the cursor is null
    if (natTable.getCursor() == null) {
        natTable.doCommand(new ViewportSelectRowCommand(natTable, rowPosition, false, false));
    }

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


示例14: run

import org.eclipse.nebula.widgets.nattable.NatTable; //导入依赖的package包/类
@Override
public void run(NatTable natTable, KeyEvent event) {

    // new SetFocusToOppositePartHandler().execute();

    // first row
    int rowPosition = 1;

    Composite cmp = natTable.getParent();

    // only perform the selection if the cursor is null
    if (natTable.getCursor() == null) {
        natTable.doCommand(new ViewportSelectRowCommand(natTable, rowPosition, false, false));
    }
}
 
开发者ID:e4c,项目名称:EclipseCommander,代码行数:16,代码来源:ViewportSelectOppositePathAction.java


示例15: run

import org.eclipse.nebula.widgets.nattable.NatTable; //导入依赖的package包/类
@Override
public void run(NatTable natTable, KeyEvent event) {
    // open new path
    natTable.doCommand(new OpenPathCommand());

    // select first
    if (natTable.getCursor() == null) {
        natTable.doCommand(new ViewportSelectRowCommand(natTable, 1, false, false));
    }
}
 
开发者ID:e4c,项目名称:EclipseCommander,代码行数:11,代码来源:OpenPathAction.java


示例16: run

import org.eclipse.nebula.widgets.nattable.NatTable; //导入依赖的package包/类
@Override
public void run(NatTable natTable, MouseEvent event) {
    int rowPosition = natTable.getRowPositionByY(event.y);
    if (log.isDebugEnabled()) {
        log.debug("rowPos: " + rowPosition); //$NON-NLS-1$
    }

    if (rowPosition != -1) {
        natTable.doCommand(new OpenPathCommand());
    }

    // select first
    natTable.doCommand(new ViewportSelectRowCommand(natTable, 1, false, false));
}
 
开发者ID:e4c,项目名称:EclipseCommander,代码行数:15,代码来源:OpenPathMouseClickAction.java


示例17: createExampleControl

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


示例18: createControl

import org.eclipse.nebula.widgets.nattable.NatTable; //导入依赖的package包/类
/**
 * Creates the control contents.
 *
 * @param parent
 * @return
 */
private NatTable createControl(final Composite parent) {
    final NatTable natTable = createTable(parent);
    createTableStyling(natTable);
    natTable.configure();
    final GridData tableLayoutData = new GridData();
    tableLayoutData.horizontalAlignment = SWT.FILL;
    tableLayoutData.verticalAlignment = SWT.FILL;
    tableLayoutData.grabExcessHorizontalSpace = true;
    tableLayoutData.grabExcessVerticalSpace = true;
    natTable.setLayoutData(tableLayoutData);
    return natTable;
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:19,代码来源:ComponentDataTable.java


示例19: run

import org.eclipse.nebula.widgets.nattable.NatTable; //导入依赖的package包/类
@Override
public void run(NatTable paramNatTable, MouseEvent paramMouseEvent) {
    int rowCount = bodyDataLayer.getRowCount();
    if (rowCount > RESIZE_THRESHOLD) {
        noOpResizeAction.run(paramNatTable, paramMouseEvent);
    } else {
        defaultResizeAction.run(paramNatTable, paramMouseEvent);
    }
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:10,代码来源:DataTableResizeColumnAction.java


示例20: getGapWidth

import org.eclipse.nebula.widgets.nattable.NatTable; //导入依赖的package包/类
/**
 * 
 *
 * @return
 */
private int getGapWidth() {
    NatTable table = context.getTable();
    if (table == null || table.isDisposed()) return 0;
    int offset = this.bodyLayerStack != null ? this.bodyLayerStack.getRowHeaderLayer() != null ? this.bodyLayerStack.getRowHeaderLayer().getWidth() : 0 : 0; 
    return table != null ? table.getSize().x - super.getWidth() - offset: 0;
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:12,代码来源:DataTableFillLayout.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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