public abstract class UIProvider extends Object implements Serializable
Constructor and Description |
---|
UIProvider() |
Modifier and Type | Method and Description |
---|---|
UI |
createInstance(UICreateEvent event) |
protected static <T extends Annotation> |
getAnnotationFor(Class<?> clazz,
Class<T> annotationType)
Helper to get an annotation for a class.
|
String |
getPageTitle(UICreateEvent event) |
PushMode |
getPushMode(UICreateEvent event)
Finds the
PushMode to use for a specific UI. |
Transport |
getPushTransport(UICreateEvent event)
Finds the
Transport to use for a specific UI. |
String |
getTheme(UICreateEvent event)
Finds the theme to use for a specific UI.
|
abstract Class<? extends UI> |
getUIClass(UIClassSelectionEvent event) |
String |
getWidgetset(UICreateEvent event)
Deprecated.
This method has been replaced by
getWidgetsetInfo(UICreateEvent) in 7.7 |
WidgetsetInfo |
getWidgetsetInfo(UICreateEvent event)
Finds the widgetset to use for a specific UI.
|
boolean |
isPreservedOnRefresh(UICreateEvent event)
Checks whether the same UI state should be reused if the framework can
detect that the application is opened in a browser window where it has
previously been open.
|
public abstract Class<? extends UI> getUIClass(UIClassSelectionEvent event)
public UI createInstance(UICreateEvent event)
protected static <T extends Annotation> T getAnnotationFor(Class<?> clazz, Class<T> annotationType)
Note that searching implemented interfaces for @Inherited
annotations and searching for superclasses for non-inherited annotations
do not follow the standard semantics and are supported for backwards
compatibility. Future versions of the framework might only support the
standard semantics of @Inherited
.
clazz
- the class from which the annotation should be foundannotationType
- the annotation type to look fornull
if the
annotation is not present on the classpublic String getTheme(UICreateEvent event)
null
is returned.
The default implementation checks for a @Theme
annotation on the
UI class.
event
- the UI create event with information about the UI and the
current request.null
if the default theme
should be used@Deprecated public String getWidgetset(UICreateEvent event)
getWidgetsetInfo(UICreateEvent)
in 7.7null
is returned.
This method uses the Widgetset definition priority order from
getWidgetsetInfo(UICreateEvent)
.
Note: This method exists only for backwards compatibility and overriding it won't have the effect it used to.
event
- the UI create event with information about the UI and the
current request.null
if the default
widgetset should be usedpublic WidgetsetInfo getWidgetsetInfo(UICreateEvent event)
null
is returned.
The default implementation uses the following order of priority for finding the widgetset information:
Widgetset
annotation if it is defined for the UI classevent
- the UI create event with information about the UI and the
current request.null
if the default widgetset
should be usedpublic boolean isPreservedOnRefresh(UICreateEvent event)
Whenever a preserved UI is reused, its
refresh
method is
invoked by the framework first.
event
- the UI create event with information about the UI and the
current request.true
if the same UI instance should be reused e.g.
when the browser window is refreshed.public String getPageTitle(UICreateEvent event)
public PushMode getPushMode(UICreateEvent event)
PushMode
to use for a specific UI. If no specific push
mode is required, null
is returned.
The default implementation uses the @Push
annotation if it's
defined for the UI class.
event
- the UI create event with information about the UI and the
current request.null
if the default push
mode should be usedpublic Transport getPushTransport(UICreateEvent event)
Transport
to use for a specific UI. If no transport is
defined, null
is returned.
The default implementation uses the @Push
annotation if it's
defined for the UI class.
event
- the UI create event with information about the UI and the
current request.null
if the default
transport type should be usedCopyright © 2018 Vaadin Ltd. All rights reserved.