ソースを参照

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年前
コミット
74f36e731d
コミッターのメールアドレスに関連付けられたアカウントが存在しません
1個のファイルの変更12行の追加0行の削除
  1. 12
    0
      server/src/main/java/com/vaadin/ui/Tree.java

+ 12
- 0
server/src/main/java/com/vaadin/ui/Tree.java ファイルの表示

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

読み込み中…
キャンセル
保存