diff options
author | Henri Sara <henri.sara@itmill.com> | 2009-05-11 09:19:03 +0000 |
---|---|---|
committer | Henri Sara <henri.sara@itmill.com> | 2009-05-11 09:19:03 +0000 |
commit | adc8c0ad3573272c236040c3a76005b9e73a5737 (patch) | |
tree | a3860704dbd5b82dc6af38684b80f8ef79a32722 /src/com/itmill/toolkit/demo/featurebrowser/EmbeddedBrowserExample.java | |
parent | 5abc870dda584d0c2fc47fd5eec4ae3de3fa240e (diff) | |
download | vaadin-framework-adc8c0ad3573272c236040c3a76005b9e73a5737.tar.gz vaadin-framework-adc8c0ad3573272c236040c3a76005b9e73a5737.zip |
#2904: initial bulk rename "com.itmill.toolkit" -> "com.vaadin"
- com.itmill.toolkit.external not yet fully renamed
svn changeset:7715/svn branch:6.0
Diffstat (limited to 'src/com/itmill/toolkit/demo/featurebrowser/EmbeddedBrowserExample.java')
-rw-r--r-- | src/com/itmill/toolkit/demo/featurebrowser/EmbeddedBrowserExample.java | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/src/com/itmill/toolkit/demo/featurebrowser/EmbeddedBrowserExample.java b/src/com/itmill/toolkit/demo/featurebrowser/EmbeddedBrowserExample.java deleted file mode 100644 index 58f79b17c2..0000000000 --- a/src/com/itmill/toolkit/demo/featurebrowser/EmbeddedBrowserExample.java +++ /dev/null @@ -1,90 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.itmill.toolkit.demo.featurebrowser; - -import java.net.MalformedURLException; -import java.net.URL; - -import com.itmill.toolkit.data.Property.ValueChangeEvent; -import com.itmill.toolkit.terminal.ExternalResource; -import com.itmill.toolkit.ui.Embedded; -import com.itmill.toolkit.ui.Select; -import com.itmill.toolkit.ui.VerticalLayout; -import com.itmill.toolkit.ui.Window.Notification; - -/** - * Demonstrates the use of Embedded and "suggesting" Select by creating a simple - * web-browser. Note: does not check for recursion. - * - * @author IT Mill Ltd. - * @see com.itmill.toolkit.ui.Window - */ -public class EmbeddedBrowserExample extends VerticalLayout implements - Select.ValueChangeListener { - - // Default URL to open. - private static final String DEFAULT_URL = "http://www.itmill.com/index_itmill_toolkit.htm"; - - // The embedded page - Embedded emb = new Embedded(); - - public EmbeddedBrowserExample() { - this(new String[] { DEFAULT_URL, - "http://www.itmill.com/index_developers.htm", - "http://toolkit.itmill.com/demo/doc/api/", - "http://www.itmill.com/manual/index.html" }); - } - - public EmbeddedBrowserExample(String[] urls) { - setSizeFull(); - - // create the address combobox - final Select select = new Select(); - // allow input - select.setNewItemsAllowed(true); - // no empty selection - select.setNullSelectionAllowed(false); - // no 'go' -button clicking necessary - select.setImmediate(true); - // add some pre-configured URLs - for (int i = 0; i < urls.length; i++) { - select.addItem(urls[i]); - } - // add to layout - addComponent(select); - // add listener and select initial URL - select.addListener(this); - select.setValue(urls[0]); - - select.setWidth("100%"); - - // configure the embedded and add to layout - emb.setType(Embedded.TYPE_BROWSER); - emb.setSizeFull(); - addComponent(emb); - // make the embedded as large as possible - setExpandRatio(emb, 1); - - } - - public void valueChange(ValueChangeEvent event) { - final String url = (String) event.getProperty().getValue(); - if (url != null) { - try { - // the selected url has changed, let's go there - @SuppressWarnings("unused") - URL u = new URL(url); - emb.setSource(new ExternalResource(url)); - - } catch (MalformedURLException e) { - getWindow().showNotification("Invalid address", - e.getMessage() + " (example: http://www.itmill.com)", - Notification.TYPE_WARNING_MESSAGE); - } - - } - - } -} |