blob: 8962f5de9af9a6cbd7a9b22f560a5ef5839f8076 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
package com.vaadin.tests.application;
import com.vaadin.Application;
import com.vaadin.annotations.PreserveOnRefresh;
import com.vaadin.server.AbstractUIProvider;
import com.vaadin.server.WrappedRequest;
import com.vaadin.tests.components.AbstractTestApplication;
import com.vaadin.ui.Label;
import com.vaadin.ui.UI;
public class RefreshStatePreserve extends AbstractTestApplication {
@PreserveOnRefresh
public static class RefreshStateUI extends UI {
@Override
public void init(WrappedRequest request) {
getContent().addComponent(
new Label("window.name: "
+ request.getBrowserDetails().getWindowName()));
getContent().addComponent(new Label("UI id: " + getUIId()));
}
}
@Override
public void init() {
super.init();
addUIProvider(new AbstractUIProvider() {
@Override
public Class<? extends UI> getUIClass(Application application,
WrappedRequest request) {
return RefreshStateUI.class;
}
});
}
@Override
protected String getTestDescription() {
return "Refreshing the browser window should preserve the state";
}
@Override
protected Integer getTicketNumber() {
return Integer.valueOf(8068);
}
}
|