From: Jouni Koivuviita Date: Fri, 4 Sep 2009 12:08:32 +0000 (+0000) Subject: Fixes ##2972: Create theme selector for Sampler X-Git-Tag: 6.7.0.beta1~2519 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ef488df19ce15c651ae7b23a797671746ae18c2f;p=vaadin-framework.git Fixes ##2972: Create theme selector for Sampler svn changeset:8665/svn branch:6.1 --- diff --git a/WebContent/VAADIN/themes/runo/button/button.css b/WebContent/VAADIN/themes/runo/button/button.css index 53762a03df..230d49912f 100644 --- a/WebContent/VAADIN/themes/runo/button/button.css +++ b/WebContent/VAADIN/themes/runo/button/button.css @@ -33,7 +33,8 @@ /* Small style */ -.v-button-small { +.v-button-small, +.v-disabled.v-button-small { font-size: 11px; line-height: 14px; padding: 1px 15px; @@ -42,7 +43,8 @@ /* 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/runo/styles.css b/WebContent/VAADIN/themes/runo/styles.css index 739d089c85..0c70ca98f4 100644 --- a/WebContent/VAADIN/themes/runo/styles.css +++ b/WebContent/VAADIN/themes/runo/styles.css @@ -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 index 0000000000..c3c4ff1678 --- /dev/null +++ b/WebContent/VAADIN/themes/sampler-reindeer/styles.css @@ -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 index 0000000000..f5c19e4115 --- /dev/null +++ b/WebContent/VAADIN/themes/sampler-runo/styles.css @@ -0,0 +1,3 @@ +@import url(../runo/styles.css); + +@import url(../sampler/styles.css); \ No newline at end of file diff --git a/WebContent/VAADIN/themes/sampler/layouts/examplecustomlayout.html b/WebContent/VAADIN/themes/sampler/layouts/examplecustomlayout.html index 1e139a6c9c..0d2af150c5 100644 --- a/WebContent/VAADIN/themes/sampler/layouts/examplecustomlayout.html +++ b/WebContent/VAADIN/themes/sampler/layouts/examplecustomlayout.html @@ -30,7 +30,7 @@ - This + This information is in the layout. diff --git a/WebContent/VAADIN/themes/sampler/sampler/palette.png b/WebContent/VAADIN/themes/sampler/sampler/palette.png new file mode 100644 index 0000000000..dc67427b26 Binary files /dev/null and b/WebContent/VAADIN/themes/sampler/sampler/palette.png differ diff --git a/WebContent/VAADIN/themes/sampler/sampler/segment.png b/WebContent/VAADIN/themes/sampler/sampler/segment.png index a2f5049589..5896cb8fc5 100644 Binary files a/WebContent/VAADIN/themes/sampler/sampler/segment.png and b/WebContent/VAADIN/themes/sampler/sampler/segment.png differ diff --git a/WebContent/VAADIN/themes/sampler/sampler/styles.css b/WebContent/VAADIN/themes/sampler/sampler/styles.css index e2e0718b96..3b18645d74 100644 --- a/WebContent/VAADIN/themes/sampler/sampler/styles.css +++ b/WebContent/VAADIN/themes/sampler/sampler/styles.css @@ -154,7 +154,7 @@ 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 { @@ -162,7 +162,36 @@ } .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, diff --git a/WebContent/VAADIN/themes/sampler/styles.css b/WebContent/VAADIN/themes/sampler/styles.css index 00f8978965..6715ad1b9f 100644 --- a/WebContent/VAADIN/themes/sampler/styles.css +++ b/WebContent/VAADIN/themes/sampler/styles.css @@ -1,5 +1,3 @@ -@import url(../reindeer/styles.css); - @import url(sampler/styles.css); @import url(dummy/styles.css); diff --git a/src/com/vaadin/demo/sampler/ExampleUtil.java b/src/com/vaadin/demo/sampler/ExampleUtil.java index 3888dd25fa..ca50d2a654 100644 --- a/src/com/vaadin/demo/sampler/ExampleUtil.java +++ b/src/com/vaadin/demo/sampler/ExampleUtil.java @@ -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 }); diff --git a/src/com/vaadin/demo/sampler/SamplerApplication.java b/src/com/vaadin/demo/sampler/SamplerApplication.java index 85978c16da..d3a85287fc 100644 --- a/src/com/vaadin/demo/sampler/SamplerApplication.java +++ b/src/com/vaadin/demo/sampler/SamplerApplication.java @@ -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("", search); + final PopupView pv = new PopupView("", 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) { diff --git a/src/com/vaadin/demo/sampler/features/accordions/AccordionDisabledExample.java b/src/com/vaadin/demo/sampler/features/accordions/AccordionDisabledExample.java index edc1b6a95a..6566144a3f 100644 --- a/src/com/vaadin/demo/sampler/features/accordions/AccordionDisabledExample.java +++ b/src/com/vaadin/demo/sampler/features/accordions/AccordionDisabledExample.java @@ -25,12 +25,9 @@ public class AccordionDisabledExample extends VerticalLayout implements private Tab t2; private Tab t3; - private static final ThemeResource icon1 = new ThemeResource( - "icons/action_save.gif"); - private static final ThemeResource icon2 = new ThemeResource( - "icons/comment_yellow.gif"); - private static final ThemeResource icon3 = new ThemeResource( - "icons/icon_info.gif"); + private static final ThemeResource icon1 = new ThemeResource("../sampler/icons/action_save.gif"); + private static final ThemeResource icon2 = new ThemeResource("../sampler/icons/comment_yellow.gif"); + private static final ThemeResource icon3 = new ThemeResource("../sampler/icons/icon_info.gif"); public AccordionDisabledExample() { setSpacing(true); diff --git a/src/com/vaadin/demo/sampler/features/accordions/AccordionIconsExample.java b/src/com/vaadin/demo/sampler/features/accordions/AccordionIconsExample.java index 9bb8418fbc..fa21952c38 100644 --- a/src/com/vaadin/demo/sampler/features/accordions/AccordionIconsExample.java +++ b/src/com/vaadin/demo/sampler/features/accordions/AccordionIconsExample.java @@ -12,12 +12,9 @@ import com.vaadin.ui.TabSheet.Tab; public class AccordionIconsExample extends HorizontalLayout implements Accordion.SelectedTabChangeListener { - private static final ThemeResource icon1 = new ThemeResource( - "icons/action_save.gif"); - private static final ThemeResource icon2 = new ThemeResource( - "icons/comment_yellow.gif"); - private static final ThemeResource icon3 = new ThemeResource( - "icons/icon_info.gif"); + private static final ThemeResource icon1 = new ThemeResource("../sampler/icons/action_save.gif"); + private static final ThemeResource icon2 = new ThemeResource("../sampler/icons/comment_yellow.gif"); + private static final ThemeResource icon3 = new ThemeResource("../sampler/icons/icon_info.gif"); private Accordion a; diff --git a/src/com/vaadin/demo/sampler/features/buttons/ButtonLinkExample.java b/src/com/vaadin/demo/sampler/features/buttons/ButtonLinkExample.java index 8723c85749..f328c3dfac 100644 --- a/src/com/vaadin/demo/sampler/features/buttons/ButtonLinkExample.java +++ b/src/com/vaadin/demo/sampler/features/buttons/ButtonLinkExample.java @@ -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() { diff --git a/src/com/vaadin/demo/sampler/features/buttons/ButtonPushExample.java b/src/com/vaadin/demo/sampler/features/buttons/ButtonPushExample.java index 35f3bf5a86..c9e3943770 100644 --- a/src/com/vaadin/demo/sampler/features/buttons/ButtonPushExample.java +++ b/src/com/vaadin/demo/sampler/features/buttons/ButtonPushExample.java @@ -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() { diff --git a/src/com/vaadin/demo/sampler/features/buttons/ButtonSwitchExample.java b/src/com/vaadin/demo/sampler/features/buttons/ButtonSwitchExample.java index 2df35d1c47..3a9c8a8fdc 100644 --- a/src/com/vaadin/demo/sampler/features/buttons/ButtonSwitchExample.java +++ b/src/com/vaadin/demo/sampler/features/buttons/ButtonSwitchExample.java @@ -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); diff --git a/src/com/vaadin/demo/sampler/features/commons/IconsExample.java b/src/com/vaadin/demo/sampler/features/commons/IconsExample.java index 4e27ecf4c2..911e2338c3 100644 --- a/src/com/vaadin/demo/sampler/features/commons/IconsExample.java +++ b/src/com/vaadin/demo/sampler/features/commons/IconsExample.java @@ -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); } diff --git a/src/com/vaadin/demo/sampler/features/layouts/CustomLayoutsExample.java b/src/com/vaadin/demo/sampler/features/layouts/CustomLayoutsExample.java index c997582fc6..e759ea5421 100644 --- a/src/com/vaadin/demo/sampler/features/layouts/CustomLayoutsExample.java +++ b/src/com/vaadin/demo/sampler/features/layouts/CustomLayoutsExample.java @@ -13,7 +13,8 @@ public class CustomLayoutsExample extends VerticalLayout { // Create the custom layout and set it as a component in // the current layout - CustomLayout custom = new CustomLayout("examplecustomlayout"); + CustomLayout custom = new CustomLayout( + "../../sampler/layouts/examplecustomlayout"); addComponent(custom); // Create components and bind them to the location tags diff --git a/src/com/vaadin/demo/sampler/features/link/LinkCurrentWindowExample.java b/src/com/vaadin/demo/sampler/features/link/LinkCurrentWindowExample.java index 0be2bce3a8..855fb0ab93 100644 --- a/src/com/vaadin/demo/sampler/features/link/LinkCurrentWindowExample.java +++ b/src/com/vaadin/demo/sampler/features/link/LinkCurrentWindowExample.java @@ -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); diff --git a/src/com/vaadin/demo/sampler/features/link/LinkNoDecorationsExample.java b/src/com/vaadin/demo/sampler/features/link/LinkNoDecorationsExample.java index db90bce3f5..e5457191c9 100644 --- a/src/com/vaadin/demo/sampler/features/link/LinkNoDecorationsExample.java +++ b/src/com/vaadin/demo/sampler/features/link/LinkNoDecorationsExample.java @@ -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); diff --git a/src/com/vaadin/demo/sampler/features/link/LinkSizedWindowExample.java b/src/com/vaadin/demo/sampler/features/link/LinkSizedWindowExample.java index 6618b46ce0..b7667982bc 100644 --- a/src/com/vaadin/demo/sampler/features/link/LinkSizedWindowExample.java +++ b/src/com/vaadin/demo/sampler/features/link/LinkSizedWindowExample.java @@ -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"); diff --git a/src/com/vaadin/demo/sampler/features/selects/ComboBoxInputPromptExample.java b/src/com/vaadin/demo/sampler/features/selects/ComboBoxInputPromptExample.java index 28289c7fd6..b9a0469127 100644 --- a/src/com/vaadin/demo/sampler/features/selects/ComboBoxInputPromptExample.java +++ b/src/com/vaadin/demo/sampler/features/selects/ComboBoxInputPromptExample.java @@ -13,7 +13,7 @@ public class ComboBoxInputPromptExample extends VerticalLayout implements "Helsinki", "Madrid", "Oslo", "Paris", "Stockholm" }; public ComboBoxInputPromptExample() { - setMargin(true); // for looks: more 'air' + setMargin(true, false, false, false); // for looks: more 'air' // Create & set input prompt ComboBox l = new ComboBox(); diff --git a/src/com/vaadin/demo/sampler/features/table/TableMainFeaturesExample.java b/src/com/vaadin/demo/sampler/features/table/TableMainFeaturesExample.java index 6868358ce3..fd5f4fde4b 100644 --- a/src/com/vaadin/demo/sampler/features/table/TableMainFeaturesExample.java +++ b/src/com/vaadin/demo/sampler/features/table/TableMainFeaturesExample.java @@ -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, diff --git a/src/com/vaadin/demo/sampler/features/tabsheets/TabSheetDisabledExample.java b/src/com/vaadin/demo/sampler/features/tabsheets/TabSheetDisabledExample.java index 7a39fd8da8..c240846d86 100644 --- a/src/com/vaadin/demo/sampler/features/tabsheets/TabSheetDisabledExample.java +++ b/src/com/vaadin/demo/sampler/features/tabsheets/TabSheetDisabledExample.java @@ -13,12 +13,9 @@ import com.vaadin.ui.TabSheet.Tab; @SuppressWarnings("serial") public class TabSheetDisabledExample extends VerticalLayout implements TabSheet.SelectedTabChangeListener, Button.ClickListener { - private static final ThemeResource icon1 = new ThemeResource( - "icons/action_save.gif"); - private static final ThemeResource icon2 = new ThemeResource( - "icons/comment_yellow.gif"); - private static final ThemeResource icon3 = new ThemeResource( - "icons/icon_info.gif"); + private static final ThemeResource icon1 = new ThemeResource("../sampler/icons/action_save.gif"); + private static final ThemeResource icon2 = new ThemeResource("../sampler/icons/comment_yellow.gif"); + private static final ThemeResource icon3 = new ThemeResource("../sampler/icons/icon_info.gif"); private TabSheet t; private Button toggleEnabled; diff --git a/src/com/vaadin/demo/sampler/features/tabsheets/TabSheetIconsExample.java b/src/com/vaadin/demo/sampler/features/tabsheets/TabSheetIconsExample.java index 0dbff62381..97903e8e70 100644 --- a/src/com/vaadin/demo/sampler/features/tabsheets/TabSheetIconsExample.java +++ b/src/com/vaadin/demo/sampler/features/tabsheets/TabSheetIconsExample.java @@ -12,12 +12,9 @@ public class TabSheetIconsExample extends VerticalLayout implements TabSheet.SelectedTabChangeListener { // Icons for the table - private static final ThemeResource icon1 = new ThemeResource( - "icons/action_save.gif"); - private static final ThemeResource icon2 = new ThemeResource( - "icons/comment_yellow.gif"); - private static final ThemeResource icon3 = new ThemeResource( - "icons/icon_info.gif"); + private static final ThemeResource icon1 = new ThemeResource("../sampler/icons/action_save.gif"); + private static final ThemeResource icon2 = new ThemeResource("../sampler/icons/comment_yellow.gif"); + private static final ThemeResource icon3 = new ThemeResource("../sampler/icons/icon_info.gif"); private TabSheet t; diff --git a/src/com/vaadin/demo/sampler/features/tabsheets/TabSheetScrollingExample.java b/src/com/vaadin/demo/sampler/features/tabsheets/TabSheetScrollingExample.java index 43509ba809..19d8c2475e 100644 --- a/src/com/vaadin/demo/sampler/features/tabsheets/TabSheetScrollingExample.java +++ b/src/com/vaadin/demo/sampler/features/tabsheets/TabSheetScrollingExample.java @@ -11,12 +11,9 @@ import com.vaadin.ui.TabSheet.Tab; public class TabSheetScrollingExample extends VerticalLayout implements TabSheet.SelectedTabChangeListener { - private static final ThemeResource icon1 = new ThemeResource( - "icons/action_save.gif"); - private static final ThemeResource icon2 = new ThemeResource( - "icons/comment_yellow.gif"); - private static final ThemeResource icon3 = new ThemeResource( - "icons/icon_info.gif"); + private static final ThemeResource icon1 = new ThemeResource("../sampler/icons/action_save.gif"); + private static final ThemeResource icon2 = new ThemeResource("../sampler/icons/comment_yellow.gif"); + private static final ThemeResource icon3 = new ThemeResource("../sampler/icons/icon_info.gif"); private TabSheet t; diff --git a/src/com/vaadin/demo/sampler/features/text/TextFieldInputPromptExample.java b/src/com/vaadin/demo/sampler/features/text/TextFieldInputPromptExample.java index 29339dcd8f..0889b07fa1 100644 --- a/src/com/vaadin/demo/sampler/features/text/TextFieldInputPromptExample.java +++ b/src/com/vaadin/demo/sampler/features/text/TextFieldInputPromptExample.java @@ -12,7 +12,7 @@ public class TextFieldInputPromptExample extends VerticalLayout implements public TextFieldInputPromptExample() { // add som 'air' to the layout setSpacing(true); - setMargin(true); + setMargin(true, false, false, false); // Username field + input prompt TextField username = new TextField(); diff --git a/src/com/vaadin/demo/sampler/features/upload/UploadWithProgressMonitoringExample.java b/src/com/vaadin/demo/sampler/features/upload/UploadWithProgressMonitoringExample.java index 2af9a8432f..d3954cf320 100644 --- a/src/com/vaadin/demo/sampler/features/upload/UploadWithProgressMonitoringExample.java +++ b/src/com/vaadin/demo/sampler/features/upload/UploadWithProgressMonitoringExample.java @@ -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");