Ver código fonte

Add asMultiSelect() to Tree class (#11949)

Tree class doesn't currently provide an obvious way that would enable a Tree object to be treated as a multi select. This commit extends the Tree API, enabling it to be used as a multi select, which would importantly facilitate the selection/deselection of multiple items in trees whose SelectionMode is MULTI.

closes #11948
tags/8.11.0.alpha1
Tarek Oraby 4 anos atrás
pai
commit
74f36e731d
Nenhuma conta vinculada ao e-mail do autor do commit
1 arquivos alterados com 12 adições e 0 exclusões
  1. 12
    0
      server/src/main/java/com/vaadin/ui/Tree.java

+ 12
- 0
server/src/main/java/com/vaadin/ui/Tree.java Ver arquivo

@@ -573,6 +573,18 @@ public class Tree<T> extends Composite
public Registration addSelectionListener(SelectionListener<T> listener) {
return treeGrid.addSelectionListener(listener);
}
/**
* Use this tree as a multi select in {@link Binder}. Throws
* {@link IllegalStateException} if the tree is not using
* {@link SelectionMode#MULTI}.
*
* @return the multi select wrapper that can be used in binder
* @since 8.11
*/
public MultiSelect<T> asMultiSelect() {
return treeGrid.asMultiSelect();
}

/**
* Use this tree as a single select in {@link Binder}. Throws

Carregando…
Cancelar
Salvar