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


Java CellReference类代码示例

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


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

示例1: onClick

import com.vaadin.client.widget.grid.CellReference; //导入依赖的package包/类
@Override
public void onClick(GridClickEvent event) {
    SelectionModel<JsonObject> selectionModel = grid.getSelectionModel();
    if (!(selectionModel instanceof SelectionModel.Multi)) {
        return;
    }

    SelectionModel.Multi<JsonObject> model = (SelectionModel.Multi<JsonObject>) selectionModel;
    CellReference<JsonObject> cell = grid.getEventCell();

    if (!event.isShiftKeyDown() || previous < 0) {
        handleCtrlClick(model, cell, event);
        previous = cell.getRowIndex();
        return;
    }

    // This works on the premise that grid fires the data available event to
    // any newly added handlers.
    boolean ctrlOrMeta = event.isControlKeyDown() || event.isMetaKeyDown();
    handler = grid.addDataAvailableHandler(new ShiftSelector(cell, model, ctrlOrMeta));
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:22,代码来源:MultiSelectionBodyClickHandler.java

示例2: ctrlClickSelect

import com.vaadin.client.widget.grid.CellReference; //导入依赖的package包/类
@Override
protected void ctrlClickSelect(SelectionModel<JsonObject> model, CellReference<JsonObject> cell, GridClickEvent e) {
	// Plain control click, or no previously selected.
	if (!e.isShiftKeyDown() || previous < 0) {
		super.ctrlClickSelect(model, cell, e);
		previous = cell.getRowIndex();
		return;
	}

	// Stop selecting text for now.
	WidgetUtil.setTextSelectionEnabled(grid.getElement(), false);
	WidgetUtil.clearTextSelection();

	// This works on the premise that grid fires the data available event to
	// any newly added handlers.
	boolean ctrlOrMeta = e.isControlKeyDown() || e.isMetaKeyDown();
	handler = grid.addDataAvailableHandler(new ShiftSelector(cell, model, ctrlOrMeta));
}
 
开发者ID:tsuoanttila,项目名称:GridExtensionPack,代码行数:19,代码来源:ShiftCtrlClickSelectionHandler.java

示例3: handleCtrlClick

import com.vaadin.client.widget.grid.CellReference; //导入依赖的package包/类
protected void handleCtrlClick(SelectionModel.Multi<JsonObject> model,
                               CellReference<JsonObject> cell, GridClickEvent event) {
    NativeEvent e = event.getNativeEvent();
    JsonObject row = cell.getRow();
    if (!e.getCtrlKey() && !e.getMetaKey()) {
        model.deselectAll();
    }

    if (model.isSelected(row)) {
        model.deselect(row);
    } else {
        model.select(row);
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:15,代码来源:MultiSelectionBodyClickHandler.java

示例4: onClick

import com.vaadin.client.widget.grid.CellReference; //导入依赖的package包/类
@Override
public void onClick(GridClickEvent event) {
	SelectionModel<JsonObject> model = grid.getSelectionModel();
	CellReference<JsonObject> cell = grid.getEventCell();

	ctrlClickSelect(model, cell, event);
}
 
开发者ID:tsuoanttila,项目名称:GridExtensionPack,代码行数:8,代码来源:CtrlClickSelectionHandler.java

示例5: ctrlClickSelect

import com.vaadin.client.widget.grid.CellReference; //导入依赖的package包/类
protected void ctrlClickSelect(SelectionModel<JsonObject> model, CellReference<JsonObject> cell,
		GridClickEvent event) {
	NativeEvent e = event.getNativeEvent();
	JsonObject row = cell.getRow();
	if (!e.getCtrlKey() && !e.getMetaKey()) {
		model.deselectAll();
	}

	if (model.isSelected(row)) {
		model.deselect(row);
	} else {
		model.select(row);
	}
}
 
开发者ID:tsuoanttila,项目名称:GridExtensionPack,代码行数:15,代码来源:CtrlClickSelectionHandler.java

示例6: ShiftSelector

import com.vaadin.client.widget.grid.CellReference; //导入依赖的package包/类
private ShiftSelector(CellReference<JsonObject> cell,
                      SelectionModel.Multi<JsonObject> model, boolean ctrlOrMeta) {
    this.cell = cell;
    this.model = model;
    this.ctrlOrMeta = ctrlOrMeta;
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:7,代码来源:MultiSelectionBodyClickHandler.java

示例7: extractComponentElement

import com.vaadin.client.widget.grid.CellReference; //导入依赖的package包/类
private Element extractComponentElement(CellReference cell) {
    return ((AbstractComponentConnector) cell.getValue()).getWidget().getElement();
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:4,代码来源:EnterKeyDownHandler.java

示例8: isCellContainingComponent

import com.vaadin.client.widget.grid.CellReference; //导入依赖的package包/类
private boolean isCellContainingComponent(CellReference cell) {
    return cell.getValue() instanceof AbstractComponentConnector;
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:4,代码来源:EnterKeyDownHandler.java

示例9: ShiftSelector

import com.vaadin.client.widget.grid.CellReference; //导入依赖的package包/类
private ShiftSelector(CellReference<JsonObject> cell, SelectionModel<JsonObject> model, boolean ctrlOrMeta) {
	this.cell = cell;
	this.model = model;
	this.ctrlOrMeta = ctrlOrMeta;
}
 
开发者ID:tsuoanttila,项目名称:GridExtensionPack,代码行数:6,代码来源:ShiftCtrlClickSelectionHandler.java

示例10: isFirstCell

import com.vaadin.client.widget.grid.CellReference; //导入依赖的package包/类
/**
 * Check if cell is the first cell in the whole grid
 *
 * @param cellReference
 *            Cell
 * @param element
 *            element
 * @param shiftKeyDown
 *            if shiftKey was down when event was triggered
 * @return true if first cell in the first row
 */
protected static boolean isFirstCell(CellReference cellReference, Element element, boolean shiftKeyDown) {
	return isFirstRow(cellReference) && !hasPreviousInputElement(element, shiftKeyDown);
}
 
开发者ID:vaadin,项目名称:grid-renderers-collection-addon,代码行数:15,代码来源:NavigationUtil.java

示例11: isFirstRow

import com.vaadin.client.widget.grid.CellReference; //导入依赖的package包/类
/**
 * Check if given cell is in the first row of the grid
 *
 * @param cellReference
 *            cell
 * @return true if in first row of the grid
 */
protected static boolean isFirstRow(CellReference cellReference) {
	return cellReference.getRowIndex() == 0;
}
 
开发者ID:vaadin,项目名称:grid-renderers-collection-addon,代码行数:11,代码来源:NavigationUtil.java

示例12: isFirstColumn

import com.vaadin.client.widget.grid.CellReference; //导入依赖的package包/类
/**
 * Check if given cell is in the first column of the row
 *
 * @param cellReference
 *            cell
 * @return true if in first column
 */
protected static boolean isFirstColumn(CellReference cellReference) {
	return cellReference.getColumnIndex() == 0;
}
 
开发者ID:vaadin,项目名称:grid-renderers-collection-addon,代码行数:11,代码来源:NavigationUtil.java

示例13: isLastCell

import com.vaadin.client.widget.grid.CellReference; //导入依赖的package包/类
/**
 * Check if the cell is the last cell in the whole grid
 *
 * @param cellReference
 *            Cell
 * @param grid
 *            Grid to check
 * @param element
 *            element
 * @return true if the last column in the last row
 */
protected static boolean isLastCell(CellReference cellReference, Grid grid, Element element, boolean shiftKeyDown) {
	return isLastRow(cellReference, grid) && !hasNextInputElement(element, shiftKeyDown);
}
 
开发者ID:vaadin,项目名称:grid-renderers-collection-addon,代码行数:15,代码来源:NavigationUtil.java

示例14: isLastRow

import com.vaadin.client.widget.grid.CellReference; //导入依赖的package包/类
/**
 * Check if given cell is in the last row of the grid
 *
 * @param cellReference
 *            cell
 * @param grid
 *            Grid for cell
 * @return true if in first row of the grid
 */
protected static boolean isLastRow(CellReference cellReference, Grid grid) {
	return cellReference.getRowIndex() + 1 == grid.getDataSource()
		.size();
}
 
开发者ID:vaadin,项目名称:grid-renderers-collection-addon,代码行数:14,代码来源:NavigationUtil.java

示例15: isLastColumn

import com.vaadin.client.widget.grid.CellReference; //导入依赖的package包/类
/**
 * Check if given cell is on the last column of the row
 *
 * @param cellReference
 *            Cell
 * @param grid
 *            Grid for cell
 * @return true if in last column
 */
protected static boolean isLastColumn(CellReference cellReference, Grid grid) {
	return cellReference.getColumnIndex() + 1 == grid.getColumnCount();
}
 
开发者ID:vaadin,项目名称:grid-renderers-collection-addon,代码行数:13,代码来源:NavigationUtil.java


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