|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vaadin.Application com.vaadin.Application.LegacyApplication
@Deprecated public static class Application.LegacyApplication
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.
Nested Class Summary |
---|
Field Summary |
---|
Fields inherited from class com.vaadin.Application |
---|
ROOT_PARAMETER |
Constructor Summary | |
---|---|
Application.LegacyApplication()
Deprecated. |
Method Summary | |
---|---|
void |
addWindow(Root.LegacyWindow root)
Deprecated. Adds a new browser level window to this application. |
Root.LegacyWindow |
getMainWindow()
Deprecated. Gets the mainWindow of the application. |
Root.LegacyWindow |
getRoot(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) . |
String |
getTheme()
Deprecated. Gets the application's theme. |
String |
getThemeForRoot(Root root)
Deprecated. This implementation returns the theme that has been set using setTheme(String) |
Root.LegacyWindow |
getWindow(String name)
Deprecated. Gets a root by name. |
Collection<Root.LegacyWindow> |
getWindows()
Deprecated. Gets the set of windows contained by the application. |
void |
removeWindow(Root.LegacyWindow root)
Deprecated. Removes the specified window from the application. |
void |
setMainWindow(Root.LegacyWindow mainWindow)
Deprecated. Sets the main window of this application. |
void |
setTheme(String theme)
Deprecated. Sets the application's theme. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Application.LegacyApplication()
Method Detail |
---|
public void setMainWindow(Root.LegacyWindow mainWindow)
mainWindow
- the root to set as the default windowpublic Root.LegacyWindow getMainWindow()
The main window is the window attached to the application URL (
Application.getURL()
) and thus which is show by default to the user.
Note that each application must have at least one main window.
public Root.LegacyWindow getRoot(WrappedRequest request)
getWindow(String)
.
Gets a root for a request for which no root is already known. This method
is called when the framework processes a request that does not originate
from an existing root instance. This typically happens when a host page
is requested.
Subclasses of Application may override this method to provide custom logic for choosing how to create a suitable root or for picking an already created root. If an existing root is picked, care should be taken to avoid keeping the same root open in multiple browser windows, as that will cause the states to go out of sync.
If WrappedRequest.BrowserDetails
are required to create a Root, the
implementation can throw a RootRequiresMoreInformationException
exception. In this case, the framework will instruct the browser to send
the additional details, whereupon this method is invoked again with the
browser details present in the wrapped request. Throwing the exception if
the browser details are already available is not supported.
The default implementation in Application.LegacyApplication
creates a new instance
of the Root class returned by Application.getRootClassName(WrappedRequest)
,
which in turn uses the "root" parameter from web.xml.
If DeploymentConfiguration.getClassLoader()
for the request
returns a ClassLoader
, it is used for loading the Root class.
Otherwise the ClassLoader
used to load this class is used.
getRoot
in class Application
request
- the wrapped request for which a root is needed
getWindow(String)
,
Application.getRoot(WrappedRequest)
public void setTheme(String theme)
Note that this theme can be overridden for a specific root with
Application.getThemeForRoot(Root)
. Setting theme to be
null
selects the default theme. For the available theme
names, see the contents of the VAADIN/themes directory.
theme
- the new theme for this application.public String getTheme()
null
is returned.
public String getThemeForRoot(Root root)
setTheme(String)
Finds the theme to use for a specific root. If no specific theme is
required, null
is returned.
TODO Tell what the default implementation does once it does something.
getThemeForRoot
in class Application
root
- the root to get a theme for
null
if the default theme
should be usedpublic Root.LegacyWindow getWindow(String name)
Gets a root by name. Returns null
if the application is
not running or it does not contain a window corresponding to the
name.
name
- the name of the requested window
null
to use
the default windowpublic void addWindow(Root.LegacyWindow root)
#addWindow(Root, String)
root
- the root window to add to the application#addWindow(Root, String)
public void removeWindow(Root.LegacyWindow root)
and #getWindowName(Root)
.
Note that removing window from the application does not close the browser window - the window is only removed from the server-side.
root
- the root to removepublic Collection<Root.LegacyWindow> getWindows()
Note that the returned set of windows can not be modified.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |