Change-Id: Ifd93251fdc20b93ad276c551796557bb9026766atags/7.6.0.alpha7
} | } | ||||
/** | /** | ||||
* | |||||
* @since 7.6 | |||||
* @param c | * @param c | ||||
*/ | */ | ||||
public static void runWhenDependenciesLoaded(Command c) { | public static void runWhenDependenciesLoaded(Command c) { |
import com.google.gwt.user.client.ui.HasWidgets; | import com.google.gwt.user.client.ui.HasWidgets; | ||||
import com.google.gwt.user.client.ui.Widget; | import com.google.gwt.user.client.ui.Widget; | ||||
import com.vaadin.client.ApplicationConfiguration.ErrorMessage; | import com.vaadin.client.ApplicationConfiguration.ErrorMessage; | ||||
import com.vaadin.client.ApplicationConnection.ApplicationStoppedEvent; | |||||
import com.vaadin.client.ResourceLoader.ResourceLoadEvent; | import com.vaadin.client.ResourceLoader.ResourceLoadEvent; | ||||
import com.vaadin.client.ResourceLoader.ResourceLoadListener; | import com.vaadin.client.ResourceLoader.ResourceLoadListener; | ||||
import com.vaadin.client.communication.ConnectionStateHandler; | import com.vaadin.client.communication.ConnectionStateHandler; | ||||
* Sets a resource that has been pre-loaded via UIDL, such as custom | * Sets a resource that has been pre-loaded via UIDL, such as custom | ||||
* layouts. | * layouts. | ||||
* | * | ||||
* @since 7.6 | |||||
* @param name | * @param name | ||||
* identifier of the resource to Set | * identifier of the resource to Set | ||||
* @param resource | * @param resource | ||||
/** | /** | ||||
* Gets the server RPC queue for this application | * Gets the server RPC queue for this application | ||||
* | * | ||||
* @since 7.6 | |||||
* @return the server RPC queue | * @return the server RPC queue | ||||
*/ | */ | ||||
public ServerRpcQueue getServerRpcQueue() { | public ServerRpcQueue getServerRpcQueue() { | ||||
/** | /** | ||||
* Gets the communication error handler for this application | * Gets the communication error handler for this application | ||||
* | * | ||||
* @since 7.6 | |||||
* @return the server RPC queue | * @return the server RPC queue | ||||
*/ | */ | ||||
public ConnectionStateHandler getConnectionStateHandler() { | public ConnectionStateHandler getConnectionStateHandler() { | ||||
/** | /** | ||||
* Gets the (server to client) message handler for this application | * Gets the (server to client) message handler for this application | ||||
* | * | ||||
* @since 7.6 | |||||
* @return the message handler | * @return the message handler | ||||
*/ | */ | ||||
public MessageHandler getMessageHandler() { | public MessageHandler getMessageHandler() { | ||||
/** | /** | ||||
* Gets the server rpc manager for this application | * Gets the server rpc manager for this application | ||||
* | * | ||||
* @since 7.6 | |||||
* @return the server rpc manager | * @return the server rpc manager | ||||
*/ | */ | ||||
public RpcManager getRpcManager() { | public RpcManager getRpcManager() { | ||||
/** | /** | ||||
* Gets the (client to server) message sender for this application | * Gets the (client to server) message sender for this application | ||||
* | * | ||||
* @since 7.6 | |||||
* @return the message sender | * @return the message sender | ||||
*/ | */ | ||||
public MessageSender getMessageSender() { | public MessageSender getMessageSender() { | ||||
} | } | ||||
/** | /** | ||||
* @since 7.6 | |||||
* @return the widget set | * @return the widget set | ||||
*/ | */ | ||||
public WidgetSet getWidgetSet() { | public WidgetSet getWidgetSet() { |
* | * | ||||
* Returns NaN if the property cannot be converted to a double | * Returns NaN if the property cannot be converted to a double | ||||
* | * | ||||
* @since 7.5.1 | |||||
* @param name | * @param name | ||||
* the property to retrieve | * the property to retrieve | ||||
* @return the double value of the property | * @return the double value of the property |
* -1 is returned if the element has not been measured. If 0 is returned, it | * -1 is returned if the element has not been measured. If 0 is returned, it | ||||
* might indicate that the element is not attached to the DOM. | * might indicate that the element is not attached to the DOM. | ||||
* | * | ||||
* @since 7.5.1 | |||||
* @param element | * @param element | ||||
* the element to get the measured size for | * the element to get the measured size for | ||||
* @return the measured outer height (including margins, paddings and | * @return the measured outer height (including margins, paddings and | ||||
* The value returned by this method is always rounded up. To get the exact | * The value returned by this method is always rounded up. To get the exact | ||||
* outer width, use {@link #getOuterWidthDouble(Element)} | * outer width, use {@link #getOuterWidthDouble(Element)} | ||||
* | * | ||||
* @since 7.5.1 | |||||
* @param element | * @param element | ||||
* the element to get the measured size for | * the element to get the measured size for | ||||
* @return the measured outer width (including margins, paddings and | * @return the measured outer width (including margins, paddings and | ||||
* -1 is returned if the element has not been measured. If 0 is returned, it | * -1 is returned if the element has not been measured. If 0 is returned, it | ||||
* might indicate that the element is not attached to the DOM. | * might indicate that the element is not attached to the DOM. | ||||
* | * | ||||
* @since 7.5.1 | |||||
* @param element | * @param element | ||||
* the element to get the measured size for | * the element to get the measured size for | ||||
* @return the measured inner height (excluding margins, paddings and | * @return the measured inner height (excluding margins, paddings and | ||||
* -1 is returned if the element has not been measured. If 0 is returned, it | * -1 is returned if the element has not been measured. If 0 is returned, it | ||||
* might indicate that the element is not attached to the DOM. | * might indicate that the element is not attached to the DOM. | ||||
* | * | ||||
* @since 7.5.1 | |||||
* @param element | * @param element | ||||
* the element to get the measured size for | * the element to get the measured size for | ||||
* @return the measured inner width (excluding margins, paddings and | * @return the measured inner width (excluding margins, paddings and |
* Returns time relative to the particular page load time. The value should | * Returns time relative to the particular page load time. The value should | ||||
* not be used directly but rather difference between two values returned by | * not be used directly but rather difference between two values returned by | ||||
* this method should be used to compare measurements. | * this method should be used to compare measurements. | ||||
* | |||||
* @since 7.6 | |||||
*/ | */ | ||||
public static double getRelativeTimeMillis() { | public static double getRelativeTimeMillis() { | ||||
return RELATIVE_TIME_SUPPLIER.getRelativeTime(); | return RELATIVE_TIME_SUPPLIER.getRelativeTime(); |
/** | /** | ||||
* Round {@code num} up to {@code exp} decimal positions. | * Round {@code num} up to {@code exp} decimal positions. | ||||
* | |||||
* @since 7.6 | |||||
*/ | */ | ||||
public static native double round(double num, int exp) | public static native double round(double num, int exp) | ||||
/*-{ | /*-{ |
* Gets the border-box width for the given element, i.e. element width + | * Gets the border-box width for the given element, i.e. element width + | ||||
* border + padding. | * border + padding. | ||||
* | * | ||||
* @since 7.5.1 | |||||
* @param element | * @param element | ||||
* The element to check | * The element to check | ||||
* @return The border-box width for the element | * @return The border-box width for the element | ||||
* Gets the border-box height for the given element, i.e. element height + | * Gets the border-box height for the given element, i.e. element height + | ||||
* border + padding. | * border + padding. | ||||
* | * | ||||
* @since 7.5.1 | |||||
* @param element | * @param element | ||||
* The element to check | * The element to check | ||||
* @return The border-box height for the element | * @return The border-box height for the element |
* overridden to provide extra information through an alternative RPC | * overridden to provide extra information through an alternative RPC | ||||
* interface. | * interface. | ||||
* | * | ||||
* @since | |||||
* @since 7.6 | |||||
* @param event | * @param event | ||||
*/ | */ | ||||
protected void sendContextClickEvent(ContextMenuEvent event) { | protected void sendContextClickEvent(ContextMenuEvent event) { |
* If both message and caption are null, redirects the user to the url | * If both message and caption are null, redirects the user to the url | ||||
* immediately | * immediately | ||||
* | * | ||||
* @since 7.5.1 | |||||
* @param connection | * @param connection | ||||
* A reference to the ApplicationConnection | * A reference to the ApplicationConnection | ||||
* @param caption | * @param caption |
* | * | ||||
* When using this constructor, the layout and widget must be set before any | * When using this constructor, the layout and widget must be set before any | ||||
* other operations are performed on the slot. | * other operations are performed on the slot. | ||||
* | |||||
* @since 7.6 | |||||
*/ | */ | ||||
public Slot() { | public Slot() { | ||||
setStyleName(SLOT_CLASSNAME); | setStyleName(SLOT_CLASSNAME); |
* Context click event fired by a {@link Component}. ContextClickEvent happens | * Context click event fired by a {@link Component}. ContextClickEvent happens | ||||
* when context click happens on the client-side inside the Component. | * when context click happens on the client-side inside the Component. | ||||
* | * | ||||
* @since | |||||
* @since 7.6 | |||||
* @author Vaadin Ltd | * @author Vaadin Ltd | ||||
*/ | */ | ||||
public class ContextClickEvent extends ClickEvent { | public class ContextClickEvent extends ClickEvent { |
* Checks if the current thread has exclusive access to this VaadinSession | * Checks if the current thread has exclusive access to this VaadinSession | ||||
* | * | ||||
* @return true if the thread has exclusive access, false otherwise | * @return true if the thread has exclusive access, false otherwise | ||||
* @since | |||||
* @since 7.1 | |||||
*/ | */ | ||||
public boolean hasLock() { | public boolean hasLock() { | ||||
ReentrantLock l = ((ReentrantLock) getLockInstance()); | ReentrantLock l = ((ReentrantLock) getLockInstance()); | ||||
* WrappedSession. | * WrappedSession. | ||||
* | * | ||||
* @return true if this thread has exclusive access, false otherwise | * @return true if this thread has exclusive access, false otherwise | ||||
* @since | |||||
* @since 7.6 | |||||
*/ | */ | ||||
protected static boolean hasLock(VaadinService service, | protected static boolean hasLock(VaadinService service, | ||||
WrappedSession session) { | WrappedSession session) { |
/** | /** | ||||
* Tests whether the user is using Edge. | * Tests whether the user is using Edge. | ||||
* | * | ||||
* @since 7.5.3 | |||||
* @return true if the user is using Edge, false if the user is not using | * @return true if the user is using Edge, false if the user is not using | ||||
* Edge or if no information on the browser is present | * Edge or if no information on the browser is present | ||||
*/ | */ |
* @see PortletSession#PORTLET_SCOPE | * @see PortletSession#PORTLET_SCOPE | ||||
* @see PortletSession#APPLICATION_SCOPE | * @see PortletSession#APPLICATION_SCOPE | ||||
* | * | ||||
* @since | |||||
* @since 7.6 | |||||
*/ | */ | ||||
public Object getAttribute(String name, int scope) { | public Object getAttribute(String name, int scope) { | ||||
return session.getAttribute(name, scope); | return session.getAttribute(name, scope); | ||||
* @see PortletSession#PORTLET_SCOPE | * @see PortletSession#PORTLET_SCOPE | ||||
* @see PortletSession#APPLICATION_SCOPE | * @see PortletSession#APPLICATION_SCOPE | ||||
* | * | ||||
* @since | |||||
* @since 7.6 | |||||
*/ | */ | ||||
public void setAttribute(String name, Object value, int scope) { | public void setAttribute(String name, Object value, int scope) { | ||||
session.setAttribute(name, value, scope); | session.setAttribute(name, value, scope); | ||||
* | * | ||||
* @see PortletSession#getAttributeNames() | * @see PortletSession#getAttributeNames() | ||||
* | * | ||||
* @since | |||||
* @since 7.6 | |||||
*/ | */ | ||||
public Set<String> getAttributeNames(int scope) { | public Set<String> getAttributeNames(int scope) { | ||||
return WrappedHttpSession.enumerationToSet(session | return WrappedHttpSession.enumerationToSet(session | ||||
* @see PortletSession#PORTLET_SCOPE | * @see PortletSession#PORTLET_SCOPE | ||||
* @see PortletSession#APPLICATION_SCOPE | * @see PortletSession#APPLICATION_SCOPE | ||||
* | * | ||||
* @since | |||||
* @since 7.6 | |||||
*/ | */ | ||||
public void removeAttribute(String name, int scope) { | public void removeAttribute(String name, int scope) { | ||||
session.removeAttribute(name, scope); | session.removeAttribute(name, scope); |
* timeout to a value smaller than the proxy timeout so that the server is | * timeout to a value smaller than the proxy timeout so that the server is | ||||
* aware of a reconnect taking place. | * aware of a reconnect taking place. | ||||
* | * | ||||
* @since 7.6 | |||||
* @param suspendTimeout | * @param suspendTimeout | ||||
* the timeout to use for suspended AtmosphereResources | * the timeout to use for suspended AtmosphereResources | ||||
*/ | */ | ||||
/** | /** | ||||
* Gets the timeout used for suspend calls when using long polling. | * Gets the timeout used for suspend calls when using long polling. | ||||
* | * | ||||
* @since 7.6 | |||||
* @return the timeout to use for suspended AtmosphereResources | * @return the timeout to use for suspended AtmosphereResources | ||||
*/ | */ | ||||
public int getLongPollingSuspendTimeout() { | public int getLongPollingSuspendTimeout() { |
/** | /** | ||||
* Gets the id of the client to server message | * Gets the id of the client to server message | ||||
* | * | ||||
* @since 7.6 | |||||
* @return the server message id | * @return the server message id | ||||
*/ | */ | ||||
public int getClientToServerId() { | public int getClientToServerId() { |
/** | /** | ||||
* Sets the value of the field. | * Sets the value of the field. | ||||
* | * | ||||
* @since | |||||
* @since 7.5.7 | |||||
* @param newFieldValue | * @param newFieldValue | ||||
* the New value of the field. | * the New value of the field. | ||||
* @param repaintIsNotNeeded | * @param repaintIsNotNeeded |
* multiselect mode all collections of id:s can be assigned. | * multiselect mode all collections of id:s can be assigned. | ||||
* </p> | * </p> | ||||
* | * | ||||
* @since 7.5.7 | |||||
* @param newValue | * @param newValue | ||||
* the New selected item or collection of selected items. | * the New selected item or collection of selected items. | ||||
* @param repaintIsNotNeeded | * @param repaintIsNotNeeded |
/** | /** | ||||
* ContextClickEvent for the Grid Component. | * ContextClickEvent for the Grid Component. | ||||
* | * | ||||
* @since | |||||
* @since 7.6 | |||||
*/ | */ | ||||
public static class GridContextClickEvent extends ContextClickEvent { | public static class GridContextClickEvent extends ContextClickEvent { | ||||
/** | /** | ||||
* Abstract base class for Grid header and footer sections. | * Abstract base class for Grid header and footer sections. | ||||
* | * | ||||
* @since 7.6 | |||||
* @param <ROWTYPE> | * @param <ROWTYPE> | ||||
* the type of the rows in the section | * the type of the rows in the section | ||||
*/ | */ | ||||
* given converter and renderer. This method is public only for testing | * given converter and renderer. This method is public only for testing | ||||
* purposes. | * purposes. | ||||
* | * | ||||
* @since 7.6 | |||||
* @param renderer | * @param renderer | ||||
* the renderer to use | * the renderer to use | ||||
* @param converter | * @param converter |
* This is only used when overriding the URL to use. Setting this to null | * This is only used when overriding the URL to use. Setting this to null | ||||
* (the default) will use the default URL. | * (the default) will use the default URL. | ||||
* | * | ||||
* @since | |||||
* @since 7.6 | |||||
* @param pushUrl | * @param pushUrl | ||||
* The push URL to use | * The push URL to use | ||||
*/ | */ | ||||
* This is only used when overriding the URL to use. Returns null (the | * This is only used when overriding the URL to use. Returns null (the | ||||
* default) when the default URL is used. | * default) when the default URL is used. | ||||
* | * | ||||
* @since | |||||
* @since 7.6 | |||||
* @return the URL to use for push requests, or null to use to default | * @return the URL to use for push requests, or null to use to default | ||||
*/ | */ | ||||
public String getPushUrl(); | public String getPushUrl(); |
} | } | ||||
/** | /** | ||||
* This event is fired when the collapse state of a column changes | |||||
* This event is fired when the collapse state of a column changes. | |||||
* | |||||
* @since 7.6 | |||||
*/ | */ | ||||
public static class ColumnCollapseEvent extends Component.Event { | public static class ColumnCollapseEvent extends Component.Event { | ||||
/** | /** | ||||
* Interface for listening to column collapse events. | * Interface for listening to column collapse events. | ||||
* | |||||
* @since 7.6 | |||||
*/ | */ | ||||
public interface ColumnCollapseListener extends Serializable { | public interface ColumnCollapseListener extends Serializable { | ||||
* Adds a column collapse listener to the Table. A column collapse listener | * Adds a column collapse listener to the Table. A column collapse listener | ||||
* is called when the collapsed state of a column changes. | * is called when the collapsed state of a column changes. | ||||
* | * | ||||
* @since 7.6 | |||||
* | |||||
* @param listener | * @param listener | ||||
* The listener to attach | * The listener to attach | ||||
*/ | */ | ||||
/** | /** | ||||
* Removes a column reorder listener from the Table. | * Removes a column reorder listener from the Table. | ||||
* | |||||
* | |||||
* @since 7.6 | |||||
* @param listener | * @param listener | ||||
* The listener to remove | * The listener to remove | ||||
*/ | */ |
* <code>false</code>, the content is passed to the browser as plain text. | * <code>false</code>, the content is passed to the browser as plain text. | ||||
* The default setting is <code>false</code> | * The default setting is <code>false</code> | ||||
* | * | ||||
* @since | |||||
* @since 7.6 | |||||
* @param htmlContentAllowed | * @param htmlContentAllowed | ||||
* <code>true</code> if the captions are used as html, | * <code>true</code> if the captions are used as html, | ||||
* <code>false</code> if used as plain text | * <code>false</code> if used as plain text | ||||
/** | /** | ||||
* Checks whether captions are interpreted as html or plain text. | * Checks whether captions are interpreted as html or plain text. | ||||
* | * | ||||
* @since | |||||
* @since 7.6 | |||||
* @return <code>true</code> if the captions are displayed as html, | * @return <code>true</code> if the captions are displayed as html, | ||||
* <code>false</code> if displayed as plain text | * <code>false</code> if displayed as plain text | ||||
* @see #setHtmlContentAllowed(boolean) | * @see #setHtmlContentAllowed(boolean) |
* unencodes more characters than {@link #encodeForTextNode(String)} encodes | * unencodes more characters than {@link #encodeForTextNode(String)} encodes | ||||
* </p> | * </p> | ||||
* | * | ||||
* @since | |||||
* @since 7.6 | |||||
* @param input | * @param input | ||||
* @return | * @return | ||||
*/ | */ |
/** | /** | ||||
* The name of the parameter used to transmit the id of the client to server | * The name of the parameter used to transmit the id of the client to server | ||||
* messages. | * messages. | ||||
* | |||||
* @since 7.6 | |||||
*/ | */ | ||||
public static final String CLIENT_TO_SERVER_ID = "clientId"; | public static final String CLIENT_TO_SERVER_ID = "clientId"; | ||||
/** | /** | ||||
* The name of the parameter used for sending the widget set version to the | * The name of the parameter used for sending the widget set version to the | ||||
* server | * server | ||||
* | |||||
* @since 7.6 | |||||
*/ | */ | ||||
public static final String WIDGETSET_VERSION_ID = "wsver"; | public static final String WIDGETSET_VERSION_ID = "wsver"; | ||||
/** | /** | ||||
* Client-to-server RPC interface for context click events | * Client-to-server RPC interface for context click events | ||||
* | * | ||||
* @since | |||||
* @since 7.6 | |||||
* @author Vaadin Ltd | * @author Vaadin Ltd | ||||
*/ | */ | ||||
public interface ContextClickRpc extends ServerRpc { | public interface ContextClickRpc extends ServerRpc { |
/** | /** | ||||
* Tests if the browser is Edge. | * Tests if the browser is Edge. | ||||
* | * | ||||
* @since 7.5.3 | |||||
* @return true if it is Edge, false otherwise | * @return true if it is Edge, false otherwise | ||||
*/ | */ | ||||
public boolean isEdge() { | public boolean isEdge() { |
/** | /** | ||||
* Enum describing different sections of Grid. | * Enum describing different sections of Grid. | ||||
* | |||||
* @since 7.6 | |||||
*/ | */ | ||||
public enum Section { | public enum Section { | ||||
HEADER, BODY, FOOTER | HEADER, BODY, FOOTER |
/** | /** | ||||
* Informs the server that a context click has happened inside of Grid. | * Informs the server that a context click has happened inside of Grid. | ||||
* | * | ||||
* @since | |||||
* @since 7.6 | |||||
* @param rowIndex | * @param rowIndex | ||||
* index of clicked row in Grid section | * index of clicked row in Grid section | ||||
* @param rowKey | * @param rowKey |
/** | /** | ||||
* The key in which a row's description can be found | * The key in which a row's description can be found | ||||
* | * | ||||
* @since 7.6 | |||||
* @see com.vaadin.shared.data.DataProviderRpc#setRowData(int, String) | * @see com.vaadin.shared.data.DataProviderRpc#setRowData(int, String) | ||||
*/ | */ | ||||
public static final String JSONKEY_ROWDESCRIPTION = "rd"; | public static final String JSONKEY_ROWDESCRIPTION = "rd"; | ||||
/** | /** | ||||
* The key in which a cell's description can be found | * The key in which a cell's description can be found | ||||
* | * | ||||
* @since 7.6 | |||||
* @see com.vaadin.shared.data.DataProviderRpc#setRowData(int, String) | * @see com.vaadin.shared.data.DataProviderRpc#setRowData(int, String) | ||||
*/ | */ | ||||
public static final String JSONKEY_CELLDESCRIPTION = "cd"; | public static final String JSONKEY_CELLDESCRIPTION = "cd"; | ||||
/** The enabled state of the editor interface */ | /** The enabled state of the editor interface */ | ||||
public boolean editorEnabled = false; | public boolean editorEnabled = false; | ||||
/** Buffered editor mode */ | |||||
/** | |||||
* Buffered editor mode | |||||
* | |||||
* @since 7.6 | |||||
*/ | |||||
@DelegateToWidget | @DelegateToWidget | ||||
public boolean editorBuffered = true; | public boolean editorBuffered = true; | ||||
/** Whether rows and/or cells have generated descriptions (tooltips) */ | |||||
/** | |||||
* Whether rows and/or cells have generated descriptions (tooltips) | |||||
* | |||||
* @since 7.6 | |||||
*/ | |||||
public boolean hasDescriptions; | public boolean hasDescriptions; | ||||
/** The caption for the save button in the editor */ | /** The caption for the save button in the editor */ |
public class TableConstants implements Serializable { | public class TableConstants implements Serializable { | ||||
/** | /** | ||||
* Enum describing different sections of Table. | * Enum describing different sections of Table. | ||||
* | |||||
* @since 7.6 | |||||
*/ | */ | ||||
public enum Section { | public enum Section { | ||||
HEADER, BODY, FOOTER | HEADER, BODY, FOOTER |
/** | /** | ||||
* Client-to-server RPC interface for the Table component | * Client-to-server RPC interface for the Table component | ||||
* | * | ||||
* @since | |||||
* @since 7.6 | |||||
* @author Vaadin Ltd | * @author Vaadin Ltd | ||||
*/ | */ | ||||
public interface TableServerRpc extends ServerRpc { | public interface TableServerRpc extends ServerRpc { |