From 4de8f4d21cf60bb592c4f8ebf0d936fffff8177c Mon Sep 17 00:00:00 2001 From: Marc Englund Date: Wed, 14 Nov 2007 10:05:26 +0000 Subject: [PATCH] Throws on setMultiSelect() and setNewItemsAllowed() svn changeset:2804/svn branch:trunk --- src/com/itmill/toolkit/ui/NativeSelect.java | 66 ++++++++++++--------- 1 file changed, 39 insertions(+), 27 deletions(-) diff --git a/src/com/itmill/toolkit/ui/NativeSelect.java b/src/com/itmill/toolkit/ui/NativeSelect.java index 8de651ebd6..353ca9c8d8 100644 --- a/src/com/itmill/toolkit/ui/NativeSelect.java +++ b/src/com/itmill/toolkit/ui/NativeSelect.java @@ -1,6 +1,3 @@ -/** - * - */ package com.itmill.toolkit.ui; import java.util.Collection; @@ -10,32 +7,47 @@ import com.itmill.toolkit.terminal.PaintException; import com.itmill.toolkit.terminal.PaintTarget; /** - * Since TK5 default select is customized component with many advanced features - * over terminals native select components. Sometimes "native" select may still - * be the best option. Terminal renders this select with its native select - * widget. + * This is a simple drop-down select without, for instance, support for + * multiselect, new items, lazyloading, and other advanced features. Sometimes + * "native" select without all the bells-and-whistles of the ComboBox is a + * better choice. */ public class NativeSelect extends AbstractSelect { - public NativeSelect() { - super(); - } - - public NativeSelect(String caption, Collection options) { - super(caption, options); - } - - public NativeSelect(String caption, Container dataSource) { - super(caption, dataSource); - } - - public NativeSelect(String caption) { - super(caption); - } - - public void paintContent(PaintTarget target) throws PaintException { - target.addAttribute("type", "native"); - super.paintContent(target); - } + public NativeSelect() { + super(); + } + + public NativeSelect(String caption, Collection options) { + super(caption, options); + } + + public NativeSelect(String caption, Container dataSource) { + super(caption, dataSource); + } + + public NativeSelect(String caption) { + super(caption); + } + + public void paintContent(PaintTarget target) throws PaintException { + target.addAttribute("type", "native"); + super.paintContent(target); + } + + public void setMultiSelect(boolean multiSelect) + throws UnsupportedOperationException { + if (multiSelect == true) { + throw new UnsupportedOperationException("Multiselect not supported"); + } + } + + public void setNewItemsAllowed(boolean allowNewOptions) + throws UnsupportedOperationException { + if (allowNewOptions == true) { + throw new UnsupportedOperationException( + "newItemsAllowed not supported"); + } + } } -- 2.39.5