]> source.dussan.org Git - vaadin-framework.git/commitdiff
Throws on setMultiSelect() and setNewItemsAllowed()
authorMarc Englund <marc.englund@itmill.com>
Wed, 14 Nov 2007 10:05:26 +0000 (10:05 +0000)
committerMarc Englund <marc.englund@itmill.com>
Wed, 14 Nov 2007 10:05:26 +0000 (10:05 +0000)
svn changeset:2804/svn branch:trunk

src/com/itmill/toolkit/ui/NativeSelect.java

index 8de651ebd6eb682acbfec8e60922cd3e703778cd..353ca9c8d8e6355612df66c41769a7c1f8b4ccc4 100644 (file)
@@ -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");
+        }
+    }
 
 }