com.vaadin.client
Class ApplicationConnection

java.lang.Object
  extended by com.vaadin.client.ApplicationConnection
All Implemented Interfaces:
com.google.gwt.event.shared.HasHandlers

public class ApplicationConnection
extends java.lang.Object
implements com.google.gwt.event.shared.HasHandlers

This is the client side communication "engine", managing client-server communication with its server side counterpart com.vaadin.server.VaadinService. Client-side connectors receive updates from the corresponding server-side connector (typically component) as state updates or RPC calls. The connector has the possibility to communicate back with its server side counter part through RPC calls. TODO document better Entry point classes (widgetsets) define onModuleLoad().


Nested Class Summary
static class ApplicationConnection.ApplicationConnectionEvent
           
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.ConnectionStatusEvent
          Event triggered when a XHR request has finished with the status code of the response.
static class ApplicationConnection.MultiStepDuration
           
static class ApplicationConnection.RequestStartingEvent
           
static class ApplicationConnection.ResponseHandlingEndedEvent
           
static class ApplicationConnection.ResponseHandlingStartedEvent
           
 
Field Summary
protected  boolean applicationRunning
           
protected  boolean cssLoaded
           
static java.lang.String DISABLED_CLASSNAME
           
static java.lang.String ERROR_CLASSNAME_EXT
           
protected  int lastProcessingTime
          Holds the time spent rendering the last request
static java.lang.String MODIFIED_CLASSNAME
           
static java.lang.String REQUIRED_CLASSNAME
           
static java.lang.String REQUIRED_CLASSNAME_EXT
           
protected  int totalProcessingTime
          Holds the total time spent rendering requests during the lifetime of the session.
static java.lang.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 Summary
ApplicationConnection()
           
 
Method Summary
static java.lang.String addGetParameters(java.lang.String uri, java.lang.String extraParams)
          Adds the get parameters to the uri and returns the new uri that contains the parameters.
<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)
           
 void addMethodInvocationToQueue(com.vaadin.shared.communication.MethodInvocation invocation, boolean delayed, boolean lastOnly)
          Adds an explicit RPC method invocation to the send queue.
 void analyzeLayouts()
          Deprecated. as of 7.1. Replaced by UIConnector.analyzeLayouts()
 void captionSizeUpdated(Widget widget)
          Deprecated. As of 7.0.2, has not had any effect for a long time
protected  void doAjaxRequest(java.lang.String uri, JSONObject payload, RequestCallback requestCallback)
          Sends an asynchronous UIDL request to the server using the given URI.
protected  void doUidlRequest(java.lang.String uri, JSONObject payload)
          Sends an asynchronous or synchronous UIDL request to the server using the given URI.
protected  void doUidlRequest(java.lang.String uri, JSONObject payload, boolean retry)
          Sends an asynchronous or synchronous UIDL request to the server using the given URI.
protected  void endRequest()
           
