com.vaadin.ui.Grid.getEditor()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(180)

本文整理了Java中com.vaadin.ui.Grid.getEditor()方法的一些代码示例,展示了Grid.getEditor()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Grid.getEditor()方法的具体详情如下:
包路径:com.vaadin.ui.Grid
类名称:Grid
方法名:getEditor

Grid.getEditor介绍

暂无

代码示例

代码示例来源:origin: com.vaadin/vaadin-server

private void sort(boolean userOriginated) {
  // Set sort orders
  // In-memory comparator
  getDataCommunicator().setInMemorySorting(createSortingComparator());
  // Back-end sort properties
  List<QuerySortOrder> sortProperties = new ArrayList<>();
  sortOrder.stream().map(
      order -> order.getSorted().getSortOrder(order.getDirection()))
      .forEach(s -> s.forEach(sortProperties::add));
  getDataCommunicator().setBackEndSorting(sortProperties);
  // Close grid editor if it's open.
  if (getEditor().isOpen()) {
    getEditor().cancel();
  }
  fireEvent(new SortEvent<>(this, new ArrayList<>(sortOrder),
      userOriginated));
}

代码示例来源:origin: com.vaadin/vaadin-server

/**
 * Sets a component and setter to use for editing values of this column
 * in the editor row. This is a shorthand for use in simple cases where
 * no validator or converter is needed. Use
 * {@link #setEditorBinding(Binding)} to support more complex cases.
 * <p>
 * <strong>Note:</strong> The same component cannot be used for multiple
 * columns.
 *
 * @param editorComponent
 *            the editor component
 * @param setter
 *            a setter that stores the component value in the row item
 * @return this column
 *
 * @see #setEditorBinding(Binding)
 * @see Grid#getEditor()
 * @see Binder#bind(HasValue, ValueProvider, Setter)
 */
public <C extends HasValue<V> & Component> Column<T, V> setEditorComponent(
    C editorComponent, Setter<T, V> setter) {
  Objects.requireNonNull(editorComponent,
      "Editor component cannot be null");
  Objects.requireNonNull(setter, "Setter cannot be null");
  Binding<T, V> binding = getGrid().getEditor().getBinder()
      .bind(editorComponent, valueProvider::apply, setter);
  return setEditorBinding(binding);
}

代码示例来源:origin: com.vaadin/vaadin-server

Binding<T, F> binding = getGrid().getEditor().getBinder()
    .bind(editorComponent, propertyName);

代码示例来源:origin: com.haulmont.cuba/cuba-web

@Override
public E getEditedItem() {
  return component.getEditor() instanceof CubaEditorImpl
      ? ((CubaEditorImpl<E>) component.getEditor()).getBean()
      : component.getEditor().getBinder().getBean();
}

代码示例来源:origin: com.haulmont.cuba/cuba-web

@Override
public void setEditorCancelCaption(String cancelCaption) {
  component.getEditor().setCancelCaption(cancelCaption);
}

代码示例来源:origin: com.holon-platform.vaadin/holon-vaadin

/**
 * Set whether the item editor is enabled.
 * @param enabled whether the item editor is enabled
 */
public void setEditorEnabled(boolean enabled) {
  getGrid().getEditor().setEnabled(enabled);
}

代码示例来源:origin: com.holon-platform.vaadin/holon-vaadin

/**
 * Set the item editor <em>cancel</em> button caption
 * @param caption the caption to set
 */
public void setEditorCancelCaption(String caption) {
  getGrid().getEditor().setCancelCaption(caption);
}

代码示例来源:origin: com.holon-platform.vaadin/holon-vaadin

/**
 * Register an item editor save listener.
 * @param listener The listener to add
 * @return the listener registration
 */
public Registration addEditorSaveListener(EditorSaveListener<T> listener) {
  return getGrid().getEditor().addSaveListener(listener);
}

代码示例来源:origin: com.holon-platform.vaadin/holon-vaadin

/**
 * Register an item editor open listener.
 * @param listener The listener to add
 * @return the listener registration
 */
