From ef488df19ce15c651ae7b23a797671746ae18c2f Mon Sep 17 00:00:00 2001 From: Jouni Koivuviita Date: Fri, 4 Sep 2009 12:08:32 +0000 Subject: [PATCH] Fixes ##2972: Create theme selector for Sampler svn changeset:8665/svn branch:6.1 --- .../VAADIN/themes/runo/button/button.css | 6 +- WebContent/VAADIN/themes/runo/styles.css | 6 +- .../VAADIN/themes/sampler-reindeer/styles.css | 3 + .../VAADIN/themes/sampler-runo/styles.css | 3 + .../sampler/layouts/examplecustomlayout.html | 2 +- .../VAADIN/themes/sampler/sampler/palette.png | Bin 0 -> 1725 bytes .../VAADIN/themes/sampler/sampler/segment.png | Bin 1005 -> 1390 bytes .../VAADIN/themes/sampler/sampler/styles.css | 33 ++++++++++- WebContent/VAADIN/themes/sampler/styles.css | 2 - src/com/vaadin/demo/sampler/ExampleUtil.java | 2 +- .../demo/sampler/SamplerApplication.java | 56 +++++++++++++++--- .../accordions/AccordionDisabledExample.java | 9 +-- .../accordions/AccordionIconsExample.java | 9 +-- .../features/buttons/ButtonLinkExample.java | 3 +- .../features/buttons/ButtonPushExample.java | 3 +- .../features/buttons/ButtonSwitchExample.java | 3 +- .../features/commons/IconsExample.java | 14 ++--- .../layouts/CustomLayoutsExample.java | 3 +- .../link/LinkCurrentWindowExample.java | 3 +- .../link/LinkNoDecorationsExample.java | 3 +- .../features/link/LinkSizedWindowExample.java | 3 +- .../selects/ComboBoxInputPromptExample.java | 2 +- .../table/TableMainFeaturesExample.java | 6 +- .../tabsheets/TabSheetDisabledExample.java | 9 +-- .../tabsheets/TabSheetIconsExample.java | 9 +-- .../tabsheets/TabSheetScrollingExample.java | 9 +-- .../text/TextFieldInputPromptExample.java | 2 +- .../UploadWithProgressMonitoringExample.java | 18 ++++-- 28 files changed, 143 insertions(+), 78 deletions(-) create mode 100644 WebContent/VAADIN/themes/sampler-reindeer/styles.css create mode 100644 WebContent/VAADIN/themes/sampler-runo/styles.css create mode 100644 WebContent/VAADIN/themes/sampler/sampler/palette.png 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 0000000000000000000000000000000000000000..dc67427b26509d5be65ae2388002ce1ce2d82483 GIT binary patch literal 1725 zcmV;u215CXP)6ewU{l-{uVS$w<$@y3{?(Lh*P!&!?uOG8u}Z;D{nlf#c3`qY?G{ ze9L*wIZns1591goj-L-b@8g+LkgH9I+ zMNAfpLZN_x-{(De;J}bpJ3Krbo;%DN#KUpiL%6nX&ENb+o=75cKmu{R^I2CzW8?VP zD1*tO(rD$SB|ILl^5(qBTeoh)KYqX8U>&*HRlQ2|nixsH@T-B%^Bvri zb8g#aqtQ4zHg;E~^3JAWF%Tp?CnpDM&W*N+VAA*)l59*sSC;I&#@F1)7Z=C!J79CuJCSZ;1E zpm-yVfJZbseR#xBv~#CGAmFe$@reoi@^Zpvd#ux|E?&~=^gt-9#Z*>S+O1am{QihX z765Y0%rrLMm&;`7X=x}*CLstXF%dYc`ua>wO$~-&TrT&^Q>Ua-X=~eK!tI6wi3o(e zS5ihMlZ8S7hr<~f(gKglN=xW88t!yXO-@=Y*4Wrscne!U{p|A*gCQb{abkkJc3m2< z+-{#SnanWJYIS53O-W9Mn+^1nN+nDtqg&nc?RVenbb5c3;lLf3FD&M!`^^@sHC7(W z=ksi~Y5lPNar+aq*%B?NSweaj6AXw4uEIKm95VJrN$>(7f22*G;G$;<_M!U#WW;>` z>+n*Bn{e~_e9X7B&qnhFG5|m^F) zrvt7q=!{QJd<+c!;r#iK$$up+7$ydQkTW`!a<1ZRYHDgw*Xjehrpy+JS8v|>_R}XV z*Q={27^R?~;96Ccx?7DRk$@1$lHb?T(i~ma@{4zFHyB2t=3TsW1qoA;kb~e6x@*@i zNV`VU?+kOm9P`2f`K2?NDB&UCw)ANbf|C2-H<@j}^!76V#|Kq?kKq)=#V7JFb|@U7juMM4oM&&s4ETTs{j?(Mr)a|_~y zE(5CQk;8{NI-Z71BZh`S%XPc2{9M9?6$&;$OI^eEA5Oc1gLN1s8)!YK7 z5iZ#wAf#YN5$u*o#5^t!0^G5^@WT&|LDLEy)8yo&*=$xQ6rqcK=*Us6P8WV}rl)Oe z4wsyekOZuq3F;b51_y_ruSi|DE~INRnT*L~K6}>r#i_5LS3@EVkY5V)+4E@{qSn3o z1`t?9wzfStnHCW`jF4f;8#hkexmyQS9bALHbynAqXmw)tu0?tcmaq;A zKL4B121-T)x`r;N9!2~lMkWVzjr0;gfD$NaWO6{)oG$0f=$ce6d&Ro;uK)u8*)$3| T_ge&E00000NkvXXu0mjfKY&4t literal 0 HcmV?d00001 diff --git a/WebContent/VAADIN/themes/sampler/sampler/segment.png b/WebContent/VAADIN/themes/sampler/sampler/segment.png index a2f504958940671a83a7e9070163cd61b60752d1..5896cb8fc545145139f6ddc5af34a636f38701c1 100644 GIT binary patch delta 944 zcmV;h15f7mzbECnVFfInwp!No1C1S zot>SYo}QndpP-Ll?si~=|s;aB2tE{Z7t*x!D zuCA}IuduMNv9YnTva++Yv$V9dwY9ajwzju_x3{>sxVgExy1Kf%ySu!+yuH1>zP`S{ zzrVo1z`?=6!otGC!^6bH#KpzM#>U3S$H&OX$jQmc%F4>i%gfBn%+1Zs&d$!y&(F}% z(9zM+($dn?)6>+{)YaA1*4Eb7*VowC*xA|H+S=ON+uPjS+}+*X-rnBd-{0Wi;Njta z;o{=ruz*=jZ3>=;-O`>FVn0>+9?6?CkCB?e6aG@9*#M@bK~R@$&NW z^Yioc^z`-h_4fAm_xJbs`1twx`TF|$`}_O+{QUj>{r>*`|NsA(fz+721 zrmZ#Dlt{X!U~8NCmv_kK_|9s7)$OkFriv%j)t&K8xccyay3+J;E^8P^x#~*OgE_20 z?B}Q}P4`-?UMyScO4A)BtPY%)s4GnmWwD0vD@$EzdLWNAfRj9RrRlDJB32hZ6{#yt zdoo!be9lx?n(i)Sbz`qkU1_?rfYpij1?o!ERyNDR$82?_>HcC?KRy(zD^2(0vw9HC zS68}2A~x$Ap4-|Qp*v(O>f90005pNkl*OU1e~Srmfg|#MSLC&!sB~d|@R$x4c{D znin?9D7@iqbD`M<;bfS?A#cfW;DS>EzNu<|6L4Eq8($FcUR4_(33#oljZX?VP}RmK1UyhR za4p-HIXDrwTio^N6%HRoj2^kJz#qTH;0I0Pe$eGoZH-Nte9xxFwv_Aah_t3N&>HD~ z=yd<~w|A!YH)@af2Ma_jsrM;PI;x2x%R6Vn| zWPf{Qv4VLHkG6`%6+6$t5H*O$AyI8SmPd`@ZJww$9?7Lf@GMtU8xMHY0MnNPs5TzWrbh8STT~kl=TpP@oG+?-jeCo!Uc4+8)yAPLDuh>AqT0Bxi0Z?wB2jJJ zQ%LpTNuj7V_Hrl>FLFe+@lXjhgr_B<+PJ@f>PMnLRQua;pZb71Jo<6_+mnfMW)1gf uD^E", 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"); -- 2.39.5