public class ApplicationConnection extends Object implements com.google.gwt.event.shared.HasHandlers
onModuleLoad()
.Modifier and Type | Class and Description |
---|---|
static class |
ApplicationConnection.ApplicationConnectionEvent |
static class |
ApplicationConnection.ApplicationState |
static class |
ApplicationConnection.ApplicationStoppedEvent
Event triggered when a application is stopped by calling
ApplicationConnection#setApplicationRunning(false) . |
static interface |
ApplicationConnection.ApplicationStoppedHandler
A listener for listening to application stopped events.
|
static interface |
ApplicationConnection.CommunicationErrorHandler
Allows custom handling of communication errors.
|
static interface |
ApplicationConnection.CommunicationHandler
The communication handler methods are called at certain points during
communication with the server.
|
static class |
ApplicationConnection.MultiStepDuration |
static class |
ApplicationConnection.RequestStartingEvent |
static class |
ApplicationConnection.ResponseHandlingEndedEvent |
static class |
ApplicationConnection.ResponseHandlingStartedEvent |
Modifier and Type | Field and Description |
---|---|
protected ConnectionStateHandler |
connectionStateHandler |
protected boolean |
cssLoaded |
static String |
DISABLED_CLASSNAME
Deprecated.
|
static String |
ERROR_CLASSNAME_EXT
Deprecated.
|
protected MessageHandler |
messageHandler |
protected MessageSender |
messageSender |
static String |
MODIFIED_CLASSNAME
Deprecated.
|
static String |
REQUIRED_CLASSNAME
Deprecated.
|
static String |
REQUIRED_CLASSNAME_EXT
Deprecated.
|
protected ServerRpcQueue |
serverRpcQueue |
static String |
UIDL_REFRESH_TOKEN
A string that, if found in a non-JSON response to a UIDL request, will
cause the browser to refresh the page.
|
Constructor and Description |
---|
ApplicationConnection() |
Modifier and Type | Method and Description |
---|---|
static String |
addGetParameters(String uri,
String extraParams)
Deprecated.
Use
SharedUtil.addGetParameters(String,String)
instead |
<H extends com.google.gwt.event.shared.EventHandler> |
addHandler(com.google.gwt.event.shared.GwtEvent.Type<H> type,
H handler) |
void |
analyzeLayouts()
Deprecated.
as of 7.1. Replaced by
UIConnector.analyzeLayouts() |
void |
captionSizeUpdated(com.google.gwt.user.client.ui.Widget widget)
Deprecated.
As of 7.0.2, has not had any effect for a long time
|
void |
executeWhenCSSLoaded(com.google.gwt.user.client.Command c) |
void |
fireEvent(com.google.gwt.event.shared.GwtEvent<?> event) |
void |
flushActiveConnector()
Calls
ComponentConnector.flush() on the active connector. |
void |
forceLayout()
This will cause re-layouting of all components.
|
ApplicationConnection.ApplicationState |
getApplicationState()
Returns the state of this application.
|
ApplicationConfiguration |
getConfiguration()
Gets the
ApplicationConfiguration for the current application. |
ConnectionStateHandler |
getConnectionStateHandler()
Gets the communication error handler for this application
|
ServerConnector |
getConnector(String connectorId,
int connectorType)
Get either an existing ComponentConnector or create a new
ComponentConnector with the given type and id.
|
VContextMenu |
getContextMenu()
Singleton method to get instance of app's context menu.
|
Heartbeat |
getHeartbeat()
Returns the hearbeat instance.
|
Icon |
getIcon(String uri)
Gets an
Icon instance corresponding to a URI. |
int |
getLastSeenServerSyncId() |
VLoadingIndicator |
getLoadingIndicator()
Returns the loading indicator used by this ApplicationConnection
|
MessageHandler |
getMessageHandler()
Gets the (server to client) message handler for this application
|
MessageSender |
getMessageSender()
Gets the (client to server) message sender for this application
|
ComponentConnector |
getPaintable(UIDL uidl)
Deprecated.
|
String |
getResource(String name)
Gets a resource that has been pre-loaded via UIDL, such as custom
layouts.
|
RpcManager |
getRpcManager()
Gets the server rpc manager for this application
|
ServerRpcQueue |
getServerRpcQueue()
Gets the server RPC queue for this application
|
String |
getThemeUri()
Gets the URI for the current theme.
|
UIConnector |
getUIConnector()
Gets the main view
|
VTooltip |
getVTooltip()
Get VTooltip instance related to application connection
|
WidgetSet |
getWidgetSet() |
void |
handleCommunicationError(String details,
int statusCode) |
boolean |
handleComponentRelativeSize(com.google.gwt.user.client.ui.Widget widget)
Deprecated.
As of 7.0, serves no purpose
|
boolean |
hasEventListeners(ComponentConnector connector,
String eventIdentifier)
Deprecated.
As of 7.0. Use
AbstractConnector#hasEventListener(String) instead |
boolean |
hasEventListeners(com.google.gwt.user.client.ui.Widget widget,
String eventIdentifier)
Deprecated.
As of 7.0. Use
AbstractConnector.hasEventListener(String)
instead |
void |
init(WidgetSet widgetSet,
ApplicationConfiguration cnf) |
boolean |
isApplicationRunning()
Checks if the application is in the
ApplicationConnection.ApplicationState.RUNNING
state. |
protected boolean |
isCSSLoaded()
Checks whether or not the CSS is loaded.
|
boolean |
isLoadingIndicatorVisible()
Deprecated.
As of 7.1. Use
getLoadingIndicator() and
VLoadingIndicator.isVisible() .isVisible() instead. |
void |
loadScriptDependencies(com.google.gwt.core.client.JsArrayString dependencies) |
void |
loadStyleDependencies(com.google.gwt.core.client.JsArrayString dependencies) |
void |
runDescendentsLayout(com.google.gwt.user.client.ui.HasWidgets container)
Deprecated.
As of 7.0, serves no purpose
|
protected void |
scheduleHeartbeat()
Deprecated.
as of 7.2, use
Heartbeat.schedule() instead |
protected void |
sendHeartbeat()
Deprecated.
as of 7.2, use
Heartbeat.send() instead |
void |
sendPendingVariableChanges()
Deprecated.
as of 7.6, use
ServerRpcQueue.flush() |
void |
setApplicationRunning(boolean applicationRunning) |
void |
setCommunicationErrorDelegate(ApplicationConnection.CommunicationErrorHandler delegate)
Sets the delegate that is called whenever a communication error occurrs.
|
void |
setResource(String name,
String resource)
Sets a resource that has been pre-loaded via UIDL, such as custom
layouts.
|
void |
showAuthenticationError(String details)
Shows the authentication error notification.
|
void |
showCommunicationError(String details,
int statusCode)
Shows the communication error notification.
|
protected void |
showError(String details,
ApplicationConfiguration.ErrorMessage message)
Shows an error notification.
|
void |
showSessionExpiredError(String details)
Shows the session expiration notification.
|
void |
start()
Starts this application.
|
String |
translateVaadinUri(String uidlUri)
Translates custom protocols in UIDL URI's to be recognizable by browser.
|
void |
unregisterPaintable(ServerConnector p)
Deprecated.
As of 7.0. No longer serves any purpose.
|
boolean |
updateComponent(com.google.gwt.user.client.ui.Widget component,
UIDL uidl,
boolean manageCaption)
Deprecated.
As of 7.0, no longer serves any purpose
|
void |
updateVariable(String paintableId,
String variableName,
boolean newValue,
boolean immediate)
Sends a new value for the given paintables given variable to the server.
|
void |
updateVariable(String paintableId,
String variableName,
double newValue,
boolean immediate)
Sends a new value for the given paintables given variable to the server.
|
void |
updateVariable(String paintableId,
String variableName,
float newValue,
boolean immediate)
Sends a new value for the given paintables given variable to the server.
|
void |
updateVariable(String paintableId,
String variableName,
int newValue,
boolean immediate)
Sends a new value for the given paintables given variable to the server.
|
void |
updateVariable(String paintableId,
String variableName,
long newValue,
boolean immediate)
Sends a new value for the given paintables given variable to the server.
|
void |
updateVariable(String paintableId,
String variableName,
Map<String,Object> map,
boolean immediate)
Sends a new value for the given paintables given variable to the server.
|
void |
updateVariable(String paintableId,
String variableName,
Object[] values,
boolean immediate)
Sends a new value for the given paintables given variable to the server.
|
void |
updateVariable(String paintableId,
String variableName,
ServerConnector newValue,
boolean immediate)
Sends a new value for the given paintables given variable to the server.
|
void |
updateVariable(String paintableId,
String variableName,
String[] values,
boolean immediate)
Sends a new value for the given paintables given variable to the server.
|
void |
updateVariable(String paintableId,
String variableName,
String newValue,
boolean immediate)
Sends a new value for the given paintables given variable to the server.
|
@Deprecated public static final String MODIFIED_CLASSNAME
@Deprecated public static final String DISABLED_CLASSNAME
@Deprecated public static final String REQUIRED_CLASSNAME
@Deprecated public static final String REQUIRED_CLASSNAME_EXT
@Deprecated public static final String ERROR_CLASSNAME_EXT
public static final String UIDL_REFRESH_TOKEN
This allows, for instance, a servlet filter to redirect the application to a custom login page when the session expires. For example:
if (sessionExpired) { response.setHeader("Content-Type", "text/html"); response.getWriter().write(myLoginPageHtml + "<!-- Vaadin-Refresh: " + request.getContextPath() + " -->"); }
protected boolean cssLoaded
protected ServerRpcQueue serverRpcQueue
protected ConnectionStateHandler connectionStateHandler
protected MessageHandler messageHandler
protected MessageSender messageSender
public void init(WidgetSet widgetSet, ApplicationConfiguration cnf)
public void start()
ApplicationConfiguration#startNextApplication()
, which should be
called once this application has started (first response received) or
failed to start. This ensures that the applications are started in order,
to avoid session-id problems.@Deprecated public void analyzeLayouts()
UIConnector.analyzeLayouts()
public void executeWhenCSSLoaded(com.google.gwt.user.client.Command c)
protected boolean isCSSLoaded()
public void showCommunicationError(String details, int statusCode)
details
- Optional details.statusCode
- The status code returned for the requestpublic void showAuthenticationError(String details)
details
- Optional details.public void showSessionExpiredError(String details)
details
- Optional details.protected void showError(String details, ApplicationConfiguration.ErrorMessage message)
details
- Optional details.message
- An ErrorMessage describing the error.public VLoadingIndicator getLoadingIndicator()
@Deprecated public boolean isLoadingIndicatorVisible()
getLoadingIndicator()
and
VLoadingIndicator.isVisible()
.isVisible() instead.public void loadStyleDependencies(com.google.gwt.core.client.JsArrayString dependencies)
public void loadScriptDependencies(com.google.gwt.core.client.JsArrayString dependencies)
@Deprecated public void sendPendingVariableChanges()
ServerRpcQueue.flush()
public void updateVariable(String paintableId, String variableName, ServerConnector newValue, boolean immediate)
The update is actually queued to be sent at a suitable time. If immediate is true, the update is sent as soon as possible. If immediate is false, the update will be sent along with the next immediate update.
paintableId
- the id of the paintable that owns the variablevariableName
- the name of the variablenewValue
- the new value to be sentimmediate
- true if the update is to be sent as soon as possiblepublic void updateVariable(String paintableId, String variableName, String newValue, boolean immediate)
The update is actually queued to be sent at a suitable time. If immediate is true, the update is sent as soon as possible. If immediate is false, the update will be sent along with the next immediate update.
paintableId
- the id of the paintable that owns the variablevariableName
- the name of the variablenewValue
- the new value to be sentimmediate
- true if the update is to be sent as soon as possiblepublic void updateVariable(String paintableId, String variableName, int newValue, boolean immediate)
The update is actually queued to be sent at a suitable time. If immediate is true, the update is sent as soon as possible. If immediate is false, the update will be sent along with the next immediate update.
paintableId
- the id of the paintable that owns the variablevariableName
- the name of the variablenewValue
- the new value to be sentimmediate
- true if the update is to be sent as soon as possiblepublic void updateVariable(String paintableId, String variableName, long newValue, boolean immediate)
The update is actually queued to be sent at a suitable time. If immediate is true, the update is sent as soon as possible. If immediate is false, the update will be sent along with the next immediate update.
paintableId
- the id of the paintable that owns the variablevariableName
- the name of the variablenewValue
- the new value to be sentimmediate
- true if the update is to be sent as soon as possiblepublic void updateVariable(String paintableId, String variableName, float newValue, boolean immediate)
The update is actually queued to be sent at a suitable time. If immediate is true, the update is sent as soon as possible. If immediate is false, the update will be sent along with the next immediate update.
paintableId
- the id of the paintable that owns the variablevariableName
- the name of the variablenewValue
- the new value to be sentimmediate
- true if the update is to be sent as soon as possiblepublic void updateVariable(String paintableId, String variableName, double newValue, boolean immediate)
The update is actually queued to be sent at a suitable time. If immediate is true, the update is sent as soon as possible. If immediate is false, the update will be sent along with the next immediate update.
paintableId
- the id of the paintable that owns the variablevariableName
- the name of the variablenewValue
- the new value to be sentimmediate
- true if the update is to be sent as soon as possiblepublic void updateVariable(String paintableId, String variableName, boolean newValue, boolean immediate)
The update is actually queued to be sent at a suitable time. If immediate is true, the update is sent as soon as possible. If immediate is false, the update will be sent along with the next immediate update.
paintableId
- the id of the paintable that owns the variablevariableName
- the name of the variablenewValue
- the new value to be sentimmediate
- true if the update is to be sent as soon as possiblepublic void updateVariable(String paintableId, String variableName, Map<String,Object> map, boolean immediate)
The update is actually queued to be sent at a suitable time. If immediate is true, the update is sent as soon as possible. If immediate is false, the update will be sent along with the next immediate update.
paintableId
- the id of the paintable that owns the variablevariableName
- the name of the variablemap
- the new values to be sentimmediate
- true if the update is to be sent as soon as possiblepublic void updateVariable(String paintableId, String variableName, String[] values, boolean immediate)
The update is actually queued to be sent at a suitable time. If immediate is true, the update is sent as soon as possible. If immediate is false, the update will be sent along with the next immediate update.
A null array is sent as an empty array.
paintableId
- the id of the paintable that owns the variablevariableName
- the name of the variablevalues
- the new value to be sentimmediate
- true if the update is to be sent as soon as possiblepublic void updateVariable(String paintableId, String variableName, Object[] values, boolean immediate)
The update is actually queued to be sent at a suitable time. If immediate is true, the update is sent as soon as possible. If immediate is false, the update will be sent along with the next immediate update.
A null array is sent as an empty array.
paintableId
- the id of the paintable that owns the variablevariableName
- the name of the variablevalues
- the new value to be sentimmediate
- true if the update is to be sent as soon as possible@Deprecated public void runDescendentsLayout(com.google.gwt.user.client.ui.HasWidgets container)
LayoutManager
.container
- public void forceLayout()
@Deprecated public boolean handleComponentRelativeSize(com.google.gwt.user.client.ui.Widget widget)
paintable
- @Deprecated public ComponentConnector getPaintable(UIDL uidl)
public ServerConnector getConnector(String connectorId, int connectorType)
connectorId
- Id of the paintableconnectorType
- Type of the connector, as passed from the server sidepublic String getResource(String name)
name
- identifier of the resource to getpublic void setResource(String name, String resource)
name
- identifier of the resource to Setresource
- the resourcepublic VContextMenu getContextMenu()
public Icon getIcon(String uri)
Icon
instance corresponding to a URI.uri
- public String translateVaadinUri(String uidlUri)
uidlUri
- Vaadin URI from uidlpublic String getThemeUri()
@Deprecated public void captionSizeUpdated(com.google.gwt.user.client.ui.Widget widget)
component
- the Paintable whose caption has changedpublic UIConnector getUIConnector()
public ApplicationConfiguration getConfiguration()
ApplicationConfiguration
for the current application.ApplicationConfiguration
@Deprecated public boolean hasEventListeners(ComponentConnector connector, String eventIdentifier)
AbstractConnector#hasEventListener(String)
insteadconnector
- The connector to register event listeners foreventIdentifier
- The identifier for the event@Deprecated public static String addGetParameters(String uri, String extraParams)
SharedUtil.addGetParameters(String,String)
insteaduri
- The uri to which the parameters should be added.extraParams
- One or more parameters in the format "a=b" or "c=d&e=f". An
empty string is allowed but will not modify the url.@Deprecated public void unregisterPaintable(ServerConnector p)
public VTooltip getVTooltip()
@Deprecated public boolean updateComponent(com.google.gwt.user.client.ui.Widget component, UIDL uidl, boolean manageCaption)
component
- uidl
- manageCaption
- @Deprecated public boolean hasEventListeners(com.google.gwt.user.client.ui.Widget widget, String eventIdentifier)
AbstractConnector.hasEventListener(String)
instead@Deprecated protected void scheduleHeartbeat()
Heartbeat.schedule()
instead@Deprecated protected void sendHeartbeat()
Heartbeat.send()
insteadHeartbeat requests are used to inform the server that the client-side is still alive. If the client page is closed or the connection lost, the server will eventually close the inactive UI.
public void handleCommunicationError(String details, int statusCode)
public void setCommunicationErrorDelegate(ApplicationConnection.CommunicationErrorHandler delegate)
delegate
- the delegate.public void setApplicationRunning(boolean applicationRunning)
public boolean isApplicationRunning()
ApplicationConnection.ApplicationState.RUNNING
state.public <H extends com.google.gwt.event.shared.EventHandler> com.google.gwt.event.shared.HandlerRegistration addHandler(com.google.gwt.event.shared.GwtEvent.Type<H> type, H handler)
public void fireEvent(com.google.gwt.event.shared.GwtEvent<?> event)
fireEvent
in interface com.google.gwt.event.shared.HasHandlers
public void flushActiveConnector()
ComponentConnector.flush()
on the active connector. Does
nothing if there is no active (focused) connector.public Heartbeat getHeartbeat()
public ApplicationConnection.ApplicationState getApplicationState()
public ServerRpcQueue getServerRpcQueue()
public ConnectionStateHandler getConnectionStateHandler()
public MessageHandler getMessageHandler()
public RpcManager getRpcManager()
public MessageSender getMessageSender()
public WidgetSet getWidgetSet()
public int getLastSeenServerSyncId()
Copyright © 2019 Vaadin Ltd. All rights reserved.