Session Closed
36 | 37 |You were inactive too long and the session was closed.
38 | 39 | 40 | 41 |├── .classpath
├── .externalToolBuilders
├── Copy sources.launch
└── Sass Compilation.launch
├── .gitignore
├── .project
├── .settings
├── org.eclipse.jdt.core.prefs
├── org.eclipse.wst.common.component
└── org.eclipse.wst.common.project.facet.core.xml
├── README.md
├── WebContent
├── META-INF
│ └── MANIFEST.MF
├── VAADIN
│ └── themes
│ │ ├── book-examples
│ │ ├── .gitignore
│ │ ├── Makefile
│ │ ├── addons.scss
│ │ ├── book-examples.scss
│ │ ├── favicon.ico
│ │ ├── fonts
│ │ │ ├── 03805817-4611-4dbc-8c65-0f73031c3973.woff
│ │ │ ├── 548e8c1d-b37a-43af-b197-a35e2f0c3d2f.ttf
│ │ │ ├── c280ced9-704c-46b2-a66a-aff7ee1627bf.woff
│ │ │ └── d5f9f72d-afb7-4c57-8348-b4bdac42edbb.ttf
│ │ ├── icons
│ │ │ ├── axe-16px.png
│ │ │ ├── axe-32px.png
│ │ │ ├── axe-8px.png
│ │ │ ├── coffee-16px.png
│ │ │ ├── coffee-20px.png
│ │ │ ├── comment_yellow.gif
│ │ │ ├── external-link.png
│ │ │ ├── external-link.svg
│ │ │ ├── magnifier.png
│ │ │ ├── tea-16px.png
│ │ │ ├── tea-20px.png
│ │ │ ├── user.png
│ │ │ ├── vaadin-arrow-down-white.png
│ │ │ ├── vaadin-arrow-down.svg
│ │ │ ├── vaadin-arrow-right-orange.png
│ │ │ └── vaadin-arrow-right-orange.svg
│ │ ├── img
│ │ │ ├── Ripley_Scroll-300px.jpg
│ │ │ ├── Ripley_Scroll.jpg
│ │ │ ├── cat-128px.png
│ │ │ ├── cat-16px.png
│ │ │ ├── checkbox-checked.png
│ │ │ ├── checkbox-checked.svg
│ │ │ ├── checkbox-unchecked.png
│ │ │ ├── checkbox-unchecked.svg
│ │ │ ├── copernicus-128px.jpg
│ │ │ ├── dog-128px.png
│ │ │ ├── dog-16px.png
│ │ │ ├── dog-32px.png
│ │ │ ├── embedded-journalist.jpg
│ │ │ ├── galileo-128px.jpg
│ │ │ ├── image-sources.txt
│ │ │ ├── kepler-128px.jpg
│ │ │ ├── neocreo_Blue_World_Map_640x.png
│ │ │ ├── nicubunu_Chain.png
│ │ │ ├── penguin-128px.png
│ │ │ ├── penguin-16px.png
│ │ │ ├── pig-128px.png
│ │ │ ├── pig-16px.png
│ │ │ ├── pig-32px.png
│ │ │ ├── planets
│ │ │ │ ├── Earth.jpg
│ │ │ │ ├── Earth_small.png
│ │ │ │ ├── Earth_symbol.png
│ │ │ │ ├── Jupiter.jpg
│ │ │ │ ├── Jupiter_symbol.png
│ │ │ │ ├── Mars.jpg
│ │ │ │ ├── Mars_symbol.png
│ │ │ │ ├── Mercury.jpg
│ │ │ │ ├── Mercury_small.png
│ │ │ │ ├── Mercury_symbol.png
│ │ │ │ ├── Neptune.jpg
│ │ │ │ ├── Neptune_symbol.png
│ │ │ │ ├── Saturn.jpg
│ │ │ │ ├── Saturn_symbol.png
│ │ │ │ ├── Uranus.jpg
│ │ │ │ ├── Uranus_symbol.png
│ │ │ │ ├── Venus.jpg
│ │ │ │ ├── Venus_small.png
│ │ │ │ ├── Venus_symbol.png
│ │ │ │ └── image-sources.txt
│ │ │ ├── reindeer-128px.png
│ │ │ ├── reindeer-16px.png
│ │ │ ├── reindeer-256px.png
│ │ │ ├── reindeer-32px.png
│ │ │ ├── reindeer-64px.png
│ │ │ ├── reindeer.svg
│ │ │ ├── richtextarea-toolbar-fi.png
│ │ │ ├── sheep-128px.png
│ │ │ ├── sheep-16px.png
│ │ │ ├── smiley.jpg
│ │ │ ├── smiley2-128px.png
│ │ │ ├── smiley2-20px.png
│ │ │ ├── smiley2.svg
│ │ │ ├── themeimage.png
│ │ │ ├── tree-arrows-white.png
│ │ │ ├── vaadin-logo.png
│ │ │ └── vaadin_spin.swf
│ │ ├── layouts
│ │ │ ├── layoutname.html
│ │ │ ├── printpage.html
│ │ │ └── stylingexample.html
│ │ ├── pdfexample.pdf
│ │ └── styles.scss
│ │ ├── mobiletheme
│ │ ├── close64.png
│ │ └── styles.css
│ │ ├── myproject
│ │ ├── .gitignore
│ │ ├── addons.scss
│ │ ├── myproject.scss
│ │ └── styles.scss
│ │ ├── mytheme
│ │ ├── .gitignore
│ │ ├── addons.scss
│ │ ├── mytheme.scss
│ │ └── styles.scss
│ │ └── myvalotheme
│ │ ├── .gitignore
│ │ ├── addons.scss
│ │ ├── myvalotheme.scss
│ │ └── styles.scss
├── WEB-INF
│ ├── applicationContext.xml
│ ├── beans.xml
│ ├── classes
│ │ └── META-INF
│ │ │ └── persistence.xml
│ ├── exclusions.list
│ ├── fop.xconf
│ ├── images
│ │ └── image.png
│ ├── liferay-display.xml
│ ├── liferay-plugin-package.properties
│ ├── liferay-portlet.xml
│ ├── portlet.xml
│ └── web.xml
├── closed.html
├── embedding-in-div.html
├── embedding-in-jsp.jsp
├── examples
│ ├── jscomponent-example.html
│ └── mylibrary.js
├── images
│ ├── datamodel
│ │ └── beanitem-doublebinding-lo.png
│ └── image.png
├── index.html
├── logout.html
├── multicoltest.html
├── pure-clientside.html
└── static-login.html
├── build
├── bin
│ └── trackchanges.py
└── build.xml
├── ivy.xml
├── ivysettings.xml
├── src
├── com
│ └── vaadin
│ │ └── book
│ │ ├── BookExamplesUI.java
│ │ ├── LogFormatter.java
│ │ ├── MyCustomServlet.java
│ │ ├── applications
│ │ ├── CookieExampleApplication.java
│ │ ├── DynamicWindowUI.java
│ │ ├── HelloWorld.java
│ │ ├── HttpServletRequestApplication.java
│ │ ├── IndexingExampleApplication.java
│ │ ├── MyHierarchicalUI.java
│ │ ├── MyPortletUI.java
│ │ ├── PortletCustomModeExample.java
│ │ ├── PortletModeExample.java
│ │ ├── StaticLoginUI.java
│ │ ├── ThreadLocalApplication.java
│ │ └── UIToBeTested.java
│ │ ├── examples
│ │ ├── AbstractExampleItem.java
│ │ ├── AnyBookExampleBundle.java
│ │ ├── BookExample.java
│ │ ├── BookExampleBundle.java
│ │ ├── BookExampleLibrary.java
│ │ ├── BrknExample.java
│ │ ├── CaptionedExampleItem.java
│ │ ├── Description.java
│ │ ├── EmboExample.java
│ │ ├── ExampleCtgr.java
│ │ ├── RedirctItem.java
│ │ ├── SourceFragment.java
│ │ ├── addons
│ │ │ ├── AddonTests.java
│ │ │ ├── ChartsExample.java
│ │ │ ├── charts
│ │ │ │ ├── AxesExample.java
│ │ │ │ ├── BoxPlotExample.java
│ │ │ │ ├── ChartTypesExample.java
│ │ │ │ ├── Charts3DExample.java
│ │ │ │ ├── ChartsExample.java
│ │ │ │ ├── FunnelExample.java
│ │ │ │ ├── GaugeExample.java
│ │ │ │ ├── HeatMapExample.java
│ │ │ │ ├── PyramidExample.java
│ │ │ │ ├── ScatterExample.java
│ │ │ │ ├── TimelineExample.java
│ │ │ │ ├── countrycoordinates-to-java.py
│ │ │ │ ├── countrycoordinates.txt
│ │ │ │ └── countrycoordinates.txt~
│ │ │ ├── jpacontainer
│ │ │ │ ├── CelestialBody.java
│ │ │ │ ├── Country.java
│ │ │ │ ├── JPAContainerExample.java
│ │ │ │ ├── JPAFieldFactoryExample.java
│ │ │ │ ├── JPAFilteringExample.java
│ │ │ │ ├── JPAHierarhicalExample.java
│ │ │ │ └── Person.java
│ │ │ ├── spreadsheet
│ │ │ │ ├── SpreadsheetComponentsExample.java
│ │ │ │ ├── SpreadsheetExample.java
│ │ │ │ ├── SpreadsheetManagementExample.java
│ │ │ │ └── SpreadsheetTablesExample.java
│ │ │ └── touchkit
│ │ │ │ ├── AdaptiveMobileUI.java
│ │ │ │ ├── MyMobileWidgetSet.gwt.xml
│ │ │ │ └── SimplePhoneUI.java
│ │ ├── advanced
│ │ │ ├── AnimalView.html
│ │ │ ├── AppData.java
│ │ │ ├── BrowserInfoExample.java
│ │ │ ├── CustomViewProviderUI.java
│ │ │ ├── DebugWindowExample.java
│ │ │ ├── EmbeddingExample.java
│ │ │ ├── FontIconExample.java
│ │ │ ├── GlobalAccessExample.java
│ │ │ ├── I18NExample.java
│ │ │ ├── JSAPIExample.java
│ │ │ ├── LoggingExample.java
│ │ │ ├── LoginView.html
│ │ │ ├── MainView.html
│ │ │ ├── MyAppCaptions.java
│ │ │ ├── MyAppCaptions_fi.java
│ │ │ ├── NavigatorExample.java
│ │ │ ├── NavigatorUI.java
│ │ │ ├── PopupWindowExample.java
│ │ │ ├── PrintingExample.java
│ │ │ ├── RequestHandlerExample.java
│ │ │ ├── RightToLeftStrings.java
│ │ │ ├── RightToLeftStrings_ar.java
│ │ │ ├── ServletRequestListenerExample.java
│ │ │ ├── ShortcutExample.java
│ │ │ ├── UriFragmentExample.java
│ │ │ ├── cdi
│ │ │ │ ├── BroadcastMessage.java
│ │ │ │ ├── CDIBroadcaster.java
│ │ │ │ ├── CDIChatUI.java
│ │ │ │ ├── CDIEventUI.java
│ │ │ │ ├── CDIExample.java
│ │ │ │ ├── CDINavEventsUI.java
│ │ │ │ ├── CDIProducerUI.java
│ │ │ │ ├── CDIProducers.java
│ │ │ │ ├── ChatBox.java
│ │ │ │ ├── DisplayPanel.java
│ │ │ │ ├── Greeter.java
│ │ │ │ ├── HelpView.html
│ │ │ │ ├── HelpView.java
│ │ │ │ ├── InputPanel.java
│ │ │ │ ├── LoginView.java
│ │ │ │ ├── MainView.java
│ │ │ │ ├── MyCDIComponentFactory.java
│ │ │ │ ├── MyCDIUI.java
│ │ │ │ ├── MyEvent.java
│ │ │ │ └── User.java
│ │ │ ├── dd
│ │ │ │ ├── ComponentDnDExample.java
│ │ │ │ ├── DiagramDnDExample.java
│ │ │ │ ├── DragNDropTreeExample.java
│ │ │ │ ├── ResizeDnDExample.java
│ │ │ │ ├── TreeAndTableExample.java
│ │ │ │ ├── resize-handle.png
│ │ │ │ └── resize-handle.svg
│ │ │ ├── push
│ │ │ │ ├── Broadcaster.java
│ │ │ │ ├── PushAroundUI.java
│ │ │ │ ├── PushExample.java
│ │ │ │ └── PushyUI.java
│ │ │ └── spring
│ │ │ │ ├── BroadcastMessage.java
│ │ │ │ ├── ChatBox.java
│ │ │ │ ├── DisplayPanel.java
│ │ │ │ ├── Greeter.java
│ │ │ │ ├── InputPanel.java
│ │ │ │ ├── LoginView.java
│ │ │ │ ├── MainView.java
│ │ │ │ ├── MyAccessDeniedView.java
│ │ │ │ ├── MyEvent.java
│ │ │ │ ├── MySpringServlet.java
│ │ │ │ ├── MySpringUI.java
│ │ │ │ ├── SpringBroadcaster.java
│ │ │ │ ├── SpringChatUI.java
│ │ │ │ ├── SpringEventUI.java
│ │ │ │ ├── SpringExample.java
│ │ │ │ ├── SpringNavEventsUI.java
│ │ │ │ ├── SpringProducerUI.java
│ │ │ │ ├── SpringProducers.java
│ │ │ │ └── User.java
│ │ ├── application
│ │ │ ├── ArchitectureExample.java
│ │ │ ├── BuildingUIExample.java
│ │ │ ├── ErrorIndicatorExample.java
│ │ │ ├── EventListenerExample.java
│ │ │ ├── LayoutClickListenerExample.java
│ │ │ ├── LifecycleExample.java
│ │ │ ├── MVCExample.java
│ │ │ ├── NotificationExample.java
│ │ │ ├── ResourceExample.java
│ │ │ ├── calc
│ │ │ │ ├── CalculatorModel.java
│ │ │ │ ├── MVCCalculator.java
│ │ │ │ └── MVPCalculator.java
│ │ │ ├── declarative
│ │ │ │ ├── CustomComponentDesign.html
│ │ │ │ ├── DeclarativeComponents.html
│ │ │ │ ├── DeclarativeUIExample.java
│ │ │ │ ├── DeclarativeViewUI.java
│ │ │ │ ├── DesignRootUI.java
│ │ │ │ ├── ExampleComponent.java
│ │ │ │ ├── InlineDesign.html
│ │ │ │ ├── MyBasicDeclarativeUI.java
│ │ │ │ ├── MyDeclarativeUI.html
│ │ │ │ └── MyDeclarativeUI.java
│ │ │ └── images
│ │ │ │ └── image.png
│ │ ├── client
│ │ │ ├── ColorPicker.java
│ │ │ ├── ColorPickerApplication.java
│ │ │ ├── ColorpickerExample.java
│ │ │ ├── MyComponent.java
│ │ │ ├── MyComponentExample.java
│ │ │ ├── clientside
│ │ │ │ ├── MyModule.gwt.xml
│ │ │ │ ├── MyModuleWidgetset.gwt.xml
│ │ │ │ └── client
│ │ │ │ │ ├── MyEntryPoint.java
│ │ │ │ │ └── MyWidget.java
│ │ │ ├── js
│ │ │ │ ├── JSIntegrationExample.java
│ │ │ │ ├── MyComponent.java
│ │ │ │ ├── MyComponentState.java
│ │ │ │ ├── mycomponent-connector.js
│ │ │ │ └── mylibrary.js
│ │ │ └── widgetset
│ │ │ │ ├── ColorPickerWidgetSet.gwt.xml
│ │ │ │ ├── client
│ │ │ │ ├── colorpicker
│ │ │ │ │ ├── ColorPickerConnector.java
│ │ │ │ │ ├── ColorPickerState.java
│ │ │ │ │ ├── GwtColorPicker.java
│ │ │ │ │ └── VColorPicker.java
│ │ │ │ ├── mycomponent
│ │ │ │ │ ├── MyComponentClientRpc.java
│ │ │ │ │ ├── MyComponentConnector.java
│ │ │ │ │ ├── MyComponentServerRpc.java
│ │ │ │ │ ├── MyComponentState.java
│ │ │ │ │ └── MyComponentWidget.java
│ │ │ │ └── renderer
│ │ │ │ │ ├── CellValueChangeRpc.java
│ │ │ │ │ ├── MyButtonRenderer.java
│ │ │ │ │ ├── MyButtonRendererConnector.java
│ │ │ │ │ ├── RendererTextBox.java
│ │ │ │ │ ├── TextFieldRenderer.java
│ │ │ │ │ └── TextFieldRendererConnector.java
│ │ │ │ └── public
│ │ │ │ └── colorpicker
│ │ │ │ └── styles.css
│ │ ├── component
│ │ │ ├── BufferingExample.java
│ │ │ ├── ButtonExample.java
│ │ │ ├── CalendarExample.java
│ │ │ ├── CheckBoxExample.java
│ │ │ ├── ColorPickerExample.java
│ │ │ ├── ComboBoxExample.java
│ │ │ ├── CustomComponentExample.java
│ │ │ ├── CustomFieldExample.java
│ │ │ ├── DateFieldExample.java
│ │ │ ├── EmbeddedExample.java
│ │ │ ├── ImageExample.java
│ │ │ ├── LabelExample.java
│ │ │ ├── LinkExample.java
│ │ │ ├── ListSelectExample.java
│ │ │ ├── MenuBarExample.java
│ │ │ ├── MenuNavigatorUI.java
│ │ │ ├── MyCalendarEvent.java
│ │ │ ├── NativeSelectExample.java
│ │ │ ├── OptionGroupExample.java
│ │ │ ├── PasswordFieldExample.java
│ │ │ ├── ProgressBarExample.java
│ │ │ ├── ProgressIndicatorExample.java
│ │ │ ├── RichTextAreaExample.java
│ │ │ ├── SelectExample.java
│ │ │ ├── SliderExample.java
│ │ │ ├── TextAreaExample.java
│ │ │ ├── TextChangeEventsExample.java
│ │ │ ├── TextFieldExample.java
│ │ │ ├── TreeExample.java
│ │ │ ├── TreeTableExample.java
│ │ │ ├── TwinColSelectExample.java
│ │ │ ├── UploadExample.java
│ │ │ ├── grid
│ │ │ │ ├── ColumnsExample.java
│ │ │ │ ├── GridDataBindingExample.java
│ │ │ │ ├── GridEditingExample.java
│ │ │ │ ├── GridExample.java
│ │ │ │ ├── GridSortBug.java
│ │ │ │ ├── GridStyleExample.java
│ │ │ │ ├── HierarchicalGridExample.java
│ │ │ │ ├── MyButtonRenderer.java
│ │ │ │ ├── RendererExample.java
│ │ │ │ └── TextFieldRenderer.java
│ │ │ ├── properties
│ │ │ │ ├── CaptionExample.java
│ │ │ │ ├── DescriptionExample.java
│ │ │ │ ├── EnabledExample.java
│ │ │ │ ├── FocusExample.java
│ │ │ │ ├── IconExample.java
│ │ │ │ ├── ListenerExample.java
│ │ │ │ ├── LocaleExample.java
│ │ │ │ ├── MultiSelectExample.java
│ │ │ │ ├── ReadOnlyExample.java
│ │ │ │ ├── RequiredExample.java
│ │ │ │ ├── StyleNameExample.java
│ │ │ │ ├── ValidationExample.java
│ │ │ │ └── VisibleExample.java
│ │ │ └── table
│ │ │ │ ├── GeneratedColumnExample.java
│ │ │ │ ├── TableEditingExample.java
│ │ │ │ └── TableExample.java
│ │ ├── datamodel
│ │ │ ├── BeanContainerExample.java
│ │ │ ├── BeanItemContainerExample.java
│ │ │ ├── BeanValidationExample.java
│ │ │ ├── ContainerExample.java
│ │ │ ├── ContainerFilterExample.java
│ │ │ ├── ConverterExample.java
│ │ │ ├── FieldGroupExample.java
│ │ │ ├── FilesystemContainerExample.java
│ │ │ ├── HierarchicalExample.java
│ │ │ ├── IndexedContainerExample.java
│ │ │ ├── ItemExample.java
│ │ │ └── PropertyExample.java
│ │ ├── editor
│ │ │ ├── CompositeExample.java
│ │ │ ├── MyComponent.java
│ │ │ ├── MyComponent2.java
│ │ │ └── MyComposite3.java
│ │ ├── gettingstarted
│ │ │ ├── MyScalaUI.scala
│ │ │ ├── MyprojectUI.java
│ │ │ └── NewProjectExample.java
│ │ ├── intro
│ │ │ └── HelloWorldExample.java
│ │ ├── layout
│ │ │ ├── AbsoluteLayoutExample.java
│ │ │ ├── AccordionExample.java
│ │ │ ├── AlignmentExample.java
│ │ │ ├── CssLayoutExample.java
│ │ │ ├── CustomLayoutExample.java
│ │ │ ├── ExpandRatioExample.java
│ │ │ ├── FormLayoutExample.java
│ │ │ ├── GridLayoutExample.java
│ │ │ ├── LayoutExample.java
│ │ │ ├── LayoutFeaturesExample.java
│ │ │ ├── MarginExample.java
│ │ │ ├── OrderedLayoutExample.java
│ │ │ ├── PanelExample.java
│ │ │ ├── PopupViewExample.java
│ │ │ ├── SpacingExample.java
│ │ │ ├── SplitPanelExample.java
│ │ │ ├── SubWindowExample.java
│ │ │ ├── TabSheetExample.java
│ │ │ └── WindowExample.java
│ │ ├── misc
│ │ │ ├── ExceptionExamples.java
│ │ │ ├── I18nPrototype.java
│ │ │ ├── ItemContainerExample.java
│ │ │ └── SerializationExample.java
│ │ ├── portlet
│ │ │ ├── IPCSessionReceiver.java
│ │ │ ├── IPCSessionSender.java
│ │ │ ├── MyPortletUI.java
│ │ │ ├── Person.java
│ │ │ ├── PortletCustomModeExample.java
│ │ │ └── PortletModeExample.java
│ │ └── themes
│ │ │ ├── BuiltInThemeExample.java
│ │ │ ├── ResponsiveExample.java
│ │ │ ├── ScssThemeExample.java
│ │ │ ├── ScssThemeUI.java
│ │ │ ├── ThemeExample.java
│ │ │ ├── ThemeTricksExample.java
│ │ │ └── ValoThemeUI.java
│ │ ├── js
│ │ └── jquery-2.1.0.min.js
│ │ ├── ui
│ │ ├── AbstractExampleMenu.java
│ │ ├── AccordionMenu.java
│ │ ├── SourceListing.java
│ │ └── TreeMenu.java
│ │ └── widgetset
│ │ └── BookExamplesWidgetSet.gwt.xml
├── logging.properties
└── org
│ └── vaadin
│ └── itemcontainer
│ └── ItemContainer.java
└── tests
└── com
└── vaadin
└── book
└── examples
├── BookExampleTestcase.java
├── ForExample.java
├── application
└── NotificationTest.java
├── component
├── ButtonTest.java
├── CalendarTest.java
├── ComboBoxTest.java
├── PasswordFieldTest.java
├── TableTest.java
└── properties
│ └── DescriptionTest.java
├── layout
├── PanelTest.java
└── PopupViewTest.java
└── testbench
├── SeleniumTestcase.java
└── Testcase.java
/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
4 |
|
15 | ||||
18 | |
You were inactive too long and the session was closed.
38 | 39 | 40 | 41 |Time is now <%= new java.util.Date() %>.
38 | 39 |And below is a Vaadin app.
40 | 41 | 42 | 43 | 44 | 45 |<% 46 | for (int i=0; i<3; i++) 47 | out.println("Isn't it nice?"); 48 | %>
49 | 50 | 51 | -------------------------------------------------------------------------------- /WebContent/examples/jscomponent-example.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 8 | 9 |Below is a JavaScript component created in a <div> placeholder element (empty at first):
25 | 26 | 27 | 28 | 29 | 30 | 37 | 38 |39 | Now, you can do the following: 40 |
41 | 42 |You can now close this window.
25 | 26 | 39 |This is static-login.html and below is a pure 12 | HTML login form:
13 | 14 | 15 | 16 | 17 | 18 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/com/vaadin/book/LogFormatter.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.book; 2 | 3 | import java.io.PrintWriter; 4 | import java.io.StringWriter; 5 | import java.text.DateFormat; 6 | import java.text.SimpleDateFormat; 7 | import java.util.Date; 8 | import java.util.logging.Formatter; 9 | import java.util.logging.LogRecord; 10 | 11 | public final class LogFormatter extends Formatter { 12 | DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mmZ"); 13 | 14 | @Override 15 | public String format(LogRecord record) { 16 | System.out.println("Logging..."); 17 | StringBuilder sb = new StringBuilder(); 18 | 19 | sb.append(df.format(new Date(record.getMillis()))) 20 | .append(" ") 21 | .append(record.getLevel().getLocalizedName()) 22 | .append(": ") 23 | .append(formatMessage(record)); 24 | 25 | if (record.getThrown() != null) { 26 | try { 27 | StringWriter sw = new StringWriter(); 28 | PrintWriter pw = new PrintWriter(sw); 29 | record.getThrown().printStackTrace(pw); 30 | pw.close(); 31 | sb.append(sw.toString()); 32 | } catch (Exception ex) { 33 | // ignore 34 | } 35 | } 36 | 37 | return sb.toString(); } 38 | } 39 | -------------------------------------------------------------------------------- /src/com/vaadin/book/applications/DynamicWindowUI.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.book.applications; 2 | 3 | // BEGIN-EXAMPLE: advanced.applicationwindow.dynamic 4 | // TODO Vaadin 7: Fix 5 | import com.vaadin.server.VaadinRequest; 6 | import com.vaadin.ui.Label; 7 | import com.vaadin.ui.UI; 8 | import com.vaadin.ui.VerticalLayout; 9 | 10 | public class DynamicWindowUI extends UI { 11 | private static final long serialVersionUID = 1340937891969118454L; 12 | 13 | @Override 14 | protected void init(VaadinRequest request) { 15 | // Create the content root layout for the UI 16 | VerticalLayout layout = new VerticalLayout(); 17 | setContent(layout); 18 | 19 | // Create just the main window initially 20 | layout.addComponent(new Label("This is the main window.")); 21 | } 22 | 23 | // Puts some content in the window 24 | /* 25 | void initWindow(final UI window) { 26 | VerticalLayout layout = new VerticalLayout(); 27 | layout.setSpacing(true); 28 | window.setContent(layout); 29 | 30 | // A button to open a new window 31 | Link openNew = new Link("Open New Window", 32 | new ExternalResource(BookExamplesUI.APPCONTEXT + "/dynamicwindow/"), 33 | "_blank", 480, 100, Page.BORDER_DEFAULT); 34 | window.addComponent(openNew); 35 | 36 | // Demonstrate closing pop-up windows 37 | Button close = new Button("Close This Window"); 38 | close.addListener(new Button.ClickListener() { 39 | private static final long serialVersionUID = -86208708122352874L; 40 | 41 | public void buttonClick(ClickEvent event) { 42 | JavaScript.getCurrent().execute("close();"); 43 | } 44 | }); 45 | window.addComponent(close); 46 | } 47 | 48 | int windowCount = 0; 49 | */ 50 | } 51 | // END-EXAMPLE: advanced.applicationwindow.dynamic 52 | -------------------------------------------------------------------------------- /src/com/vaadin/book/applications/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.book.applications; 2 | 3 | // BEGIN-EXAMPLE: intro.walkthrough.helloworld 4 | import com.vaadin.annotations.Theme; 5 | import com.vaadin.annotations.Title; 6 | import com.vaadin.server.VaadinRequest; 7 | import com.vaadin.ui.Button; 8 | import com.vaadin.ui.Button.ClickEvent; 9 | import com.vaadin.ui.Button.ClickListener; 10 | import com.vaadin.ui.Label; 11 | import com.vaadin.ui.Notification; 12 | import com.vaadin.ui.UI; 13 | import com.vaadin.ui.VerticalLayout; 14 | 15 | @Title("My UI") 16 | @Theme("valo") 17 | public class HelloWorld extends UI { 18 | private static final long serialVersionUID = 511085335415683713L; 19 | 20 | @Override 21 | protected void init(VaadinRequest request) { 22 | // Create the content root layout for the UI 23 | VerticalLayout content = new VerticalLayout(); 24 | setContent(content); 25 | 26 | // Display the greeting 27 | content.addComponent(new Label("Hello World!")); 28 | 29 | // Have a clickable button 30 | content.addComponent(new Button("Push Me!", 31 | new ClickListener() { 32 | private static final long serialVersionUID = 5808429544582385114L; 33 | 34 | @Override 35 | public void buttonClick(ClickEvent event) { 36 | Notification.show("Pushed!"); 37 | } 38 | })); 39 | } 40 | } 41 | // END-EXAMPLE: intro.walkthrough.helloworld 42 | -------------------------------------------------------------------------------- /src/com/vaadin/book/applications/MyHierarchicalUI.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.book.applications; 2 | 3 | import com.vaadin.annotations.Theme; 4 | import com.vaadin.book.examples.component.TreeExample; 5 | import com.vaadin.book.examples.component.table.TableExample; 6 | import com.vaadin.server.VaadinRequest; 7 | import com.vaadin.ui.HorizontalLayout; 8 | import com.vaadin.ui.Label; 9 | import com.vaadin.ui.Table; 10 | import com.vaadin.ui.Tree; 11 | import com.vaadin.ui.UI; 12 | import com.vaadin.ui.VerticalLayout; 13 | 14 | // BEGIN-EXAMPLE: application.architecture.hierarchical 15 | @Theme("valo") 16 | public class MyHierarchicalUI extends UI { 17 | private static final long serialVersionUID = 511085335415683713L; 18 | 19 | @Override 20 | protected void init(VaadinRequest request) { 21 | // The root of the component hierarchy 22 | VerticalLayout content = new VerticalLayout(); 23 | content.setSizeFull(); // Use entire window 24 | setContent(content); // Attach to the UI 25 | 26 | // Add some component 27 | content.addComponent(new Label("Hello!")); 28 | 29 | // Layout inside layout 30 | HorizontalLayout hor = new HorizontalLayout(); 31 | hor.setSizeFull(); // Use all available space 32 | 33 | // Couple of horizontally laid out components 34 | Tree tree = new Tree("My Tree", 35 | TreeExample.createTreeContent()); 36 | hor.addComponent(tree); 37 | 38 | Table table = new Table("My Table", 39 | TableExample.generateContent()); 40 | table.setSizeFull(); 41 | hor.addComponent(table); 42 | hor.setExpandRatio(table, 1); // Expand to fill 43 | 44 | content.addComponent(hor); 45 | content.setExpandRatio(hor, 1); // Expand to fill 46 | } 47 | } 48 | // END-EXAMPLE: application.architecture.hierarchical 49 | -------------------------------------------------------------------------------- /src/com/vaadin/book/applications/UIToBeTested.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.book.applications; 2 | 3 | import com.vaadin.annotations.Theme; 4 | import com.vaadin.server.VaadinRequest; 5 | import com.vaadin.ui.Button; 6 | import com.vaadin.ui.Button.ClickEvent; 7 | import com.vaadin.ui.Button.ClickListener; 8 | import com.vaadin.ui.Label; 9 | import com.vaadin.ui.UI; 10 | import com.vaadin.ui.VerticalLayout; 11 | 12 | // BEGIN-EXAMPLE: testbench.application 13 | @Theme("valo") 14 | public class UIToBeTested extends UI { 15 | private static final long serialVersionUID = 511085335415683713L; 16 | 17 | @Override 18 | protected void init(VaadinRequest request) { 19 | setId("myui"); 20 | 21 | final VerticalLayout content = new VerticalLayout(); 22 | content.setMargin(true); 23 | content.setId("myui.content"); 24 | setContent(content); 25 | 26 | // Create a button 27 | Button button = new Button("Push Me!"); 28 | 29 | // Optional: give the button a unique ID 30 | button.setId("myui.content.pushmebutton"); 31 | 32 | // Set the tooltip 33 | button.setDescription("This is a tip"); 34 | 35 | // Do something when the button is clicked 36 | button.addClickListener(new ClickListener() { 37 | private static final long serialVersionUID = -8358743723903182533L; 38 | 39 | @Override 40 | public void buttonClick(ClickEvent event) { 41 | // This label will not have a set ID 42 | content.addComponent(new Label("Thanks!")); 43 | } 44 | }); 45 | content.addComponent(button); 46 | } 47 | } 48 | // END-EXAMPLE: testbench.application 49 | -------------------------------------------------------------------------------- /src/com/vaadin/book/examples/AbstractExampleItem.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.book.examples; 2 | 3 | import java.io.Serializable; 4 | 5 | public class AbstractExampleItem implements Serializable { 6 | private static final long serialVersionUID = -6281280822803513663L; 7 | 8 | protected String exampleId; 9 | protected String context; 10 | private String parentId; 11 | private boolean collapsed; 12 | 13 | public AbstractExampleItem(String itemid) { 14 | if ("-".equals(itemid.substring(itemid.length()-1))) { 15 | this.collapsed = true; 16 | itemid = itemid.substring(0, itemid.length()-1); 17 | } else 18 | collapsed = false; 19 | 20 | this.exampleId = itemid; 21 | 22 | // Determine parent node and context 23 | int lastdot = itemid.lastIndexOf("."); 24 | if (lastdot != -1) { 25 | parentId = itemid.substring(0, lastdot); 26 | context = itemid.substring(lastdot+1); 27 | } else 28 | parentId = null; 29 | } 30 | 31 | public String getExampleId() { 32 | return exampleId; 33 | } 34 | 35 | public String getParentId() { 36 | return parentId; 37 | } 38 | 39 | public boolean isCollapsed() { 40 | return collapsed; 41 | } 42 | } -------------------------------------------------------------------------------- /src/com/vaadin/book/examples/AnyBookExampleBundle.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.book.examples; 2 | 3 | import java.io.Serializable; 4 | 5 | public interface AnyBookExampleBundle extends Serializable { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /src/com/vaadin/book/examples/BookExampleBundle.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.book.examples; 2 | 3 | public interface BookExampleBundle extends AnyBookExampleBundle { 4 | public void init (String context); 5 | } 6 | -------------------------------------------------------------------------------- /src/com/vaadin/book/examples/BrknExample.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.book.examples; 2 | 3 | import com.vaadin.ui.Component; 4 | import com.vaadin.ui.Label; 5 | 6 | 7 | public class BrknExample extends BookExample { 8 | private static final long serialVersionUID = -7260105851251039038L; 9 | 10 | public BrknExample(String exampleId, String shortName, Class> exclass) { 11 | super(exampleId, shortName, exclass); 12 | } 13 | 14 | @Override 15 | public String getDescription() { 16 | return " elements. */
22 | .colorpicker-currentcolorbox {
23 | width: 240px;
24 | text-align: center;
25 | vertical-align: middle !important;
26 | }
27 |
--------------------------------------------------------------------------------
/src/com/vaadin/book/examples/component/MyCalendarEvent.java:
--------------------------------------------------------------------------------
1 | package com.vaadin.book.examples.component;
2 |
3 | import java.util.Date;
4 |
5 | import javax.persistence.Entity;
6 | import javax.persistence.GeneratedValue;
7 | import javax.persistence.GenerationType;
8 | import javax.persistence.Id;
9 | import javax.persistence.Temporal;
10 | import javax.persistence.TemporalType;
11 |
12 | @Entity
13 | public class MyCalendarEvent {
14 | @Id
15 | @GeneratedValue(strategy=GenerationType.IDENTITY)
16 | Long id;
17 |
18 | String caption;
19 | String description;
20 |
21 | @Temporal(TemporalType.TIMESTAMP)
22 | Date startDate;
23 |
24 | @Temporal(TemporalType.TIMESTAMP)
25 | Date endDate;
26 | String styleName;
27 |
28 | public MyCalendarEvent() {
29 | }
30 |
31 | public MyCalendarEvent(String caption, String description,
32 | Date startDate, Date endDate, String styleName) {
33 | this.caption = caption;
34 | this.description = description;
35 | this.startDate = startDate;
36 | this.endDate = endDate;
37 | this.styleName = styleName;
38 | }
39 |
40 | public Long getId() {
41 | return id;
42 | }
43 | public void setId(Long id) {
44 | this.id = id;
45 | }
46 | public String getCaption() {
47 | return caption;
48 | }
49 | public void setCaption(String caption) {
50 | this.caption = caption;
51 | }
52 | public String getDescription() {
53 | return description;
54 | }
55 | public void setDescription(String description) {
56 | this.description = description;
57 | }
58 | public Date getStartDate() {
59 | return startDate;
60 | }
61 | public void setStartDate(Date startDate) {
62 | this.startDate = startDate;
63 | }
64 | public Date getEndDate() {
65 | return endDate;
66 | }
67 | public void setEndDate(Date endDate) {
68 | this.endDate = endDate;
69 | }
70 | public String getStyleName() {
71 | return styleName;
72 | }
73 | public void setStyleName(String styleName) {
74 | this.styleName = styleName;
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/src/com/vaadin/book/examples/component/NativeSelectExample.java:
--------------------------------------------------------------------------------
1 | package com.vaadin.book.examples.component;
2 |
3 | import com.vaadin.book.examples.AnyBookExampleBundle;
4 | import com.vaadin.data.Container;
5 | import com.vaadin.data.util.IndexedContainer;
6 | import com.vaadin.ui.CustomComponent;
7 | import com.vaadin.ui.NativeSelect;
8 | import com.vaadin.ui.Notification;
9 | import com.vaadin.ui.VerticalLayout;
10 |
11 | public class NativeSelectExample extends CustomComponent implements AnyBookExampleBundle {
12 | private static final long serialVersionUID = -4292553844521293140L;
13 |
14 | public void basic(VerticalLayout layout) {
15 | // BEGIN-EXAMPLE: component.select.nativeselect.basic
16 | // Create the selection component with some items
17 | NativeSelect select = new NativeSelect("Native Selection");
18 | select.addItems("Mercury", "Venus", "Earth", "Mars",
19 | "Jupiter", "Saturn", "Neptune", "Uranus");
20 | select.setNullSelectionAllowed(false);
21 |
22 | select.addValueChangeListener( event -> // Java 8
23 | Notification.show((String) select.getValue()));
24 | select.setImmediate(true);
25 | // END-EXAMPLE: component.select.nativeselect.basic
26 |
27 | layout.setHeight("200px");
28 | layout.addComponent(select);
29 | }
30 |
31 | Container createSelectData() {
32 | IndexedContainer container = new IndexedContainer();
33 | container.addContainerProperty("caption", String.class, null);
34 | return container;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/com/vaadin/book/examples/component/PasswordFieldExample.java:
--------------------------------------------------------------------------------
1 | package com.vaadin.book.examples.component;
2 |
3 | import com.vaadin.book.examples.BookExampleBundle;
4 | import com.vaadin.ui.Button;
5 | import com.vaadin.ui.CustomComponent;
6 | import com.vaadin.ui.Label;
7 | import com.vaadin.ui.PasswordField;
8 | import com.vaadin.ui.VerticalLayout;
9 |
10 | public class PasswordFieldExample extends CustomComponent implements BookExampleBundle {
11 | private static final long serialVersionUID = -4454143876393393750L;
12 |
13 | public void init (String context) {
14 | VerticalLayout layout = new VerticalLayout();
15 | layout.addStyleName("passwordfieldexample");
16 |
17 | if ("basic".equals(context))
18 | basic(layout);
19 | else if ("css".equals(context))
20 | css (layout);
21 |
22 | setCompositionRoot(layout);
23 | }
24 |
25 | void basic(VerticalLayout layout) {
26 | // BEGIN-EXAMPLE: component.passwordfield.basic
27 | // Create a text field
28 | PasswordField tf = new PasswordField("Keep it secret");
29 |
30 | Button ok = new Button("OK", event -> // Java 8
31 | layout.addComponent(new Label("Secret: " + tf.getValue())));
32 | // END-EXAMPLE: component.passwordfield.basic
33 |
34 | layout.addComponents(tf, ok);
35 | layout.setSpacing(true);
36 | }
37 |
38 | public static String cssDescription =
39 | "Styling PasswordField with CSS" + 40 | "PasswordField uses the same v-textfield style as TextField. "; 41 | 42 | void css(VerticalLayout layout) { 43 | // BEGIN-EXAMPLE: component.passwordfield.css 44 | PasswordField tf = new PasswordField("Fence around the secret field"); 45 | tf.addStyleName("dashing"); 46 | // END-EXAMPLE: component.passwordfield.css 47 | 48 | layout.addComponent(tf); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/com/vaadin/book/examples/component/RichTextAreaExample.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.book.examples.component; 2 | 3 | import com.vaadin.book.examples.BookExampleBundle; 4 | import com.vaadin.ui.Button; 5 | import com.vaadin.ui.CustomComponent; 6 | import com.vaadin.ui.Label; 7 | import com.vaadin.ui.RichTextArea; 8 | import com.vaadin.ui.VerticalLayout; 9 | 10 | public class RichTextAreaExample extends CustomComponent implements BookExampleBundle { 11 | private static final long serialVersionUID = -4292553844521293140L; 12 | 13 | public void init (String context) { 14 | VerticalLayout layout = new VerticalLayout(); 15 | 16 | if ("basic".equals(context)) 17 | basic(layout); 18 | else if ("localization".equals(context)) 19 | localization(layout); 20 | 21 | setCompositionRoot(layout); 22 | } 23 | 24 | void basic(VerticalLayout layout) { 25 | // BEGIN-EXAMPLE: component.richtextarea.basic 26 | RichTextArea area = new RichTextArea("My Rich Textarea"); 27 | area.setValue("Helpful Heading"+ 28 | "All this is for you to edit. "); 29 | 30 | // Handle edits 31 | Button ok = new Button("OK"); 32 | Label feedback = new Label((String) area.getValue()); 33 | ok.addClickListener(event -> // Java 8 34 | feedback.setValue(area.getValue())); 35 | // END-EXAMPLE: component.richtextarea.basic 36 | 37 | layout.addComponents(area, ok, feedback); 38 | layout.setSpacing(true); 39 | } 40 | 41 | void localization(VerticalLayout layout) { 42 | // BEGIN-EXAMPLE: component.richtextarea.localization 43 | RichTextArea area = new RichTextArea(); 44 | area.setCaption("You can edit stuff here"); 45 | area.setValue("Helpful Heading"+ 46 | "All this is for you to edit. "); 47 | 48 | // END-EXAMPLE: component.richtextarea.localization 49 | 50 | layout.addComponent(area); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/com/vaadin/book/examples/component/grid/MyButtonRenderer.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.book.examples.component.grid; 2 | 3 | import com.vaadin.ui.renderers.ButtonRenderer; 4 | 5 | public class MyButtonRenderer extends ButtonRenderer { 6 | public MyButtonRenderer() { 7 | super(); 8 | } 9 | 10 | public MyButtonRenderer(RendererClickListener listener) { 11 | this(); 12 | addClickListener(listener); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/com/vaadin/book/examples/component/grid/TextFieldRenderer.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.book.examples.component.grid; 2 | 3 | import com.vaadin.book.examples.client.widgetset.client.renderer.CellValueChangeRpc; 4 | import com.vaadin.data.Container; 5 | import com.vaadin.data.Property; 6 | import com.vaadin.ui.Grid; 7 | import com.vaadin.ui.Grid.AbstractRenderer; 8 | 9 | public class TextFieldRenderer extends AbstractRendererHello World" + 30 | ""; 31 | 32 | // EXAMPLE-REF: gettingstarted.firstproject.newproject com.vaadin.book.examples.gettingstarted.MyprojectUI gettingstarted.firstproject.newproject 33 | void newproject(Layout layout) { 34 | BrowserFrame embedded = new BrowserFrame(); 35 | embedded.setSource(new ExternalResource(BookExamplesUI.APPCONTEXT + "/newproject?restartApplication")); 36 | embedded.setWidth("400px"); 37 | embedded.setHeight("200px"); 38 | layout.addComponent(embedded); 39 | } 40 | 41 | // EXAMPLE-REF: gettingstarted.scala com.vaadin.book.examples.gettingstarted.MyScalaUI gettingstarted.scala 42 | void scalaui(Layout layout) { 43 | BrowserFrame embedded = new BrowserFrame(); 44 | embedded.setSource(new ExternalResource(BookExamplesUI.APPCONTEXT + "/scalaproject?restartApplication")); 45 | embedded.setWidth("400px"); 46 | embedded.setHeight("200px"); 47 | layout.addComponent(embedded); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/com/vaadin/book/examples/intro/HelloWorldExample.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.book.examples.intro; 2 | 3 | import com.vaadin.book.BookExamplesUI; 4 | import com.vaadin.book.examples.BookExampleBundle; 5 | import com.vaadin.server.ExternalResource; 6 | import com.vaadin.ui.CustomComponent; 7 | import com.vaadin.ui.Embedded; 8 | import com.vaadin.ui.VerticalLayout; 9 | 10 | public class HelloWorldExample extends CustomComponent implements BookExampleBundle { 11 | private static final long serialVersionUID = -4292553844521293140L; 12 | 13 | public static final String helloworldDescription = 14 | "Hello World" + 15 | "You make a basic Vaadin application by extending the UI component and implementing the init() method. " + 16 | "
SCSS Themes" + "You can write a theme using SCSS instead of CSS simply by having a " + "styles.scss instead of styles.css file in the theme folder. "; 16 | 17 | public void init(String context) { 18 | VerticalLayout layout = new VerticalLayout(); 19 | 20 | if ("basic".equals(context)) 21 | basic(layout); 22 | else layout.addComponent(new Label("Invalid context " + context)); 23 | 24 | setCompositionRoot(layout); 25 | } 26 | 27 | // EXAMPLE-REF: themes.scss.basic com.vaadin.book.examples.themes.ScssThemeUI themes.scss.basic 28 | // EXAMPLE-APPFILE: themes.scss.basic VAADIN/themes/mytheme/styles.scss 29 | void basic(VerticalLayout layout) { 30 | BrowserFrame browser = new BrowserFrame(); 31 | browser.setSource(new ExternalResource(BookExamplesUI.APPCONTEXT + "/scsstheme?restartApplication")); 32 | browser.setWidth("300px"); 33 | browser.setHeight("150px"); 34 | layout.addComponent(browser); 35 | 36 | setCompositionRoot(layout); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/com/vaadin/book/examples/themes/ScssThemeUI.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.book.examples.themes; 2 | 3 | import com.vaadin.annotations.Theme; 4 | import com.vaadin.server.VaadinRequest; 5 | import com.vaadin.ui.Button; 6 | import com.vaadin.ui.Label; 7 | import com.vaadin.ui.UI; 8 | import com.vaadin.ui.VerticalLayout; 9 | 10 | //BEGIN-EXAMPLE: themes.scss.basic 11 | @Theme("mytheme") 12 | public class ScssThemeUI extends UI { 13 | private static final long serialVersionUID = 511085335415683713L; 14 | 15 | @Override 16 | protected void init(VaadinRequest request) { 17 | // Set the window or tab title 18 | getPage().setTitle("Window with My Theme"); 19 | 20 | // Create the content root layout for the UI 21 | VerticalLayout content = new VerticalLayout(); 22 | setContent(content); 23 | 24 | content.addComponent(new Label("This is my theme!")); 25 | 26 | Button button = new Button("Stylish Button"); 27 | button.addStyleName("mybutton"); 28 | content.addComponent(button); 29 | } 30 | } 31 | // END-EXAMPLE: themes.scss.basic 32 | -------------------------------------------------------------------------------- /src/com/vaadin/book/examples/themes/ThemeExample.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.book.examples.themes; 2 | 3 | import com.vaadin.book.BookExamplesUI; 4 | import com.vaadin.book.examples.AnyBookExampleBundle; 5 | import com.vaadin.server.ExternalResource; 6 | import com.vaadin.ui.BrowserFrame; 7 | import com.vaadin.ui.VerticalLayout; 8 | 9 | public class ThemeExample implements AnyBookExampleBundle { 10 | private static final long serialVersionUID = -4292553844521293140L; 11 | 12 | // EXAMPLE-REF: themes.using.default.valo com.vaadin.book.examples.themes.ValoThemeUI themes.using.default.valo 13 | // EXAMPLE-APPFILE: themes.using.default.valo VAADIN/themes/myvalotheme/styles.scss 14 | // EXAMPLE-APPFILE: themes.using.default.valo VAADIN/themes/myvalotheme/myvalotheme.scss 15 | public void valo(VerticalLayout layout) { 16 | BrowserFrame browser = new BrowserFrame(); 17 | browser.setSource(new ExternalResource(BookExamplesUI.APPCONTEXT + "/myvalothemeui?restartApplication")); 18 | browser.setWidth("800px"); 19 | browser.setHeight("600px"); 20 | layout.addComponent(browser); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/com/vaadin/book/ui/TreeMenu.java: -------------------------------------------------------------------------------- 1 | package com.vaadin.book.ui; 2 | 3 | import com.vaadin.server.ThemeResource; 4 | import com.vaadin.ui.Image; 5 | import com.vaadin.ui.Label; 6 | import com.vaadin.ui.Layout; 7 | import com.vaadin.ui.Panel; 8 | import com.vaadin.ui.VerticalLayout; 9 | import com.vaadin.ui.themes.Reindeer; 10 | 11 | /** 12 | * The old plain and simple tree menu. This will be replaced later. 13 | * 14 | * @author magi 15 | */ 16 | public class TreeMenu extends AbstractExampleMenu { 17 | private static final long serialVersionUID = -5810026236836035167L; 18 | 19 | public TreeMenu(Layout viewLayout, Label exampleTitle) { 20 | super(viewLayout, exampleTitle); 21 | 22 | addStyleName("examplemenu"); 23 | setWidth("400px"); 24 | setHeight("100%"); 25 | 26 | VerticalLayout content = new VerticalLayout(); 27 | content.setSizeFull(); 28 | 29 | Image logo = new Image(null, new ThemeResource("img/vaadin-logo.png")); 30 | logo.addStyleName("vaadinlogo"); 31 | content.addComponent(logo); 32 | 33 | Panel scrollpanel = new Panel("Table of Contents"); 34 | scrollpanel.setSizeFull(); 35 | scrollpanel.addStyleName(Reindeer.PANEL_LIGHT); 36 | scrollpanel.addStyleName("menupanel"); 37 | scrollpanel.addStyleName("scrollmenu"); 38 | 39 | scrollpanel.setContent(menu); 40 | 41 | content.addComponent(scrollpanel); 42 | content.setExpandRatio(scrollpanel, 1.0f); 43 | 44 | setCompositionRoot(content); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/com/vaadin/book/widgetset/BookExamplesWidgetSet.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | |