]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixes ##2972: Create theme selector for Sampler
authorJouni Koivuviita <jouni.koivuviita@itmill.com>
Fri, 4 Sep 2009 12:08:32 +0000 (12:08 +0000)
committerJouni Koivuviita <jouni.koivuviita@itmill.com>
Fri, 4 Sep 2009 12:08:32 +0000 (12:08 +0000)
svn changeset:8665/svn branch:6.1

28 files changed:
WebContent/VAADIN/themes/runo/button/button.css
WebContent/VAADIN/themes/runo/styles.css
WebContent/VAADIN/themes/sampler-reindeer/styles.css [new file with mode: 0644]
WebContent/VAADIN/themes/sampler-runo/styles.css [new file with mode: 0644]
WebContent/VAADIN/themes/sampler/layouts/examplecustomlayout.html
WebContent/VAADIN/themes/sampler/sampler/palette.png [new file with mode: 0644]
WebContent/VAADIN/themes/sampler/sampler/segment.png
WebContent/VAADIN/themes/sampler/sampler/styles.css
WebContent/VAADIN/themes/sampler/styles.css
src/com/vaadin/demo/sampler/ExampleUtil.java
src/com/vaadin/demo/sampler/SamplerApplication.java
src/com/vaadin/demo/sampler/features/accordions/AccordionDisabledExample.java
src/com/vaadin/demo/sampler/features/accordions/AccordionIconsExample.java
src/com/vaadin/demo/sampler/features/buttons/ButtonLinkExample.java
src/com/vaadin/demo/sampler/features/buttons/ButtonPushExample.java
src/com/vaadin/demo/sampler/features/buttons/ButtonSwitchExample.java
src/com/vaadin/demo/sampler/features/commons/IconsExample.java
src/com/vaadin/demo/sampler/features/layouts/CustomLayoutsExample.java
src/com/vaadin/demo/sampler/features/link/LinkCurrentWindowExample.java
src/com/vaadin/demo/sampler/features/link/LinkNoDecorationsExample.java
src/com/vaadin/demo/sampler/features/link/LinkSizedWindowExample.java
src/com/vaadin/demo/sampler/features/selects/ComboBoxInputPromptExample.java
src/com/vaadin/demo/sampler/features/table/TableMainFeaturesExample.java
src/com/vaadin/demo/sampler/features/tabsheets/TabSheetDisabledExample.java
src/com/vaadin/demo/sampler/features/tabsheets/TabSheetIconsExample.java
src/com/vaadin/demo/sampler/features/tabsheets/TabSheetScrollingExample.java
src/com/vaadin/demo/sampler/features/text/TextFieldInputPromptExample.java
src/com/vaadin/demo/sampler/features/upload/UploadWithProgressMonitoringExample.java

index 53762a03df6198ec525c3b863c265c10cbbd617d..230d49912fd47a4207e33858a3353676a1664bdc 100644 (file)
@@ -33,7 +33,8 @@
 \r
 /* Small style */\r
 \r
