\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
\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
/* Small style */
-.v-button-small {
+.v-button-small,
+.v-disabled.v-button-small {
font-size: 11px;
line-height: 14px;
padding: 1px 15px;
/* Link style */
-.v-button-link {
+.v-button-link,
+.v-disabled.v-button-link {
border: none;
background: transparent;
padding: 0;
--- /dev/null
+@import url(../reindeer/styles.css);
+
+@import url(../sampler/styles.css);
\ No newline at end of file
--- /dev/null
+@import url(../runo/styles.css);
+
+@import url(../sampler/styles.css);
\ No newline at end of file
</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
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,
-@import url(../reindeer/styles.css);
-
@import url(sampler/styles.css);
@import url(dummy/styles.css);
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 });
.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();
}
*/
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
Button previousSample;
Button nextSample;
private ComboBox search;
+ private ComboBox theme;
@Override
public void detach() {
setSizeFull();
mainExpand.setSizeFull();
setCaption("Vaadin Sampler");
+ setTheme(currentTheme);
// topbar (navigation)
HorizontalLayout nav = new HorizontalLayout();
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();
* 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()) {
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) {
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) {
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
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
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() {
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() {
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);
/* 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);
}
\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
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);
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);
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");
"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
// 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,
@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
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
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
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
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");
}
});
cancelProcessing.setEnabled(false);
-
+ cancelProcessing.setStyleName("small");
addComponent(cancelProcessing);
handBrake.setImmediate(true);
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");