Package com.vaadin.client
Class ApplicationConfiguration
- java.lang.Object
-
- com.vaadin.client.ApplicationConfiguration
-
- All Implemented Interfaces:
com.google.gwt.core.client.EntryPoint
public class ApplicationConfiguration extends Object implements com.google.gwt.core.client.EntryPoint
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ApplicationConfiguration.ErrorMessage
Wraps a native javascript object containing fields for an error message
-
Constructor Summary
Constructors Constructor Description ApplicationConfiguration()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addComponentInheritanceInfo(ValueMap valueMap)
void
addComponentMappings(ValueMap valueMap, WidgetSet widgetSet)
String
getAtmosphereJSVersion()
Return Atmosphere JS version.String
getAtmosphereVersion()
Return Atmosphere version.ApplicationConfiguration.ErrorMessage
getAuthorizationError()
ApplicationConfiguration.ErrorMessage
getCommunicationError()
static ApplicationConfiguration
getConfigFromDOM(String appId)
Class<? extends ServerConnector>
getConnectorClassByEncodedTag(int tag)
int
getHeartbeatInterval()
Integer
getParentTag(int tag)
String
getRootPanelId()
static List<ApplicationConnection>
getRunningApplications()
String
getServerSideClassNameForTag(Integer tag)
String
getServiceUrl()
Gets the URL to the server-side VaadinService.String
getServiceUrlParameterName()
Return the name of the parameter used to to send data to the service url.String
getServletVersion()
ApplicationConfiguration.ErrorMessage
getSessionExpiredError()
Integer[]
getTagsForServerSideClassName(String classname)
Returns all tags for given class.String
getThemeName()
Deprecated.as of 7.3.String
getUIDL()
Gets the initial UIDL from the DOM, if it was provided during the init process.int
getUIId()
Gets the UI id of the server-side UI associated with this client-side instance.String
getVaadinDirUrl()
Gets the URL of the VAADIN directory on the server.com.google.gwt.core.client.JavaScriptObject
getVersionInfoJSObject()
static boolean
isDebugMode()
Checks if client side is in debug mode.static boolean
isProductionMode()
Checks if production mode is enabled.static boolean
isQuietDebugMode()
Checks whether debug logging should be quietboolean
isStandalone()
boolean
isWidgetsetVersionSent()
Checks whether the widget set version has been sent to the server.void
onModuleLoad()
static void
registerCallback(String widgetsetName)
Registers that callback that the bootstrap javascript uses to start applications once the widgetset is loaded and all required information is availablestatic void
runWhenDependenciesLoaded(com.google.gwt.user.client.Command c)
void
setAppId(String appId)
void
setWidgetsetVersionSent()
Registers that the widget set version has been sent to the server.static void
startApplication(String applicationId)
Starts the application with a given id by reading the configuration options stored by the bootstrap javascript.boolean
useServiceUrlPathParam()
Checks whether path info in requests to the server-side service should be in a request parameter (namedv-resourcePath
) or appended to the end of the service URL.
-
-
-
Method Detail
-
useServiceUrlPathParam
public boolean useServiceUrlPathParam()
Checks whether path info in requests to the server-side service should be in a request parameter (namedv-resourcePath
) or appended to the end of the service URL.- Returns:
true
if path info should be a request parameter;false
if the path info goes after the service URL- See Also:
getServiceUrl()
-
getServiceUrlParameterName
public String getServiceUrlParameterName()
Return the name of the parameter used to to send data to the service url. This method should only be called ifuseServiceUrlPathParam()
is true.- Returns:
- The parameter name, by default
v-resourcePath
- Since:
- 7.1.6
-
getRootPanelId
public String getRootPanelId()
-
getServiceUrl
public String getServiceUrl()
Gets the URL to the server-side VaadinService. IfuseServiceUrlPathParam()
returntrue
, the requested path info should be in thev-resourcePath
query parameter; else the path info should be appended to the end of the URL.- Returns:
- the URL to the server-side service as a string
- See Also:
useServiceUrlPathParam()
-
getThemeName
@Deprecated public String getThemeName()
Deprecated.as of 7.3. UseUIConnector.getActiveTheme()
to get the theme currently in use- Returns:
- the theme name used when initializing the application
-
getVaadinDirUrl
public String getVaadinDirUrl()
Gets the URL of the VAADIN directory on the server.- Returns:
- the URL of the VAADIN directory
-
setAppId
public void setAppId(String appId)
-
getUIDL
public String getUIDL()
Gets the initial UIDL from the DOM, if it was provided during the init process.- Returns:
-
isStandalone
public boolean isStandalone()
- Returns:
- true if the application is served by std. Vaadin servlet and is considered to be the only or main content of the host page.
-
getUIId
public int getUIId()
Gets the UI id of the server-side UI associated with this client-side instance. The UI id should be included in every request originating from this instance in order to associate the request with the right UI instance on the server.- Returns:
- the UI id
-
getHeartbeatInterval
public int getHeartbeatInterval()
- Returns:
- The interval in seconds between heartbeat requests, or a non-positive number if heartbeat is disabled.
-
getVersionInfoJSObject
public com.google.gwt.core.client.JavaScriptObject getVersionInfoJSObject()
-
getCommunicationError
public ApplicationConfiguration.ErrorMessage getCommunicationError()
-
getAuthorizationError
public ApplicationConfiguration.ErrorMessage getAuthorizationError()
-
getSessionExpiredError
public ApplicationConfiguration.ErrorMessage getSessionExpiredError()
-
startApplication
public static void startApplication(String applicationId)
Starts the application with a given id by reading the configuration options stored by the bootstrap javascript.- Parameters:
applicationId
- id of the application to load, this is also the id of the html element into which the application should be rendered.
-
getRunningApplications
public static List<ApplicationConnection> getRunningApplications()
-
getConfigFromDOM
public static ApplicationConfiguration getConfigFromDOM(String appId)
-
getServletVersion
public String getServletVersion()
-
getAtmosphereVersion
public String getAtmosphereVersion()
Return Atmosphere version.- Returns:
- Atmosphere version.
- Since:
- 7.4
-
getAtmosphereJSVersion
public String getAtmosphereJSVersion()
Return Atmosphere JS version.- Returns:
- Atmosphere JS version.
- Since:
- 7.4
-
getConnectorClassByEncodedTag
public Class<? extends ServerConnector> getConnectorClassByEncodedTag(int tag)
-
addComponentInheritanceInfo
public void addComponentInheritanceInfo(ValueMap valueMap)
-
getTagsForServerSideClassName
public Integer[] getTagsForServerSideClassName(String classname)
Returns all tags for given class. Tags are used inApplicationConfiguration
to keep track of different classes and their hierarchy- Parameters:
classname
- name of class which tags we want- Returns:
- Integer array of tags pointing to this classname
- Since:
- 7.2
-
getParentTag
public Integer getParentTag(int tag)
-
runWhenDependenciesLoaded
public static void runWhenDependenciesLoaded(com.google.gwt.user.client.Command c)
- Parameters:
c
-- Since:
- 7.6
-
onModuleLoad
public void onModuleLoad()
- Specified by:
onModuleLoad
in interfacecom.google.gwt.core.client.EntryPoint
-
registerCallback
public static void registerCallback(String widgetsetName)
Registers that callback that the bootstrap javascript uses to start applications once the widgetset is loaded and all required information is available- Parameters:
widgetsetName
- the name of this widgetset
-
isDebugMode
public static boolean isDebugMode()
Checks if client side is in debug mode. Practically this is invoked by adding ?debug parameter to URI. Please note that debug mode is always disabled if production mode is enabled, but disabling production mode does not automatically enable debug mode.- Returns:
- true if client side is currently been debugged
- See Also:
isProductionMode()
-
isProductionMode
public static boolean isProductionMode()
Checks if production mode is enabled. When production mode is enabled, client-side logging is disabled. There may also be other performance optimizations.- Returns:
true
if production mode is enabled; otherwisefalse
.- Since:
- 7.1.2
-
isQuietDebugMode
public static boolean isQuietDebugMode()
Checks whether debug logging should be quiet- Returns:
true
if debug logging should be quiet
-
isWidgetsetVersionSent
public boolean isWidgetsetVersionSent()
Checks whether the widget set version has been sent to the server. It is sent in the first UIDL request.- Returns:
true
if browser information has already been sent
-
setWidgetsetVersionSent
public void setWidgetsetVersionSent()
Registers that the widget set version has been sent to the server.
-
-