Hi,I’ve got a UI, which ought to look very different, depending on an application state. To handle this, I’d like to have an interface like
public interface UIBuilder {
UI getUI();
}
and configure that in web.xml. My UIBuilder would look like
public UI getUI() {
if (isInExceptionalState()) {
return new ExceptionalUI();
} else {
return new DefaultUI();
}
Otherwise I’d have to check for isExceptionalState() in the UI class a lot.
Alternatively, I might replace the UI upon state change with something like
VaadinSession.getCurrent().replaceUI(otherUI);
Is something along these lines possible? Or do you have other suggestions how to handle my situation?
Thanks,
Jochen