本文整理汇总了Java中com.google.gwt.cell.client.HasCell类的典型用法代码示例。如果您正苦于以下问题:Java HasCell类的具体用法?Java HasCell怎么用?Java HasCell使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HasCell类属于com.google.gwt.cell.client包,在下文中一共展示了HasCell类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initActionsColumn
import com.google.gwt.cell.client.HasCell; //导入依赖的package包/类
private com.google.gwt.user.cellview.client.Column initActionsColumn() {
List<HasCell<DataGridFilterSummary, ?>> cells = new LinkedList<HasCell<DataGridFilterSummary, ?>>();
cells.add(new RemoveActionHasCell("Remove",
new ActionCell.Delegate<DataGridFilterSummary>() {
@Override
public void execute(DataGridFilterSummary filter) {
gridPreferenceStore.removeCustomFilter(filter.getFilterName());
refreshGrid();
}
}));
CompositeCell<DataGridFilterSummary> cell = new CompositeCell<DataGridFilterSummary>(cells);
com.google.gwt.user.cellview.client.Column<DataGridFilterSummary, DataGridFilterSummary> actionsColumn = new com.google.gwt.user.cellview.client.Column<DataGridFilterSummary, DataGridFilterSummary>(
cell) {
@Override
public DataGridFilterSummary getValue(DataGridFilterSummary object) {
return object;
}
};
return actionsColumn;
}
示例2: fireEventToCell
import com.google.gwt.cell.client.HasCell; //导入依赖的package包/类
/**
* Fire an event to the Cell within the specified {@link TableCellElement}.
*/
private <C> void fireEventToCell(Event event, String eventType, Element parentElem,
final T rowValue, Context context, HasCell<T, C> column) {
// Check if the cell consumes the event.
Cell<C> cell = column.getCell();
if (!cellConsumesEventType(cell, eventType)) {
return;
}
C cellValue = column.getValue(rowValue);
boolean cellWasEditing = cell.isEditing(context, parentElem, cellValue);
if (column instanceof Column) {
/*
* If the HasCell is a Column, let it handle the event itself. This is
* here for legacy support.
*/
Column<T, C> col = (Column<T, C>) column;
col.onBrowserEvent(context, parentElem, rowValue, event);
} else {
// Create a FieldUpdater.
final FieldUpdater<T, C> fieldUpdater = column.getFieldUpdater();
final int index = context.getIndex();
ValueUpdater<C> valueUpdater = (fieldUpdater == null) ? null : (value) -> {
fieldUpdater.update(index, rowValue, value);
};
// Fire the event to the cell.
cell.onBrowserEvent(context, parentElem, cellValue, event, valueUpdater);
}
// Reset focus if needed.
cellIsEditing = cell.isEditing(context, parentElem, cellValue);
if (cellWasEditing && !cellIsEditing) {
CellBasedWidgetImpl.get().resetFocus(() -> {
setFocus(true);
});
}
}
示例3: render
import com.google.gwt.cell.client.HasCell; //导入依赖的package包/类
@Override
protected <X> void render(Context context, GlobalPermissionEnum value,
SafeHtmlBuilder sb, HasCell<GlobalPermissionEnum, X> hasCell) {
Cell<X> cell = hasCell.getCell();
sb.appendHtmlConstant("<td>");
cell.render(context, hasCell.getValue(value), sb);
sb.appendHtmlConstant("</td>");
}