protected  void extendLiferaySession()
          If on Liferay and logged in, ask the client side session management JavaScript to extend the session duration.
 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.
 java.lang.String getCommunicationMethodName()
          Returns a human readable string representation of the method used to communicate with the server.
 ApplicationConfiguration getConfiguration()
          Gets the ApplicationConfiguration for the current application.
 ServerConnector getConnector(java.lang.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.
 java.lang.String getCsrfToken()
          Gets the token (aka double submit cookie) that the server uses to protect against Cross Site Request Forgery attacks.
 Heartbeat getHeartbeat()
          Returns the hearbeat instance.
 Icon getIcon(java.lang.String uri)
          Gets an Icon instance corresponding to a URI.
 int getLastResponseId()
          Gets the id of the last received response.
 VLoadingIndicator getLoadingIndicator()
          Returns the loading indicator used by this ApplicationConnection
 ComponentConnector getPaintable(UIDL uidl)
          Deprecated. 
 java.lang.String getResource(java.lang.String name)
          Gets a recource that has been pre-loaded via UIDL, such as custom layouts.
 java.lang.String getThemeUri()
          Gets the URI for the current theme.
 UIConnector getUIConnector()
          Gets the main view
protected  java.lang.String getUidlSecurityKey()
           
 VTooltip getVTooltip()
          Get VTooltip instance related to application connection
 boolean handleComponentRelativeSize(Widget widget)
          Deprecated. As of 7.0, serves no purpose
 void handlePushMessage(java.lang.String message)
           
protected  void handleUIDLMessage(java.util.Date start, java.lang.String jsonText, ValueMap json)
           
protected  void handleWhenCSSLoaded(java.lang.String jsonText, ValueMap json)
           
 boolean hasActiveRequest()
          Indicates whether or not there are currently active UIDL requests.
 boolean hasEventListeners(ComponentConnector paintable, java.lang.String eventIdentifier)
          Deprecated. As of 7.0. Use AbstractComponentState#hasEventListener(String) instead
 boolean hasEventListeners(Widget widget, java.lang.String eventIdentifier)
          Deprecated. As of 7.0. Use AbstractConnector.hasEventListener(String) instead
 void init(WidgetSet widgetSet, ApplicationConfiguration cnf)
           
 boolean isApplicationRunning()
           
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.
protected  void makeUidlRequest(JSONArray reqInvocations, java.lang.String extraParams)
          Makes an UIDL request to the server.
 void removePendingInvocations(com.vaadin.shared.communication.MethodInvocation invocation)
          Removes any pending invocation of the given method from the queue
protected  void repaintAll()
           
 void resumeResponseHandling(java.lang.Object lock)
          Resumes the rendering process once all locks have been removed.
 void runDescendentsLayout(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()
          This method sends currently queued variable changes to server.
 void setApplicationRunning(boolean running)
           
 void setCommunicationErrorDelegate(ApplicationConnection.CommunicationErrorHandler delegate)
          Sets the delegate that is called whenever a communication error occurrs.
 void setPushEnabled(boolean enabled)
          Sets the status for the push connection.
protected  void showAuthenticationError(java.lang.String details)
          Shows the authentication error notification.
protected  void showCommunicationError(java.lang.String details, int statusCode)
          Shows the communication error notification.
protected  void showError(java.lang.String details, ApplicationConfiguration.ErrorMessage message)
          Shows an error notification.
 void showSessionExpiredError(java.lang.String details)
          Shows the session expiration notification.
 void start()
          Starts this application.
protected  void startRequest()
           
 void suspendReponseHandling(java.lang.Object lock)
          This method can be used to postpone rendering of a response for a short period of time (e.g.
 java.lang.String translateVaadinUri(java.lang.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(Widget component, UIDL uidl, boolean manageCaption)
          Deprecated. As of 7.0, no longer serves any purpose
 void updateVariable(java.lang.String paintableId, java.lang.String variableName, boolean newValue, boolean immediate)
          Sends a new value for the given paintables given variable to the server.
 void updateVariable(java.lang.String paintableId, java.lang.String variableName, double newValue, boolean immediate)
          Sends a new value for the given paintables given variable to the server.
 void updateVariable(java.lang.String paintableId, java.lang.String variableName, float newValue, boolean immediate)
          Sends a new value for the given paintables given variable to the server.
 void updateVariable(java.lang.String paintableId, java.lang.String variableName, int newValue, boolean immediate)
          Sends a new value for the given paintables given variable to the server.
 void updateVariable(java.lang.String paintableId, java.lang.String variableName, long newValue, boolean immediate)
          Sends a new value for the given paintables given variable to the server.
 void updateVariable(java.lang.String paintableId, java.lang.String variableName, java.util.Map<java.lang.String,java.lang.Object> map, boolean immediate)
          Sends a new value for the given paintables given variable to the server.
 void updateVariable(java.lang.String paintableId, java.lang.String variableName, java.lang.Object[] values, boolean immediate)
          Sends a new value for the given paintables given variable to the server.
 void updateVariable(java.lang.String paintableId, java.lang.String variableName, ServerConnector newValue, boolean immediate)
          Sends a new value for the given paintables given variable to the server.
 void updateVariable(java.lang.String paintableId, java.lang.String variableName, java.lang.String[] values, boolean immediate)
          Sends a new value for the given paintables given variable to the server.
 void updateVariable(java.lang.String paintableId, java.lang.String variableName, java.lang.String newValue, boolean immediate)
          Sends a new value for the given paintables given variable to the server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODIFIED_CLASSNAME

public static final java.lang.String MODIFIED_CLASSNAME
See Also:
Constant Field Values

DISABLED_CLASSNAME

public static final java.lang.String DISABLED_CLASSNAME
See Also:
Constant Field Values

REQUIRED_CLASSNAME

public static final java.lang.String REQUIRED_CLASSNAME
See Also:
Constant Field Values

REQUIRED_CLASSNAME_EXT

public static final java.lang.String REQUIRED_CLASSNAME_EXT
See Also:
Constant Field Values

ERROR_CLASSNAME_EXT

public static final java.lang.String ERROR_CLASSNAME_EXT
See Also:
Constant Field Values

UIDL_REFRESH_TOKEN

public static final java.lang.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. If followed by a colon, optional whitespace, and a URI, causes the browser to synchronously load the URI.

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() + " -->");
 }
 

See Also:
Constant Field Values

applicationRunning

protected boolean applicationRunning

cssLoaded

protected boolean cssLoaded

lastProcessingTime

protected int lastProcessingTime
Holds the time spent rendering the last request


totalProcessingTime

protected int totalProcessingTime
Holds the total time spent rendering requests during the lifetime of the session.

Constructor Detail

ApplicationConnection

public ApplicationConnection()
Method Detail

init

public void init(WidgetSet widgetSet,
                 ApplicationConfiguration cnf)

start

public void start()
Starts this application. Don't call this method directly - it's called by 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.


extendLiferaySession

protected void extendLiferaySession()
If on Liferay and logged in, ask the client side session management JavaScript to extend the session duration. Otherwise, Liferay client side JavaScript will explicitly expire the session even though the server side considers the session to be active. See ticket #8305 for more information.


hasActiveRequest

public boolean hasActiveRequest()
Indicates whether or not there are currently active UIDL requests. Used internally to sequence requests properly, seldom needed in Widgets.

Returns:
true if there are active requests

repaintAll

protected void repaintAll()

analyzeLayouts

@Deprecated
public void analyzeLayouts()
Deprecated. as of 7.1. Replaced by UIConnector.analyzeLayouts()

Requests an analyze of layouts, to find inconsistencies. Exclusively used for debugging during development.


makeUidlRequest

protected void makeUidlRequest(JSONArray reqInvocations,
                               java.lang.String extraParams)
Makes an UIDL request to the server.

Parameters:
reqInvocations - Data containing RPC invocations and all related information.
extraParams - Parameters that are added as GET parameters to the url. Contains key=value pairs joined by & characters or is empty if no parameters should be added. Should not start with any special character.

doUidlRequest

protected void doUidlRequest(java.lang.String uri,
                             JSONObject payload)
Sends an asynchronous or synchronous UIDL request to the server using the given URI.

Parameters:
uri - The URI to use for the request. May includes GET parameters
payload - The contents of the request to send

doUidlRequest

protected void doUidlRequest(java.lang.String uri,
                             JSONObject payload,
                             boolean retry)
Sends an asynchronous or synchronous UIDL request to the server using the given URI.

Parameters:
uri - The URI to use for the request. May includes GET parameters
payload - The contents of the request to send
retry - true when a status code 0 should be retried
Since:
7.3.7

doAjaxRequest

protected void doAjaxRequest(java.lang.String uri,
                             JSONObject payload,
                             RequestCallback requestCallback)
                      throws RequestException
Sends an asynchronous UIDL request to the server using the given URI.

Parameters:
uri - The URI to use for the request. May includes GET parameters
payload - The contents of the request to send
requestCallback - The handler for the response
Throws:
RequestException - if the request could not be sent

handleWhenCSSLoaded

protected void handleWhenCSSLoaded(java.lang.String jsonText,
                                   ValueMap json)

isCSSLoaded

protected boolean isCSSLoaded()
Checks whether or not the CSS is loaded. By default checks the size of the loading indicator element.

Returns:

showCommunicationError

protected void showCommunicationError(java.lang.String details,
                                      int statusCode)
Shows the communication error notification.

Parameters:
details - Optional details for debugging.
statusCode - The status code returned for the request

showAuthenticationError

protected void showAuthenticationError(java.lang.String details)
Shows the authentication error notification.

Parameters:
details - Optional details for debugging.

showSessionExpiredError

public void showSessionExpiredError(java.lang.String details)
Shows the session expiration notification.

Parameters:
details - Optional details for debugging.

showError

protected void showError(java.lang.String details,
                         ApplicationConfiguration.ErrorMessage message)
Shows an error notification.

Parameters:
details - Optional details for debugging.
message - An ErrorMessage describing the error.

startRequest

protected void startRequest()

endRequest

protected void endRequest()

getLoadingIndicator

public VLoadingIndicator getLoadingIndicator()
Returns the loading indicator used by this ApplicationConnection

Returns:
The loading indicator for this ApplicationConnection

isLoadingIndicatorVisible

@Deprecated
public boolean isLoadingIndicatorVisible()
Deprecated. As of 7.1. Use getLoadingIndicator() and VLoadingIndicator.isVisible().isVisible() instead.

Determines whether or not the loading indicator is showing.

Returns:
true if the loading indicator is visible

getLastResponseId

public int getLastResponseId()
Gets the id of the last received response. This id can be used by connectors to determine whether new data has been received from the server to avoid doing the same calculations multiple times.

No guarantees are made for the structure of the id other than that there will be a new unique value every time a new response with data from the server is received.

The initial id when no request has yet been processed is -1.

Returns:
and id identifying the response

handleUIDLMessage

protected void handleUIDLMessage(java.util.Date start,
                                 java.lang.String jsonText,
                                 ValueMap json)

addMethodInvocationToQueue

public void addMethodInvocationToQueue(com.vaadin.shared.communication.MethodInvocation invocation,
                                       boolean delayed,
                                       boolean lastOnly)
Adds an explicit RPC method invocation to the send queue.

Parameters:
invocation - RPC method invocation
delayed - false to trigger sending within a short time window (possibly combining subsequent calls to a single request), true to let the framework delay sending of RPC calls and variable changes until the next non-delayed change
lastOnly - true to remove all previously delayed invocations of the same method that were also enqueued with lastonly set to true. false to add invocation to the end of the queue without touching previously enqueued invocations.
Since:
7.0

removePendingInvocations

public void removePendingInvocations(com.vaadin.shared.communication.MethodInvocation invocation)
Removes any pending invocation of the given method from the queue

Parameters:
invocation - The invocation to remove

sendPendingVariableChanges

public void sendPendingVariableChanges()
This method sends currently queued variable changes to server. It is called when immediate variable update must happen. To ensure correct order for variable changes (due servers multithreading or network), we always wait for active request to be handler before sending a new one. If there is an active request, we will put varible "burst" to queue that will be purged after current request is handled.


updateVariable

public void updateVariable(java.lang.String paintableId,
                           java.lang.String variableName,
                           ServerConnector newValue,
                           boolean immediate)
Sends a new value for the given paintables given variable to the server.

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.

Parameters:
paintableId - the id of the paintable that owns the variable
variableName - the name of the variable
newValue - the new value to be sent
immediate - true if the update is to be sent as soon as possible

updateVariable

public void updateVariable(java.lang.String paintableId,
                           java.lang.String variableName,
                           java.lang.String newValue,
                           boolean immediate)
Sends a new value for the given paintables given variable to the server.

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.

Parameters:
paintableId - the id of the paintable that owns the variable
variableName - the name of the variable
newValue - the new value to be sent
immediate - true if the update is to be sent as soon as possible

updateVariable

public void updateVariable(java.lang.String paintableId,
                           java.lang.String variableName,
                           int newValue,
                           boolean immediate)
Sends a new value for the given paintables given variable to the server.

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.

Parameters:
paintableId - the id of the paintable that owns the variable
variableName - the name of the variable
newValue - the new value to be sent
immediate - true if the update is to be sent as soon as possible

updateVariable

public void updateVariable(java.lang.String paintableId,
                           java.lang.String variableName,
                           long newValue,
                           boolean immediate)
Sends a new value for the given paintables given variable to the server.

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.

Parameters:
paintableId - the id of the paintable that owns the variable
variableName - the name of the variable
newValue - the new value to be sent
immediate - true if the update is to be sent as soon as possible

updateVariable

public void updateVariable(java.lang.String paintableId,
                           java.lang.String variableName,
                           float newValue,
                           boolean immediate)
Sends a new value for the given paintables given variable to the server.

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.

Parameters:
paintableId - the id of the paintable that owns the variable
variableName - the name of the variable
newValue - the new value to be sent
immediate - true if the update is to be sent as soon as possible

updateVariable

public void updateVariable(java.lang.String paintableId,
                           java.lang.String variableName,
                           double newValue,
                           boolean immediate)
Sends a new value for the given paintables given variable to the server.

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.

Parameters:
paintableId - the id of the paintable that owns the variable
variableName - the name of the variable
newValue - the new value to be sent
immediate - true if the update is to be sent as soon as possible

updateVariable

public void updateVariable(java.lang.String paintableId,
                           java.lang.String variableName,
                           boolean newValue,
                           boolean immediate)
Sends a new value for the given paintables given variable to the server.

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.

Parameters:
paintableId - the id of the paintable that owns the variable
variableName - the name of the variable
newValue - the new value to be sent
immediate - true if the update is to be sent as soon as possible

updateVariable

public void updateVariable(java.lang.String paintableId,
                           java.lang.String variableName,
                           java.util.Map<java.lang.String,java.lang.Object> map,
                           boolean immediate)
Sends a new value for the given paintables given variable to the server.

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.

Parameters:
paintableId - the id of the paintable that owns the variable
variableName - the name of the variable
map - the new values to be sent
immediate - true if the update is to be sent as soon as possible

updateVariable

public void updateVariable(java.lang.String paintableId,
                           java.lang.String variableName,
                           java.lang.String[] values,
                           boolean immediate)
Sends a new value for the given paintables given variable to the server. 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.

Parameters:
paintableId - the id of the paintable that owns the variable
variableName - the name of the variable
values - the new value to be sent
immediate - true if the update is to be sent as soon as possible

updateVariable

public void updateVariable(java.lang.String paintableId,
                           java.lang.String variableName,
                           java.lang.Object[] values,
                           boolean immediate)
Sends a new value for the given paintables given variable to the server. 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.

Parameters:
paintableId - the id of the paintable that owns the variable
variableName - the name of the variable
values - the new value to be sent
immediate - true if the update is to be sent as soon as possible

runDescendentsLayout

@Deprecated
public void runDescendentsLayout(HasWidgets container)
Deprecated. As of 7.0, serves no purpose

Does absolutely nothing. Replaced by LayoutManager.

Parameters:
container -

forceLayout

public void forceLayout()
This will cause re-layouting of all components. Mainly used for development. Published to JavaScript.


handleComponentRelativeSize

@Deprecated
public boolean handleComponentRelativeSize(Widget widget)
Deprecated. As of 7.0, serves no purpose

Returns false

Parameters:
paintable -
Returns:
false, always

getPaintable

@Deprecated
public ComponentConnector getPaintable(UIDL uidl)
Deprecated. 


getConnector

public ServerConnector getConnector(java.lang.String connectorId,
                                    int connectorType)
Get either an existing ComponentConnector or create a new ComponentConnector with the given type and id. If a ComponentConnector with the given id already exists, returns it. Otherwise creates and registers a new ComponentConnector of the given type.

Parameters:
connectorId - Id of the paintable
connectorType - Type of the connector, as passed from the server side
Returns:
Either an existing ComponentConnector or a new ComponentConnector of the given type

getResource

public java.lang.String getResource(java.lang.String name)
Gets a recource that has been pre-loaded via UIDL, such as custom layouts.

Parameters:
name - identifier of the resource to get
Returns:
the resource

getContextMenu

public VContextMenu getContextMenu()
Singleton method to get instance of app's context menu.

Returns:
VContextMenu object

getIcon

public Icon getIcon(java.lang.String uri)
Gets an Icon instance corresponding to a URI.

Parameters:
uri -
Returns:
Icon object
Since:
7.2

translateVaadinUri

public java.lang.String translateVaadinUri(java.lang.String uidlUri)
Translates custom protocols in UIDL URI's to be recognizable by browser. All uri's from UIDL should be routed via this method before giving them to browser due URI's in UIDL may contain custom protocols like theme://.

Parameters:
uidlUri - Vaadin URI from uidl
Returns:
translated URI ready for browser

getThemeUri

public java.lang.String getThemeUri()
Gets the URI for the current theme. Can be used to reference theme resources.

Returns:
URI to the current theme

getUidlSecurityKey

protected java.lang.String getUidlSecurityKey()

getCsrfToken

public java.lang.String getCsrfToken()
Gets the token (aka double submit cookie) that the server uses to protect against Cross Site Request Forgery attacks.

Returns:
the CSRF token string

captionSizeUpdated

@Deprecated
public void captionSizeUpdated(Widget widget)
Deprecated. As of 7.0.2, has not had any effect for a long time

Use to notify that the given component's caption has changed; layouts may have to be recalculated.

Parameters:
component - the Paintable whose caption has changed

getUIConnector

public UIConnector getUIConnector()
Gets the main view

Returns:
the main view

getConfiguration

public ApplicationConfiguration getConfiguration()
Gets the ApplicationConfiguration for the current application.

Returns:
the configuration for this application
See Also:
ApplicationConfiguration

hasEventListeners

@Deprecated
public boolean hasEventListeners(ComponentConnector paintable,
                                            java.lang.String eventIdentifier)
Deprecated. As of 7.0. Use AbstractComponentState#hasEventListener(String) instead

Checks if there is a registered server side listener for the event. The list of events which has server side listeners is updated automatically before the component is updated so the value is correct if called from updatedFromUIDL.

Parameters:
paintable - The connector to register event listeners for
eventIdentifier - The identifier for the event
Returns:
true if at least one listener has been registered on server side for the event identified by eventIdentifier.

addGetParameters

public static java.lang.String addGetParameters(java.lang.String uri,
                                                java.lang.String extraParams)
Adds the get parameters to the uri and returns the new uri that contains the parameters.

Parameters:
uri - 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.
Returns:
The modified URI with the get parameters in extraParams added.

unregisterPaintable

@Deprecated
public void unregisterPaintable(ServerConnector p)
Deprecated. As of 7.0. No longer serves any purpose.


getVTooltip

public VTooltip getVTooltip()
Get VTooltip instance related to application connection

Returns:
VTooltip instance

updateComponent

@Deprecated
public boolean updateComponent(Widget component,
                                          UIDL uidl,
                                          boolean manageCaption)
Deprecated. As of 7.0, no longer serves any purpose

Method provided for backwards compatibility. Duties previously done by this method is now handled by the state change event handler in AbstractComponentConnector. The only function this method has is to return true if the UIDL is a "cached" update.

Parameters:
component -
uidl -
manageCaption -
Returns:

hasEventListeners

@Deprecated
public boolean hasEventListeners(Widget widget,
                                            java.lang.String eventIdentifier)
Deprecated. As of 7.0. Use AbstractConnector.hasEventListener(String) instead


scheduleHeartbeat

@Deprecated
protected void scheduleHeartbeat()
Deprecated. as of 7.2, use Heartbeat.schedule() instead

Schedules a heartbeat request to occur after the configured heartbeat interval elapses if the interval is a positive number. Otherwise, does nothing.


sendHeartbeat

@Deprecated
protected void sendHeartbeat()
Deprecated. as of 7.2, use Heartbeat.send() instead

Sends a heartbeat request to the server.

Heartbeat 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.


suspendReponseHandling

public void suspendReponseHandling(java.lang.Object lock)
This method can be used to postpone rendering of a response for a short period of time (e.g. to avoid the rendering process during animation).

Parameters:
lock -

resumeResponseHandling

public void resumeResponseHandling(java.lang.Object lock)
Resumes the rendering process once all locks have been removed.

Parameters:
lock -

setCommunicationErrorDelegate

public void setCommunicationErrorDelegate(ApplicationConnection.CommunicationErrorHandler delegate)
Sets the delegate that is called whenever a communication error occurrs.

Parameters:
delegate - the delegate.

setApplicationRunning

public void setApplicationRunning(boolean running)

isApplicationRunning

public boolean isApplicationRunning()

addHandler

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)

fireEvent

public void fireEvent(com.google.gwt.event.shared.GwtEvent<?> event)
Specified by:
fireEvent in interface com.google.gwt.event.shared.HasHandlers

flushActiveConnector

public void flushActiveConnector()
Calls ComponentConnector.flush() on the active connector. Does nothing if there is no active (focused) connector.


setPushEnabled

public void setPushEnabled(boolean enabled)
Sets the status for the push connection.

Parameters:
enabled - true to enable the push connection; false to disable the push connection.

handlePushMessage

public void handlePushMessage(java.lang.String message)

getCommunicationMethodName

public java.lang.String getCommunicationMethodName()
Returns a human readable string representation of the method used to communicate with the server.

Returns:
A string representation of the current transport type
Since:
7.1

getHeartbeat

public Heartbeat getHeartbeat()
Returns the hearbeat instance.



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