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
method() addItemProperty() HierarchicalContainer
abstractMethod() (must or may implement) n
Default sizes: 100% wide/high undefined width/height
Viewer Property ValueChangeEvent

Editor setValue() ValueChangeListener


getValue()
Paintable valueChange()
VariableOwner paint()
changeVariables() setDebugId()
commit/discard()
focus() setWriteThrough()
setTabIndex() setReadThrough() Buffered
Sizeable
Focusable
setWidth/Height()
setSizeFull/Undefined() Event Component Field BufferedValidatable Validatable
addValidator()
Listener addStyleName/Listener() setRequired() isValid(), validate()
setCaption/Icon() setRequiredError() buttonClick()
Embedded setEnabled/Visible()
v-container ClickListener NativeButton
getParent(), attach/detach()
ClickEvent v-nativebutton

Link AbstractComponent AbstractField Button


v-link paintContent() v-button CheckBox
setDescription() v-checkbox
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 CssLayout v-optiongroup createField()
v-customlayout v-splitpanel-... v-gridlayout v-csslayout 1
ColumnGenerator setTableFieldFactory()
new CustomLayout("template") setSplitPosition/Locked() addComponent(c)
/(c, col, row)/(c, c1, r1, c2, r2) Table Container.Ordered
v-table Container.Sortable
CellStyleGenerator
FormLayout AbstractOrderedLayout
v-formlayout
Tree Container.Hierarchical
v-tree
ItemStyleGenerator
HorizontalLayout VerticalLayout The Class Diagram presents all user interface component classes
v-horizontallayout v-verticallayout
2010 IT Mill Ltd
and the most important interfaces, relationships, and methods.
Cheat Sheet For Vaadin 6.4
GWT: code.google.com/webtoolkit/

Application Architecture for Vaadin Applications Client-Side Widget Integration


Google Web Toolkit

Widget SomeWidget

Vaadin Client-Side Integration

Paintable VMyWidget*
updateFromUIDL()

*) Needs to call updateVariable() to serialize state


to server. Must implement updateFromUIDL() to
deserialize state from 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
- 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
Paintable VariableOwner
paint() changeVariables()
All images, embedded objects, and downloadable
Resources files are represented as resources.
loaded from the file system Component PaintTarget
Resource ApplicationResource FileResource

any URL loaded from the class path AbstractComponent


paintContent()
ExternalResource ClassResource
MyComponent*
loaded from a theme provided dynamically by the application @ClientWidget(VMyWidget.class)

ThemeResource StreamResource *) Must implement changeVariables() for deserialization


and 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");

Vous aimerez peut-être aussi