diff options
author | Artur <artur@vaadin.com> | 2017-04-26 11:12:01 +0300 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-04-26 11:12:01 +0300 |
commit | a48e5a1cb8f6c8ae18af19406d3e7ba3c9886c69 (patch) | |
tree | 9965868a6606c4ab56f9ec55b8e9090eefcef9f9 /client/src | |
parent | 2e5b49113439310d2dae9ec86fca3ccdf74833f5 (diff) | |
download | vaadin-framework-a48e5a1cb8f6c8ae18af19406d3e7ba3c9886c69.tar.gz vaadin-framework-a48e5a1cb8f6c8ae18af19406d3e7ba3c9886c69.zip |
Add an option for defining number of visible items in a NativeSelect (#9109)
Diffstat (limited to 'client/src')
-rw-r--r-- | client/src/main/java/com/vaadin/client/ui/VNativeSelect.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/client/src/main/java/com/vaadin/client/ui/VNativeSelect.java b/client/src/main/java/com/vaadin/client/ui/VNativeSelect.java index d838d9b3dd..80fc27ab98 100644 --- a/client/src/main/java/com/vaadin/client/ui/VNativeSelect.java +++ b/client/src/main/java/com/vaadin/client/ui/VNativeSelect.java @@ -110,4 +110,28 @@ public class VNativeSelect extends FocusableFlowPanelComposite } super.setHeight(height); } + + /** + * Sets the number of items that are visible. If only one item is visible, + * then the box will be displayed as a drop-down list (the default). + * + * @since + * @param visibleItemCount + * the visible item count + */ + public void setVisibleItemCount(int visibleItemCount) { + getListBox().setVisibleItemCount(visibleItemCount); + } + + /** + * Gets the number of items that are visible. If only one item is visible, + * then the box will be displayed as a drop-down list. + * + * @since + * @return the visible item count + */ + public int getVisibleItemCount() { + return getListBox().getVisibleItemCount(); + } + } |