Class UIProvider
- java.lang.Object
-
- com.vaadin.server.UIProvider
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
DefaultUIProvider,LegacyApplicationUIProvider
public abstract class UIProvider extends Object implements Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description UIProvider()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description UIcreateInstance(UICreateEvent event)protected static <T extends Annotation>
TgetAnnotationFor(Class<?> clazz, Class<T> annotationType)Helper to get an annotation for a class.StringgetPageTitle(UICreateEvent event)PushModegetPushMode(UICreateEvent event)Finds thePushModeto use for a specific UI.TransportgetPushTransport(UICreateEvent event)Finds theTransportto use for a specific UI.StringgetTheme(UICreateEvent event)Finds the theme to use for a specific UI.abstract Class<? extends UI>getUIClass(UIClassSelectionEvent event)StringgetWidgetset(UICreateEvent event)Deprecated.This method has been replaced bygetWidgetsetInfo(UICreateEvent)in 7.7WidgetsetInfogetWidgetsetInfo(UICreateEvent event)Finds the widgetset to use for a specific UI.booleanisPreservedOnRefresh(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.
-
-
-
Method Detail
-
getUIClass
public abstract Class<? extends UI> getUIClass(UIClassSelectionEvent event)
-
createInstance
public UI createInstance(UICreateEvent event)
-
getAnnotationFor
protected static <T extends Annotation> T getAnnotationFor(Class<?> clazz, Class<T> annotationType)
Helper to get an annotation for a class. If the annotation is not present on the target class, its super classes and directly implemented interfaces are also searched for the annotation. Interfaces implemented by superclasses are not taken into account.Note that searching implemented interfaces for
@Inheritedannotations 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.- Parameters:
clazz- the class from which the annotation should be foundannotationType- the annotation type to look for- Returns:
- an annotation of the given type, or
nullif the annotation is not present on the class
-
getTheme
public String getTheme(UICreateEvent event)
Finds the theme to use for a specific UI. If no specific theme is required,nullis returned.The default implementation checks for a @
Themeannotation on the UI class.- Parameters:
event- the UI create event with information about the UI and the current request.- Returns:
- the name of the theme, or
nullif the default theme should be used
-
getWidgetset
@Deprecated public String getWidgetset(UICreateEvent event)
Deprecated.This method has been replaced bygetWidgetsetInfo(UICreateEvent)in 7.7Finds the widgetset to use for a specific UI. If no specific widgetset is required,nullis 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.
- Parameters:
event- the UI create event with information about the UI and the current request.- Returns:
- the name of the widgetset, or
nullif the default widgetset should be used
-
getWidgetsetInfo
public WidgetsetInfo getWidgetsetInfo(UICreateEvent event)
Finds the widgetset to use for a specific UI. If no specific widgetset is required,nullis returned.The default implementation uses the following order of priority for finding the widgetset information:
- @
Widgetsetannotation if it is defined for the UI class - The class AppWidgetset if one exists in the default package
- A widgetset called AppWidgetset if there is an AppWidgetset.gwt.xml file in the default package
- null to use the default widgetset otherwise
- Parameters:
event- the UI create event with information about the UI and the current request.- Returns:
- the widgetset info, or
nullif the default widgetset should be used - Since:
- 7.7
- @
-
isPreservedOnRefresh
public 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. The framework attempts to discover this by checking the value of window.name in the browser.Whenever a preserved UI is reused, its
refreshmethod is invoked by the framework first.- Parameters:
event- the UI create event with information about the UI and the current request.- Returns:
trueif the same UI instance should be reused e.g. when the browser window is refreshed.
-
getPageTitle
public String getPageTitle(UICreateEvent event)
-
getPushMode
public PushMode getPushMode(UICreateEvent event)
Finds thePushModeto use for a specific UI. If no specific push mode is required,nullis returned.The default implementation uses the @
Pushannotation if it's defined for the UI class.- Parameters:
event- the UI create event with information about the UI and the current request.- Returns:
- the push mode to use, or
nullif the default push mode should be used
-
getPushTransport
public Transport getPushTransport(UICreateEvent event)
Finds theTransportto use for a specific UI. If no transport is defined,nullis returned.The default implementation uses the @
Pushannotation if it's defined for the UI class.- Parameters:
event- the UI create event with information about the UI and the current request.- Returns:
- the transport type to use, or
nullif the default transport type should be used
-
-