Procházet zdrojové kódy

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 před 4 roky
rodič
revize
74f36e731d
Žádný účet není propojen s e-mailovou adresou tvůrce revize
1 změnil soubory, kde provedl 12 přidání a 0 odebrání
  1. 12
    0
      server/src/main/java/com/vaadin/ui/Tree.java

+ 12
- 0
server/src/main/java/com/vaadin/ui/Tree.java Zobrazit soubor

@@ -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

Načítá se…
Zrušit
Uložit