57. 934 tickets closed during 16 months of
development
Oldest ticket created 3/2008
Newest ticket 2/2013
3939 commits made by 23 authors
93 % by 6 persons
> 1 000 000 lines of code touched
58. Renewed
JS
Sass
from Inside
HTML5
+= UI
GWT
RPC
Complete State Field
stack
81. public class Vaadin6App extends Application {
public void init() {
setMainWindow(createWindow());
}
public Window getWindow(String name) {
Window window = super.getWindow(name);
if (window == null) {
window = createWindow();
window.setName(name);
addWindow(window);
}
return window;
}
private Window createWindow() {
Window window = new Window("Vaadin 6 Application");
window.addComponent(new TextField("What is your name"));
window.addComponent(new Button("Do not push me"));
return window;
}
}
82. @Title("Vaadin 7 Application")
public class HellowUI extends UI {
protected void init(VaadinRequest request) {
setContent(new VerticalLayout(
new TextField("What is your name"),
new Button("Do not push me")));
}
}
83. @PreserveOnRefresh
@Title("Vaadin 7 Application")
public class HellowUI extends UI {
protected void init(VaadinRequest request) {
setContent(new VerticalLayout(
new TextField("What is your name"),
new Button("Do not push me")));
}
}
87. public class Employee {
String firstName;
String lastName;
double salary;
6
Date birthDate;
// Getters, setters, …
}
Form form = new Form();
form.setItemDataSource(
new BeanItem<Employee>(employee));
88.
89.
90. form.setFormFieldFactory(new FormFieldFactory() {
public Field createField(Item item, Object propertyId,
Component uiContext) {
if ("birthDate".equals(propertyId)) {
6
DateField df = new DateField();
df.setResolution(DateField.RESOLUTION_DAY);
return df;
}
// ..
return DefaultFieldFactory.createFieldByPropertyType(item
.getItemProperty(propertyId).getType());
}
});
91. 7
GridLayout form = new GridLayout(2,2) {
TextField firstName = new TextField("First name");
TextField lastName = new TextField("Last name");
TextField salary = new TextField("Salary");
DateField birthDate = new DateField("Birth date");
{
birthDate.setResolution(Resolution.DAY);
setSpacing(true);
addComponent(firstName);
addComponent(lastName);
addComponent(birthDate);
addComponent(salary);
}
};
BeanFieldGroup<Employee> fieldGroup = new BeanFieldGroup<Employee>(Employee.class);
fieldGroup.bindMemberFields(form);
fieldGroup.setItemDataSource(new BeanItem<Employee>(employee));
92. public class Person {
@Size(min = 5, max = 50)
private String name;
@Min(0)
@Max(100)
private int age;
// + constructor + setters + getters
}
99. Publish API from Java
getPage().getJavaScript().addFunction("myCallback",
new JavaScriptCallback() {
public void call(JSONArray arguments) throws JSONException {
// Do something with the arguments
}
});
Use from JavaScript
window.myCallback('foo', 100);
100. Server-side Java API for Widget
public class MyWidget extends AbstractJavaScriptComponent {
public MyWidget() {
addFunction("plotClick", new JavaScriptFunction() {
public void call(JSONArray arguments) throws JSONException {
// Do something with the event
}
});
}
public static class MyWidgetState extends JavaScriptComponentState {
public List<List<List<Double>>> plotSeriesData =
new ArrayList<List<List<Double>>>();
}
public MyWidgetState getState() { return (MyWidgetState) super.getState(); }
}
101. Widget implementation in JavaScript
window.com_example_MyWidget = function() {
var element = $(this.getWidgetElement());
// Draw a plot for any server-side (plot data) state change
this.onStateChange = function() {
$.plot(element, this.getState().series, {grid: {clickable: true}});
}
// Communicate local events back to server-side component
element.bind('plotclick', function(event, point, item) {
if (item) {
var onPlotClick = this.getCallback("plotClick");
onPlotClick(item.seriesIndex, item.dataIndex);
}
});
}
103. Vaadin Framework 7.1 April
• Server push
• Based on Atmosphere Framework
• Web sockets, long polling and polling
• Calendar (now under Apache 2.0 license)
• Limited IE 10 support without touch
• CSS string inject
• Renewed debug console features
◦ Redesigned UI/UX for debug window
◦ Optimize widgetset
• Arithmetics for SASS
• Packaging SCSS / CSS for add-ons
104.
105. Vaadin Charts 1.1 May
• New charts:
• Funnel
• Box plot
• Waterfall
• Bubble
• Error bars
• Different coloring of a graph above and below a threshold
• Pinch zooming and panning for touch devices
106.
107.
108.
109.
110.
111.
112.
113. Vaadin TouchKit 3.0 April
• Vaadin 7 support
• New components:
• URLField
• Datefield
• Combobox
115. Vaadin CDI
• Registering UI with @CDIUI annotation (web.xml no more)
• Registering Views (to CDIViewManager)
• Decoupling UI:s by injecting UI components (handy for MVP)
• Injecting all the normal Java EE stuff (ejbs, events, ...)
• UI Scope to complement the session scope
• Supports JAAS (set @RolesAllowed for a View, ...)
• 1.0 alpha to be released any day now (in staging repo today)
• Apache 2.0 License
116. Vaadin JPAContainer
• License changed to Apache 2.0
• Vaadin 7 compatible version released in March