public Registration addEditorOpenListener(EditorOpenListener<T> listener) {
  return getGrid().getEditor().addOpenListener(listener);
}

代码示例来源:origin: com.holon-platform.vaadin/holon-vaadin

/**
 * Set the item editor <em>save</em> button caption
 * @param caption the caption to set
 */
public void setEditorSaveCaption(String caption) {
  getGrid().getEditor().setSaveCaption(caption);
}

代码示例来源:origin: com.holon-platform.vaadin/holon-vaadin

/**
 * Register an item editor cancel listener.
 * @param listener The listener to add
 * @return the listener registration
 */
public Registration addEditorCancelListener(EditorCancelListener<T> listener) {
  return getGrid().getEditor().addCancelListener(listener);
}

代码示例来源:origin: com.holon-platform.vaadin/holon-vaadin

/**
 * Set whether the item editor is in buffered mode.
 * @param buffered whether the item editor is in buffered mode
 */
public void setEditorBuffered(boolean buffered) {
  getGrid().getEditor().setBuffered(buffered);
}

代码示例来源:origin: com.holon-platform.vaadin/holon-vaadin

/**
 * Set the editor error generator.
 * @param editorErrorGenerator the editor error generator to set
 */
public void setEditorErrorGenerator(EditorErrorGenerator<T> editorErrorGenerator) {
  getGrid().getEditor().setErrorGenerator(editorErrorGenerator);
}

代码示例来源:origin: com.holon-platform.vaadin/holon-vaadin

@Override
public void editRow(int rowNumber) {
  if (!isEditable()) {
    throw new IllegalStateException("The listing is not editable");
  }
  getGrid().getEditor().editRow(rowNumber);
}

代码示例来源:origin: com.holon-platform.vaadin/holon-vaadin

@Override
public void cancelEditing() {
  if (!isEditable()) {
    throw new IllegalStateException("The listing is not editable");
  }
  getGrid().getEditor().cancel();
}

代码示例来源:origin: com.haulmont.cuba/cuba-web

@Override
public Subscription addEditorOpenListener(Consumer<EditorOpenEvent> listener) {
  if (editorOpenListener == null) {
    editorOpenListener = component.getEditor().addOpenListener(this::onEditorOpen);
  }
  return getEventHub().subscribe(EditorOpenEvent.class, listener);
}

代码示例来源:origin: com.haulmont.cuba/cuba-web

@Override
public Subscription addEditorPostCommitListener(Consumer<EditorPostCommitEvent> listener) {
  if (editorSaveListener == null) {
    editorSaveListener = component.getEditor().addSaveListener(this::onEditorSave);
  }
  return getEventHub().subscribe(EditorPostCommitEvent.class, listener);
}

代码示例来源:origin: com.haulmont.cuba/cuba-web

@Override
public Subscription addEditorPreCommitListener(Consumer<EditorPreCommitEvent> listener) {
  if (editorBeforeSaveListener == null) {
    //noinspection unchecked
    CubaEditorImpl<E> editor = (CubaEditorImpl) component.getEditor();
    editorBeforeSaveListener = editor.addBeforeSaveListener(this::onEditorBeforeSave);
  }
  return getEventHub().subscribe(EditorPreCommitEvent.class, listener);
}

代码示例来源:origin: com.haulmont.cuba/cuba-web

@Override
public Subscription addEditorCloseListener(Consumer<EditorCloseEvent> listener) {
  if (editorCancelListener == null) {
    editorCancelListener = component.getEditor().addCancelListener(this::onEditorCancel);
  }
  return getEventHub().subscribe(EditorCloseEvent.class, listener);
}

代码示例来源:origin: com.holon-platform.vaadin/holon-vaadin

/**
 * Add an item-level validator.
 * @param validator The validator to add (not null)
 */
public void addValidator(Validator<T> validator) {
  ObjectUtils.argumentNotNull(validator, "Validator must be not null");
  getGrid().getEditor().getBinder().withValidator(validator);
}

相关文章

Grid类方法