Browse Source

Revert "Output legacy locators for TestBench Recorder (#14102)."

This reverts commit f50b07abc7.

- the same issue is solved by https://dev.vaadin.com/review/#/c/4459/8

Change-Id: I6807fd48fd36791a9214d2223cabc6d4322bcba7
tags/7.4.0.beta2
Mika Murtojärvi 9 years ago
parent
commit
57d1b87d7f

+ 93
- 93
client/src/com/vaadin/client/ApplicationConnection.java View File

* This is the client side communication "engine", managing client-server * This is the client side communication "engine", managing client-server
* communication with its server side counterpart * communication with its server side counterpart
* com.vaadin.server.VaadinService. * com.vaadin.server.VaadinService.
*
*
* Client-side connectors receive updates from the corresponding server-side * Client-side connectors receive updates from the corresponding server-side
* connector (typically component) as state updates or RPC calls. The connector * connector (typically component) as state updates or RPC calls. The connector
* has the possibility to communicate back with its server side counter part * has the possibility to communicate back with its server side counter part
* through RPC calls. * through RPC calls.
*
*
* TODO document better * TODO document better
*
*
* Entry point classes (widgetsets) define <code>onModuleLoad()</code>. * Entry point classes (widgetsets) define <code>onModuleLoad()</code>.
*/ */
public class ApplicationConnection implements HasHandlers { public class ApplicationConnection implements HasHandlers {
* A string that, if found in a non-JSON response to a UIDL request, will * 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 * 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. * whitespace, and a URI, causes the browser to synchronously load the URI.
*
*
* <p> * <p>
* This allows, for instance, a servlet filter to redirect the application * This allows, for instance, a servlet filter to redirect the application
* to a custom login page when the session expires. For example: * to a custom login page when the session expires. For example:
* </p> * </p>
*
*
* <pre> * <pre>
* if (sessionExpired) { * if (sessionExpired) {
* response.setHeader(&quot;Content-Type&quot;, &quot;text/html&quot;); * response.setHeader(&quot;Content-Type&quot;, &quot;text/html&quot;);
/** /**
* Event triggered when a XHR request has finished with the status code of * Event triggered when a XHR request has finished with the status code of
* the response. * the response.
*
*
* Useful for handlers observing network failures like online/off-line * Useful for handlers observing network failures like online/off-line
* monitors. * monitors.
*/ */
/** /**
* Event triggered when a application is stopped by calling * Event triggered when a application is stopped by calling
* {@link ApplicationConnection#setApplicationRunning(false)}. * {@link ApplicationConnection#setApplicationRunning(false)}.
*
*
* To listen for the event add a {@link ApplicationStoppedHandler} by * To listen for the event add a {@link ApplicationStoppedHandler} by
* invoking * invoking
* {@link ApplicationConnection#addHandler(ApplicationConnection.ApplicationStoppedEvent.Type, ApplicationStoppedHandler)} * {@link ApplicationConnection#addHandler(ApplicationConnection.ApplicationStoppedEvent.Type, ApplicationStoppedHandler)}
* to the {@link ApplicationConnection} * to the {@link ApplicationConnection}
*
*
* @since 7.1.8 * @since 7.1.8
* @author Vaadin Ltd * @author Vaadin Ltd
*/ */
/** /**
* Called when a communication error has occurred. Returning * Called when a communication error has occurred. Returning
* <code>true</code> from this method suppresses error handling. * <code>true</code> from this method suppresses error handling.
*
*
* @param details * @param details
* A string describing the error. * A string describing the error.
* @param statusCode * @param statusCode
* A listener for listening to application stopped events. The listener can * A listener for listening to application stopped events. The listener can
* be added to a {@link ApplicationConnection} by invoking * be added to a {@link ApplicationConnection} by invoking
* {@link ApplicationConnection#addHandler(ApplicationStoppedEvent.Type, ApplicationStoppedHandler)} * {@link ApplicationConnection#addHandler(ApplicationStoppedEvent.Type, ApplicationStoppedHandler)}
*
*
* @since 7.1.8 * @since 7.1.8
* @author Vaadin Ltd * @author Vaadin Ltd
*/ */
* Triggered when the {@link ApplicationConnection} marks a previously * Triggered when the {@link ApplicationConnection} marks a previously
* running application as stopped by invoking * running application as stopped by invoking
* {@link ApplicationConnection#setApplicationRunning(false)} * {@link ApplicationConnection#setApplicationRunning(false)}
*
*
* @param event * @param event
* the event triggered by the {@link ApplicationConnection} * the event triggered by the {@link ApplicationConnection}
*/ */
* called once this application has started (first response received) or * called once this application has started (first response received) or
* failed to start. This ensures that the applications are started in order, * failed to start. This ensures that the applications are started in order,
* to avoid session-id problems. * to avoid session-id problems.
*
*
*/ */
public void start() { public void start() {
String jsonText = configuration.getUIDL(); String jsonText = configuration.getUIDL();
return componentLocator.@com.vaadin.client.componentlocator.ComponentLocator::getElementsByPathStartingAt(Ljava/lang/String;Lcom/google/gwt/dom/client/Element;)(id, element); return componentLocator.@com.vaadin.client.componentlocator.ComponentLocator::getElementsByPathStartingAt(Ljava/lang/String;Lcom/google/gwt/dom/client/Element;)(id, element);
}); });
client.getPathForElement = $entry(function(element) { client.getPathForElement = $entry(function(element) {
return componentLocator.@com.vaadin.client.componentlocator.ComponentLocator::getLegacyPathForElement(Lcom/google/gwt/dom/client/Element;)(element);
return componentLocator.@com.vaadin.client.componentlocator.ComponentLocator::getPathForElement(Lcom/google/gwt/dom/client/Element;)(element);
}); });
client.initializing = false; client.initializing = false;


* <li><code>vaadin.postRequestHooks</code> is a map of functions which gets * <li><code>vaadin.postRequestHooks</code> is a map of functions which gets
* called after each XHR made by vaadin application. Note, that it is * called after each XHR made by vaadin application. Note, that it is
* attaching js functions responsibility to create the variable like this: * attaching js functions responsibility to create the variable like this:
*
*
* <code><pre> * <code><pre>
* if(!vaadin.postRequestHooks) {vaadin.postRequestHooks = new Object();} * if(!vaadin.postRequestHooks) {vaadin.postRequestHooks = new Object();}
* postRequestHooks.myHook = function(appId) { * postRequestHooks.myHook = function(appId) {
* </pre></code> First parameter passed to these functions is the identifier * </pre></code> First parameter passed to these functions is the identifier
* of Vaadin application that made the request. * of Vaadin application that made the request.
* </ul> * </ul>
*
*
* TODO make this multi-app aware * TODO make this multi-app aware
*/ */
private native void initializeClientHooks() private native void initializeClientHooks()
/** /**
* Runs possibly registered client side post request hooks. This is expected * Runs possibly registered client side post request hooks. This is expected
* to be run after each uidl request made by Vaadin application. * to be run after each uidl request made by Vaadin application.
*
*
* @param appId * @param appId
*/ */
private static native void runPostRequestHooks(String appId) private static native void runPostRequestHooks(String appId)
/** /**
* If on Liferay and logged in, ask the client side session management * If on Liferay and logged in, ask the client side session management
* JavaScript to extend the session duration. * JavaScript to extend the session duration.
*
*
* Otherwise, Liferay client side JavaScript will explicitly expire the * Otherwise, Liferay client side JavaScript will explicitly expire the
* session even though the server side considers the session to be active. * session even though the server side considers the session to be active.
* See ticket #8305 for more information. * See ticket #8305 for more information.
/** /**
* Indicates whether or not there are currently active UIDL requests. Used * Indicates whether or not there are currently active UIDL requests. Used
* internally to sequence requests properly, seldom needed in Widgets. * internally to sequence requests properly, seldom needed in Widgets.
*
*
* @return true if there are active requests * @return true if there are active requests
*/ */
public boolean hasActiveRequest() { public boolean hasActiveRequest() {
/** /**
* Requests an analyze of layouts, to find inconsistencies. Exclusively used * Requests an analyze of layouts, to find inconsistencies. Exclusively used
* for debugging during development. * for debugging during development.
*
*
* @deprecated as of 7.1. Replaced by {@link UIConnector#analyzeLayouts()} * @deprecated as of 7.1. Replaced by {@link UIConnector#analyzeLayouts()}
*/ */
@Deprecated @Deprecated
* Sends a request to the server to print details to console that will help * Sends a request to the server to print details to console that will help
* the developer to locate the corresponding server-side connector in the * the developer to locate the corresponding server-side connector in the
* source code. * source code.
*
*
* @param serverConnector * @param serverConnector
* @deprecated as of 7.1. Replaced by * @deprecated as of 7.1. Replaced by
* {@link UIConnector#showServerDebugInfo(ServerConnector)} * {@link UIConnector#showServerDebugInfo(ServerConnector)}


/** /**
* Makes an UIDL request to the server. * Makes an UIDL request to the server.
*
*
* @param reqInvocations * @param reqInvocations
* Data containing RPC invocations and all related information. * Data containing RPC invocations and all related information.
* @param extraParams * @param extraParams
/** /**
* Sends an asynchronous or synchronous UIDL request to the server using the * Sends an asynchronous or synchronous UIDL request to the server using the
* given URI. * given URI.
*
*
* @param uri * @param uri
* The URI to use for the request. May includes GET parameters * The URI to use for the request. May includes GET parameters
* @param payload * @param payload
/** /**
* Handles received UIDL JSON text, parsing it, and passing it on to the * Handles received UIDL JSON text, parsing it, and passing it on to the
* appropriate handlers, while logging timing information. * appropriate handlers, while logging timing information.
*
*
* @param jsonText * @param jsonText
* @param statusCode * @param statusCode
*/ */


/** /**
* Sends an asynchronous UIDL request to the server using the given URI. * Sends an asynchronous UIDL request to the server using the given URI.
*
*
* @param uri * @param uri
* The URI to use for the request. May includes GET parameters * The URI to use for the request. May includes GET parameters
* @param payload * @param payload
/** /**
* Checks whether or not the CSS is loaded. By default checks the size of * Checks whether or not the CSS is loaded. By default checks the size of
* the loading indicator element. * the loading indicator element.
*
*
* @return * @return
*/ */
protected boolean isCSSLoaded() { protected boolean isCSSLoaded() {


/** /**
* Shows the communication error notification. * Shows the communication error notification.
*
*
* @param details * @param details
* Optional details for debugging. * Optional details for debugging.
* @param statusCode * @param statusCode
* The status code returned for the request * The status code returned for the request
*
*
*/ */
protected void showCommunicationError(String details, int statusCode) { protected void showCommunicationError(String details, int statusCode) {
VConsole.error("Communication error: " + details); VConsole.error("Communication error: " + details);


/** /**
* Shows the authentication error notification. * Shows the authentication error notification.
*
*
* @param details * @param details
* Optional details for debugging. * Optional details for debugging.
*/ */


/** /**
* Shows the session expiration notification. * Shows the session expiration notification.
*
*
* @param details * @param details
* Optional details for debugging. * Optional details for debugging.
*/ */


/** /**
* Shows an error notification. * Shows an error notification.
*
*
* @param details * @param details
* Optional details for debugging. * Optional details for debugging.
* @param message * @param message


/** /**
* Shows the error notification. * Shows the error notification.
*
*
* @param details * @param details
* Optional details for debugging. * Optional details for debugging.
*/ */


/** /**
* This method is called after applying uidl change set to application. * This method is called after applying uidl change set to application.
*
*
* It will clean current and queued variable change sets. And send next * It will clean current and queued variable change sets. And send next
* change set if it exists. * change set if it exists.
*/ */
/** /**
* Cleans given queue of variable changes of such changes that came from * Cleans given queue of variable changes of such changes that came from
* components that do not exist anymore. * components that do not exist anymore.
*
*
* @param variableBurst * @param variableBurst
*/ */
private void cleanVariableBurst( private void cleanVariableBurst(
* <p> * <p>
* Used by the native "client.isActive" function. * Used by the native "client.isActive" function.
* </p> * </p>
*
*
* @return true if deferred commands are (potentially) being executed, false * @return true if deferred commands are (potentially) being executed, false
* otherwise * otherwise
*/ */


/** /**
* Returns the loading indicator used by this ApplicationConnection * Returns the loading indicator used by this ApplicationConnection
*
*
* @return The loading indicator for this ApplicationConnection * @return The loading indicator for this ApplicationConnection
*/ */
public VLoadingIndicator getLoadingIndicator() { public VLoadingIndicator getLoadingIndicator() {


/** /**
* Determines whether or not the loading indicator is showing. * Determines whether or not the loading indicator is showing.
*
*
* @return true if the loading indicator is visible * @return true if the loading indicator is visible
* @deprecated As of 7.1. Use {@link #getLoadingIndicator()} and * @deprecated As of 7.1. Use {@link #getLoadingIndicator()} and
* {@link VLoadingIndicator#isVisible()}.isVisible() instead. * {@link VLoadingIndicator#isVisible()}.isVisible() instead.
* server is received. * server is received.
* <p> * <p>
* The initial id when no request has yet been processed is -1. * The initial id when no request has yet been processed is -1.
*
*
* @return and id identifying the response * @return and id identifying the response
*/ */
public int getLastResponseId() { public int getLastResponseId() {
/** /**
* Sends the state change events created while updating the state * Sends the state change events created while updating the state
* information. * information.
*
*
* This must be called after hierarchy change listeners have been * This must be called after hierarchy change listeners have been
* called. At least caption updates for the parent are strange if * called. At least caption updates for the parent are strange if
* fired from state change listeners and thus calls the parent * fired from state change listeners and thus calls the parent
* BEFORE the parent is aware of the child (through a * BEFORE the parent is aware of the child (through a
* ConnectorHierarchyChangedEvent) * ConnectorHierarchyChangedEvent)
*
*
* @param pendingStateChangeEvents * @param pendingStateChangeEvents
* The events to send * The events to send
*/ */
* Updates the connector hierarchy and returns a list of events that * Updates the connector hierarchy and returns a list of events that
* should be fired after update of the hierarchy and the state is * should be fired after update of the hierarchy and the state is
* done. * done.
*
*
* @param json * @param json
* The JSON containing the hierarchy information * The JSON containing the hierarchy information
* @return A collection of events that should be fired when update * @return A collection of events that should be fired when update


/** /**
* Adds an explicit RPC method invocation to the send queue. * Adds an explicit RPC method invocation to the send queue.
*
*
* @since 7.0 * @since 7.0
*
*
* @param invocation * @param invocation
* RPC method invocation * RPC method invocation
* @param delayed * @param delayed


/** /**
* Removes any pending invocation of the given method from the queue * Removes any pending invocation of the given method from the queue
*
*
* @param invocation * @param invocation
* The invocation to remove * The invocation to remove
*/ */
/** /**
* This method sends currently queued variable changes to server. It is * This method sends currently queued variable changes to server. It is
* called when immediate variable update must happen. * called when immediate variable update must happen.
*
*
* To ensure correct order for variable changes (due servers multithreading * To ensure correct order for variable changes (due servers multithreading
* or network), we always wait for active request to be handler before * 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 * 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. * "burst" to queue that will be purged after current request is handled.
*
*
*/ */
public void sendPendingVariableChanges() { public void sendPendingVariableChanges() {
if (!deferedSendPending) { if (!deferedSendPending) {


/** /**
* Build the variable burst and send it to server. * Build the variable burst and send it to server.
*
*
* When sync is forced, we also force sending of all pending variable-bursts * When sync is forced, we also force sending of all pending variable-bursts
* at the same time. This is ok as we can assume that DOM will never be * at the same time. This is ok as we can assume that DOM will never be
* updated after this. * updated after this.
*
*
* @param pendingInvocations * @param pendingInvocations
* List of RPC method invocations to send * List of RPC method invocations to send
*/ */
* is true, the update is sent as soon as possible. If immediate is false, * 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. * the update will be sent along with the next immediate update.
* </p> * </p>
*
*
* @param paintableId * @param paintableId
* the id of the paintable that owns the variable * the id of the paintable that owns the variable
* @param variableName * @param variableName
* is true, the update is sent as soon as possible. If immediate is false, * 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. * the update will be sent along with the next immediate update.
* </p> * </p>
*
*
* @param paintableId * @param paintableId
* the id of the paintable that owns the variable * the id of the paintable that owns the variable
* @param variableName * @param variableName
* is true, the update is sent as soon as possible. If immediate is false, * 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. * the update will be sent along with the next immediate update.
* </p> * </p>
*
*
* @param paintableId * @param paintableId
* the id of the paintable that owns the variable * the id of the paintable that owns the variable
* @param variableName * @param variableName
* is true, the update is sent as soon as possible. If immediate is false, * 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. * the update will be sent along with the next immediate update.
* </p> * </p>
*
*
* @param paintableId * @param paintableId
* the id of the paintable that owns the variable * the id of the paintable that owns the variable
* @param variableName * @param variableName
* is true, the update is sent as soon as possible. If immediate is false, * 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. * the update will be sent along with the next immediate update.
* </p> * </p>
*
*
* @param paintableId * @param paintableId
* the id of the paintable that owns the variable * the id of the paintable that owns the variable
* @param variableName * @param variableName
* is true, the update is sent as soon as possible. If immediate is false, * 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. * the update will be sent along with the next immediate update.
* </p> * </p>
*
*
* @param paintableId * @param paintableId
* the id of the paintable that owns the variable * the id of the paintable that owns the variable
* @param variableName * @param variableName
* is true, the update is sent as soon as possible. If immediate is false, * 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. * the update will be sent along with the next immediate update.
* </p> * </p>
*
*
* @param paintableId * @param paintableId
* the id of the paintable that owns the variable * the id of the paintable that owns the variable
* @param variableName * @param variableName
* is true, the update is sent as soon as possible. If immediate is false, * 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. * the update will be sent along with the next immediate update.
* </p> * </p>
*
*
* @param paintableId * @param paintableId
* the id of the paintable that owns the variable * the id of the paintable that owns the variable
* @param variableName * @param variableName


/** /**
* Sends a new value for the given paintables given variable to the server. * 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 * 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, * 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. * the update will be sent along with the next immediate update.
*
*
* A null array is sent as an empty array. * A null array is sent as an empty array.
*
*
* @param paintableId * @param paintableId
* the id of the paintable that owns the variable * the id of the paintable that owns the variable
* @param variableName * @param variableName


/** /**
* Sends a new value for the given paintables given variable to the server. * 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 * 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, * 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. </p> * the update will be sent along with the next immediate update. </p>
*
*
* A null array is sent as an empty array. * A null array is sent as an empty array.
*
*
*
*
* @param paintableId * @param paintableId
* the id of the paintable that owns the variable * the id of the paintable that owns the variable
* @param variableName * @param variableName


/** /**
* Does absolutely nothing. Replaced by {@link LayoutManager}. * Does absolutely nothing. Replaced by {@link LayoutManager}.
*
*
* @param container * @param container
* @deprecated As of 7.0, serves no purpose * @deprecated As of 7.0, serves no purpose
*/ */


/** /**
* Returns false * Returns false
*
*
* @param paintable * @param paintable
* @return false, always * @return false, always
* @deprecated As of 7.0, serves no purpose * @deprecated As of 7.0, serves no purpose


/** /**
* Returns false * Returns false
*
*
* @param paintable * @param paintable
* @return false, always * @return false, always
* @deprecated As of 7.0, serves no purpose * @deprecated As of 7.0, serves no purpose
/** /**
* Get either an existing ComponentConnector or create a new * Get either an existing ComponentConnector or create a new
* ComponentConnector with the given type and id. * ComponentConnector with the given type and id.
*
*
* If a ComponentConnector with the given id already exists, returns it. * If a ComponentConnector with the given id already exists, returns it.
* Otherwise creates and registers a new ComponentConnector of the given * Otherwise creates and registers a new ComponentConnector of the given
* type. * type.
*
*
* @param connectorId * @param connectorId
* Id of the paintable * Id of the paintable
* @param connectorType * @param connectorType
* Type of the connector, as passed from the server side * Type of the connector, as passed from the server side
*
*
* @return Either an existing ComponentConnector or a new ComponentConnector * @return Either an existing ComponentConnector or a new ComponentConnector
* of the given type * of the given type
*/ */


/** /**
* Creates a new ServerConnector with the given type and id. * Creates a new ServerConnector with the given type and id.
*
*
* Creates and registers a new ServerConnector of the given type. Should * Creates and registers a new ServerConnector of the given type. Should
* never be called with the connector id of an existing connector. * never be called with the connector id of an existing connector.
*
*
* @param connectorId * @param connectorId
* Id of the new connector * Id of the new connector
* @param connectorType * @param connectorType
* Type of the connector, as passed from the server side * Type of the connector, as passed from the server side
*
*
* @return A new ServerConnector of the given type * @return A new ServerConnector of the given type
*/ */
private ServerConnector createAndRegisterConnector(String connectorId, private ServerConnector createAndRegisterConnector(String connectorId,
/** /**
* Gets a recource that has been pre-loaded via UIDL, such as custom * Gets a recource that has been pre-loaded via UIDL, such as custom
* layouts. * layouts.
*
*
* @param name * @param name
* identifier of the resource to get * identifier of the resource to get
* @return the resource * @return the resource


/** /**
* Singleton method to get instance of app's context menu. * Singleton method to get instance of app's context menu.
*
*
* @return VContextMenu object * @return VContextMenu object
*/ */
public VContextMenu getContextMenu() { public VContextMenu getContextMenu() {


/** /**
* Gets an {@link Icon} instance corresponding to a URI. * Gets an {@link Icon} instance corresponding to a URI.
*
*
* @since 7.2 * @since 7.2
* @param uri * @param uri
* @return Icon object * @return Icon object
* Translates custom protocols in UIDL URI's to be recognizable by browser. * 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 * 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://. * to browser due URI's in UIDL may contain custom protocols like theme://.
*
*
* @param uidlUri * @param uidlUri
* Vaadin URI from uidl * Vaadin URI from uidl
* @return translated URI ready for browser * @return translated URI ready for browser
/** /**
* Gets the URI for the current theme. Can be used to reference theme * Gets the URI for the current theme. Can be used to reference theme
* resources. * resources.
*
*
* @return URI to the current theme * @return URI to the current theme
*/ */
public String getThemeUri() { public String getThemeUri() {
/** /**
* Listens for Notification hide event, and redirects. Used for system * Listens for Notification hide event, and redirects. Used for system
* messages, such as session expired. * messages, such as session expired.
*
*
*/ */
private class NotificationRedirect implements VNotification.EventListener { private class NotificationRedirect implements VNotification.EventListener {
String url; String url;
/** /**
* Gets the token (aka double submit cookie) that the server uses to protect * Gets the token (aka double submit cookie) that the server uses to protect
* against Cross Site Request Forgery attacks. * against Cross Site Request Forgery attacks.
*
*
* @return the CSRF token string * @return the CSRF token string
*/ */
public String getCsrfToken() { public String getCsrfToken() {
/** /**
* Use to notify that the given component's caption has changed; layouts may * Use to notify that the given component's caption has changed; layouts may
* have to be recalculated. * have to be recalculated.
*
*
* @param component * @param component
* the Paintable whose caption has changed * the Paintable whose caption has changed
* @deprecated As of 7.0.2, has not had any effect for a long time * @deprecated As of 7.0.2, has not had any effect for a long time


/** /**
* Gets the main view * Gets the main view
*
*
* @return the main view * @return the main view
*/ */
public UIConnector getUIConnector() { public UIConnector getUIConnector() {


/** /**
* Gets the {@link ApplicationConfiguration} for the current application. * Gets the {@link ApplicationConfiguration} for the current application.
*
*
* @see ApplicationConfiguration * @see ApplicationConfiguration
* @return the configuration for this application * @return the configuration for this application
*/ */
* list of events which has server side listeners is updated automatically * list of events which has server side listeners is updated automatically
* before the component is updated so the value is correct if called from * before the component is updated so the value is correct if called from
* updatedFromUIDL. * updatedFromUIDL.
*
*
* @param paintable * @param paintable
* The connector to register event listeners for * The connector to register event listeners for
* @param eventIdentifier * @param eventIdentifier
/** /**
* Adds the get parameters to the uri and returns the new uri that contains * Adds the get parameters to the uri and returns the new uri that contains
* the parameters. * the parameters.
*
*
* @param uri * @param uri
* The uri to which the parameters should be added. * The uri to which the parameters should be added.
* @param extraParams * @param extraParams


/** /**
* Get VTooltip instance related to application connection * Get VTooltip instance related to application connection
*
*
* @return VTooltip instance * @return VTooltip instance
*/ */
public VTooltip getVTooltip() { public VTooltip getVTooltip() {
* this method is now handled by the state change event handler in * this method is now handled by the state change event handler in
* AbstractComponentConnector. The only function this method has is to * AbstractComponentConnector. The only function this method has is to
* return true if the UIDL is a "cached" update. * return true if the UIDL is a "cached" update.
*
*
* @param component * @param component
* @param uidl * @param uidl
* @param manageCaption * @param manageCaption
* Schedules a heartbeat request to occur after the configured heartbeat * Schedules a heartbeat request to occur after the configured heartbeat
* interval elapses if the interval is a positive number. Otherwise, does * interval elapses if the interval is a positive number. Otherwise, does
* nothing. * nothing.
*
*
* @deprecated as of 7.2, use {@link Heartbeat#schedule()} instead * @deprecated as of 7.2, use {@link Heartbeat#schedule()} instead
*/ */
@Deprecated @Deprecated
* Heartbeat requests are used to inform the server that the client-side is * 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 * still alive. If the client page is closed or the connection lost, the
* server will eventually close the inactive UI. * server will eventually close the inactive UI.
*
*
* @deprecated as of 7.2, use {@link Heartbeat#send()} instead * @deprecated as of 7.2, use {@link Heartbeat#send()} instead
*/ */
@Deprecated @Deprecated
/** /**
* This method can be used to postpone rendering of a response for a short * 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). * period of time (e.g. to avoid the rendering process during animation).
*
*
* @param lock * @param lock
*/ */
public void suspendReponseHandling(Object lock) { public void suspendReponseHandling(Object lock) {


/** /**
* Resumes the rendering process once all locks have been removed. * Resumes the rendering process once all locks have been removed.
*
*
* @param lock * @param lock
*/ */
public void resumeResponseHandling(Object lock) { public void resumeResponseHandling(Object lock) {


/** /**
* Sets the delegate that is called whenever a communication error occurrs. * Sets the delegate that is called whenever a communication error occurrs.
*
*
* @param delegate * @param delegate
* the delegate. * the delegate.
*/ */


/** /**
* Gets the active connector for focused element in browser. * Gets the active connector for focused element in browser.
*
*
* @return Connector for focused element or null. * @return Connector for focused element or null.
*/ */
private ComponentConnector getActiveConnector() { private ComponentConnector getActiveConnector() {


/** /**
* Sets the status for the push connection. * Sets the status for the push connection.
*
*
* @param enabled * @param enabled
* <code>true</code> to enable the push connection; * <code>true</code> to enable the push connection;
* <code>false</code> to disable the push connection. * <code>false</code> to disable the push connection.
/** /**
* Returns a human readable string representation of the method used to * Returns a human readable string representation of the method used to
* communicate with the server. * communicate with the server.
*
*
* @since 7.1 * @since 7.1
* @return A string representation of the current transport type * @return A string representation of the current transport type
*/ */

+ 1
- 21
client/src/com/vaadin/client/componentlocator/ComponentLocator.java View File

public class ComponentLocator { public class ComponentLocator {


private final List<LocatorStrategy> locatorStrategies; private final List<LocatorStrategy> locatorStrategies;
private final LocatorStrategy legacyLocatorStrategy;


/** /**
* Reference to ApplicationConnection instance. * Reference to ApplicationConnection instance.
*/ */
public ComponentLocator(ApplicationConnection client) { public ComponentLocator(ApplicationConnection client) {
this.client = client; this.client = client;
legacyLocatorStrategy = new LegacyLocatorStrategy(client);
locatorStrategies = Arrays.asList(new VaadinFinderLocatorStrategy( locatorStrategies = Arrays.asList(new VaadinFinderLocatorStrategy(
client), legacyLocatorStrategy);
client), new LegacyLocatorStrategy(client));
} }


/** /**
return null; return null;
} }


/**
* Returns a String locator which uniquely identifies the target element.
* The returned locator is in a legacy format that is suitable for Vaadin
* TestBench Recorder. For non-legacy format, use
* {@link #getPathForElement(com.google.gwt.user.client.Element)} instead.
*
*
* @since 7.4
* @param targetElement
* The element to generate a path for.
* @return A String locator that identifies the target element or null if a
* String locator could not be created.
*/
public String getLegacyPathForElement(Element targetElement) {
return legacyLocatorStrategy
.getPathForElement(DOM.asOld(targetElement));
}

/** /**
* Locates an element using a String locator (path) which identifies a DOM * Locates an element using a String locator (path) which identifies a DOM
* element. The {@link #getPathForElement(Element)} method can be used for * element. The {@link #getPathForElement(Element)} method can be used for

Loading…
Cancel
Save