-.v-button-small {\r
+.v-button-small,\r
+.v-disabled.v-button-small {\r
        font-size: 11px;\r
        line-height: 14px;\r
        padding: 1px 15px;\r
@@ -42,7 +43,8 @@
 \r
 \r
 /* Link style */\r
-.v-button-link {\r
+.v-button-link,\r
+.v-disabled.v-button-link {\r
        border: none;\r
        background: transparent;\r
        padding: 0;\r
index 739d089c852dbd6593c24bfca1b40a97c9341147..0c70ca98f49815c3df25385b48b07a16d541fddb 100644 (file)
@@ -1740,7 +1740,8 @@ div.v-tree-node-leaf {
 
 /* Small style */
 
-.v-button-small {
+.v-button-small,
+.v-disabled.v-button-small {
        font-size: 11px;
        line-height: 14px;
        padding: 1px 15px;
@@ -1749,7 +1750,8 @@ div.v-tree-node-leaf {
 
 
 /* Link style */
-.v-button-link {
+.v-button-link,
+.v-disabled.v-button-link {
        border: none;
        background: transparent;
        padding: 0;
diff --git a/WebContent/VAADIN/themes/sampler-reindeer/styles.css b/WebContent/VAADIN/themes/sampler-reindeer/styles.css
new file mode 100644 (file)
index 0000000..c3c4ff1
--- /dev/null
@@ -0,0 +1,3 @@
+@import url(../reindeer/styles.css);
+
+@import url(../sampler/styles.css);
\ No newline at end of file
diff --git a/WebContent/VAADIN/themes/sampler-runo/styles.css b/WebContent/VAADIN/themes/sampler-runo/styles.css
new file mode 100644 (file)
index 0000000..f5c19e4
--- /dev/null
@@ -0,0 +1,3 @@
+@import url(../runo/styles.css);
+
+@import url(../sampler/styles.css);
\ No newline at end of file
index 1e139a6c9c9c81f462c9487eeb2565b6b7a4e6ae..0d2af150c5dfb5127ad79626e4de1e53d9f470d8 100644 (file)
@@ -30,7 +30,7 @@
        </tr>\r
        <tr>\r
                <td colspan="2" style="padding: 7px; background-color: #4172AE">\r
-               <IMG align="absbottom" src="../icons/icon_info.gif" /> This\r
+               <img align="absbottom" src="../../sampler/icons/icon_info.gif" /> This\r
                information is in the layout.\r
                <td>\r
        </tr>\r
diff --git a/WebContent/VAADIN/themes/sampler/sampler/palette.png b/WebContent/VAADIN/themes/sampler/sampler/palette.png
new file mode 100644 (file)
index 0000000..dc67427
Binary files /dev/null and b/WebContent/VAADIN/themes/sampler/sampler/palette.png differ
index a2f504958940671a83a7e9070163cd61b60752d1..5896cb8fc545145139f6ddc5af34a636f38701c1 100644 (file)
Binary files a/WebContent/VAADIN/themes/sampler/sampler/segment.png and b/WebContent/VAADIN/themes/sampler/sampler/segment.png differ
index e2e0718b9686ffcd9afc993a7d4353693d2fed16..3b18645d747bbb54411e78d9f827ad1a749045ff 100644 (file)
        display: block;
        height: 24px;
        background-repeat: no-repeat;
-       background-position: 50% 30%;
+       background-position: 50% 40%;
 }
 .v-app-SamplerApplication .v-horizontallayout-segment .v-nativebutton-tree-switch span,
 .v-app-SamplerApplication .v-horizontallayout-segment .v-nativebutton-tree-switch.v-pressed span {
 }
 .v-app-SamplerApplication .v-horizontallayout-segment .v-popupview span {
        background-image: url(magnifier.png);
-       background-position: 50% 40%;
+}
+.v-app-SamplerApplication .theme-select,
+.v-app-SamplerApplication .theme-select * {
+       background: transparent;
+}
+.v-app-SamplerApplication .theme-select .v-filterselect-input {
+       width: 0;
+       height: 0;
+       padding: 0;
+       overflow: hidden;
+}
+.v-app-SamplerApplication .theme-select {
+       width: 32px;
+       height: 24px;
+       overflow: hidden;
+       padding: 0;
+       border: none;
+       background: transparent url(segment.png) no-repeat;
+}
+.v-app-SamplerApplication .theme-select:active {
+       background-position: 0 bottom;
+}
+.v-app-SamplerApplication .theme-select .v-filterselect-button {
+       width: 32px;
+       height: 24px;
+       cursor: default;
+       background: url(palette.png) no-repeat right 0;
+}
+.v-app-SamplerApplication .theme-select:active .v-filterselect-button {
+       background-position: right bottom;
 }
 .v-app-SamplerApplication .v-horizontallayout-segment .v-nativebutton-previous span,
 .v-app-SamplerApplication .v-horizontallayout-segment .v-nativebutton-previous.v-pressed span,
index 00f897896587b35533f51b80b98d780f5e441f64..6715ad1b9f81483628945e3ad84944836fa803d1 100644 (file)
@@ -1,5 +1,3 @@
-@import url(../reindeer/styles.css);
-
 @import url(sampler/styles.css);
 
 @import url(dummy/styles.css);
index 3888dd25fa9e38871021c86a667ecac471648fcc..ca50d2a6543952566a027d56d598f4e4336bdc8b 100644 (file)
@@ -199,7 +199,7 @@ public final class ExampleUtil {
             item.getItemProperty(iso3166_PROPERTY_NAME).setValue(name);
             item.getItemProperty(iso3166_PROPERTY_SHORT).setValue(id);
             item.getItemProperty(iso3166_PROPERTY_FLAG).setValue(
-                    new ThemeResource("flags/" + id.toLowerCase() + ".gif"));
+                    new ThemeResource("../sampler/flags/" + id.toLowerCase() + ".gif"));
         }
         container.sort(new Object[] { iso3166_PROPERTY_NAME },
                 new boolean[] { true });
index 85978c16da980a2742193e4b026d4a91c70428ab..d3a85287fc2ca2ca07650b2c12e0a35788c3dd69 100644 (file)
@@ -53,14 +53,16 @@ public class SamplerApplication extends Application {
             .getContainer(true);
 
     // init() inits
-    private static final String THEME_NAME = "sampler";
+    private static final String[] THEMES = { "reindeer", "runo" };
+    private static final String SAMPLER_THEME_NAME = "sampler";
+
+    private static String currentTheme = SAMPLER_THEME_NAME + "-" + THEMES[0];
 
     // used when trying to guess theme location
     private static String APP_URL = null;
 
     @Override
     public void init() {
-        setTheme("sampler");
         setMainWindow(new SamplerWindow());
         APP_URL = getURL().toString();
     }
@@ -72,12 +74,13 @@ public class SamplerApplication extends Application {
      */
     public static String getThemeBase() {
         try {
-            URI uri = new URI(APP_URL + "../VAADIN/themes/" + THEME_NAME + "/");
+            URI uri = new URI(APP_URL + "../VAADIN/themes/"
+                    + SAMPLER_THEME_NAME + "/");
             return uri.normalize().toString();
         } catch (Exception e) {
             System.err.println("Theme location could not be resolved:" + e);
         }
-        return "/VAADIN/themes/" + THEME_NAME + "/";
+        return "/VAADIN/themes/" + SAMPLER_THEME_NAME + "/";
     }
 
     // Supports multiple browser windows
@@ -165,6 +168,7 @@ public class SamplerApplication extends Application {
         Button previousSample;
         Button nextSample;
         private ComboBox search;
+        private ComboBox theme;
 
         @Override
         public void detach() {
@@ -181,6 +185,7 @@ public class SamplerApplication extends Application {
             setSizeFull();
             mainExpand.setSizeFull();
             setCaption("Vaadin Sampler");
+            setTheme(currentTheme);
 
             // topbar (navigation)
             HorizontalLayout nav = new HorizontalLayout();
@@ -226,6 +231,11 @@ public class SamplerApplication extends Application {
             nav.addComponent(mode);
             nav.setComponentAlignment(mode, Alignment.MIDDLE_LEFT);
 
+            // Select theme
+            Component themeSelect = createThemeSelect();
+            nav.addComponent(themeSelect);
+            nav.setComponentAlignment(themeSelect, Alignment.MIDDLE_LEFT);
+
             // Layouts for top area buttons
             HorizontalLayout quicknav = new HorizontalLayout();
             HorizontalLayout arrows = new HorizontalLayout();
@@ -344,7 +354,7 @@ public class SamplerApplication extends Application {
              * super.changeVariables(source, variables); if (isPopupVisible()) {
              * search.focus(); } } };
              */
-            PopupView pv = new PopupView("<span></span>", search);
+            final PopupView pv = new PopupView("<span></span>", search);
             pv.addListener(new PopupView.PopupVisibilityListener() {
                 public void popupVisibilityChange(PopupVisibilityEvent event) {
                     if (event.isPopupVisible()) {
@@ -358,6 +368,36 @@ public class SamplerApplication extends Application {
             return pv;
         }
 
+        private Component createThemeSelect() {
+            theme = new ComboBox();
+            theme.setWidth("32px");
+            theme.setNewItemsAllowed(false);
+            theme.setFilteringMode(ComboBox.FILTERINGMODE_CONTAINS);
+            theme.setImmediate(true);
+            theme.setNullSelectionAllowed(false);
+            for (String themeName : THEMES) {
+                theme.addItem(SAMPLER_THEME_NAME + "-" + themeName);
+                theme.setItemCaption(SAMPLER_THEME_NAME + "-" + themeName,
+                        themeName.substring(0, 1).toUpperCase()
+                                + themeName.substring(1) + " theme");
+            }
+            theme.setValue(currentTheme);
+
+            theme.addListener(new ComboBox.ValueChangeListener() {
+                public void valueChange(ValueChangeEvent event) {
+                    final String newTheme = event.getProperty().getValue()
+                            .toString();
+                    setTheme(newTheme);
+                    currentTheme = newTheme;
+                }
+            });
+
+            theme.setStyleName("theme-select");
+            theme.setDescription("Select Theme");
+
+            return theme;
+        }
+
         private Component createLogo() {
             Button logo = new NativeButton("", new Button.ClickListener() {
                 public void buttonClick(ClickEvent event) {
@@ -437,13 +477,13 @@ public class SamplerApplication extends Application {
         private ModeSwitch createModeSwitch() {
             ModeSwitch m = new ModeSwitch();
             m.addMode(currentList, "", "View as Icons", new ThemeResource(
-                    "sampler/grid.png"));
+                    "../sampler/sampler/grid.png"));
             /*- no CoverFlow yet
             m.addMode(coverFlow, "", "View as Icons", new ThemeResource(
-                    "sampler/flow.gif"));
+                    "../sampler/sampler/flow.gif"));
              */
             m.addMode(new FeatureTable(), "", "View as List",
-                    new ThemeResource("sampler/list.png"));
+                    new ThemeResource("../sampler/sampler/list.png"));
             m.addListener(new ModeSwitch.ModeSwitchListener() {
                 public void componentEvent(Event event) {
                     if (event instanceof ModeSwitchEvent) {
index edc1b6a95a6400f77438496c583d4e42ccfcb059..6566144a3fcac8d801cde880311233a0747b030f 100644 (file)
@@ -25,12 +25,9 @@ public class AccordionDisabledExample extends VerticalLayout implements
     private Tab t2;\r
     private Tab t3;\r
 \r
-    private static final ThemeResource icon1 = new ThemeResource(\r
-            "icons/action_save.gif");\r
-    private static final ThemeResource icon2 = new ThemeResource(\r
-            "icons/comment_yellow.gif");\r
-    private static final ThemeResource icon3 = new ThemeResource(\r
-            "icons/icon_info.gif");\r
+    private static final ThemeResource icon1 = new ThemeResource("../sampler/icons/action_save.gif");\r
+    private static final ThemeResource icon2 = new ThemeResource("../sampler/icons/comment_yellow.gif");\r
+    private static final ThemeResource icon3 = new ThemeResource("../sampler/icons/icon_info.gif");\r
 \r
     public AccordionDisabledExample() {\r
         setSpacing(true);\r
index 9bb8418fbc4bc0ee6cc33184364a2cb5fadc6021..fa21952c384d45e2b885550527b92b2b2c10bcf1 100644 (file)
@@ -12,12 +12,9 @@ import com.vaadin.ui.TabSheet.Tab;
 public class AccordionIconsExample extends HorizontalLayout implements\r
         Accordion.SelectedTabChangeListener {\r
 \r
-    private static final ThemeResource icon1 = new ThemeResource(\r
-            "icons/action_save.gif");\r
-    private static final ThemeResource icon2 = new ThemeResource(\r
-            "icons/comment_yellow.gif");\r
-    private static final ThemeResource icon3 = new ThemeResource(\r
-            "icons/icon_info.gif");\r
+    private static final ThemeResource icon1 = new ThemeResource("../sampler/icons/action_save.gif");\r
+    private static final ThemeResource icon2 = new ThemeResource("../sampler/icons/comment_yellow.gif");\r
+    private static final ThemeResource icon3 = new ThemeResource("../sampler/icons/icon_info.gif");\r
 \r
     private Accordion a;\r
 \r
index 8723c85749f781414551c1aa63d8b85caecd73c6..f328c3dfac2da45a12a730eeceb9b4da8b67cae4 100644 (file)
@@ -11,8 +11,7 @@ public class ButtonLinkExample extends VerticalLayout implements
 
     private static final String CAPTION = "Help";
     private static final String TOOLTIP = "Show help";
-    private static final ThemeResource ICON = new ThemeResource(
-            "icons/icon_info.gif");
+    private static final ThemeResource ICON = new ThemeResource("../sampler/icons/icon_info.gif");
     private static final String NOTIFICATION = "Help clicked";
 
     public ButtonLinkExample() {
index 35f3bf5a867ae333cf377796c331ccc84311274e..c9e3943770abb97d14bcc3005fd3afd4cc2b57e5 100644 (file)
@@ -11,8 +11,7 @@ public class ButtonPushExample extends VerticalLayout implements
 
     private static final String CAPTION = "Save";
     private static final String TOOLTIP = "Save changes";
-    private static final ThemeResource ICON = new ThemeResource(
-            "icons/action_save.gif");
+    private static final ThemeResource ICON = new ThemeResource("../sampler/icons/action_save.gif");
     private static final String NOTIFICATION = "Changes have been saved";
 
     public ButtonPushExample() {
index 2df35d1c474ebd8d6cbbc0c802fad9ab422c62ec..3a9c8a8fdcbf6eb0674a5f1bb15d280466350283 100644 (file)
@@ -11,8 +11,7 @@ public class ButtonSwitchExample extends VerticalLayout implements
 
     private static final String CAPTION = "Allow HTML";
     private static final String TOOLTIP = "Allow/disallow HTML in comments";
-    private static final ThemeResource ICON = new ThemeResource(
-            "icons/page_code.gif");
+    private static final ThemeResource ICON = new ThemeResource("../sampler/icons/page_code.gif");
 
     public ButtonSwitchExample() {
         setSpacing(true);
index 4e27ecf4c285620ee286862cacad961751806c64..911e2338c39539dd4f2946d5aeb152a0649b4da9 100644 (file)
@@ -16,34 +16,34 @@ public class IconsExample extends VerticalLayout {
 
         /* Button w/ icon */
         Button button = new Button("Save");
-        button.setIcon(new ThemeResource("icons/action_save.gif"));
+        button.setIcon(new ThemeResource("../sampler/icons/action_save.gif"));
         addComponent(button);
 
         /* Label */;
         Label l = new Label("Icons are very handy");
         l.setCaption("Comment");
-        l.setIcon(new ThemeResource("icons/comment_yellow.gif"));
+        l.setIcon(new ThemeResource("../sampler/icons/comment_yellow.gif"));
         addComponent(l);
 
         /* Panel w/ links */
         Panel p = new Panel("Handy links");
-        p.setIcon(new ThemeResource("icons/icon_info.gif"));
+        p.setIcon(new ThemeResource("../sampler/icons/icon_info.gif"));
         addComponent(p);
         Link lnk = new Link("http://www.vaadin.com", new ExternalResource(
                 "http://www.vaadin.com"));
-        lnk.setIcon(new ThemeResource("icons/icon_world.gif"));
+        lnk.setIcon(new ThemeResource("../sampler/icons/icon_world.gif"));
         p.addComponent(lnk);
         lnk = new Link("http://www.vaadin.com/learn", new ExternalResource(
                 "http://www.vaadin.com/learn"));
-        lnk.setIcon(new ThemeResource("icons/icon_world.gif"));
+        lnk.setIcon(new ThemeResource("../sampler/icons/icon_world.gif"));
         p.addComponent(lnk);
         lnk = new Link("http://dev.vaadin.com/", new ExternalResource(
                 "http://dev.vaadin.com/"));
-        lnk.setIcon(new ThemeResource("icons/icon_world.gif"));
+        lnk.setIcon(new ThemeResource("../sampler/icons/icon_world.gif"));
         p.addComponent(lnk);
         lnk = new Link("http://www.vaadin.com/forum", new ExternalResource(
                 "http://www.vaadin.com/forum"));
-        lnk.setIcon(new ThemeResource("icons/icon_world.gif"));
+        lnk.setIcon(new ThemeResource("../sampler/icons/icon_world.gif"));
         p.addComponent(lnk);
 
     }
index c997582fc62622f25dfc7100f71f0ac2e90c2fa8..e759ea5421cb882cb58688cd97cbd6a4db4a59f0 100644 (file)
@@ -13,7 +13,8 @@ public class CustomLayoutsExample extends VerticalLayout {
 \r
         // Create the custom layout and set it as a component in\r
         // the current layout\r
-        CustomLayout custom = new CustomLayout("examplecustomlayout");\r
+        CustomLayout custom = new CustomLayout(\r
+                "../../sampler/layouts/examplecustomlayout");\r
         addComponent(custom);\r
 \r
         // Create components and bind them to the location tags\r
index 0be2bce3a80da353eebe192be207ad5c8c2e31d0..855fb0ab9332721c72fbf5bc230cd71aa9495e1b 100644 (file)
@@ -10,8 +10,7 @@ public class LinkCurrentWindowExample extends VerticalLayout {
 
     private static final String CAPTION = "Open Google";
     private static final String TOOLTIP = "http://www.google.com";
-    private static final ThemeResource ICON = new ThemeResource(
-            "icons/icon_world.gif");
+    private static final ThemeResource ICON = new ThemeResource("../sampler/icons/icon_world.gif");
 
     public LinkCurrentWindowExample() {
         setSpacing(true);
index db90bce3f59aca5d2c9eff088e84ebe1cf11f2a4..e5457191c9a441da30d52737687e9ed90d45bdb7 100644 (file)
@@ -10,8 +10,7 @@ public class LinkNoDecorationsExample extends VerticalLayout {
 
     private static final String CAPTION = "Open Google in new window";
     private static final String TOOLTIP = "http://www.google.com (opens in new window)";
-    private static final ThemeResource ICON = new ThemeResource(
-            "icons/icon_world.gif");
+    private static final ThemeResource ICON = new ThemeResource("../sampler/icons/icon_world.gif");
 
     public LinkNoDecorationsExample() {
         setSpacing(true);
index 6618b46ce03b82347c0b1a1ab9636275d25201ab..b7667982bc7543ec35d2ac72eb1e0ff687db6dde 100644 (file)
@@ -11,8 +11,7 @@ public class LinkSizedWindowExample extends VerticalLayout {
 
     private static final String CAPTION = "Open Google in small window";
     private static final String TOOLTIP = "http://www.google.com (opens in small window)";
-    private static final ThemeResource ICON = new ThemeResource(
-            "icons/icon_world.gif");
+    private static final ThemeResource ICON = new ThemeResource("../sampler/icons/icon_world.gif");
     private static final Resource TARGET = new ExternalResource(
             "http://www.google.com/m");
 
index 28289c7fd6f5fe098253b4360479adb1e085b636..b9a0469127c8d0373580241294ae93e369517354 100644 (file)
@@ -13,7 +13,7 @@ public class ComboBoxInputPromptExample extends VerticalLayout implements
             "Helsinki", "Madrid", "Oslo", "Paris", "Stockholm" };\r
 \r
     public ComboBoxInputPromptExample() {\r
-        setMargin(true); // for looks: more 'air'\r
+        setMargin(true, false, false, false); // for looks: more 'air'\r
 \r
         // Create & set input prompt\r
         ComboBox l = new ComboBox();\r
index 6868358ce301429060e70b2a4b4accc3a113ce28..fd5f4fde4b0adecde217202e1cab09d9b5b1da50 100644 (file)
@@ -59,11 +59,11 @@ public class TableMainFeaturesExample extends VerticalLayout {
 
         // Icons for column headers
         table.setColumnIcon(ExampleUtil.iso3166_PROPERTY_FLAG,
-                new ThemeResource("icons/action_save.gif"));
+                new ThemeResource("../sampler/icons/action_save.gif"));
         table.setColumnIcon(ExampleUtil.iso3166_PROPERTY_NAME,
-                new ThemeResource("icons/icon_get_world.gif"));
+                new ThemeResource("../sampler/icons/icon_get_world.gif"));
         table.setColumnIcon(ExampleUtil.iso3166_PROPERTY_SHORT,
-                new ThemeResource("icons/page_code.gif"));
+                new ThemeResource("../sampler/icons/page_code.gif"));
 
         // Column alignment
         table.setColumnAlignment(ExampleUtil.iso3166_PROPERTY_SHORT,
index 7a39fd8da82444465a5b92565f26db9babef53bf..c240846d86b4e49b1dc85e8ac7dacf61db763606 100644 (file)
@@ -13,12 +13,9 @@ import com.vaadin.ui.TabSheet.Tab;
 @SuppressWarnings("serial")\r
 public class TabSheetDisabledExample extends VerticalLayout implements\r
         TabSheet.SelectedTabChangeListener, Button.ClickListener {\r
-    private static final ThemeResource icon1 = new ThemeResource(\r
-            "icons/action_save.gif");\r
-    private static final ThemeResource icon2 = new ThemeResource(\r
-            "icons/comment_yellow.gif");\r
-    private static final ThemeResource icon3 = new ThemeResource(\r
-            "icons/icon_info.gif");\r
+    private static final ThemeResource icon1 = new ThemeResource("../sampler/icons/action_save.gif");\r
+    private static final ThemeResource icon2 = new ThemeResource("../sampler/icons/comment_yellow.gif");\r
+    private static final ThemeResource icon3 = new ThemeResource("../sampler/icons/icon_info.gif");\r
 \r
     private TabSheet t;\r
     private Button toggleEnabled;\r
index 0dbff62381121a1dae3c5626e73f0af732f1c903..97903e8e70774145586cbc1652656fe0532675f2 100644 (file)
@@ -12,12 +12,9 @@ public class TabSheetIconsExample extends VerticalLayout implements
         TabSheet.SelectedTabChangeListener {\r
 \r
     // Icons for the table\r
-    private static final ThemeResource icon1 = new ThemeResource(\r
-            "icons/action_save.gif");\r
-    private static final ThemeResource icon2 = new ThemeResource(\r
-            "icons/comment_yellow.gif");\r
-    private static final ThemeResource icon3 = new ThemeResource(\r
-            "icons/icon_info.gif");\r
+    private static final ThemeResource icon1 = new ThemeResource("../sampler/icons/action_save.gif");\r
+    private static final ThemeResource icon2 = new ThemeResource("../sampler/icons/comment_yellow.gif");\r
+    private static final ThemeResource icon3 = new ThemeResource("../sampler/icons/icon_info.gif");\r
 \r
     private TabSheet t;\r
 \r
index 43509ba809f6f462b314f65da4651b216e4d386a..19d8c2475ef24b50d15bc3298faba76e11b0d2da 100644 (file)
@@ -11,12 +11,9 @@ import com.vaadin.ui.TabSheet.Tab;
 public class TabSheetScrollingExample extends VerticalLayout implements\r
         TabSheet.SelectedTabChangeListener {\r
 \r
-    private static final ThemeResource icon1 = new ThemeResource(\r
-            "icons/action_save.gif");\r
-    private static final ThemeResource icon2 = new ThemeResource(\r
-            "icons/comment_yellow.gif");\r
-    private static final ThemeResource icon3 = new ThemeResource(\r
-            "icons/icon_info.gif");\r
+    private static final ThemeResource icon1 = new ThemeResource("../sampler/icons/action_save.gif");\r
+    private static final ThemeResource icon2 = new ThemeResource("../sampler/icons/comment_yellow.gif");\r
+    private static final ThemeResource icon3 = new ThemeResource("../sampler/icons/icon_info.gif");\r
 \r
     private TabSheet t;\r
 \r
index 29339dcd8f0048dc8c36fc6f147dd67b8991563f..0889b07fa1a9e9493d024d724511168ddf52a5d7 100644 (file)
@@ -12,7 +12,7 @@ public class TextFieldInputPromptExample extends VerticalLayout implements
     public TextFieldInputPromptExample() {\r
         // add som 'air' to the layout\r
         setSpacing(true);\r
-        setMargin(true);\r
+        setMargin(true, false, false, false);\r
 \r
         // Username field + input prompt\r
         TextField username = new TextField();\r
index 2af9a8432fe1338a122f07f967c7b488c257d3fa..d3954cf32092c49a42df3dd253d7e1bb7aef50f8 100644 (file)
@@ -30,12 +30,18 @@ public class UploadWithProgressMonitoringExample extends VerticalLayout {
 
     private LineBreakCounter counter = new LineBreakCounter();
 
-    private Upload upload = new Upload("Upload a file", counter);
+    private Upload upload = new Upload("", counter);
 
     public UploadWithProgressMonitoringExample() {
-        upload.setImmediate(true); // make analyzing start immediatedly when
-        upload.setButtonCaption("Analyze file");
-        // file is selected
+        setMargin(true, false, false, false);
+        setSpacing(true);
+
+        addComponent(new Label(
+                "Upload a file and we'll count the number of line break charaters found in it."));
+
+        // make analyzing start immediatedly when file is selected
+        upload.setImmediate(true);
+        upload.setButtonCaption("Upload File");
         addComponent(upload);
 
         CheckBox handBrake = new CheckBox("Simulate slow server");
@@ -56,7 +62,7 @@ public class UploadWithProgressMonitoringExample extends VerticalLayout {
             }
         });
         cancelProcessing.setEnabled(false);
-
+        cancelProcessing.setStyleName("small");
         addComponent(cancelProcessing);
 
         handBrake.setImmediate(true);
@@ -64,7 +70,9 @@ public class UploadWithProgressMonitoringExample extends VerticalLayout {
         addComponent(handBrake);
 
         Panel p = new Panel("Status");
+        p.setSizeUndefined();
         FormLayout l = new FormLayout();
+        l.setMargin(true);
         p.setContent(l);
         state.setCaption("Current state");
         state.setValue("Idle");