com.vaadin
Class LegacyApplication

java.lang.Object
  extended by com.vaadin.server.AbstractUIProvider
      extended by com.vaadin.LegacyApplication
All Implemented Interfaces:
Terminal.ErrorListener, UIProvider, java.io.Serializable

Deprecated. This class is only intended to ease migration and should not be used for new projects.

@Deprecated
public abstract class LegacyApplication
extends AbstractUIProvider
implements Terminal.ErrorListener

A special application designed to help migrating applications from Vaadin 6 to Vaadin 7. The legacy application supports setting a main window, adding additional browser level windows and defining the theme for the entire application.

Since:
7.0
See Also:
Serialized Form

Constructor Summary
LegacyApplication()
          Deprecated.  
 
Method Summary
 void addWindow(UI.LegacyWindow uI)
          Deprecated. Adds a new browser level window to this application.
protected  void close()
          Deprecated.  
 UI createInstance(WrappedRequest request, java.lang.Class<? extends UI> type)
          Deprecated.  
 void doInit()
          Deprecated.  
 VaadinSession getContext()
          Deprecated.  
 UI getExistingUI(WrappedRequest request)
          Deprecated. This implementation simulates the way of finding a window for a request by extracting a window name from the requested path and passes that name to getWindow(String).
 UI.LegacyWindow getMainWindow()
          Deprecated. Gets the mainWindow of the application.
 java.lang.String getPageTitle(WrappedRequest request, java.lang.Class<? extends UI> uiClass)
          Deprecated.  
 java.lang.String getTheme()
          Deprecated. Gets the application's theme.
 java.lang.String getTheme(WrappedRequest request, java.lang.Class<? extends UI> uiClass)
          Deprecated. Finds the theme to use for a specific UI.
 java.lang.Class<? extends UI> getUIClass(WrappedRequest request)
          Deprecated.  
 java.net.URL getURL()
          Deprecated.  
 UI.LegacyWindow getWindow(java.lang.String name)
          Deprecated.  Gets a UI by name.
 java.util.Collection<UI.LegacyWindow> getWindows()
          Deprecated. Gets the set of windows contained by the application.
protected abstract  void init()
          Deprecated.  
 boolean isRunning()
          Deprecated.  
 void removeWindow(UI.LegacyWindow uI)
          Deprecated. Removes the specified window from the application.
 void setMainWindow(UI.LegacyWindow mainWindow)
          Deprecated. Sets the main window of this application.
 void setTheme(java.lang.String theme)
          Deprecated. Sets the application's theme.
 void terminalError(Terminal.ErrorEvent event)
          Deprecated. Invoked when a terminal error occurs.
 
Methods inherited from class com.vaadin.server.AbstractUIProvider
getAnnotationFor, getWidgetset, isPreservedOnRefresh
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LegacyApplication

public LegacyApplication()
Deprecated. 
Method Detail

setMainWindow

public void setMainWindow(UI.LegacyWindow mainWindow)
Deprecated. 
Sets the main window of this application. Setting window as a main window of this application also adds the window to this application.

Parameters:
mainWindow - the UI to set as the default window

doInit

public void doInit()
Deprecated. 

init

protected abstract void init()
Deprecated. 

getUIClass

public java.lang.Class<? extends UI> getUIClass(WrappedRequest request)
Deprecated. 
Specified by:
getUIClass in interface UIProvider

createInstance

public UI createInstance(WrappedRequest request,
                         java.lang.Class<? extends UI> type)
Deprecated. 
Specified by:
createInstance in interface UIProvider
Overrides:
createInstance in class AbstractUIProvider

getTheme

public java.lang.String getTheme(WrappedRequest request,
                                 java.lang.Class<? extends UI> uiClass)
Deprecated. 
Description copied from interface: UIProvider
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.

Specified by:
getTheme in interface UIProvider
Overrides:
getTheme in class AbstractUIProvider
Returns:
the name of the theme, or null if the default theme should be used

getPageTitle

public java.lang.String getPageTitle(WrappedRequest request,
                                     java.lang.Class<? extends UI> uiClass)
Deprecated. 
Specified by:
getPageTitle in interface UIProvider
Overrides:
getPageTitle in class AbstractUIProvider

getMainWindow

public UI.LegacyWindow getMainWindow()
Deprecated. 
Gets the mainWindow of the application.

The main window is the window attached to the application URL ( getURL()) and thus which is show by default to the user.

Note that each application must have at least one main window.

Returns:
the UI used as the default window

getExistingUI

public UI getExistingUI(WrappedRequest request)
Deprecated. 
This implementation simulates the way of finding a window for a request by extracting a window name from the requested path and passes that name to getWindow(String).

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 UIProvider.isPreservedOnRefresh(WrappedRequest, Class) before falling back to bootstrapping and creating a new UI instance.

Specified by:
getExistingUI in interface UIProvider
Overrides:
getExistingUI in class AbstractUIProvider
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.

setTheme

public void setTheme(java.lang.String theme)
Deprecated. 
Sets the application's theme.

Note that this theme can be overridden for a specific UI with VaadinSession#getThemeForUI(UI). Setting theme to be null selects the default theme. For the available theme names, see the contents of the VAADIN/themes directory.

Parameters:
theme - the new theme for this application.

getTheme

public java.lang.String getTheme()
Deprecated. 
Gets the application's theme. The application's theme is the default theme used by all the uIs for which a theme is not explicitly defined. If the application theme is not explicitly set, null is returned.

Returns:
the name of the application's theme.

getWindow

public UI.LegacyWindow getWindow(java.lang.String name)
Deprecated. 

Gets a UI by name. Returns null if the application is not running or it does not contain a window corresponding to the name.

Parameters:
name - the name of the requested window
Returns:
a UI corresponding to the name, or null to use the default window

addWindow

public void addWindow(UI.LegacyWindow uI)
Deprecated. 
Adds a new browser level window to this application. Please note that UI doesn't have a name that is used in the URL - to add a named window you should instead use #addWindow(UI, String)

Parameters:
uI - the UI window to add to the application
See Also:
#addWindow(UI, String)

removeWindow

public void removeWindow(UI.LegacyWindow uI)
Deprecated. 
Removes the specified window from the application. This also removes all name mappings for the window (see and #getWindowName(UI).

Note that removing window from the application does not close the browser window - the window is only removed from the server-side.

Parameters:
uI - the UI to remove

getWindows

public java.util.Collection<UI.LegacyWindow> getWindows()
Deprecated. 
Gets the set of windows contained by the application.

Note that the returned set of windows can not be modified.

Returns:
the unmodifiable collection of windows.

terminalError

public void terminalError(Terminal.ErrorEvent event)
Deprecated. 
Description copied from interface: Terminal.ErrorListener
Invoked when a terminal error occurs.

Specified by:
terminalError in interface Terminal.ErrorListener
Parameters:
event - the fired event.

getContext

public VaadinSession getContext()
Deprecated. 

close

protected void close()
Deprecated. 

isRunning

public boolean isRunning()
Deprecated. 

getURL

public java.net.URL getURL()
Deprecated. 


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