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


Java BaseGridRendererHelper.getColumnInformation方法代码示例

本文整理汇总了Java中org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper.getColumnInformation方法的典型用法代码示例。如果您正苦于以下问题:Java BaseGridRendererHelper.getColumnInformation方法的具体用法?Java BaseGridRendererHelper.getColumnInformation怎么用?Java BaseGridRendererHelper.getColumnInformation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper的用法示例。


在下文中一共展示了BaseGridRendererHelper.getColumnInformation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getUiColumnIndex

import org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper; //导入方法依赖的package包/类
/**
 * Gets the column index corresponding to the provided Canvas x-coordinate relative to the grid. Grid-relative coordinates can be
 * obtained from {@link INodeXYEvent} using {@link CoordinateUtilities#convertDOMToGridCoordinate(GridWidget, Point2D)}
 * @param gridWidget GridWidget to check.
 * @param cx x-coordinate relative to the GridWidget.
 * @return The column index or null if the coordinate did not map to a cell.
 */
public static Integer getUiColumnIndex(final GridWidget gridWidget,
                                       final double cx) {
    final GridData gridModel = gridWidget.getModel();
    final BaseGridRendererHelper rendererHelper = gridWidget.getRendererHelper();

    if (cx < 0 || cx > gridWidget.getWidth()) {
        return null;
    }

    //Get column index
    final BaseGridRendererHelper.ColumnInformation ci = rendererHelper.getColumnInformation(cx);
    final GridColumn<?> column = ci.getColumn();
    final int uiColumnIndex = ci.getUiColumnIndex();

    if (column == null) {
        return null;
    }
    if (uiColumnIndex < 0 || uiColumnIndex > gridModel.getColumnCount() - 1) {
        return null;
    }

    return uiColumnIndex;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:31,代码来源:CoordinateUtilities.java

示例2: startEditingCell

import org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper; //导入方法依赖的package包/类
@Override
public boolean startEditingCell(final Point2D ap) {
    //Get row information
    final Integer uiRowIndex = CoordinateUtilities.getUiRowIndex(gridWidget,
                                                                 ap.getY());
    if (uiRowIndex == null) {
        return false;
    }

    //Get column information
    final BaseGridRendererHelper rendererHelper = gridWidget.getRendererHelper();
    final BaseGridRendererHelper.ColumnInformation ci = rendererHelper.getColumnInformation(ap.getX());
    final GridColumn<?> column = ci.getColumn();
    if (column == null) {
        return false;
    }

    return edit(uiRowIndex,
                ci);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:21,代码来源:BaseCellSelectionManager.java

示例3: handleHeaderCellDoubleClick

import org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper; //导入方法依赖的package包/类
@Override
protected boolean handleHeaderCellDoubleClick(final NodeMouseDoubleClickEvent event) {
    //Convert Canvas co-ordinate to Grid co-ordinate
    final Point2D ap = CoordinateUtilities.convertDOMToGridCoordinate(gridWidget,
                                                                      new Point2D(event.getX(),
                                                                                  event.getY()));
    final double cx = ap.getX();
    final double cy = ap.getY();

    //Get column information
    final BaseGridRendererHelper rendererHelper = gridWidget.getRendererHelper();
    final BaseGridRendererHelper.RenderingInformation ri = rendererHelper.getRenderingInformation();
    if (ri == null) {
        return false;
    }
    final BaseGridRendererHelper.ColumnInformation ci = rendererHelper.getColumnInformation(cx);
    final GridColumn<?> column = ci.getColumn();
    if (!hasEditableHeader(column)) {
        return false;
    }

    //Get row index
    final Integer uiHeaderRowIndex = EditableHeaderUtilities.getUiHeaderRowIndex(gridWidget,
                                                                                 column,
                                                                                 cy);
    if (!isEditableHeader(column,
                          uiHeaderRowIndex)) {
        return false;
    }

    //Get rendering information
    final EditableHeaderMetaData headerMetaData = (EditableHeaderMetaData) column.getHeaderMetaData().get(uiHeaderRowIndex);
    final GridBodyCellRenderContext context = EditableHeaderUtilities.makeRenderContext(gridWidget,
                                                                                        ri,
                                                                                        ci,
                                                                                        uiHeaderRowIndex);
    headerMetaData.edit(context);

    return true;
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:41,代码来源:EditableHeaderGridWidgetMouseDoubleClickHandler.java


注:本文中的org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper.getColumnInformation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。