本文整理汇总了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));
}
示例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));
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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;
}
示例7: extractComponentElement
import com.vaadin.client.widget.grid.CellReference; //导入依赖的package包/类
private Element extractComponentElement(CellReference cell) {
return ((AbstractComponentConnector) cell.getValue()).getWidget().getElement();
}
示例8: isCellContainingComponent
import com.vaadin.client.widget.grid.CellReference; //导入依赖的package包/类
private boolean isCellContainingComponent(CellReference cell) {
return cell.getValue() instanceof AbstractComponentConnector;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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();
}
示例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();
}