public Set<String> getConsumedEvents() { return cell.getConsumedEvents(); }
/** * Check if a cell consumes the specified event type. * * @param cell the cell * @param eventType the event type to check * @return true if consumed, false if not */ protected boolean cellConsumesEventType(Cell<?> cell, String eventType) { Set<String> consumedEvents = cell.getConsumedEvents(); return consumedEvents != null && consumedEvents.contains(eventType); }
/** * Check if a column consumes events. */ private static boolean isColumnInteractive(HasCell<?, ?> column) { Set<String> consumedEvents = column.getCell().getConsumedEvents(); return consumedEvents != null && consumedEvents.size() > 0; }
/** * Construct a new {@link CompositeCell}. * * @param hasCells the cells that makeup the composite */ public CompositeCell(List<HasCell<C, ?>> hasCells) { // Create a new, readonly copy so cells cannot be added or removed. this.hasCells = Collections.unmodifiableList(new ArrayList<HasCell<C, ?>>(hasCells)); // Get the consumed events and depends on selection. Set<String> theConsumedEvents = null; for (HasCell<C, ?> hasCell : hasCells) { Cell<?> cell = hasCell.getCell(); Set<String> events = cell.getConsumedEvents(); if (events != null) { if (theConsumedEvents == null) { theConsumedEvents = new HashSet<String>(); } theConsumedEvents.addAll(events); } if (cell.dependsOnSelection()) { dependsOnSelection = true; } if (cell.handlesSelection()) { handlesSelection = true; } } if (theConsumedEvents != null) { this.consumedEvents = Collections.unmodifiableSet(theConsumedEvents); } }
Set<String> cellEvents = col.getCell().getConsumedEvents(); if (cellEvents != null) { consumedEvents.addAll(cellEvents); Set<String> headerEvents = header.getCell().getConsumedEvents(); if (headerEvents != null) { consumedEvents.addAll(headerEvents); Set<String> footerEvents = footer.getCell().getConsumedEvents(); if (footerEvents != null) { consumedEvents.addAll(footerEvents);
@Override public void onBrowserEvent(Event event) { CellBasedWidgetImpl.get().onBrowserEvent(this, event); super.onBrowserEvent(event); // Forward the event to the cell. String eventType = event.getType(); Set<String> consumedEvents = cell.getConsumedEvents(); if (consumedEvents != null && consumedEvents.contains(eventType)) { cell.onBrowserEvent(createContext(), getElement(), value, event, valueUpdater); } }
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); }
/** * Creates a {@link CellWidget} with the specified cell, initial value, key * provider, using the specified element as the wrapper around the cell. * * @param cell the cell to wrap * @param initialValue the initial value of the Cell * @param keyProvider the key provider used to get keys from values * @param elem the browser element to use */ protected CellWidget(Cell<C> cell, C initialValue, ProvidesKey<C> keyProvider, Element elem) { this.cell = cell; this.keyProvider = keyProvider; setElement(elem); CellBasedWidgetImpl.get().sinkEvents(this, cell.getConsumedEvents()); /* * Skip the equality check. If initialValue is null, it will be equal to * this.value, but that doesn't mean that we don't want to render the * initialValue. */ this.value = initialValue; redraw(); }
/** * Fire an event to the cell. * * @param context the {@link Context} of the cell * @param event the event that was fired * @param parent the parent of the cell * @param value the value of the cell */ protected void fireEventToCell(Context context, Event event, Element parent, T value) { Set<String> consumedEvents = cell.getConsumedEvents(); if (consumedEvents != null && consumedEvents.contains(event.getType())) { boolean cellWasEditing = cell.isEditing(context, parent, value); cell.onBrowserEvent(context, parent, value, event, valueUpdater); cellIsEditing = cell.isEditing(context, parent, value); if (cellWasEditing && !cellIsEditing) { CellBasedWidgetImpl.get().resetFocus(new Scheduler.ScheduledCommand() { @Override public void execute() { setFocus(true); } }); } } }
/** * {@inheritDoc} */ @Override public Set<String> getConsumedEvents() { return cell.getConsumedEvents(); }
/** * Check if a cell consumes the specified event type. * * @param cell the cell * @param eventType the event type to check * @return true if consumed, false if not */ protected boolean cellConsumesEventType(Cell<?> cell, String eventType) { Set<String> consumedEvents = cell.getConsumedEvents(); return consumedEvents != null && consumedEvents.contains(eventType); }
/** * Check if a cell consumes the specified event type. * * @param cell the cell * @param eventType the event type to check * @return true if consumed, false if not */ protected boolean cellConsumesEventType(Cell<?> cell, String eventType) { Set<String> consumedEvents = cell.getConsumedEvents(); return consumedEvents != null && consumedEvents.contains(eventType); }
/** * Check if a cell consumes the specified event type. * * @param cell the cell * @param eventType the event type to check * @return true if consumed, false if not */ protected boolean cellConsumesEventType(Cell<?> cell, String eventType) { Set<String> consumedEvents = cell.getConsumedEvents(); return consumedEvents != null && consumedEvents.contains(eventType); }
/** * Check if a column consumes events. */ private static boolean isColumnInteractive(HasCell<?, ?> column) { Set<String> consumedEvents = column.getCell().getConsumedEvents(); return consumedEvents != null && consumedEvents.size() > 0; }
/** * Check if a column consumes events. */ private static boolean isColumnInteractive(HasCell<?, ?> column) { Set<String> consumedEvents = column.getCell().getConsumedEvents(); return consumedEvents != null && consumedEvents.size() > 0; }
return; Set<String> consumedEvents = parentCell.getConsumedEvents(); if (consumedEvents != null && consumedEvents.contains(eventType)) { parentCell
eventsToSink.add(BrowserEvents.BLUR); Set<String> consumedEvents = nodeInfo.getCell().getConsumedEvents(); if (consumedEvents != null) { eventsToSink.addAll(consumedEvents);
CellBasedWidgetImpl.get().sinkEvents(this, cell.getConsumedEvents());
@Override public void onBrowserEvent(Event event) { CellBasedWidgetImpl.get().onBrowserEvent(this, event); super.onBrowserEvent(event); // Forward the event to the cell. String eventType = event.getType(); Set<String> consumedEvents = cell.getConsumedEvents(); if (consumedEvents != null && consumedEvents.contains(eventType)) { cell.onBrowserEvent(createContext(), getElement(), value, event, valueUpdater); } }
@Override public void onBrowserEvent(Event event) { CellBasedWidgetImpl.get().onBrowserEvent(this, event); super.onBrowserEvent(event); // Forward the event to the cell. String eventType = event.getType(); Set<String> consumedEvents = cell.getConsumedEvents(); if (consumedEvents != null && consumedEvents.contains(eventType)) { cell.onBrowserEvent(createContext(), getElement(), value, event, valueUpdater); } }