Vous êtes sur la page 1sur 2

For Vaadin 6.

Cheat Sheet
Website: vaadin.com Developer site: dev.vaadin.com Forum: vaadin.com/forum Manual: vaadin.com/book

Server-Side Components Data Model Ordered Indexed

Viewer Container Filterable Sortable


Legend Interface Editor addItem()
Inner Inherits or Hierarchical
n
implements IndexedContainer
Class Abstract Class Viewer Item
Inner Inner Editor addItemProperty() HierarchicalContainer
method() abstractMethod() (must or may implement) n

Viewer Property ValueChangeEvent


VariableOwner Paintable paint()
changeVariables() setDebugId() Editor setValue() ValueChangeListener
getValue()
valueChange()

commit/discard()
Sizeable focus() setWriteThrough()
setTabIndex() setReadThrough() Buffered
setWidth() Focusable
setHeight()
setFullSize()
setUndefinedSize() Event Component Field BufferedValidatable Validatable
Listener addStyleName/Listener() setRequired() addValidator()
setCaption/Icon() setRequiredError() buttonClick() isValid()
Embedded setEnabled/Visible() validate()
v-container ClickListener
getParent(), attach/detach()
ClickEvent

Link AbstractComponent AbstractField Button CheckBox


v-link paintContent() v-button v-checkbox
setDescription()
setImmediate()
Label TextField RichTextArea
v-label ProgressIndicator v-textfield v-richtextarea
v-progressindicator
v-menubar setRows/Columns/Secret/InputPrompt/MaxLength()
setPollingInterval/Indeterminate()
MenuBar Upload
v-upload
MenuItem Command
DateField InlineDateField
LoginForm Slider v-datefield v-inlinedatefield
addItem() v-loginform v-slider
addComponent() setResolution()
setOrientation/Resolution()
setMin/Max() Buffered
ComponentContainer Validatable Form PopupDateField
CustomComponent Item v-form v-popupdatefield
v-customcomponent Container
Editor
1 setCompositionRoot()
setLayout() setFormFieldFactory()
setContent() setFooter()
v-panel
Panel AbstractComponentContainer AbstractSelect Select ComboBox
v-select v-filterselect
setMultiSelect()
v-window addTab()
v-tabsheet
Window PopupView n ListSelect
v-popupview
TabSheet Tab
v-listselect
setVisible/Enabled() 1
1 setMainWindow() setCaption/Icon()
com.vaadin. createField()
setDescription()
Your NativeSelect FormFieldFactory
Application Accordion
init() Application v-accordion
v-nativeselect

setTheme/Locale/LogoutURL()
ComponentPosition
TwinColSelect DefaultFieldFactory
Layout AbstractLayout AbsoluteLayout v-twincolselect
v-absolutelayout
setMargin() getPosition()

OptionGroup TableFieldFactory
CustomLayout SplitPanel GridLayout v-optiongroup createField()
v-customlayout v-splitpanel-... v-gridlayout 1
ColumnGenerator setTableFieldFactory()
CustomLayout("template") setSplitPosition/Locked() addComponent(c)/(c, col, row)/(c, c1, r1, c2, r2)
Table Container.Ordered
v-table Container.Sortable
FormLayout AbstractOrderedLayout CellStyleGenerator
v-formlayout

Tree Container.Hierarchical
v-tree

HorizontalLayout VerticalLayout
v-horizontallayout v-verticallayout The Class Diagram presents all user interface component classes
2009 IT Mill Ltd
and the most important interfaces, relationships, and methods.
Cheat Sheet For Vaadin 6.2
GWT: code.google.com/webtoolkit/

Application Architecture for Vaadin Applications Client-Side Widget Integration


Any GWT widget -
Google Web Toolkit an existing or your own

...
Widget MyWidget

Must implement
Vaadin Client-Side Integration updateFromUIDL()
to deserialize state
com.vaadin.terminal.gwt.client. from server

Paintable VMyWidget
updateFromUIDL()

n 1
Needs to call
updateVariable() to
com.vaadin.terminal.gwt.client. to serialize state to
server
ApplicationConnection
updateVariable()
Makes XMLHttpRequest

Server connection:
UIDL / JSON / HTTP(S)

A user application ... Server-Side Integration


- inherits the Application class - binds components to data com.vaadin.terminal.server.

- adds a main window to it - binds components to resources CommunicationManager


- sets a theme for the window (optional) - defines event listeners to
- populates it with components implement the UI logic n
com.vaadin.terminal. com.vaadin.terminal.

Paintable VariableOwner
All images, embedded objects, and downloadable
Resources files are represented as resources.
paint() changeVariables()

loaded from the file system com.vaadin.ui. com.vaadin.terminal.

Component PaintTarget
Resource ApplicationResource FileResource
addAttribute()
any URL loaded from the class path (Implements paint()) addVariable()
AbstractComponent
ExternalResource ClassResource getTag() paintContent()

... Must implement


loaded from a theme provided dynamically by the application changeVariables() for
deserialization and
ThemeResource StreamResource MyComponent paintContent() for
serialization using the
PaintTarget interface.

Theme Contents Widget Project (See the Color Picker demo)

Use a custom theme by setting it in the main window object: Hello, World!
mainWindow.setTheme("mytheme"); public class MyApp extends com.vaadin.Application {
public void init() {
Use images included in a team as a ThemeResource: Window main = new Window("Hello Window");
Button button = new Button("Button with Icon"); setMainWindow(main);
button.setIcon(new ThemeResource("img/myimage.png")); main.setTheme("mytheme"); // Optional

Use a HTML template having <div location="hello"/> location tags Label label = new Label("Hello, World!");
with the CustomLayout component. Add components by their location tag: main.addComponent(label);
}
CustomLayout layout = new CustomLayout("mylayout"); }
layout.addComponent(new Button("Hello"), "hello");