com.vaadin.server
Class UIProvider

java.lang.Object
  extended by com.vaadin.server.UIProvider
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DefaultUIProvider, LegacyApplicationUIProvider

public abstract class UIProvider
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Constructor Summary
UIProvider()
           
 
Method Summary
 UI createInstance(UICreateEvent event)
           
protected static
<T extends java.lang.annotation.Annotation>
T
getAnnotationFor(java.lang.Class<?> clazz, java.lang.Class<T> annotationType)
          Helper to get an annotation for a class.
 java.lang.String getPageTitle(UICreateEvent event)
           
 java.lang.String getTheme(UICreateEvent event)
          Finds the theme to use for a specific UI.
abstract  java.lang.Class<? extends UI> getUIClass(UIClassSelectionEvent event)
           
 java.lang.String getWidgetset(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.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, toString
 

Constructor Detail

UIProvider

public UIProvider()
Method Detail

getUIClass

public abstract java.lang.Class<? extends UI> getUIClass(UIClassSelectionEvent event)

createInstance

public UI createInstance(UICreateEvent event)

getAnnotationFor

protected static <T extends java.lang.annotation.Annotation> T getAnnotationFor(java.lang.Class<?> clazz,
                                                                                java.lang.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 implemented interfaces are also searched for the annotation.

Parameters:
clazz - the class from which the annotation should be found
annotationType - the annotation type to look for
Returns:
an annotation of the given type, or null if the annotation is not present on the class

getTheme

public java.lang.String getTheme(UICreateEvent event)
Finds the theme to use for a specific UI. If no specific theme is required, null is returned.

The default implementation checks for a @Theme annotation 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 null if the default theme should be used

getWidgetset

public java.lang.String getWidgetset(UICreateEvent event)
Finds the widgetset to use for a specific UI. If no specific widgetset is required, null is returned.

The default implementation uses the @Widgetset annotation 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 name of the widgetset, or null if the default widgetset should be used

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.

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 java.lang.String getPageTitle(UICreateEvent event)


Copyright © 2000-2011 Vaadin Ltd. All Rights Reserved.