diff options
author | Henri Sara <henri.sara@gmail.com> | 2017-04-19 18:15:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-19 18:15:05 +0300 |
commit | 37219932b913179910fa4e0e005f9417eac93d95 (patch) | |
tree | b0fbce45bf6b1e08ef0aa0df6a1be0b509463772 /client | |
parent | 7d75f33707c5a88b65c429f34c4025910f243d35 (diff) | |
download | vaadin-framework-37219932b913179910fa4e0e005f9417eac93d95.tar.gz vaadin-framework-37219932b913179910fa4e0e005f9417eac93d95.zip |
Add/fill in missing @since tags for 8.1 (#9106)8.1.0.alpha6
Diffstat (limited to 'client')
5 files changed, 50 insertions, 45 deletions
diff --git a/client/src/main/java/com/vaadin/client/communication/MessageHandler.java b/client/src/main/java/com/vaadin/client/communication/MessageHandler.java index c9cbf5737f..53af1b141a 100644 --- a/client/src/main/java/com/vaadin/client/communication/MessageHandler.java +++ b/client/src/main/java/com/vaadin/client/communication/MessageHandler.java @@ -813,8 +813,8 @@ public class MessageHandler { JsArrayString detachedArray = detachedConnectors.dump(); for (int i = 0; i < detachedArray.length(); i++) { - ServerConnector connector = getConnectorMap().getConnector( - detachedArray.get(i)); + ServerConnector connector = getConnectorMap() + .getConnector(detachedArray.get(i)); Profiler.enter( "unregisterRemovedConnectors unregisterConnector"); @@ -1701,6 +1701,8 @@ public class MessageHandler { * establishing a push connection with the client. * * @return the push connection identifier string + * + * @since 8.1 */ public String getPushId() { return pushId; diff --git a/client/src/main/java/com/vaadin/client/connectors/grid/GridDragSourceConnector.java b/client/src/main/java/com/vaadin/client/connectors/grid/GridDragSourceConnector.java index 4511e669e6..840afec107 100644 --- a/client/src/main/java/com/vaadin/client/connectors/grid/GridDragSourceConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/grid/GridDragSourceConnector.java @@ -33,7 +33,6 @@ import com.vaadin.client.widget.escalator.RowContainer; import com.vaadin.client.widget.grid.selection.SelectionModel; import com.vaadin.client.widgets.Escalator; import com.vaadin.client.widgets.Grid; -import com.vaadin.server.Page; import com.vaadin.shared.Range; import com.vaadin.shared.ui.Connect; import com.vaadin.shared.ui.dnd.DropEffect; @@ -48,15 +47,15 @@ import elemental.json.JsonArray; import elemental.json.JsonObject; /** - * Adds HTML5 drag and drop functionality to a {@link com.vaadin.client.widgets.Grid - * Grid}'s rows. This is the client side counterpart of {@link GridDragSource}. + * Adds HTML5 drag and drop functionality to a + * {@link com.vaadin.client.widgets.Grid Grid}'s rows. This is the client side + * counterpart of {@link GridDragSource}. * * @author Vaadin Ltd - * @since + * @since 8.1 */ @Connect(GridDragSource.class) -public class GridDragSourceConnector extends - DragSourceExtensionConnector { +public class GridDragSourceConnector extends DragSourceExtensionConnector { private static final String STYLE_SUFFIX_DRAG_BADGE = "-drag-badge"; @@ -69,7 +68,7 @@ public class GridDragSourceConnector extends @Override protected void extend(ServerConnector target) { - this.gridConnector = (GridConnector) target; + gridConnector = (GridConnector) target; // Set newly added rows draggable getGridBody().setNewEscalatorRowCallback( @@ -92,9 +91,8 @@ public class GridDragSourceConnector extends Element draggedRowElement = (Element) event.getTarget(); Element badge = DOM.createSpan(); - badge.setClassName( - gridConnector.getWidget().getStylePrimaryName() + "-row" - + STYLE_SUFFIX_DRAG_BADGE); + badge.setClassName(gridConnector.getWidget().getStylePrimaryName() + + "-row" + STYLE_SUFFIX_DRAG_BADGE); badge.setInnerHTML(draggedItemKeys.size() + ""); badge.getStyle().setMarginLeft( @@ -107,7 +105,8 @@ public class GridDragSourceConnector extends draggedRowElement.appendChild(badge); - // Remove badge on the next animation frame. Drag image will still contain the badge. + // Remove badge on the next animation frame. Drag image will still + // contain the badge. AnimationScheduler.get().requestAnimationFrame(timestamp -> { badge.removeFromParent(); }, (Element) event.getTarget()); @@ -128,9 +127,8 @@ public class GridDragSourceConnector extends @Override protected String createDataTransferText(Event dragStartEvent) { - JsonArray dragData = toJsonArray( - getDraggedRows(dragStartEvent).stream().map(this::getDragData) - .collect(Collectors.toList())); + JsonArray dragData = toJsonArray(getDraggedRows(dragStartEvent).stream() + .map(this::getDragData).collect(Collectors.toList())); return dragData.toJson(); } @@ -174,8 +172,8 @@ public class GridDragSourceConnector extends DropEffect dropEffect) { // Send server RPC with dragged item keys - getRpcProxy(GridDragSourceRpc.class) - .dragEnd(dropEffect, draggedItemKeys); + getRpcProxy(GridDragSourceRpc.class).dragEnd(dropEffect, + draggedItemKeys); } /** @@ -183,9 +181,9 @@ public class GridDragSourceConnector extends * allowed and a selected row is dragged. * * @param draggedRow - * Data of dragged row. + * Data of dragged row. * @return {@code true} if multiple rows are dragged, {@code false} - * otherwise. + * otherwise. */ private boolean dragMultipleRows(JsonObject draggedRow) { SelectionModel<JsonObject> selectionModel = getGrid() @@ -208,7 +206,7 @@ public class GridDragSourceConnector extends * Get all selected rows from a subset of rows defined by {@code range}. * * @param range - * Range of indexes. + * Range of indexes. * @return List of data of all selected rows in the given range. */ private List<JsonObject> getSelectedRowsInRange(Range range) { @@ -228,7 +226,7 @@ public class GridDragSourceConnector extends * Converts a list of {@link JsonObject}s to a {@link JsonArray}. * * @param objects - * List of json objects. + * List of json objects. * @return Json array containing all json objects. */ private JsonArray toJsonArray(List<JsonObject> objects) { @@ -244,7 +242,7 @@ public class GridDragSourceConnector extends * otherwise. * * @param row - * Row data. + * Row data. * @return Drag data if present or row data otherwise. */ private JsonObject getDragData(JsonObject row) { diff --git a/client/src/main/java/com/vaadin/client/connectors/grid/GridDropTargetConnector.java b/client/src/main/java/com/vaadin/client/connectors/grid/GridDropTargetConnector.java index 7814a81208..09142e222b 100644 --- a/client/src/main/java/com/vaadin/client/connectors/grid/GridDropTargetConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/grid/GridDropTargetConnector.java @@ -43,11 +43,10 @@ import elemental.json.JsonObject; * {@link GridDropTarget}. * * @author Vaadin Ltd - * @since + * @since 8.1 */ @Connect(GridDropTarget.class) -public class GridDropTargetConnector extends - DropTargetExtensionConnector { +public class GridDropTargetConnector extends DropTargetExtensionConnector { /** * Current style name @@ -97,8 +96,8 @@ public class GridDropTargetConnector extends (NativeEvent) dropEvent); } - getRpcProxy(GridDropTargetRpc.class) - .drop(dataTransferText, rowKey, dropLocation); + getRpcProxy(GridDropTargetRpc.class).drop(dataTransferText, rowKey, + dropLocation); } private JsonObject getRowData(TableRowElement row) { @@ -120,8 +119,8 @@ public class GridDropTargetConnector extends } else if (getState().dropMode == DropMode.ON_TOP_OR_BETWEEN) { if (getRelativeY(target, event) < getState().dropThreshold) { return DropLocation.ABOVE; - } else if (target.getOffsetHeight() - getRelativeY(target, event) - < getState().dropThreshold) { + } else if (target.getOffsetHeight() + - getRelativeY(target, event) < getState().dropThreshold) { return DropLocation.BELOW; } else { return DropLocation.ON_TOP; @@ -138,8 +137,8 @@ public class GridDropTargetConnector extends @Override protected void onDragEnter(Event event) { // Generate style names for the drop target - String styleRow = - gridConnector.getWidget().getStylePrimaryName() + "-row"; + String styleRow = gridConnector.getWidget().getStylePrimaryName() + + "-row"; styleDragCenter = styleRow + STYLE_SUFFIX_DRAG_CENTER; styleDragTop = styleRow + STYLE_SUFFIX_DRAG_TOP; styleDragBottom = styleRow + STYLE_SUFFIX_DRAG_BOTTOM; diff --git a/client/src/main/java/com/vaadin/client/ui/VButton.java b/client/src/main/java/com/vaadin/client/ui/VButton.java index 6a32b32439..f872292bf6 100644 --- a/client/src/main/java/com/vaadin/client/ui/VButton.java +++ b/client/src/main/java/com/vaadin/client/ui/VButton.java @@ -424,7 +424,10 @@ public class VButton extends FocusWidget implements ClickHandler { * held down. * * @param enabled - * {@literal true} if capturing enabled, {@literal false} otherwise + * {@literal true} if capturing enabled, {@literal false} + * otherwise + * + * @since 8.1 */ public void setCapturingEnabled(boolean enabled) { capturingEnabled = enabled; @@ -434,7 +437,9 @@ public class VButton extends FocusWidget implements ClickHandler { * Returns if the widget's capturing of mouse events are enabled. * * @return {@literal true} if mouse capturing is enabled, {@literal false} - * otherwise + * otherwise + * + * @since 8.1 */ public boolean isCapturingEnabled() { return capturingEnabled; @@ -443,28 +448,28 @@ public class VButton extends FocusWidget implements ClickHandler { private static native int getHorizontalBorderAndPaddingWidth(Element elem) /*-{ // THIS METHOD IS ONLY USED FOR INTERNET EXPLORER, IT DOESN'T WORK WITH OTHERS - + var convertToPixel = function(elem, value) { // From the awesome hack by Dean Edwards // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 - + // Remember the original values var left = elem.style.left, rsLeft = elem.runtimeStyle.left; - + // Put in the new values to get a computed value out elem.runtimeStyle.left = elem.currentStyle.left; elem.style.left = value || 0; var ret = elem.style.pixelLeft; - + // Revert the changed values elem.style.left = left; elem.runtimeStyle.left = rsLeft; - + return ret; } - + var ret = 0; - + var sides = ["Right","Left"]; for(var i=0; i<2; i++) { var side = sides[i]; @@ -478,7 +483,7 @@ public class VButton extends FocusWidget implements ClickHandler { ret += parseInt(value.substr(0, value.length-2)); } } - + // Padding ------------------------------------------------------- value = elem.currentStyle["padding"+side]; if ( !/^\d+(px)?$/i.test( value ) && /^\d/.test( value ) ) { @@ -487,7 +492,7 @@ public class VButton extends FocusWidget implements ClickHandler { ret += parseInt(value.substr(0, value.length-2)); } } - + return ret; }-*/; diff --git a/client/src/main/java/com/vaadin/client/widget/escalator/RowContainer.java b/client/src/main/java/com/vaadin/client/widget/escalator/RowContainer.java index ca00ca9b63..d3247605b3 100644 --- a/client/src/main/java/com/vaadin/client/widget/escalator/RowContainer.java +++ b/client/src/main/java/com/vaadin/client/widget/escalator/RowContainer.java @@ -125,8 +125,9 @@ public interface RowContainer { * the escalator. * * @param consumer - * A Consumer function that receives the newly added table row - * elements. + * A Consumer function that receives the newly added table + * row elements. + * @since 8.1 */ public void setNewEscalatorRowCallback( Consumer<List<TableRowElement>> consumer); |