diff options
Diffstat (limited to 'client')
17 files changed, 102 insertions, 85 deletions
diff --git a/client/src/com/vaadin/DefaultWidgetSet.gwt.xml b/client/src/com/vaadin/DefaultWidgetSet.gwt.xml index 3047924ac7..01cbdc3222 100755 --- a/client/src/com/vaadin/DefaultWidgetSet.gwt.xml +++ b/client/src/com/vaadin/DefaultWidgetSet.gwt.xml @@ -10,6 +10,8 @@ <!-- Elemental is used for handling Json only --> <inherits name="elemental.Json" /> + + <inherits name="com.google.gwt.precompress.Precompress"/> <entry-point class="com.vaadin.client.ApplicationConfiguration" /> diff --git a/client/src/com/vaadin/client/DateTimeService.java b/client/src/com/vaadin/client/DateTimeService.java index 56116377cf..04006d85fb 100644 --- a/client/src/com/vaadin/client/DateTimeService.java +++ b/client/src/com/vaadin/client/DateTimeService.java @@ -498,7 +498,7 @@ public class DateTimeService { } - public static Logger getLogger() { + private static Logger getLogger() { return Logger.getLogger(DateTimeService.class.getName()); } } diff --git a/client/src/com/vaadin/client/JavaScriptConnectorHelper.java b/client/src/com/vaadin/client/JavaScriptConnectorHelper.java index d992acd8b8..a473073712 100644 --- a/client/src/com/vaadin/client/JavaScriptConnectorHelper.java +++ b/client/src/com/vaadin/client/JavaScriptConnectorHelper.java @@ -502,7 +502,7 @@ public class JavaScriptConnectorHelper { return initFunctionName; } - public static Logger getLogger() { + private static Logger getLogger() { return Logger.getLogger(JavaScriptConnectorHelper.class.getName()); } } diff --git a/client/src/com/vaadin/client/MeasuredSize.java b/client/src/com/vaadin/client/MeasuredSize.java index eeedff561f..ba8fca417b 100644 --- a/client/src/com/vaadin/client/MeasuredSize.java +++ b/client/src/com/vaadin/client/MeasuredSize.java @@ -292,7 +292,7 @@ public class MeasuredSize { return sizes1[0] != sizes2[0] || sizes1[2] != sizes2[2]; } - public static Logger getLogger() { + private static Logger getLogger() { return Logger.getLogger(MeasuredSize.class.getName()); } diff --git a/client/src/com/vaadin/client/SuperDevMode.java b/client/src/com/vaadin/client/SuperDevMode.java index 7bd759a490..c72cd73939 100644 --- a/client/src/com/vaadin/client/SuperDevMode.java +++ b/client/src/com/vaadin/client/SuperDevMode.java @@ -265,7 +265,7 @@ public class SuperDevMode { n.show(message, VNotification.CENTERED_TOP, VNotification.STYLE_SYSTEM); } - public static Logger getLogger() { + private static Logger getLogger() { return Logger.getLogger(SuperDevMode.class.getName()); } } diff --git a/client/src/com/vaadin/client/Util.java b/client/src/com/vaadin/client/Util.java index e8fbd8855b..197300f549 100644 --- a/client/src/com/vaadin/client/Util.java +++ b/client/src/com/vaadin/client/Util.java @@ -48,9 +48,9 @@ public class Util { /** * Helper method for debugging purposes. - * + * * Stops execution on firefox browsers on a breakpoint. - * + * */ @Deprecated public static void browserDebugger() { @@ -61,7 +61,7 @@ public class Util { * Helper method for a bug fix #14041. For mozilla getKeyCode return 0 for * space bar (because space is considered as char). If return 0 use * getCharCode. - * + * * @param event * @return return key code * @since 7.2.4 @@ -72,12 +72,12 @@ public class Util { } /** - * + * * Returns the topmost element of from given coordinates. - * + * * TODO fix crossplat issues clientX vs pageX. See quircksmode. Not critical * for vaadin as we scroll div istead of page. - * + * * @param x * @param y * @return the element at given coordinates @@ -92,18 +92,18 @@ public class Util { * This helper method can be called if components size have been changed * outside rendering phase. It notifies components parent about the size * change so it can react. - * + * * When using this method, developer should consider if size changes could * be notified lazily. If lazy flag is true, method will save widget and * wait for a moment until it notifies parents in chunks. This may vastly * optimize layout in various situation. Example: if component have a lot of * images their onload events may fire "layout phase" many times in a short * period. - * + * * @param widget * @param lazy * run componentSizeUpdated lazyly - * + * * @deprecated As of 7.0, use * {@link LayoutManager#setNeedsMeasure(ComponentConnector)} * instead @@ -143,7 +143,7 @@ public class Util { /** * Converts html entities to text. - * + * * @param html * @return escaped string presentation of given html */ @@ -154,7 +154,7 @@ public class Util { /** * Escapes the string so it is safe to write inside an HTML attribute. - * + * * @param attribute * The string to escape * @return An escaped version of <literal>attribute</literal>. @@ -166,9 +166,9 @@ public class Util { /** * Clones given element as in JavaScript. - * + * * Deprecate this if there appears similar method into GWT someday. - * + * * @param element * @param deep * clone child tree also @@ -275,9 +275,9 @@ public class Util { /** * Run workaround for webkits overflow auto issue. - * + * * See: our bug #2138 and https://bugs.webkit.org/show_bug.cgi?id=21462 - * + * * @param elem * with overflow auto */ @@ -291,7 +291,7 @@ public class Util { * dimension is not specified as relative it will return -1. If the shared * state does not contain width or height specifications this will return * null. - * + * * @param state * @return */ @@ -323,7 +323,7 @@ public class Util { * Checks if a and b are equals using {@link #equals(Object)}. Handles null * values as well. Does not ensure that objects are of the same type. * Assumes that the first object's equals method handle equals properly. - * + * * @param a * The first value to compare * @param b @@ -344,7 +344,7 @@ public class Util { /** * Gets the border-box width for the given element, i.e. element width + * border + padding. Always rounds up to nearest integer. - * + * * @param element * The element to check * @return The border-box width for the element @@ -357,7 +357,7 @@ public class Util { /** * Gets the border-box height for the given element, i.e. element height + * border + padding. Always rounds up to nearest integer. - * + * * @param element * The element to check * @return The border-box height for the element @@ -404,7 +404,7 @@ public class Util { /** * Detects what is currently the overflow style attribute in given element. - * + * * @param pe * the element to detect * @return true if auto or scroll @@ -420,9 +420,9 @@ public class Util { * also returned if "element" is part of its caption. If * <literal>element</literal> is not part of any child component, null is * returned. - * + * * This method returns the deepest nested VPaintableWidget. - * + * * @param client * A reference to ApplicationConnection * @param parent @@ -480,7 +480,7 @@ public class Util { /** * Will (attempt) to focus the given DOM Element. - * + * * @param el * the element to focus */ @@ -492,7 +492,7 @@ public class Util { /** * Helper method to find the nearest parent paintable instance by traversing * the DOM upwards from given element. - * + * * @param element * the element to start from */ @@ -510,7 +510,7 @@ public class Util { /** * Helper method to find first instance of given Widget type found by * traversing DOM upwards from given element. - * + * * @param element * the element where to start seeking of Widget * @param class1 @@ -524,7 +524,7 @@ public class Util { /** * Force webkit to redraw an element - * + * * @param element * The element that should be redrawn */ @@ -537,7 +537,7 @@ public class Util { * Performs a hack to trigger a re-layout in the IE8. This is usually * necessary in cases where IE8 "forgets" to update child elements when they * resize. - * + * * @param e * The element to perform the hack on */ @@ -550,7 +550,7 @@ public class Util { * Performs a hack to trigger a re-layout in the IE browser. This is usually * necessary in cases where IE "forgets" to update child elements when they * resize. - * + * * @since 7.3 * @param e * The element to perform the hack on @@ -563,9 +563,9 @@ public class Util { /** * Detaches and re-attaches the element from its parent. The element is * reattached at the same position in the DOM as it was before. - * + * * Does nothing if the element is not attached to the DOM. - * + * * @param element * The element to detach and re-attach */ @@ -581,7 +581,7 @@ public class Util { /** * Returns the index of the childElement within its parent. - * + * * @param subElement * @return */ @@ -655,7 +655,7 @@ public class Util { * Temporarily sets the {@code styleProperty} to {@code tempValue} and then * resets it to its current value. Used mainly to work around rendering * issues in IE (and possibly in other browsers) - * + * * @param element * The target element * @param styleProperty @@ -673,7 +673,7 @@ public class Util { * A helper method to return the client position from an event. Returns * position from either first changed touch (if touch event) or from the * event itself. - * + * * @param event * @return */ @@ -686,7 +686,7 @@ public class Util { * Find the element corresponding to the coordinates in the passed mouse * event. Please note that this is not always the same as the target of the * event e.g. if event capture is used. - * + * * @param event * the mouse event to get coordinates from * @return the element at the coordinates of the event @@ -701,7 +701,7 @@ public class Util { * A helper method to return the client position from an event. Returns * position from either first changed touch (if touch event) or from the * event itself. - * + * * @param event * @return */ @@ -711,7 +711,7 @@ public class Util { } /** - * + * * @see #getTouchOrMouseClientY(Event) * @param currentGwtEvent * @return @@ -723,7 +723,7 @@ public class Util { /** * @see #getTouchOrMouseClientX(Event) - * + * * @param event * @return */ @@ -750,7 +750,7 @@ public class Util { /** * Gets the currently focused element. - * + * * @return The active element or null if no active element could be found. */ @Deprecated @@ -760,7 +760,7 @@ public class Util { /** * Gets the currently focused element for Internet Explorer. - * + * * @return The currently focused element * @deprecated Use #getFocusedElement instead */ @@ -786,7 +786,7 @@ public class Util { * this method checks that this widget nor any of its parents is hidden. Can * be e.g used to check whether component should react to some events or * not. - * + * * @param widget * @return true if attached and displayed */ @@ -798,7 +798,7 @@ public class Util { /** * Scrolls an element into view vertically only. Modified version of * Element.scrollIntoView. - * + * * @param elem * The element to scroll into view */ @@ -810,7 +810,7 @@ public class Util { /** * Checks if the given event is either a touch event or caused by the left * mouse button - * + * * @param event * @return true if the event is a touch event or caused by the left mouse * button, false otherwise @@ -822,7 +822,7 @@ public class Util { /** * Performs a shallow comparison of the collections. - * + * * @param collection1 * The first collection * @param collection2 @@ -867,7 +867,7 @@ public class Util { /** * Resolve a relative URL to an absolute URL based on the current document's * location. - * + * * @param url * a string with the relative URL to resolve * @return the corresponding absolute URL as a string @@ -940,7 +940,7 @@ public class Util { /** * Convert a {@link JavaScriptObject} into a string representation. - * + * * @param json * a JavaScript object to be converted to a string * @return JSON in string representation @@ -952,7 +952,7 @@ public class Util { /** * Parse a string containing JSON into a {@link JavaScriptObject}. - * + * * @param <T> * the overlay type to expect from the parse * @param jsonAsString @@ -964,7 +964,7 @@ public class Util { return JSON.parse(jsonAsString); }-*/; - public static Logger getLogger() { + private static Logger getLogger() { return Logger.getLogger(Util.class.getName()); } } diff --git a/client/src/com/vaadin/client/VCaption.java b/client/src/com/vaadin/client/VCaption.java index 47c9309b39..ace4fd7184 100644 --- a/client/src/com/vaadin/client/VCaption.java +++ b/client/src/com/vaadin/client/VCaption.java @@ -770,7 +770,7 @@ public class VCaption extends HTML { } - public static Logger getLogger() { + private static Logger getLogger() { return Logger.getLogger(VCaption.class.getName()); } } diff --git a/client/src/com/vaadin/client/WidgetSet.java b/client/src/com/vaadin/client/WidgetSet.java index 797047367f..4402cd5b74 100644 --- a/client/src/com/vaadin/client/WidgetSet.java +++ b/client/src/com/vaadin/client/WidgetSet.java @@ -143,7 +143,7 @@ public class WidgetSet { } } - public static Logger getLogger() { + private static Logger getLogger() { return Logger.getLogger(WidgetSet.class.getName()); } } diff --git a/client/src/com/vaadin/client/communication/AtmospherePushConnection.java b/client/src/com/vaadin/client/communication/AtmospherePushConnection.java index e453ee7fcf..a81ab616cf 100644 --- a/client/src/com/vaadin/client/communication/AtmospherePushConnection.java +++ b/client/src/com/vaadin/client/communication/AtmospherePushConnection.java @@ -43,7 +43,7 @@ import elemental.json.JsonObject; /** * The default {@link PushConnection} implementation that uses Atmosphere for * handling the communication channel. - * + * * @author Vaadin Ltd * @since 7.1 */ @@ -273,9 +273,9 @@ public class AtmospherePushConnection implements PushConnection { /** * Called whenever a server push connection is established (or * re-established). - * + * * @param response - * + * * @since 7.2 */ protected void onConnect(AtmosphereResponse response) { @@ -357,7 +357,7 @@ public class AtmospherePushConnection implements PushConnection { /** * Called if the push connection fails. Atmosphere will automatically retry * the connection until successful. - * + * */ protected void onError(AtmosphereResponse response) { state = State.DISCONNECTED; @@ -588,7 +588,7 @@ public class AtmospherePushConnection implements PushConnection { return transport; } - public static Logger getLogger() { + private static Logger getLogger() { return Logger.getLogger(AtmospherePushConnection.class.getName()); } } diff --git a/client/src/com/vaadin/client/communication/RpcManager.java b/client/src/com/vaadin/client/communication/RpcManager.java index 83dd6b15bd..dfcfb47f46 100644 --- a/client/src/com/vaadin/client/communication/RpcManager.java +++ b/client/src/com/vaadin/client/communication/RpcManager.java @@ -142,7 +142,7 @@ public class RpcManager { methodInvocation.setParameters(parameters); } - public static Logger getLogger() { + private static Logger getLogger() { return Logger.getLogger(RpcManager.class.getName()); } } diff --git a/client/src/com/vaadin/client/data/AbstractRemoteDataSource.java b/client/src/com/vaadin/client/data/AbstractRemoteDataSource.java index 88977d85ec..459127c9b4 100644 --- a/client/src/com/vaadin/client/data/AbstractRemoteDataSource.java +++ b/client/src/com/vaadin/client/data/AbstractRemoteDataSource.java @@ -166,7 +166,7 @@ public abstract class AbstractRemoteDataSource<T> implements DataSource<T> { @Override public void updateRow() { int index = indexOf(row); - if (index >= 0) { + if (index >= 0 && dataChangeHandler != null) { dataChangeHandler.dataUpdated(index, 1); } } @@ -301,7 +301,7 @@ public abstract class AbstractRemoteDataSource<T> implements DataSource<T> { .partitionWith(cached); handleMissingRows(missingCachePartition[0]); handleMissingRows(missingCachePartition[2]); - } else { + } else if (dataChangeHandler != null) { dataChangeHandler.dataAvailable(cached.getStart(), cached.length()); } @@ -414,7 +414,6 @@ public abstract class AbstractRemoteDataSource<T> implements DataSource<T> { * a list of rows, starting from <code>firstRowIndex</code> */ protected void setRowData(int firstRowIndex, List<T> rowData) { - assert firstRowIndex + rowData.size() <= size(); Profiler.enter("AbstractRemoteDataSource.setRowData"); @@ -464,7 +463,10 @@ public abstract class AbstractRemoteDataSource<T> implements DataSource<T> { cached = newUsefulData; } } - dataChangeHandler.dataAvailable(cached.getStart(), cached.length()); + if (dataChangeHandler != null) { + dataChangeHandler.dataAvailable(cached.getStart(), + cached.length()); + } updatePinnedRows(rowData); } @@ -531,8 +533,9 @@ public abstract class AbstractRemoteDataSource<T> implements DataSource<T> { cached = cached.offsetBy(-removedRange.length()); } - assertDataChangeHandlerIsInjected(); - dataChangeHandler.dataRemoved(firstRowIndex, count); + if (dataChangeHandler != null) { + dataChangeHandler.dataRemoved(firstRowIndex, count); + } ensureCoverageCheck(); Profiler.leave("AbstractRemoteDataSource.removeRowData"); @@ -577,8 +580,9 @@ public abstract class AbstractRemoteDataSource<T> implements DataSource<T> { keyToIndexMap.remove(getRowKey(row)); } } - assertDataChangeHandlerIsInjected(); - dataChangeHandler.dataAdded(firstRowIndex, count); + if (dataChangeHandler != null) { + dataChangeHandler.dataAdded(firstRowIndex, count); + } ensureCoverageCheck(); Profiler.leave("AbstractRemoteDataSource.insertRowData"); @@ -724,15 +728,8 @@ public abstract class AbstractRemoteDataSource<T> implements DataSource<T> { size = newSize; dropFromCache(getCachedRange()); cached = Range.withLength(0, 0); - assertDataChangeHandlerIsInjected(); - dataChangeHandler.resetDataAndSize(newSize); - } - - private void assertDataChangeHandlerIsInjected() { - assert dataChangeHandler != null : "The dataChangeHandler was " - + "called before it was injected. Maybe you tried " - + "to manipulate the data in the DataSource's " - + "constructor instead of in overriding onAttach() " - + "and doing it there?"; + if (dataChangeHandler != null) { + dataChangeHandler.resetDataAndSize(newSize); + } } } diff --git a/client/src/com/vaadin/client/debug/internal/ConnectorInfoPanel.java b/client/src/com/vaadin/client/debug/internal/ConnectorInfoPanel.java index d26a0ee076..5269d82bd6 100644 --- a/client/src/com/vaadin/client/debug/internal/ConnectorInfoPanel.java +++ b/client/src/com/vaadin/client/debug/internal/ConnectorInfoPanel.java @@ -107,7 +107,7 @@ public class ConnectorInfoPanel extends FlowPanel { clear(); } - public static Logger getLogger() { + private static Logger getLogger() { return Logger.getLogger(ConnectorInfoPanel.class.getName()); } } diff --git a/client/src/com/vaadin/client/debug/internal/OptimizedWidgetsetPanel.java b/client/src/com/vaadin/client/debug/internal/OptimizedWidgetsetPanel.java index 5134ed3b27..d9aad9e61b 100644 --- a/client/src/com/vaadin/client/debug/internal/OptimizedWidgetsetPanel.java +++ b/client/src/com/vaadin/client/debug/internal/OptimizedWidgetsetPanel.java @@ -137,7 +137,7 @@ public class OptimizedWidgetsetPanel extends FlowPanel { return s; } - public static Logger getLogger() { + private static Logger getLogger() { return Logger.getLogger(OptimizedWidgetsetPanel.class.getName()); } } diff --git a/client/src/com/vaadin/client/ui/VMenuBar.java b/client/src/com/vaadin/client/ui/VMenuBar.java index 823861534d..c6c4b444e5 100644 --- a/client/src/com/vaadin/client/ui/VMenuBar.java +++ b/client/src/com/vaadin/client/ui/VMenuBar.java @@ -1509,13 +1509,23 @@ public class VMenuBar extends SimpleFocusablePanel implements // selection there openMenuAndFocusFirstIfPossible(getSelected()); } else { - Command command = getSelected().getCommand(); - if (command != null) { - command.execute(); - } + final Command command = getSelected().getCommand(); setSelected(null); hideParents(true); + + // #17076 keyboard selected menuitem without children: do + // not leave menu to visible ("hover open") mode + menuVisible = false; + + Scheduler.get().scheduleDeferred(new ScheduledCommand() { + @Override + public void execute() { + if (command != null) { + command.execute(); + } + } + }); } } diff --git a/client/src/com/vaadin/client/ui/dd/DDEventHandleStrategy.java b/client/src/com/vaadin/client/ui/dd/DDEventHandleStrategy.java index 9f8714ceaa..7b3203f330 100644 --- a/client/src/com/vaadin/client/ui/dd/DDEventHandleStrategy.java +++ b/client/src/com/vaadin/client/ui/dd/DDEventHandleStrategy.java @@ -31,6 +31,7 @@ import com.vaadin.client.ui.dd.VDragAndDropManager.DDManagerMediator; * The strategy could be overridden via GWT Deferred Binding mechanism. * * @author Vaadin Ltd + * @since 7.4.4 */ public class DDEventHandleStrategy { diff --git a/client/src/com/vaadin/client/ui/dd/VDragAndDropManager.java b/client/src/com/vaadin/client/ui/dd/VDragAndDropManager.java index 19004cfaa9..efca46b522 100644 --- a/client/src/com/vaadin/client/ui/dd/VDragAndDropManager.java +++ b/client/src/com/vaadin/client/ui/dd/VDragAndDropManager.java @@ -63,6 +63,8 @@ public class VDragAndDropManager { * Implementation if this interface is provided as a parameter to * DDEventHandleStrategy methods. The mediator instance allows to manage * DnD. + * + * @since 7.4.4 */ public interface DDManagerMediator { /** diff --git a/client/src/com/vaadin/client/widget/grid/datasources/ListDataSource.java b/client/src/com/vaadin/client/widget/grid/datasources/ListDataSource.java index 47e072490e..46e972b3e8 100644 --- a/client/src/com/vaadin/client/widget/grid/datasources/ListDataSource.java +++ b/client/src/com/vaadin/client/widget/grid/datasources/ListDataSource.java @@ -110,7 +110,9 @@ public class ListDataSource<T> implements DataSource<T> { @Override public void updateRow() { - changeHandler.dataUpdated(ds.indexOf(getRow()), 1); + if (changeHandler != null) { + changeHandler.dataUpdated(ds.indexOf(getRow()), 1); + } } } @@ -389,7 +391,10 @@ public class ListDataSource<T> implements DataSource<T> { throw new IllegalStateException( "Trying to fetch rows outside of array"); } - changeHandler.dataAvailable(firstRowIndex, numberOfRows); + + if (changeHandler != null) { + changeHandler.dataAvailable(firstRowIndex, numberOfRows); + } } @Override |