aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/itmill/toolkit/tests/magi/SelectExample.java
diff options
context:
space:
mode:
authorMarko Grönroos <magi@iki.fi>2008-05-29 13:21:45 +0000
committerMarko Grönroos <magi@iki.fi>2008-05-29 13:21:45 +0000
commit8acbce77cb67017dd3efd51a8d8c76202383b086 (patch)
treee774b83bed3e5c2f8b98d165bb974b839db5d835 /src/com/itmill/toolkit/tests/magi/SelectExample.java
parentd410369e22e1887f5ade7d946d38e70243a0aa68 (diff)
downloadvaadin-framework-8acbce77cb67017dd3efd51a8d8c76202383b086.tar.gz
vaadin-framework-8acbce77cb67017dd3efd51a8d8c76202383b086.zip
Renamed manual related testbench.
svn changeset:4697/svn branch:trunk
Diffstat (limited to 'src/com/itmill/toolkit/tests/magi/SelectExample.java')
-rw-r--r--src/com/itmill/toolkit/tests/magi/SelectExample.java118
1 files changed, 0 insertions, 118 deletions
diff --git a/src/com/itmill/toolkit/tests/magi/SelectExample.java b/src/com/itmill/toolkit/tests/magi/SelectExample.java
deleted file mode 100644
index 9571b3a066..0000000000
--- a/src/com/itmill/toolkit/tests/magi/SelectExample.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.itmill.toolkit.tests.magi;
-
-import com.itmill.toolkit.Application;
-import com.itmill.toolkit.data.Property;
-import com.itmill.toolkit.ui.AbstractSelect;
-import com.itmill.toolkit.ui.CustomComponent;
-import com.itmill.toolkit.ui.Label;
-import com.itmill.toolkit.ui.NativeSelect;
-import com.itmill.toolkit.ui.OptionGroup;
-import com.itmill.toolkit.ui.OrderedLayout;
-import com.itmill.toolkit.ui.Select;
-import com.itmill.toolkit.ui.TwinColSelect;
-
-/* Let us add an implementation of the ValueChangeListener interface. */
-public class SelectExample extends CustomComponent implements
- Property.ValueChangeListener {
-
- class Planet extends Object {
- String planetName;
-
- Planet(String name) {
- planetName = name;
- }
-
- public String toString() {
- return "The Planet " + planetName;
- }
- }
-
- /* Create the Select object with a caption. */
- AbstractSelect select;
-
- OrderedLayout layout = new OrderedLayout(OrderedLayout.ORIENTATION_VERTICAL);
- Label status = new Label("");
-
- SelectExample(Application application, String param, String caption,
- boolean multiselect) {
- if (param.equals("optiongroup")) {
- select = new OptionGroup(caption);
- select.setMultiSelect(multiselect);
- } else if (param.equals("twincol")) {
- select = new TwinColSelect(caption);
- } else if (param.equals("native")) {
- select = new NativeSelect(caption);
- } else if (param.equals("filter")) {
- select = new Select(caption);
- ((Select) select)
- .setFilteringMode(AbstractSelect.Filtering.FILTERINGMODE_CONTAINS);
- } else {
- select = new Select(caption);
- select.setMultiSelect(multiselect);
- }
-
- layout.addComponent(select);
- setCompositionRoot(layout);
-
- /* Fill the component with some items. */
- final String[] planets = new String[] { "Mercury", "Venus", "Earth",
- "Mars", "Jupiter", "Saturn", "Uranus", "Neptune" };
-
- for (int i = 0; i < planets.length; i++) {
- select.addItem(planets[i]);
-
- /* Create an item with an Integer as the Item ID. */
- // select.addItem(i);
- // select.addItem(new Planet(planets[i]));
- /* Set the visible caption of the item. */
- // select.setItemCaption(i, planets[i]);
- /*
- * ClassResource icon = new ClassResource
- * ("images/"+planets[i]+"_symbol.png", application);
- * layout.addComponent(new Embedded ("Icon", icon));
- * select.setItemIcon(i, icon);
- */
- }
-
- /*
- * By default, the change event is not triggered immediately when the
- * selection changes. This enables it.
- */
- select.setImmediate(true);
-
- /* Listen for changes in the selection. */
- select.addListener(this);
-
- // select.setStyle("twincol");
- // select.setMultiSelect(true);
- // select.setNewItemsAllowed(true);
- // int a=1;
-
- // select.setItemCaptionMode(Select.ITEM_CAPTION_MODE_ICON_ONLY);
- // select.setNullSelectionItemId("-- select somethingd --");
- // select.setNullSelectionAllowed(false);
-
- layout.addComponent(status);
- }
-
- /* Respond to change in the selection. */
- public void valueChange(Property.ValueChangeEvent event) {
- /*
- * The event.getProperty() returns the component. The currently selected
- * item is the property of the component, retrievable with getValue().
- */
- if (false) {
- status.setValue("Currently selected item ID: "
- + event.getProperty().getValue() + "<br/>"
- + "Class of the Item ID: "
- + event.getProperty().getValue().getClass().getName()
- + "<br/>" + "Caption: "
- + select.getItemCaption(event.getProperty().getValue()));
- status.setContentMode(Label.CONTENT_XHTML);
- }
- }
-}