com.vaadin.server
Interface UIProvider

All Known Implementing Classes:
AbstractUIProvider, DefaultUIProvider, LegacyApplication

public interface UIProvider


Method Summary
 UI createInstance(WrappedRequest request, java.lang.Class<? extends UI> type)
           
 UI getExistingUI(WrappedRequest request)
          Finds an existing UI for a request.
 java.lang.String getPageTitle(WrappedRequest request, java.lang.Class<? extends UI> uiClass)
           
 java.lang.String getTheme(WrappedRequest request, java.lang.Class<? extends UI> uiClass)
          Finds the theme to use for a specific UI.
 java.lang.Class<? extends UI> getUIClass(WrappedRequest request)
           
 java.lang.String getWidgetset(WrappedRequest request, java.lang.Class<? extends UI> uiClass)
          Finds the widgetset to use for a specific UI.
 boolean isPreservedOnRefresh(WrappedRequest request, java.lang.Class<? extends UI> uiClass)
          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

java.lang.Class<? extends UI> getUIClass(WrappedRequest request)

createInstance

UI createInstance(WrappedRequest request,
                  java.lang.Class<? extends UI> type)

getPageTitle

java.lang.String getPageTitle(WrappedRequest request,
                              java.lang.Class<? extends UI> uiClass)

isPreservedOnRefresh

boolean isPreservedOnRefresh(WrappedRequest request,
                             java.lang.Class<? extends UI> uiClass)
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:
request -
uiClass -
Returns:
trueif the same UI instance should be reused e.g. when the browser window is refreshed.

getWidgetset

java.lang.String getWidgetset(WrappedRequest request,
                              java.lang.Class<? extends UI> uiClass)
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:
request - the wrapped request for which to get a widgetset
uiClass - the UI class to get a widgetset for
Returns:
the name of the widgetset, or null if the default widgetset should be used

getTheme

java.lang.String getTheme(WrappedRequest request,
                          java.lang.Class<? extends UI> uiClass)
Finds the theme to use for a specific UI. If no specific theme is required, null is returned. TODO Tell what the default implementation does once it does something.

Parameters:
uI - the UI to get a theme for
Returns:
the name of the theme, or null if the default theme should be used

getExistingUI

UI getExistingUI(WrappedRequest request)
Finds an existing UI for a request.

Implementations should take care to not return an UI instance that might be used in some other browser as that might cause synchronization issues when changes from one browser window are not present in the other.

If no UI provider returns an existing UI, the framework does also check the window.name for an existing instance with isPreservedOnRefresh(WrappedRequest, Class) before falling back to bootstrapping and creating a new UI instance.

Parameters:
request - the request for which a UI is desired
Returns:
a UI belonging to the request, or null if this UI provider doesn't have an existing UI for the request.


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