use of com.vaadin.server.VaadinRequest in project opennms by OpenNMS.
the class NodeInfoWindowTest method setUp.
@Before
public void setUp() throws Exception {
Node testNode1 = new Node(9, "192.0.2.10", "Cartman");
final URL url = new URL("http://localhost:8080/");
window = new NodeInfoWindow(null, url);
window2 = new NodeInfoWindow(testNode1, url);
mainWindow = new Window();
app = new // Empty Application
UI() {
private static final long serialVersionUID = -6798973775063082899L;
@Override
public void init(VaadinRequest request) {
}
};
}
use of com.vaadin.server.VaadinRequest in project opennms by OpenNMS.
the class AuthWindowTest method setup.
@SuppressWarnings("serial")
@Before
public void setup() {
normalWindow = new AuthWindow(testHost, testPort);
noPortWindow = new AuthWindow(testHost, emptyPort);
noHostWindow = new AuthWindow(emptyHost, testPort);
emptyWindow = new AuthWindow(emptyHost, emptyPort);
invalidHostWindow = new AuthWindow(invalidHost, testPort);
mainWindow = new Window();
app = new // Empty Application
UI() {
@Override
public void init(VaadinRequest request) {
}
};
app.addWindow(normalWindow);
app.addWindow(noHostWindow);
app.addWindow(noPortWindow);
app.addWindow(emptyWindow);
app.addWindow(invalidHostWindow);
UI.setCurrent(app);
}
use of com.vaadin.server.VaadinRequest in project linkki by linkki-framework.
the class MessageUI method init.
@Override
protected void init(VaadinRequest request) {
Page.getCurrent().setTitle("linkki Samples :: Validation Messages");
VaadinSession.getCurrent().setConverterFactory(new LinkkiConverterFactory());
MessagesPanel messagesPanel = new MessagesPanel();
messagesPanel.setVisible(false);
User user = new User();
RegistrationSectionPmo registrationPmo = new RegistrationSectionPmo(user, u -> handleRegistration(messagesPanel, u));
// tag::validation-service[]
validationService = new RegistrationValidationService(registrationPmo);
bindingManager = new RegistrationBindingManager(validationService, ml -> messagesPanel.updateMessages(ml));
// end::validation-service[]
DefaultPmoBasedSectionFactory sectionFactory = new DefaultPmoBasedSectionFactory();
AbstractSection section = sectionFactory.createSection(registrationPmo, bindingManager.getExistingContextOrStartNewOne(getClass()));
setContent(new VerticalLayout(messagesPanel, section));
}
use of com.vaadin.server.VaadinRequest in project cuba by cuba-platform.
the class LinkHandler method handle.
/**
* Called to handle the link.
*/
public void handle() {
try {
ExternalLinkContext linkContext = new ExternalLinkContext(requestParams, action, app);
for (LinkHandlerProcessor processor : processors) {
if (processor.canHandle(linkContext)) {
processor.handle(linkContext);
break;
}
}
} finally {
VaadinRequest request = VaadinService.getCurrentRequest();
WrappedSession wrappedSession = request.getWrappedSession();
wrappedSession.removeAttribute(AppUI.LAST_REQUEST_PARAMS_ATTR);
wrappedSession.removeAttribute(AppUI.LAST_REQUEST_ACTION_ATTR);
}
}
Aggregations