}
@Override
- public UI createInstance(Class<? extends UI> type, WrappedRequest request) {
+ public UI createInstance(WrappedRequest request, Class<? extends UI> type) {
return getUIInstance(request);
}
@Override
- public String getThemeForUI(WrappedRequest request,
+ public String getTheme(WrappedRequest request,
Class<? extends UI> uiClass) {
return theme;
}
@Override
- public String getPageTitleForUI(WrappedRequest request,
+ public String getPageTitle(WrappedRequest request,
Class<? extends UI> uiClass) {
UI uiInstance = getUIInstance(request);
if (uiInstance != null) {
return uiInstance.getCaption();
} else {
- return super.getPageTitleForUI(request, uiClass);
+ return super.getPageTitle(request, uiClass);
}
}
public abstract class AbstractUIProvider implements UIProvider {
@Override
- public UI createInstance(Class<? extends UI> type,
- WrappedRequest request) {
+ public UI createInstance(WrappedRequest request,
+ Class<? extends UI> type) {
try {
return type.newInstance();
} catch (InstantiationException e) {
}
@Override
- public String getThemeForUI(WrappedRequest request,
+ public String getTheme(WrappedRequest request,
Class<? extends UI> uiClass) {
Theme uiTheme = getAnnotationFor(uiClass, Theme.class);
if (uiTheme != null) {
}
@Override
- public String getWidgetsetForUI(WrappedRequest request,
+ public String getWidgetset(WrappedRequest request,
Class<? extends UI> uiClass) {
Widgetset uiWidgetset = getAnnotationFor(uiClass, Widgetset.class);
if (uiWidgetset != null) {
}
@Override
- public boolean isUiPreserved(WrappedRequest request,
+ public boolean isPreservedOnRefresh(WrappedRequest request,
Class<? extends UI> uiClass) {
PreserveOnRefresh preserveOnRefresh = getAnnotationFor(uiClass,
PreserveOnRefresh.class);
}
@Override
- public String getPageTitleForUI(WrappedRequest request,
+ public String getPageTitle(WrappedRequest request,
Class<? extends UI> uiClass) {
Title titleAnnotation = getAnnotationFor(uiClass, Title.class);
if (titleAnnotation == null) {
String title = context.getVaadinSession()
.getUiProvider(context.getRequest(), context.getUIClass())
- .getPageTitleForUI(context.getRequest(), context.getUIClass());
+ .getPageTitle(context.getRequest(), context.getUIClass());
if (title != null) {
head.appendElement("title").appendText(title);
}
String widgetset = context.getVaadinSession()
.getUiProvider(context.getRequest(), context.getUIClass())
- .getWidgetsetForUI(context.getRequest(), context.getUIClass());
+ .getWidgetset(context.getRequest(), context.getUIClass());
if (widgetset == null) {
widgetset = request.getVaadinService().getConfiguredWidgetset(
request);
public String getThemeName(BootstrapContext context) {
return context.getVaadinSession()
.getUiProvider(context.getRequest(), context.getUIClass())
- .getThemeForUI(context.getRequest(), context.getUIClass());
+ .getTheme(context.getRequest(), context.getUIClass());
}
/**
public interface UIProvider {
public Class<? extends UI> getUIClass(WrappedRequest request);
- public UI createInstance(Class<? extends UI> type,
- WrappedRequest request);
+ public UI createInstance(WrappedRequest request,
+ Class<? extends UI> type);
- public String getPageTitleForUI(WrappedRequest request,
+ public String getPageTitle(WrappedRequest request,
Class<? extends UI> uiClass);
/**
* @return <code>true</code>if the same UI instance should be reused e.g.
* when the browser window is refreshed.
*/
- public boolean isUiPreserved(WrappedRequest request,
+ public boolean isPreservedOnRefresh(WrappedRequest request,
Class<? extends UI> uiClass);
/**
* widgetset should be used
*
*/
- public String getWidgetsetForUI(WrappedRequest request,
+ public String getWidgetset(WrappedRequest request,
Class<? extends UI> uiClass);
/**
* should be used
*
*/
- public String getThemeForUI(WrappedRequest request,
+ public String getTheme(WrappedRequest request,
Class<? extends UI> uiClass);
/**
* <p>
* If no UI provider returns an existing UI, the framework does also check
* the window.name for an existing instance with
- * {@link #isUiPreserved(WrappedRequest, Class)} before falling back to
+ * {@link #isPreservedOnRefresh(WrappedRequest, Class)} before falling back to
* bootstrapping and creating a new UI instance.
*
* @param request
protected <T extends UI> T createUIInstance(WrappedRequest request,
Class<T> uiClass) {
UIProvider uiProvider = getUiProvider(request, uiClass);
- return uiClass.cast(uiProvider.createInstance(uiClass, request));
+ return uiClass.cast(uiProvider.createInstance(request, uiClass));
}
/**
ui.doInit(request, uiId.intValue());
- if (getUiProvider(request, uiClass).isUiPreserved(request, uiClass)) {
+ if (getUiProvider(request, uiClass).isPreservedOnRefresh(request, uiClass)) {
// Remember this UI
String windowName = request.getBrowserDetails().getWindowName();
if (windowName == null) {
throw new IllegalStateException("UI id has already been defined");
}
this.uiId = uiId;
- theme = getSession().getUiProvider(request, getClass()).getThemeForUI(
+ theme = getSession().getUiProvider(request, getClass()).getTheme(
request, getClass());
getPage().init(request);
}
@Override
- public UI createInstance(Class<? extends UI> type,
- WrappedRequest request) {
+ public UI createInstance(WrappedRequest request,
+ Class<? extends UI> type) {
return getUI(request);
}
// Must override as default implementation isn't allowed to
// instantiate our non-public classes
@Override
- public UI createInstance(Class<? extends UI> type,
- WrappedRequest request) {
+ public UI createInstance(WrappedRequest request,
+ Class<? extends UI> type) {
try {
return type.newInstance();
} catch (Exception e) {