Interface Application
An instance of this interface is provided by the framework to the
configure
method of an ApplicationConfiguration
.
- Since:
- 2.0
- See Also:
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Instances of this class represent a mode of operation for an RWT application. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addEntryPoint
(String path, Class<? extends EntryPoint> entryPointType, Map<String, String> properties) Registers an entrypoint at the given servlet path.void
addEntryPoint
(String path, EntryPointFactory entryPointFactory, Map<String, String> properties) Registers an entrypoint at the given servlet path.void
addResource
(String resourceName, ResourceLoader resourceLoader) void
addServiceHandler
(String serviceHandlerId, ServiceHandler serviceHandler) Adds a service handler to the application.void
addStyleSheet
(String themeId, String styleSheetLocation) Adds the given stylesheet to a theme.void
addStyleSheet
(String themeId, String styleSheetLocation, ResourceLoader resourceLoader) Adds the given stylesheet to a theme.void
addThemeableWidget
(Class<? extends Widget> widget) Register a themeable widget for this application.void
setAttribute
(String name, Object value) Set an initial attribute in the application context.void
setExceptionHandler
(ExceptionHandler exceptionHandler) Sets the exception handler to which exceptions should be forwarded that occur while running the event loop.void
setOperationMode
(Application.OperationMode operationMode) The operation mode in which the application will be running.void
setSettingStoreFactory
(SettingStoreFactory settingStoreFactory) Configure this application to use a custom setting store implementation.
-
Method Details
-
setOperationMode
The operation mode in which the application will be running. The default isJEE_COMPATIBILITY
.- Parameters:
operationMode
- the operation mode to be used, must not benull
- See Also:
-
addEntryPoint
void addEntryPoint(String path, Class<? extends EntryPoint> entryPointType, Map<String, String> properties) Registers an entrypoint at the given servlet path. A valid path must start with a slash ('/') and must not contain any other slashes. The servlet path "/" denotes the root path. Nested paths (e.g. "/path/subpath") are currently not supported.Properties can be specified to control client-specific aspects of the entrypoint such as theme, icons, etc. The acceptable keys and values depend on the client implementation. The class
WebClient
provides constants for the default RAP client.- Parameters:
path
- a valid path to register the entry point atentryPointType
- the entry point class to be registered, must not benull
properties
- properties that control client-specific aspects of the application, such as theme, icons, etc., may benull
-
addEntryPoint
Registers an entrypoint at the given servlet path. A valid path must start with a slash ('/') and must not contain any other slashes. The servlet path "/" denotes the root path. Nested paths (e.g. "/path/subpath") are currently not supported.Properties can be specified to control client-specific aspects of the entrypoint such as theme, icons, etc. The acceptable keys and values depend on the client implementation. The class
WebClient
provides constants for the default RAP client.- Parameters:
path
- a valid path to register the entry point atentryPointFactory
- the entry point factory to be registered, must not benull
properties
- properties that control client-specific aspects of the application, such as theme, icons, etc., may benull
-
addStyleSheet
Adds the given stylesheet to a theme. If a theme with the given ID does not exist, it is created and initialized with the stylesheet. If the theme exists already, the stylesheet is appended to the theme. The stylesheet file will be loaded with the classloader of theApplicationConfiguration
.- Parameters:
themeId
- the id of the theme to register or to contribute tostyleSheetLocation
- the location of the CSS file in the format accepted byClassLoader.getResource(String)
- See Also:
-
addStyleSheet
Adds the given stylesheet to a theme. If a theme with the given ID does not exist, it is created and initialized with the stylesheet. If the theme exists already, the stylesheet is appended to the theme. The stylesheet file will be loaded with the classloader of theApplicationConfiguration
. The stylesheet file will be loaded using the given resource loader.- Parameters:
themeId
- the id of the theme to register or to contribute tostyleSheetLocation
- the location of the CSS file in the format accepted by the given resource loaderresourceLoader
- the resource loader that is able to load the style sheet from the given location- See Also:
-
setAttribute
Set an initial attribute in the application context.- Parameters:
name
- the name of the attribute, must not benull
value
- the attribute value- See Also:
-
setSettingStoreFactory
Configure this application to use a custom setting store implementation.- Parameters:
the
- setting store implementation to use, must not benull
- See Also:
-
setExceptionHandler
Sets the exception handler to which exceptions should be forwarded that occur while running the event loop.To give an exception handler the chance to log errors it called for all classes of exceptions.
Error
s however are re-thrown after the handler was called so that they cannot be swallowed.The default implementation throws the given exception, resulting in a HTTP 500 response.
- Parameters:
the
- exception handler to use, must not benull
- Since:
- 2.1
- See Also:
-
addThemeableWidget
Register a themeable widget for this application. A themeable widget is a custom widget that supports theming. To do so, the widget provides a couple of classes and files, such as a theme adapter, that will be found by a naming convention. It's sufficient to register the widget itself. For details on custom widgets, please refer to the documentation.- Parameters:
widget
- the widget to register as themeable widget- Since:
- 3.0
-
addServiceHandler
Adds a service handler to the application. A service handler is used to handle requests with a certain parameter inside the application. You can think of it like a lightweight servlet that has access to the user's session. Please see the documentation ofServiceHandler
for the URL to access this service handler.- Parameters:
serviceHandlerId
- the id for this servlet handler, used in the parameterserviceHandler
- the servlet handler to register- See Also:
-
addResource
-