private <C> boolean resetFocusOnCellImpl(Context context, T value, HasCell<T, C> column, Element cellParent) { C cellValue = column.getValue(value); Cell<C> cell = column.getCell(); return cell.resetFocus(context, cellParent, cellValue); }
private <X> boolean isEditingImpl(Context context, Element cellParent, C object, HasCell<C, X> hasCell) { return hasCell.getCell().isEditing(context, cellParent, hasCell.getValue(object)); }
private <X> boolean resetFocusImpl(Context context, Element cellParent, C value, HasCell<C, X> hasCell) { X cellValue = hasCell.getValue(value); return hasCell.getCell().resetFocus(context, cellParent, cellValue); }
private <X> void setValueImpl(Context context, Element cellParent, C object, HasCell<C, X> hasCell) { hasCell.getCell().setValue(context, cellParent, hasCell.getValue(object)); } }
private <X> void onBrowserEventImpl(final Context context, Element parent, final C object, NativeEvent event, final ValueUpdater<C> valueUpdater, final HasCell<C, X> hasCell) { Cell<X> cell = hasCell.getCell(); String eventType = event.getType(); Set<String> cellConsumedEvents = cell.getConsumedEvents(); if (cellConsumedEvents == null || !cellConsumedEvents.contains(eventType)) { // If this sub-cell doesn't consume this event. return; } ValueUpdater<X> tempUpdater = null; final FieldUpdater<C, X> fieldUpdater = hasCell.getFieldUpdater(); if (fieldUpdater != null) { tempUpdater = new ValueUpdater<X>() { @Override public void update(X value) { fieldUpdater.update(context.getIndex(), object, value); if (valueUpdater != null) { valueUpdater.update(object); } } }; } cell.onBrowserEvent(context, parent, hasCell.getValue(object), event, tempUpdater); }
/** * Render the composite cell as HTML into a {@link SafeHtmlBuilder}, suitable * for passing to {@link Element#setInnerHTML} on a container element. * * <p> * Note: If your cell contains natively focusable elements, such as buttons or * input elements, be sure to set the tabIndex to -1 so that they do not steal * focus away from the containing widget. * </p> * * @param context the {@link com.google.gwt.cell.client.Cell.Context Context} of the cell * @param value the cell value to be rendered * @param sb the {@link SafeHtmlBuilder} to be written to * @param hasCell a {@link HasCell} instance containing the cells to be * rendered within this cell */ protected <X> void render(Context context, C value, SafeHtmlBuilder sb, HasCell<C, X> hasCell) { Cell<X> cell = hasCell.getCell(); sb.appendHtmlConstant("<span>"); cell.render(context, hasCell.getValue(value), sb); sb.appendHtmlConstant("</span>"); }
theColumn.render(context, rowValue, cellBuilder); } else { column.getCell().render(context, column.getValue(rowValue), cellBuilder);
C cellValue = column.getValue(rowValue); boolean cellWasEditing = cell.isEditing(context, parentElem, cellValue); if (column instanceof Column) {
private <X> void setValueImpl(Context context, Element cellParent, C object, HasCell<C, X> hasCell) { hasCell.getCell().setValue(context, cellParent, hasCell.getValue(object)); } }
private <X> boolean isEditingImpl(Context context, Element cellParent, C object, HasCell<C, X> hasCell) { return hasCell.getCell().isEditing(context, cellParent, hasCell.getValue(object)); }
private <X> boolean resetFocusImpl(Context context, Element cellParent, C value, HasCell<C, X> hasCell) { X cellValue = hasCell.getValue(value); return hasCell.getCell().resetFocus(context, cellParent, cellValue); }
private <X> void setValueImpl(Context context, Element cellParent, C object, HasCell<C, X> hasCell) { hasCell.getCell().setValue(context, cellParent, hasCell.getValue(object)); } }
private <C> boolean resetFocusOnCellImpl(Context context, T value, HasCell<T, C> column, Element cellParent) { C cellValue = column.getValue(value); Cell<C> cell = column.getCell(); return cell.resetFocus(context, cellParent, cellValue); }
private <C> boolean resetFocusOnCellImpl(Context context, T value, HasCell<T, C> column, Element cellParent) { C cellValue = column.getValue(value); Cell<C> cell = column.getCell(); return cell.resetFocus(context, cellParent, cellValue); }
private <X> boolean resetFocusImpl(Context context, Element cellParent, C value, HasCell<C, X> hasCell) { X cellValue = hasCell.getValue(value); return hasCell.getCell().resetFocus(context, cellParent, cellValue); }
private <X> boolean isEditingImpl(Context context, Element cellParent, C object, HasCell<C, X> hasCell) { return hasCell.getCell().isEditing(context, cellParent, hasCell.getValue(object)); }
protected <X> void render(Context context, C value, SafeHtmlBuilder sb, HasCell<C, X> hasCell, String id) { com.google.gwt.cell.client.Cell<X> _cell = hasCell.getCell(); if (_cell instanceof Cell) { Cell<X> cell = (Cell<X>) _cell; // cast from GWT Cell to our Cell impl sb.appendHtmlConstant("<span id=\"" + id + "\">"); //$NON-NLS-1$ //$NON-NLS-2$ cell.render(context, hasCell.getValue(value), sb, id); sb.appendHtmlConstant("</span>"); //$NON-NLS-1$ } else { throw new IllegalStateException("CompositeCell cannot render Cells that do not implement " //$NON-NLS-1$ + Cell.class.getName()); } }
@Override protected <T> void render(Cell.Context context, C value, SafeHtmlBuilder sb, HasCell<C, T> hasCell, String id) { com.google.gwt.cell.client.Cell<T> _cell = hasCell.getCell(); if (_cell instanceof Cell) { Cell<T> cell = (Cell<T>) _cell; // cast from GWT Cell to our Cell impl if (cell instanceof HasStyleClass) { ((HasStyleClass) cell).setStyleClass(style.divInlineBlock()); } cell.render(context, hasCell.getValue(value), sb, id); } else { throw new IllegalStateException("StatusCompositeCell cannot render Cells that do not implement " //$NON-NLS-1$ + Cell.class.getName()); } }
private <X> void onBrowserEventImpl(final Context context, Element parent, final C object, NativeEvent event, final ValueUpdater<C> valueUpdater, final HasCell<C, X> hasCell) { Cell<X> cell = hasCell.getCell(); String eventType = event.getType(); Set<String> cellConsumedEvents = cell.getConsumedEvents(); if (cellConsumedEvents == null || !cellConsumedEvents.contains(eventType)) { // If this sub-cell doesn't consume this event. return; } ValueUpdater<X> tempUpdater = null; final FieldUpdater<C, X> fieldUpdater = hasCell.getFieldUpdater(); if (fieldUpdater != null) { tempUpdater = new ValueUpdater<X>() { @Override public void update(X value) { fieldUpdater.update(context.getIndex(), object, value); if (valueUpdater != null) { valueUpdater.update(object); } } }; } cell.onBrowserEvent(context, parent, hasCell.getValue(object), event, tempUpdater); }
/** * Render the composite cell as HTML into a {@link SafeHtmlBuilder}, suitable * for passing to {@link Element#setInnerHTML} on a container element. * * <p> * Note: If your cell contains natively focusable elements, such as buttons or * input elements, be sure to set the tabIndex to -1 so that they do not steal * focus away from the containing widget. * </p> * * @param context the {@link com.google.gwt.cell.client.Cell.Context Context} of the cell * @param value the cell value to be rendered * @param sb the {@link SafeHtmlBuilder} to be written to * @param hasCell a {@link HasCell} instance containing the cells to be * rendered within this cell */ protected <X> void render(Context context, C value, SafeHtmlBuilder sb, HasCell<C, X> hasCell) { Cell<X> cell = hasCell.getCell(); sb.appendHtmlConstant("<span>"); cell.render(context, hasCell.getValue(value), sb); sb.appendHtmlConstant("</span>"); }