diff options
-rw-r--r-- | client/src/com/vaadin/client/Util.java | 126 | ||||
-rw-r--r-- | client/src/com/vaadin/client/connectors/AbstractRendererConnector.java | 2 | ||||
-rw-r--r-- | client/src/com/vaadin/client/connectors/ButtonRendererConnector.java | 4 | ||||
-rw-r--r-- | client/src/com/vaadin/client/connectors/ClickableRendererConnector.java | 4 | ||||
-rw-r--r-- | client/src/com/vaadin/client/connectors/GridConnector.java | 51 | ||||
-rw-r--r-- | client/src/com/vaadin/client/connectors/ImageRendererConnector.java | 4 | ||||
-rw-r--r-- | client/src/com/vaadin/client/connectors/ProgressBarRendererConnector.java | 2 | ||||
-rw-r--r-- | client/src/com/vaadin/client/connectors/TextRendererConnector.java | 2 | ||||
-rw-r--r-- | client/src/com/vaadin/client/connectors/UnsafeHtmlRendererConnector.java | 4 | ||||
-rw-r--r-- | client/src/com/vaadin/client/renderers/ButtonRenderer.java (renamed from client/src/com/vaadin/client/ui/grid/renderers/ButtonRenderer.java) | 4 | ||||
-rw-r--r-- | client/src/com/vaadin/client/renderers/ClickableRenderer.java (renamed from client/src/com/vaadin/client/ui/grid/renderers/ClickableRenderer.java) | 8 | ||||
-rw-r--r-- | client/src/com/vaadin/client/renderers/ComplexRenderer.java (renamed from client/src/com/vaadin/client/ui/grid/renderers/ComplexRenderer.java) | 7 | ||||
-rw-r--r-- | client/src/com/vaadin/client/renderers/DateRenderer.java (renamed from client/src/com/vaadin/client/ui/grid/renderers/DateRenderer.java) | 5 | ||||
-rw-r--r-- | client/src/com/vaadin/client/renderers/HtmlRenderer.java (renamed from client/src/com/vaadin/client/ui/grid/renderers/HtmlRenderer.java) | 6 | ||||
-rw-r--r-- | client/src/com/vaadin/client/renderers/ImageRenderer.java (renamed from client/src/com/vaadin/client/ui/grid/renderers/ImageRenderer.java) | 4 | ||||
-rw-r--r-- | client/src/com/vaadin/client/renderers/NumberRenderer.java (renamed from client/src/com/vaadin/client/ui/grid/renderers/NumberRenderer.java) | 5 | ||||
-rw-r--r-- | client/src/com/vaadin/client/renderers/ProgressBarRenderer.java (renamed from client/src/com/vaadin/client/ui/grid/renderers/ProgressBarRenderer.java) | 4 | ||||
-rw-r--r-- | client/src/com/vaadin/client/renderers/Renderer.java (renamed from client/src/com/vaadin/client/ui/grid/Renderer.java) | 5 | ||||
-rw-r--r-- | client/src/com/vaadin/client/renderers/TextRenderer.java (renamed from client/src/com/vaadin/client/ui/grid/renderers/TextRenderer.java) | 5 | ||||
-rw-r--r-- | client/src/com/vaadin/client/renderers/WidgetRenderer.java (renamed from client/src/com/vaadin/client/ui/grid/renderers/WidgetRenderer.java) | 4 | ||||
-rw-r--r-- | client/src/com/vaadin/client/ui/grid/GridColumn.java | 87 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/escalator/Cell.java (renamed from client/src/com/vaadin/client/ui/grid/Cell.java) | 2 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/escalator/ColumnConfiguration.java (renamed from client/src/com/vaadin/client/ui/grid/ColumnConfiguration.java) | 2 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/escalator/EscalatorUpdater.java (renamed from client/src/com/vaadin/client/ui/grid/EscalatorUpdater.java) | 2 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/escalator/FlyweightCell.java (renamed from client/src/com/vaadin/client/ui/grid/FlyweightCell.java) | 9 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/escalator/FlyweightRow.java (renamed from client/src/com/vaadin/client/ui/grid/FlyweightRow.java) | 21 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/escalator/PositionFunction.java (renamed from client/src/com/vaadin/client/ui/grid/PositionFunction.java) | 4 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/escalator/Row.java (renamed from client/src/com/vaadin/client/ui/grid/Row.java) | 2 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/escalator/RowContainer.java (renamed from client/src/com/vaadin/client/ui/grid/RowContainer.java) | 2 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/escalator/RowVisibilityChangeEvent.java (renamed from client/src/com/vaadin/client/ui/grid/RowVisibilityChangeEvent.java) | 2 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/escalator/RowVisibilityChangeHandler.java (renamed from client/src/com/vaadin/client/ui/grid/RowVisibilityChangeHandler.java) | 2 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/escalator/ScrollbarBundle.java (renamed from client/src/com/vaadin/client/ui/grid/ScrollbarBundle.java) | 15 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/CellReference.java | 9 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/CellStyleGenerator.java | 2 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/DataAvailableEvent.java (renamed from client/src/com/vaadin/client/ui/grid/DataAvailableEvent.java) | 2 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/DataAvailableHandler.java (renamed from client/src/com/vaadin/client/ui/grid/DataAvailableHandler.java) | 2 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/EditorRowHandler.java (renamed from client/src/com/vaadin/client/ui/grid/EditorRowHandler.java) | 18 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/GridUtil.java (renamed from client/src/com/vaadin/client/ui/grid/GridUtil.java) | 37 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/RowReference.java | 2 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/RowStyleGenerator.java | 2 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/datasources/ListDataSource.java (renamed from client/src/com/vaadin/client/ui/grid/datasources/ListDataSource.java) | 6 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/datasources/ListSorter.java (renamed from client/src/com/vaadin/client/ui/grid/datasources/ListSorter.java) | 42 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/events/AbstractGridKeyEventHandler.java (renamed from client/src/com/vaadin/client/ui/grid/events/AbstractGridKeyEventHandler.java) | 4 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/events/AbstractGridMouseEventHandler.java (renamed from client/src/com/vaadin/client/ui/grid/events/AbstractGridMouseEventHandler.java) | 4 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/events/BodyClickHandler.java (renamed from client/src/com/vaadin/client/ui/grid/events/BodyClickHandler.java) | 4 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/events/BodyKeyDownHandler.java (renamed from client/src/com/vaadin/client/ui/grid/events/BodyKeyDownHandler.java) | 4 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/events/BodyKeyPressHandler.java (renamed from client/src/com/vaadin/client/ui/grid/events/BodyKeyPressHandler.java) | 4 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/events/BodyKeyUpHandler.java (renamed from client/src/com/vaadin/client/ui/grid/events/BodyKeyUpHandler.java) | 4 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/events/FooterClickHandler.java (renamed from client/src/com/vaadin/client/ui/grid/events/FooterClickHandler.java) | 4 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/events/FooterKeyDownHandler.java (renamed from client/src/com/vaadin/client/ui/grid/events/FooterKeyDownHandler.java) | 4 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/events/FooterKeyPressHandler.java (renamed from client/src/com/vaadin/client/ui/grid/events/FooterKeyPressHandler.java) | 4 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/events/FooterKeyUpHandler.java (renamed from client/src/com/vaadin/client/ui/grid/events/FooterKeyUpHandler.java) | 4 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/events/GridClickEvent.java (renamed from client/src/com/vaadin/client/ui/grid/events/GridClickEvent.java) | 17 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/events/GridKeyDownEvent.java (renamed from client/src/com/vaadin/client/ui/grid/events/GridKeyDownEvent.java) | 17 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/events/GridKeyPressEvent.java (renamed from client/src/com/vaadin/client/ui/grid/events/GridKeyPressEvent.java) | 17 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/events/GridKeyUpEvent.java (renamed from client/src/com/vaadin/client/ui/grid/events/GridKeyUpEvent.java) | 17 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/events/HeaderClickHandler.java (renamed from client/src/com/vaadin/client/ui/grid/events/HeaderClickHandler.java) | 4 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/events/HeaderKeyDownHandler.java (renamed from client/src/com/vaadin/client/ui/grid/events/HeaderKeyDownHandler.java) | 4 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/events/HeaderKeyPressHandler.java (renamed from client/src/com/vaadin/client/ui/grid/events/HeaderKeyPressHandler.java) | 4 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/events/HeaderKeyUpHandler.java (renamed from client/src/com/vaadin/client/ui/grid/events/HeaderKeyUpHandler.java) | 4 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/events/ScrollEvent.java (renamed from client/src/com/vaadin/client/ui/grid/events/ScrollEvent.java) | 2 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/events/ScrollHandler.java (renamed from client/src/com/vaadin/client/ui/grid/events/ScrollHandler.java) | 2 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/events/SelectAllEvent.java (renamed from client/src/com/vaadin/client/ui/grid/events/SelectAllEvent.java) | 4 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/events/SelectAllHandler.java (renamed from client/src/com/vaadin/client/ui/grid/events/SelectAllHandler.java) | 2 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/selection/AbstractRowHandleSelectionModel.java (renamed from client/src/com/vaadin/client/ui/grid/selection/AbstractRowHandleSelectionModel.java) | 2 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/selection/ClickSelectHandler.java (renamed from client/src/com/vaadin/client/ui/grid/selection/ClickSelectHandler.java) | 8 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/selection/HasSelectionHandlers.java (renamed from client/src/com/vaadin/client/ui/grid/selection/HasSelectionHandlers.java) | 2 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/selection/MultiSelectionRenderer.java (renamed from client/src/com/vaadin/client/ui/grid/selection/MultiSelectionRenderer.java) | 12 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/selection/SelectionEvent.java (renamed from client/src/com/vaadin/client/ui/grid/selection/SelectionEvent.java) | 11 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/selection/SelectionHandler.java (renamed from client/src/com/vaadin/client/ui/grid/selection/SelectionHandler.java) | 2 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/selection/SelectionModel.java (renamed from client/src/com/vaadin/client/ui/grid/selection/SelectionModel.java) | 12 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/selection/SelectionModelMulti.java (renamed from client/src/com/vaadin/client/ui/grid/selection/SelectionModelMulti.java) | 10 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/selection/SelectionModelNone.java (renamed from client/src/com/vaadin/client/ui/grid/selection/SelectionModelNone.java) | 6 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/selection/SelectionModelSingle.java (renamed from client/src/com/vaadin/client/ui/grid/selection/SelectionModelSingle.java) | 9 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/selection/SpaceSelectHandler.java (renamed from client/src/com/vaadin/client/ui/grid/selection/SpaceSelectHandler.java) | 18 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/sort/Sort.java (renamed from client/src/com/vaadin/client/ui/grid/sort/Sort.java) | 17 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/sort/SortEvent.java (renamed from client/src/com/vaadin/client/ui/grid/sort/SortEvent.java) | 4 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/sort/SortHandler.java (renamed from client/src/com/vaadin/client/ui/grid/sort/SortHandler.java) | 2 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widget/grid/sort/SortOrder.java (renamed from client/src/com/vaadin/client/ui/grid/sort/SortOrder.java) | 12 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widgets/Escalator.java (renamed from client/src/com/vaadin/client/ui/grid/Escalator.java) | 83 | ||||
-rw-r--r-- | client/src/com/vaadin/client/widgets/Grid.java (renamed from client/src/com/vaadin/client/ui/grid/Grid.java) | 365 | ||||
-rw-r--r-- | client/tests/src/com/vaadin/client/ui/grid/ListDataSourceTest.java | 2 | ||||
-rw-r--r-- | server/src/com/vaadin/ui/Grid.java | 2 | ||||
-rw-r--r-- | server/src/com/vaadin/ui/renderer/Renderer.java | 2 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/widgetset/client/grid/EscalatorBasicClientFeaturesWidget.java | 10 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/widgetset/client/grid/EscalatorProxy.java | 10 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/widgetset/client/grid/GridBasicClientFeaturesWidget.java | 85 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/widgetset/client/grid/GridClientColumnRendererConnector.java | 53 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/widgetset/client/grid/GridClientDataSourcesWidget.java | 11 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/widgetset/client/grid/GridColumnAutoWidthClientWidget.java | 11 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/widgetset/client/grid/IntArrayRendererConnector.java | 4 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/widgetset/client/grid/RowAwareRendererConnector.java | 8 |
92 files changed, 684 insertions, 751 deletions
diff --git a/client/src/com/vaadin/client/Util.java b/client/src/com/vaadin/client/Util.java index 82e8e96266..fcaa187a24 100644 --- a/client/src/com/vaadin/client/Util.java +++ b/client/src/com/vaadin/client/Util.java @@ -62,9 +62,9 @@ public class Util { /** * Helper method for debugging purposes. - * + * * Stops execution on firefox browsers on a breakpoint. - * + * */ public static native void browserDebugger() /*-{ @@ -76,7 +76,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 @@ -90,12 +90,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 @@ -116,18 +116,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 @@ -177,7 +177,7 @@ public class Util { /** * Converts html entities to text. - * + * * @param html * @return escaped string presentation of given html */ @@ -195,7 +195,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>. @@ -214,9 +214,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 @@ -494,9 +494,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 */ @@ -567,7 +567,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 */ @@ -600,7 +600,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 @@ -621,7 +621,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 @@ -646,7 +646,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 @@ -743,7 +743,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 @@ -765,7 +765,7 @@ public class Util { * A simple helper method to detect "computed style" (aka style sheets + * element styles). Values returned differ a lot depending on browsers. * Always be very careful when using this. - * + * * @param el * the element from which the style property is detected * @param p @@ -800,9 +800,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 @@ -860,7 +860,7 @@ public class Util { /** * Will (attempt) to focus the given DOM Element. - * + * * @param el * the element to focus */ @@ -876,7 +876,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 */ @@ -901,7 +901,7 @@ public class Util { * {@code C} or null, depending on whether the class parameter matches. This * may also be the case with other Composite-like classes that hijack the * event handling of their child widget(s). - * + * * @param element * the element where to start seeking of Widget * @param class1 @@ -938,7 +938,7 @@ public class Util { /** * Force webkit to redraw an element - * + * * @param element * The element that should be redrawn */ @@ -956,7 +956,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 */ @@ -970,7 +970,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 @@ -984,9 +984,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 */ @@ -1021,7 +1021,7 @@ public class Util { /** * Returns the index of the childElement within its parent. - * + * * @param subElement * @return */ @@ -1097,7 +1097,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 @@ -1120,7 +1120,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 */ @@ -1136,7 +1136,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 @@ -1153,7 +1153,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 */ @@ -1166,7 +1166,7 @@ public class Util { } /** - * + * * @see #getTouchOrMouseClientY(Event) * @param currentGwtEvent * @return @@ -1177,7 +1177,7 @@ public class Util { /** * @see #getTouchOrMouseClientX(Event) - * + * * @param event * @return */ @@ -1246,7 +1246,7 @@ public class Util { /** * Gets the currently focused element. - * + * * @return The active element or null if no active element could be found. */ public native static com.google.gwt.user.client.Element getFocusedElement() @@ -1260,7 +1260,7 @@ public class Util { /** * Gets the currently focused element for Internet Explorer. - * + * * @return The currently focused element * @deprecated Use #getFocusedElement instead */ @@ -1293,7 +1293,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 */ @@ -1326,7 +1326,7 @@ public class Util { /** * Scrolls an element into view vertically only. Modified version of * Element.scrollIntoView. - * + * * @param elem * The element to scroll into view */ @@ -1361,7 +1361,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 @@ -1373,7 +1373,7 @@ public class Util { /** * Performs a shallow comparison of the collections. - * + * * @param collection1 * The first collection * @param collection2 @@ -1419,7 +1419,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 @@ -1478,10 +1478,32 @@ public class Util { }-*/; /** + * The allowed value inaccuracy when comparing two double-typed pixel + * values. + * <p> + * Since we're comparing pixels on a screen, epsilon must be less than 1. + * 0.49 was deemed a perfectly fine and beautifully round number. + */ + public static final double PIXEL_EPSILON = 0.49d; + + /** + * Compares two double values with the error margin of + * {@link #PIXEL_EPSILON} (i.e. {@value #PIXEL_EPSILON}) + * + * @param num1 + * the first value for which to compare equality + * @param num2 + * the second value for which to compare equality + */ + public static boolean pixelValuesEqual(final double num1, final double num2) { + return Math.abs(num1 - num2) <= PIXEL_EPSILON; + } + + /** * Wrap a css size value and its unit and translate back and forth to the * string representation.<br/> * Eg. 50%, 123px, ... - * + * * @since 7.2.6 * @author Vaadin Ltd */ @@ -1500,7 +1522,7 @@ public class Util { /** * Gets the unit value by its type. - * + * * @param type * the type of the unit as found in the style. * @return the unit value. @@ -1517,7 +1539,7 @@ public class Util { /** * Parse the size from string format to {@link CssSize}. - * + * * @param s * the size as string. * @return a {@link CssSize} object. @@ -1557,7 +1579,7 @@ public class Util { /** * Creates a {@link CssSize} using a value and its measurement unit. - * + * * @param value * the value. * @param unit @@ -1585,7 +1607,7 @@ public class Util { /** * Gets the value for this css size. - * + * * @return the value. */ public float getValue() { @@ -1594,7 +1616,7 @@ public class Util { /** * Gets the measurement unit for this css size. - * + * * @return the unit. */ public Unit getUnit() { @@ -1618,7 +1640,7 @@ public class Util { /** * Check whether the two sizes are equals. - * + * * @param cssSize1 * the first size to compare. * @param cssSize2 diff --git a/client/src/com/vaadin/client/connectors/AbstractRendererConnector.java b/client/src/com/vaadin/client/connectors/AbstractRendererConnector.java index 3164ea01a2..ef117ad828 100644 --- a/client/src/com/vaadin/client/connectors/AbstractRendererConnector.java +++ b/client/src/com/vaadin/client/connectors/AbstractRendererConnector.java @@ -24,7 +24,7 @@ import com.vaadin.client.metadata.NoDataException; import com.vaadin.client.metadata.Type; import com.vaadin.client.metadata.TypeData; import com.vaadin.client.metadata.TypeDataStore; -import com.vaadin.client.ui.grid.Renderer; +import com.vaadin.client.renderers.Renderer; /** * An abstract base class for renderer connectors. A renderer connector is used diff --git a/client/src/com/vaadin/client/connectors/ButtonRendererConnector.java b/client/src/com/vaadin/client/connectors/ButtonRendererConnector.java index e4f850fb48..4d09c20db2 100644 --- a/client/src/com/vaadin/client/connectors/ButtonRendererConnector.java +++ b/client/src/com/vaadin/client/connectors/ButtonRendererConnector.java @@ -17,8 +17,8 @@ package com.vaadin.client.connectors; import com.google.gwt.json.client.JSONObject; import com.google.web.bindery.event.shared.HandlerRegistration; -import com.vaadin.client.ui.grid.renderers.ButtonRenderer; -import com.vaadin.client.ui.grid.renderers.ClickableRenderer.RendererClickHandler; +import com.vaadin.client.renderers.ButtonRenderer; +import com.vaadin.client.renderers.ClickableRenderer.RendererClickHandler; import com.vaadin.shared.ui.Connect; /** diff --git a/client/src/com/vaadin/client/connectors/ClickableRendererConnector.java b/client/src/com/vaadin/client/connectors/ClickableRendererConnector.java index 07f762588f..f450e6ad62 100644 --- a/client/src/com/vaadin/client/connectors/ClickableRendererConnector.java +++ b/client/src/com/vaadin/client/connectors/ClickableRendererConnector.java @@ -18,8 +18,8 @@ package com.vaadin.client.connectors; import com.google.gwt.json.client.JSONObject; import com.google.web.bindery.event.shared.HandlerRegistration; import com.vaadin.client.MouseEventDetailsBuilder; -import com.vaadin.client.ui.grid.renderers.ClickableRenderer.RendererClickEvent; -import com.vaadin.client.ui.grid.renderers.ClickableRenderer.RendererClickHandler; +import com.vaadin.client.renderers.ClickableRenderer.RendererClickEvent; +import com.vaadin.client.renderers.ClickableRenderer.RendererClickHandler; import com.vaadin.shared.ui.grid.renderers.RendererClickRpc; /** diff --git a/client/src/com/vaadin/client/connectors/GridConnector.java b/client/src/com/vaadin/client/connectors/GridConnector.java index 56903922bd..487ed70a98 100644 --- a/client/src/com/vaadin/client/connectors/GridConnector.java +++ b/client/src/com/vaadin/client/connectors/GridConnector.java @@ -38,32 +38,31 @@ import com.vaadin.client.annotations.OnStateChange; import com.vaadin.client.communication.StateChangeEvent; import com.vaadin.client.connectors.RpcDataSourceConnector.RpcDataSource; import com.vaadin.client.data.DataSource.RowHandle; +import com.vaadin.client.renderers.Renderer; import com.vaadin.client.ui.AbstractFieldConnector; import com.vaadin.client.ui.AbstractHasComponentsConnector; import com.vaadin.client.ui.SimpleManagedLayout; -import com.vaadin.client.ui.grid.EditorRowHandler; -import com.vaadin.client.ui.grid.Grid; -import com.vaadin.client.ui.grid.Grid.FooterCell; -import com.vaadin.client.ui.grid.Grid.FooterRow; -import com.vaadin.client.ui.grid.Grid.HeaderCell; -import com.vaadin.client.ui.grid.Grid.HeaderRow; -import com.vaadin.client.ui.grid.GridColumn; -import com.vaadin.client.ui.grid.Renderer; -import com.vaadin.client.ui.grid.events.SelectAllEvent; -import com.vaadin.client.ui.grid.events.SelectAllHandler; -import com.vaadin.client.ui.grid.selection.AbstractRowHandleSelectionModel; -import com.vaadin.client.ui.grid.selection.SelectionEvent; -import com.vaadin.client.ui.grid.selection.SelectionHandler; -import com.vaadin.client.ui.grid.selection.SelectionModelMulti; -import com.vaadin.client.ui.grid.selection.SelectionModelNone; -import com.vaadin.client.ui.grid.selection.SelectionModelSingle; -import com.vaadin.client.ui.grid.sort.SortEvent; -import com.vaadin.client.ui.grid.sort.SortHandler; -import com.vaadin.client.ui.grid.sort.SortOrder; import com.vaadin.client.widget.grid.CellReference; import com.vaadin.client.widget.grid.CellStyleGenerator; +import com.vaadin.client.widget.grid.EditorRowHandler; import com.vaadin.client.widget.grid.RowReference; import com.vaadin.client.widget.grid.RowStyleGenerator; +import com.vaadin.client.widget.grid.events.SelectAllEvent; +import com.vaadin.client.widget.grid.events.SelectAllHandler; +import com.vaadin.client.widget.grid.selection.AbstractRowHandleSelectionModel; +import com.vaadin.client.widget.grid.selection.SelectionEvent; +import com.vaadin.client.widget.grid.selection.SelectionHandler; +import com.vaadin.client.widget.grid.selection.SelectionModelMulti; +import com.vaadin.client.widget.grid.selection.SelectionModelNone; +import com.vaadin.client.widget.grid.selection.SelectionModelSingle; +import com.vaadin.client.widget.grid.sort.SortEvent; +import com.vaadin.client.widget.grid.sort.SortHandler; +import com.vaadin.client.widget.grid.sort.SortOrder; +import com.vaadin.client.widgets.Grid; +import com.vaadin.client.widgets.Grid.FooterCell; +import com.vaadin.client.widgets.Grid.FooterRow; +import com.vaadin.client.widgets.Grid.HeaderCell; +import com.vaadin.client.widgets.Grid.HeaderRow; import com.vaadin.shared.ui.Connect; import com.vaadin.shared.ui.grid.EditorRowClientRpc; import com.vaadin.shared.ui.grid.EditorRowServerRpc; @@ -137,7 +136,7 @@ public class GridConnector extends AbstractHasComponentsConnector implements * Custom implementation of the custom grid column using a JSONObject to * represent the cell value and String as a column type. */ - private class CustomGridColumn extends GridColumn<Object, JSONObject> { + private class CustomGridColumn extends Grid.Column<Object, JSONObject> { private final String id; @@ -253,7 +252,7 @@ public class GridConnector extends AbstractHasComponentsConnector implements } @Override - public Widget getWidget(GridColumn<?, JSONObject> column) { + public Widget getWidget(Grid.Column<?, JSONObject> column) { assert column != null; if (column instanceof CustomGridColumn) { @@ -521,7 +520,8 @@ public class GridConnector extends AbstractHasComponentsConnector implements } for (Set<String> group : rowState.cellGroups.keySet()) { - GridColumn<?, ?>[] columns = new GridColumn<?, ?>[group.size()]; + Grid.Column<?, ?>[] columns = new Grid.Column<?, ?>[group + .size()]; CellState cellState = rowState.cellGroups.get(group); int i = 0; @@ -578,7 +578,8 @@ public class GridConnector extends AbstractHasComponentsConnector implements } for (Set<String> group : rowState.cellGroups.keySet()) { - GridColumn<?, ?>[] columns = new GridColumn<?, ?>[group.size()]; + Grid.Column<?, ?>[] columns = new Grid.Column<?, ?>[group + .size()]; CellState cellState = rowState.cellGroups.get(group); int i = 0; @@ -831,7 +832,7 @@ public class GridConnector extends AbstractHasComponentsConnector implements private native void selectByHandle(RowHandle<JSONObject> handle) /*-{ var model = this.@com.vaadin.client.connectors.GridConnector::selectionModel; - model.@com.vaadin.client.ui.grid.selection.AbstractRowHandleSelectionModel::selectByHandle(*)(handle); + model.@com.vaadin.client.widget.grid.selection.AbstractRowHandleSelectionModel::selectByHandle(*)(handle); }-*/; /** @@ -841,7 +842,7 @@ public class GridConnector extends AbstractHasComponentsConnector implements private native void deselectByHandle(RowHandle<JSONObject> handle) /*-{ var model = this.@com.vaadin.client.connectors.GridConnector::selectionModel; - model.@com.vaadin.client.ui.grid.selection.AbstractRowHandleSelectionModel::deselectByHandle(*)(handle); + model.@com.vaadin.client.widget.grid.selection.AbstractRowHandleSelectionModel::deselectByHandle(*)(handle); }-*/; /** diff --git a/client/src/com/vaadin/client/connectors/ImageRendererConnector.java b/client/src/com/vaadin/client/connectors/ImageRendererConnector.java index c5dfd97f69..c0aaad07f9 100644 --- a/client/src/com/vaadin/client/connectors/ImageRendererConnector.java +++ b/client/src/com/vaadin/client/connectors/ImageRendererConnector.java @@ -20,8 +20,8 @@ import com.google.gwt.json.client.JSONValue; import com.google.web.bindery.event.shared.HandlerRegistration; import com.vaadin.client.communication.JsonDecoder; import com.vaadin.client.metadata.TypeDataStore; -import com.vaadin.client.ui.grid.renderers.ClickableRenderer.RendererClickHandler; -import com.vaadin.client.ui.grid.renderers.ImageRenderer; +import com.vaadin.client.renderers.ImageRenderer; +import com.vaadin.client.renderers.ClickableRenderer.RendererClickHandler; import com.vaadin.shared.communication.URLReference; import com.vaadin.shared.ui.Connect; diff --git a/client/src/com/vaadin/client/connectors/ProgressBarRendererConnector.java b/client/src/com/vaadin/client/connectors/ProgressBarRendererConnector.java index c3dfa66dbd..812a729da3 100644 --- a/client/src/com/vaadin/client/connectors/ProgressBarRendererConnector.java +++ b/client/src/com/vaadin/client/connectors/ProgressBarRendererConnector.java @@ -15,7 +15,7 @@ */ package com.vaadin.client.connectors; -import com.vaadin.client.ui.grid.renderers.ProgressBarRenderer; +import com.vaadin.client.renderers.ProgressBarRenderer; import com.vaadin.shared.ui.Connect; /** diff --git a/client/src/com/vaadin/client/connectors/TextRendererConnector.java b/client/src/com/vaadin/client/connectors/TextRendererConnector.java index 53aee83497..b610b3ed55 100644 --- a/client/src/com/vaadin/client/connectors/TextRendererConnector.java +++ b/client/src/com/vaadin/client/connectors/TextRendererConnector.java @@ -15,7 +15,7 @@ */ package com.vaadin.client.connectors; -import com.vaadin.client.ui.grid.renderers.TextRenderer; +import com.vaadin.client.renderers.TextRenderer; import com.vaadin.shared.ui.Connect; /** diff --git a/client/src/com/vaadin/client/connectors/UnsafeHtmlRendererConnector.java b/client/src/com/vaadin/client/connectors/UnsafeHtmlRendererConnector.java index fd93dfd9e2..3213c49a1b 100644 --- a/client/src/com/vaadin/client/connectors/UnsafeHtmlRendererConnector.java +++ b/client/src/com/vaadin/client/connectors/UnsafeHtmlRendererConnector.java @@ -15,8 +15,8 @@ */ package com.vaadin.client.connectors; -import com.vaadin.client.ui.grid.FlyweightCell; -import com.vaadin.client.ui.grid.Renderer; +import com.vaadin.client.renderers.Renderer; +import com.vaadin.client.widget.escalator.FlyweightCell; import com.vaadin.shared.ui.Connect; /** diff --git a/client/src/com/vaadin/client/ui/grid/renderers/ButtonRenderer.java b/client/src/com/vaadin/client/renderers/ButtonRenderer.java index e054c5d1bd..718d481cbf 100644 --- a/client/src/com/vaadin/client/ui/grid/renderers/ButtonRenderer.java +++ b/client/src/com/vaadin/client/renderers/ButtonRenderer.java @@ -13,11 +13,11 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.renderers; +package com.vaadin.client.renderers; import com.google.gwt.core.shared.GWT; import com.google.gwt.user.client.ui.Button; -import com.vaadin.client.ui.grid.FlyweightCell; +import com.vaadin.client.widget.escalator.FlyweightCell; /** * A Renderer that displays buttons with textual captions. The values of the diff --git a/client/src/com/vaadin/client/ui/grid/renderers/ClickableRenderer.java b/client/src/com/vaadin/client/renderers/ClickableRenderer.java index 98638c0c58..cdea5ea1b4 100644 --- a/client/src/com/vaadin/client/ui/grid/renderers/ClickableRenderer.java +++ b/client/src/com/vaadin/client/renderers/ClickableRenderer.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.renderers; +package com.vaadin.client.renderers; import com.google.gwt.dom.client.BrowserEvents; import com.google.gwt.dom.client.Element; @@ -26,9 +26,9 @@ import com.google.gwt.event.shared.EventHandler; import com.google.gwt.event.shared.HandlerManager; import com.google.gwt.user.client.ui.Widget; import com.google.web.bindery.event.shared.HandlerRegistration; -import com.vaadin.client.ui.grid.Cell; -import com.vaadin.client.ui.grid.Grid; -import com.vaadin.client.ui.grid.GridUtil; +import com.vaadin.client.widget.escalator.Cell; +import com.vaadin.client.widget.grid.GridUtil; +import com.vaadin.client.widgets.Grid; /** * An abstract superclass for renderers that render clickable widgets. Click diff --git a/client/src/com/vaadin/client/ui/grid/renderers/ComplexRenderer.java b/client/src/com/vaadin/client/renderers/ComplexRenderer.java index e6a2293b25..ce9cede72c 100644 --- a/client/src/com/vaadin/client/ui/grid/renderers/ComplexRenderer.java +++ b/client/src/com/vaadin/client/renderers/ComplexRenderer.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.renderers; +package com.vaadin.client.renderers; import java.util.Collection; import java.util.Collections; @@ -22,9 +22,8 @@ import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.NativeEvent; import com.google.gwt.dom.client.Node; import com.google.gwt.dom.client.Style.Visibility; -import com.vaadin.client.ui.grid.Cell; -import com.vaadin.client.ui.grid.FlyweightCell; -import com.vaadin.client.ui.grid.Renderer; +import com.vaadin.client.widget.escalator.Cell; +import com.vaadin.client.widget.escalator.FlyweightCell; /** * Base class for renderers that needs initialization and destruction logic diff --git a/client/src/com/vaadin/client/ui/grid/renderers/DateRenderer.java b/client/src/com/vaadin/client/renderers/DateRenderer.java index 7fff837244..4d43969495 100644 --- a/client/src/com/vaadin/client/ui/grid/renderers/DateRenderer.java +++ b/client/src/com/vaadin/client/renderers/DateRenderer.java @@ -13,15 +13,14 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.renderers; +package com.vaadin.client.renderers; import java.util.Date; import com.google.gwt.i18n.client.TimeZone; import com.google.gwt.i18n.shared.DateTimeFormat; import com.google.gwt.i18n.shared.DateTimeFormat.PredefinedFormat; -import com.vaadin.client.ui.grid.FlyweightCell; -import com.vaadin.client.ui.grid.Renderer; +import com.vaadin.client.widget.escalator.FlyweightCell; /** * A renderer for rendering dates into cells diff --git a/client/src/com/vaadin/client/ui/grid/renderers/HtmlRenderer.java b/client/src/com/vaadin/client/renderers/HtmlRenderer.java index 23aa674423..7086c20345 100644 --- a/client/src/com/vaadin/client/ui/grid/renderers/HtmlRenderer.java +++ b/client/src/com/vaadin/client/renderers/HtmlRenderer.java @@ -13,11 +13,11 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.renderers; +package com.vaadin.client.renderers; +import com.google.gwt.safehtml.shared.SafeHtml; import com.google.gwt.safehtml.shared.SafeHtmlUtils; -import com.vaadin.client.ui.grid.FlyweightCell; -import com.vaadin.client.ui.grid.Renderer; +import com.vaadin.client.widget.escalator.FlyweightCell; /** * Renders a string as HTML into a cell. diff --git a/client/src/com/vaadin/client/ui/grid/renderers/ImageRenderer.java b/client/src/com/vaadin/client/renderers/ImageRenderer.java index 591012f9e1..09c2befcc4 100644 --- a/client/src/com/vaadin/client/ui/grid/renderers/ImageRenderer.java +++ b/client/src/com/vaadin/client/renderers/ImageRenderer.java @@ -13,11 +13,11 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.renderers; +package com.vaadin.client.renderers; import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.ui.Image; -import com.vaadin.client.ui.grid.FlyweightCell; +import com.vaadin.client.widget.escalator.FlyweightCell; /** * A renderer that renders an image into a cell. Click handlers can be added to diff --git a/client/src/com/vaadin/client/ui/grid/renderers/NumberRenderer.java b/client/src/com/vaadin/client/renderers/NumberRenderer.java index ebecb2af32..ba0bd7d5bd 100644 --- a/client/src/com/vaadin/client/ui/grid/renderers/NumberRenderer.java +++ b/client/src/com/vaadin/client/renderers/NumberRenderer.java @@ -13,11 +13,10 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.renderers; +package com.vaadin.client.renderers; import com.google.gwt.i18n.client.NumberFormat; -import com.vaadin.client.ui.grid.FlyweightCell; -import com.vaadin.client.ui.grid.Renderer; +import com.vaadin.client.widget.escalator.FlyweightCell; /** * Renders a number into a cell using a specific {@link NumberFormat}. By diff --git a/client/src/com/vaadin/client/ui/grid/renderers/ProgressBarRenderer.java b/client/src/com/vaadin/client/renderers/ProgressBarRenderer.java index 01027c2cef..fb1d7ad22f 100644 --- a/client/src/com/vaadin/client/ui/grid/renderers/ProgressBarRenderer.java +++ b/client/src/com/vaadin/client/renderers/ProgressBarRenderer.java @@ -13,11 +13,11 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.renderers; +package com.vaadin.client.renderers; import com.google.gwt.core.shared.GWT; import com.vaadin.client.ui.VProgressBar; -import com.vaadin.client.ui.grid.FlyweightCell; +import com.vaadin.client.widget.escalator.FlyweightCell; /** * A Renderer that represents a double value as a graphical progress bar. diff --git a/client/src/com/vaadin/client/ui/grid/Renderer.java b/client/src/com/vaadin/client/renderers/Renderer.java index 787a145326..cf746ec130 100644 --- a/client/src/com/vaadin/client/ui/grid/Renderer.java +++ b/client/src/com/vaadin/client/renderers/Renderer.java @@ -13,8 +13,11 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid; +package com.vaadin.client.renderers; +import com.vaadin.client.widget.escalator.Cell; +import com.vaadin.client.widget.escalator.FlyweightCell; +import com.vaadin.client.widgets.Grid; /** * Renderer for rending a value <T> into cell. diff --git a/client/src/com/vaadin/client/ui/grid/renderers/TextRenderer.java b/client/src/com/vaadin/client/renderers/TextRenderer.java index d2f3520c43..e98088ede6 100644 --- a/client/src/com/vaadin/client/ui/grid/renderers/TextRenderer.java +++ b/client/src/com/vaadin/client/renderers/TextRenderer.java @@ -13,10 +13,9 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.renderers; +package com.vaadin.client.renderers; -import com.vaadin.client.ui.grid.FlyweightCell; -import com.vaadin.client.ui.grid.Renderer; +import com.vaadin.client.widget.escalator.FlyweightCell; /** * Renderer that renders text into a cell. diff --git a/client/src/com/vaadin/client/ui/grid/renderers/WidgetRenderer.java b/client/src/com/vaadin/client/renderers/WidgetRenderer.java index 69e1133131..230de0ac00 100644 --- a/client/src/com/vaadin/client/ui/grid/renderers/WidgetRenderer.java +++ b/client/src/com/vaadin/client/renderers/WidgetRenderer.java @@ -13,12 +13,12 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.renderers; +package com.vaadin.client.renderers; import com.google.gwt.dom.client.TableCellElement; import com.google.gwt.user.client.ui.Widget; import com.vaadin.client.Util; -import com.vaadin.client.ui.grid.FlyweightCell; +import com.vaadin.client.widget.escalator.FlyweightCell; /** * A renderer for rendering widgets into cells. diff --git a/client/src/com/vaadin/client/ui/grid/GridColumn.java b/client/src/com/vaadin/client/ui/grid/GridColumn.java deleted file mode 100644 index c160984cd2..0000000000 --- a/client/src/com/vaadin/client/ui/grid/GridColumn.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2000-2014 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.vaadin.client.ui.grid; - -/** - * Represents a column in the {@link Grid}. - * - * @param <C> - * The column type - * - * @param <T> - * The row type - * - * @since - * @author Vaadin Ltd - */ -public abstract class GridColumn<C, T> extends Grid.AbstractGridColumn<C, T> { - - /* - * This class is a convenience class so you do not have to reference - * Grid.AbstractGridColumn in your production code. The real implementation - * should be in the abstract class. - */ - - /** - * Constructs a new column with a simple TextRenderer. - */ - public GridColumn() { - super(); - } - - /** - * Constructs a new column with a simple TextRenderer. - * - * @param headerText - * The header text for this column - * - * @throws IllegalArgumentException - * if given Renderer is null - */ - public GridColumn(String headerText) throws IllegalArgumentException { - super(headerText); - } - - /** - * Constructs a new column with a custom renderer. - * - * @param renderer - * The renderer to use for rendering the cells - * - * @throws IllegalArgumentException - * if given Renderer is null - */ - public GridColumn(Renderer<? super C> renderer) - throws IllegalArgumentException { - super(renderer); - } - - /** - * Constructs a new column with a custom renderer. - * - * @param renderer - * The renderer to use for rendering the cells - * @param headerText - * The header text for this column - * - * @throws IllegalArgumentException - * if given Renderer or header text is null - */ - public GridColumn(String headerText, Renderer<? super C> renderer) - throws IllegalArgumentException { - super(headerText, renderer); - } -} diff --git a/client/src/com/vaadin/client/ui/grid/Cell.java b/client/src/com/vaadin/client/widget/escalator/Cell.java index ede8bb22d0..9ee6030f32 100644 --- a/client/src/com/vaadin/client/ui/grid/Cell.java +++ b/client/src/com/vaadin/client/widget/escalator/Cell.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid; +package com.vaadin.client.widget.escalator; import com.google.gwt.dom.client.TableCellElement; diff --git a/client/src/com/vaadin/client/ui/grid/ColumnConfiguration.java b/client/src/com/vaadin/client/widget/escalator/ColumnConfiguration.java index 88f07e023f..2a58fe7f66 100644 --- a/client/src/com/vaadin/client/ui/grid/ColumnConfiguration.java +++ b/client/src/com/vaadin/client/widget/escalator/ColumnConfiguration.java @@ -14,7 +14,7 @@ * the License. */ -package com.vaadin.client.ui.grid; +package com.vaadin.client.widget.escalator; /** * A representation of the columns in an instance of {@link Escalator}. diff --git a/client/src/com/vaadin/client/ui/grid/EscalatorUpdater.java b/client/src/com/vaadin/client/widget/escalator/EscalatorUpdater.java index aae6b63d20..03587b4569 100644 --- a/client/src/com/vaadin/client/ui/grid/EscalatorUpdater.java +++ b/client/src/com/vaadin/client/widget/escalator/EscalatorUpdater.java @@ -14,7 +14,7 @@ * the License. */ -package com.vaadin.client.ui.grid; +package com.vaadin.client.widget.escalator; /** * An interface that allows client code to define how a certain row in Escalator diff --git a/client/src/com/vaadin/client/ui/grid/FlyweightCell.java b/client/src/com/vaadin/client/widget/escalator/FlyweightCell.java index fe826b16c3..031511115c 100644 --- a/client/src/com/vaadin/client/ui/grid/FlyweightCell.java +++ b/client/src/com/vaadin/client/widget/escalator/FlyweightCell.java @@ -13,14 +13,15 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid; +package com.vaadin.client.widget.escalator; import java.util.List; import com.google.gwt.dom.client.Style.Display; import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.dom.client.TableCellElement; -import com.vaadin.client.ui.grid.FlyweightRow.CellIterator; +import com.vaadin.client.widget.escalator.FlyweightRow.CellIterator; +import com.vaadin.client.widgets.Escalator; /** * A {@link FlyweightCell} represents a cell in the {@link Grid} or @@ -36,7 +37,7 @@ import com.vaadin.client.ui.grid.FlyweightRow.CellIterator; * @author Vaadin Ltd */ public class FlyweightCell { - static final String COLSPAN_ATTR = "colSpan"; + public static final String COLSPAN_ATTR = "colSpan"; private final int column; private final FlyweightRow row; @@ -90,7 +91,7 @@ public class FlyweightCell { * @param element * the element corresponding to this cell, cannot be null */ - void setElement(TableCellElement element) { + public void setElement(TableCellElement element) { assert element != null; assertSetup(); this.element = element; diff --git a/client/src/com/vaadin/client/ui/grid/FlyweightRow.java b/client/src/com/vaadin/client/widget/escalator/FlyweightRow.java index 9f913f5cd1..faa1440c24 100644 --- a/client/src/com/vaadin/client/ui/grid/FlyweightRow.java +++ b/client/src/com/vaadin/client/widget/escalator/FlyweightRow.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid; +package com.vaadin.client.widget.escalator; import java.util.ArrayList; import java.util.Collection; @@ -21,6 +21,7 @@ import java.util.Iterator; import java.util.List; import com.google.gwt.dom.client.TableRowElement; +import com.vaadin.client.widgets.Escalator; /** * An internal implementation of the {@link Row} interface. @@ -32,7 +33,7 @@ import com.google.gwt.dom.client.TableRowElement; * @author Vaadin Ltd * @see Escalator.AbstractRowContainer#refreshRow(Node, int) */ -class FlyweightRow implements Row { +public class FlyweightRow implements Row { static class CellIterator implements Iterator<FlyweightCell> { /** A defensive copy of the cells in the current row. */ @@ -143,7 +144,8 @@ class FlyweightRow implements Row { private double[] columnWidths = null; private final List<FlyweightCell> cells = new ArrayList<FlyweightCell>(); - void setup(final TableRowElement e, final int row, double[] columnWidths) { + public void setup(final TableRowElement e, final int row, + double[] columnWidths) { element = e; this.row = row; this.columnWidths = columnWidths; @@ -162,7 +164,7 @@ class FlyweightRow implements Row { * * @return always <code>true</code> */ - boolean teardown() { + public boolean teardown() { element = null; row = BLANK; columnWidths = null; @@ -184,7 +186,7 @@ class FlyweightRow implements Row { return element; } - void addCells(final int index, final int numberOfColumns) { + public void addCells(final int index, final int numberOfColumns) { for (int i = 0; i < numberOfColumns; i++) { final int col = index + i; cells.add(col, new FlyweightCell(this, col)); @@ -192,7 +194,7 @@ class FlyweightRow implements Row { updateRestOfCells(index + numberOfColumns); } - void removeCells(final int index, final int numberOfColumns) { + public void removeCells(final int index, final int numberOfColumns) { cells.subList(index, index + numberOfColumns).clear(); updateRestOfCells(index); } @@ -216,7 +218,7 @@ class FlyweightRow implements Row { * @see #setup(Element, int, int[]) * @see #teardown() */ - Iterable<FlyweightCell> getCells() { + public Iterable<FlyweightCell> getCells() { return getCells(0, cells.size()); } @@ -233,7 +235,8 @@ class FlyweightRow implements Row { * the number of cells to return * @return an iterable of flyweight cells */ - Iterable<FlyweightCell> getCells(final int offset, final int numberOfCells) { + public Iterable<FlyweightCell> getCells(final int offset, + final int numberOfCells) { assertSetup(); assert offset >= 0 && offset + numberOfCells <= cells.size() : "Invalid range of cells"; return new Iterable<FlyweightCell>() { @@ -260,7 +263,7 @@ class FlyweightRow implements Row { * the number of cells to return * @return an iterable of flyweight cells */ - Iterable<FlyweightCell> getUnattachedCells(final int offset, + public Iterable<FlyweightCell> getUnattachedCells(final int offset, final int numberOfCells) { assertSetup(); assert offset >= 0 && offset + numberOfCells <= cells.size() : "Invalid range of cells"; diff --git a/client/src/com/vaadin/client/ui/grid/PositionFunction.java b/client/src/com/vaadin/client/widget/escalator/PositionFunction.java index 4db5efd0fc..7727e73de3 100644 --- a/client/src/com/vaadin/client/ui/grid/PositionFunction.java +++ b/client/src/com/vaadin/client/widget/escalator/PositionFunction.java @@ -14,7 +14,7 @@ * the License. */ -package com.vaadin.client.ui.grid; +package com.vaadin.client.widget.escalator; import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.Style.Unit; @@ -25,7 +25,7 @@ import com.google.gwt.dom.client.Style.Unit; * @since * @author Vaadin Ltd */ -interface PositionFunction { +public interface PositionFunction { /** * A position function using "transform: translate3d(x,y,z)" to position * elements in the DOM. diff --git a/client/src/com/vaadin/client/ui/grid/Row.java b/client/src/com/vaadin/client/widget/escalator/Row.java index 6419a98574..bd66837a18 100644 --- a/client/src/com/vaadin/client/ui/grid/Row.java +++ b/client/src/com/vaadin/client/widget/escalator/Row.java @@ -14,7 +14,7 @@ * the License. */ -package com.vaadin.client.ui.grid; +package com.vaadin.client.widget.escalator; import com.google.gwt.dom.client.TableRowElement; diff --git a/client/src/com/vaadin/client/ui/grid/RowContainer.java b/client/src/com/vaadin/client/widget/escalator/RowContainer.java index f969f90fc9..10b4636bfe 100644 --- a/client/src/com/vaadin/client/ui/grid/RowContainer.java +++ b/client/src/com/vaadin/client/widget/escalator/RowContainer.java @@ -14,7 +14,7 @@ * the License. */ -package com.vaadin.client.ui.grid; +package com.vaadin.client.widget.escalator; import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.TableRowElement; diff --git a/client/src/com/vaadin/client/ui/grid/RowVisibilityChangeEvent.java b/client/src/com/vaadin/client/widget/escalator/RowVisibilityChangeEvent.java index c5c5e45ca8..6807e98039 100644 --- a/client/src/com/vaadin/client/ui/grid/RowVisibilityChangeEvent.java +++ b/client/src/com/vaadin/client/widget/escalator/RowVisibilityChangeEvent.java @@ -14,7 +14,7 @@ * the License. */ -package com.vaadin.client.ui.grid; +package com.vaadin.client.widget.escalator; import com.google.gwt.event.shared.GwtEvent; diff --git a/client/src/com/vaadin/client/ui/grid/RowVisibilityChangeHandler.java b/client/src/com/vaadin/client/widget/escalator/RowVisibilityChangeHandler.java index 6aa165fe04..31afe66adb 100644 --- a/client/src/com/vaadin/client/ui/grid/RowVisibilityChangeHandler.java +++ b/client/src/com/vaadin/client/widget/escalator/RowVisibilityChangeHandler.java @@ -14,7 +14,7 @@ * the License. */ -package com.vaadin.client.ui.grid; +package com.vaadin.client.widget.escalator; import com.google.gwt.event.shared.EventHandler; diff --git a/client/src/com/vaadin/client/ui/grid/ScrollbarBundle.java b/client/src/com/vaadin/client/widget/escalator/ScrollbarBundle.java index 7d6d050e64..dfc4abe62b 100644 --- a/client/src/com/vaadin/client/ui/grid/ScrollbarBundle.java +++ b/client/src/com/vaadin/client/widget/escalator/ScrollbarBundle.java @@ -14,7 +14,7 @@ * the License. */ -package com.vaadin.client.ui.grid; +package com.vaadin.client.widget.escalator; import com.google.gwt.core.client.Scheduler; import com.google.gwt.core.client.Scheduler.ScheduledCommand; @@ -29,8 +29,9 @@ import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Event; import com.google.gwt.user.client.EventListener; import com.google.gwt.user.client.Timer; -import com.vaadin.client.ui.grid.events.ScrollEvent; -import com.vaadin.client.ui.grid.events.ScrollHandler; +import com.vaadin.client.Util; +import com.vaadin.client.widget.grid.events.ScrollEvent; +import com.vaadin.client.widget.grid.events.ScrollHandler; /** * An element-like bundle representing a configurable and visual scrollbar in @@ -41,7 +42,7 @@ import com.vaadin.client.ui.grid.events.ScrollHandler; * @see VerticalScrollbarBundle * @see HorizontalScrollbarBundle */ -abstract class ScrollbarBundle { +public abstract class ScrollbarBundle { private class ScrollEventFirer { private final ScheduledCommand fireEventCommand = new ScheduledCommand() { @@ -183,7 +184,7 @@ abstract class ScrollbarBundle { * * @see VerticalScrollbarBundle#getElement() */ - final static class VerticalScrollbarBundle extends ScrollbarBundle { + public final static class VerticalScrollbarBundle extends ScrollbarBundle { @Override public void setStylePrimaryName(String primaryStyleName) { @@ -252,7 +253,7 @@ abstract class ScrollbarBundle { * * @see HorizontalScrollbarBundle#getElement() */ - final static class HorizontalScrollbarBundle extends ScrollbarBundle { + public final static class HorizontalScrollbarBundle extends ScrollbarBundle { @Override public void setStylePrimaryName(String primaryStyleName) { @@ -442,7 +443,7 @@ abstract class ScrollbarBundle { double oldScrollPos = scrollPos; scrollPos = Math.max(0, Math.min(maxScrollPos, truncate(px))); - if (!GridUtil.pixelValuesEqual(oldScrollPos, scrollPos)) { + if (!Util.pixelValuesEqual(oldScrollPos, scrollPos)) { if (isInvisibleScrollbar) { invisibleScrollbarTemporaryResizer.show(); } diff --git a/client/src/com/vaadin/client/widget/grid/CellReference.java b/client/src/com/vaadin/client/widget/grid/CellReference.java index 66aa40f702..6adf8c892c 100644 --- a/client/src/com/vaadin/client/widget/grid/CellReference.java +++ b/client/src/com/vaadin/client/widget/grid/CellReference.java @@ -15,8 +15,7 @@ */ package com.vaadin.client.widget.grid; -import com.vaadin.client.ui.grid.Grid; -import com.vaadin.client.ui.grid.GridColumn; +import com.vaadin.client.widgets.Grid; /** * A data class which contains information which identifies a cell in a @@ -31,7 +30,7 @@ import com.vaadin.client.ui.grid.GridColumn; */ public class CellReference<T> { private int columnIndex; - private GridColumn<?, T> column; + private Grid.Column<?, T> column; private final RowReference<T> rowReference; public CellReference(RowReference<T> rowReference) { @@ -48,7 +47,7 @@ public class CellReference<T> { * @param column * the column object */ - public void set(int columnIndex, GridColumn<?, T> column) { + public void set(int columnIndex, Grid.Column<?, T> column) { this.columnIndex = columnIndex; this.column = column; } @@ -94,7 +93,7 @@ public class CellReference<T> { * * @return the column object */ - public GridColumn<?, T> getColumn() { + public Grid.Column<?, T> getColumn() { return column; } diff --git a/client/src/com/vaadin/client/widget/grid/CellStyleGenerator.java b/client/src/com/vaadin/client/widget/grid/CellStyleGenerator.java index 079d3c521b..e29148d76b 100644 --- a/client/src/com/vaadin/client/widget/grid/CellStyleGenerator.java +++ b/client/src/com/vaadin/client/widget/grid/CellStyleGenerator.java @@ -15,7 +15,7 @@ */ package com.vaadin.client.widget.grid; -import com.vaadin.client.ui.grid.Grid; +import com.vaadin.client.widgets.Grid; /** * Callback interface for generating custom style names for cells diff --git a/client/src/com/vaadin/client/ui/grid/DataAvailableEvent.java b/client/src/com/vaadin/client/widget/grid/DataAvailableEvent.java index 62b188c0ea..270abcbed6 100644 --- a/client/src/com/vaadin/client/ui/grid/DataAvailableEvent.java +++ b/client/src/com/vaadin/client/widget/grid/DataAvailableEvent.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid; +package com.vaadin.client.widget.grid; import com.google.gwt.event.shared.GwtEvent; import com.vaadin.shared.ui.grid.Range; diff --git a/client/src/com/vaadin/client/ui/grid/DataAvailableHandler.java b/client/src/com/vaadin/client/widget/grid/DataAvailableHandler.java index 06ea08a17e..a76306d38b 100644 --- a/client/src/com/vaadin/client/ui/grid/DataAvailableHandler.java +++ b/client/src/com/vaadin/client/widget/grid/DataAvailableHandler.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid; +package com.vaadin.client.widget.grid; import com.google.gwt.event.shared.EventHandler; diff --git a/client/src/com/vaadin/client/ui/grid/EditorRowHandler.java b/client/src/com/vaadin/client/widget/grid/EditorRowHandler.java index 04ca7f6cf0..14b494a3ae 100644 --- a/client/src/com/vaadin/client/ui/grid/EditorRowHandler.java +++ b/client/src/com/vaadin/client/widget/grid/EditorRowHandler.java @@ -13,10 +13,10 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid; +package com.vaadin.client.widget.grid; import com.google.gwt.user.client.ui.Widget; -import com.vaadin.client.ui.grid.Grid.EditorRow; +import com.vaadin.client.widgets.Grid; /** * An interface for binding widgets and data to the editor row. Used by the @@ -79,7 +79,7 @@ public interface EditorRowHandler<T> { /** * Returns the row data related to the row being requested. - * + * * @return the row data */ public T getRow() { @@ -103,7 +103,7 @@ public interface EditorRowHandler<T> { * the column whose widget to get * @return the widget related to the column */ - public Widget getWidget(GridColumn<?, T> column) { + public Widget getWidget(Grid.Column<?, T> column) { Widget w = grid.getEditorRowWidget(column); assert w != null; return w; @@ -130,7 +130,7 @@ public interface EditorRowHandler<T> { * @param request * the data binding request * - * @see EditorRow#editRow(int) + * @see Grid#editRow(int) */ public void bind(EditorRowRequest<T> request); @@ -141,11 +141,11 @@ public interface EditorRowHandler<T> { * An implementation must call {@link EditorRowRequest#invokeCallback() * request.invokeCallback()} when the cancel is done (possibly * asynchronously). - * + * * @param request * the cancel request * - * @see EditorRow#cancel() + * @see Grid#cancelEditorRow() */ public void cancel(EditorRowRequest<T> request); @@ -161,11 +161,11 @@ public interface EditorRowHandler<T> { /** * Returns a widget instance that is used to edit the values in the given * column. A null return value means the column is not editable. - * + * * @param column * the column whose values should be edited * @return the editor widget for the column or null if the column is not * editable */ - public Widget getWidget(GridColumn<?, T> column); + public Widget getWidget(Grid.Column<?, T> column); } diff --git a/client/src/com/vaadin/client/ui/grid/GridUtil.java b/client/src/com/vaadin/client/widget/grid/GridUtil.java index 8dc0822d9d..9edaada9b1 100644 --- a/client/src/com/vaadin/client/ui/grid/GridUtil.java +++ b/client/src/com/vaadin/client/widget/grid/GridUtil.java @@ -13,11 +13,16 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid; +package com.vaadin.client.widget.grid; import com.google.gwt.dom.client.Element; +import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.Widget; import com.vaadin.client.Util; +import com.vaadin.client.widget.escalator.Cell; +import com.vaadin.client.widget.escalator.RowContainer; +import com.vaadin.client.widgets.Escalator; +import com.vaadin.client.widgets.Grid; /** * Utilities for working with Grid. @@ -28,15 +33,6 @@ import com.vaadin.client.Util; public class GridUtil { /** - * The allowed value inaccuracy when comparing two double-typed pixel - * values. - * <p> - * Since we're comparing pixels on a screen, epsilon must be less than 1. - * 0.49 was deemed a perfectly fine and beautifully round number. - */ - public static final double PIXEL_EPSILON = 0.49d; - - /** * Returns the cell the given element belongs to. * * @param grid @@ -47,7 +43,7 @@ public class GridUtil { * descendant of one */ public static Cell findCell(Grid<?> grid, Element e) { - RowContainer container = grid.getEscalator().findRowContainer(e); + RowContainer container = getEscalator(grid).findRowContainer(e); return container != null ? container.getCell(e) : null; } @@ -81,22 +77,13 @@ public class GridUtil { * @param parent * The parent to set */ - static native final void setParent(Widget widget, Grid<?> parent) + public static native final void setParent(Widget widget, Grid<?> parent) /*-{ widget.@com.google.gwt.user.client.ui.Widget::setParent(Lcom/google/gwt/user/client/ui/Widget;)(parent); }-*/; - /** - * Compares two double values with the error margin of - * {@link #PIXEL_EPSILON} (i.e. {@value #PIXEL_EPSILON}) - * - * @param num1 - * the first value for which to compare equality - * @param num2 - * the second value for which to compare equality - */ - public static boolean pixelValuesEqual(final double num1, final double num2) { - return Math.abs(num1 - num2) <= PIXEL_EPSILON; - } - + private native static Escalator getEscalator(Grid<?> grid) + /*-{ + return grid.@com.vaadin.client.widgets.Grid::escalator; + }-*/; } diff --git a/client/src/com/vaadin/client/widget/grid/RowReference.java b/client/src/com/vaadin/client/widget/grid/RowReference.java index 8dd836cb77..9135c4aa26 100644 --- a/client/src/com/vaadin/client/widget/grid/RowReference.java +++ b/client/src/com/vaadin/client/widget/grid/RowReference.java @@ -15,7 +15,7 @@ */ package com.vaadin.client.widget.grid; -import com.vaadin.client.ui.grid.Grid; +import com.vaadin.client.widgets.Grid; /** * A data class which contains information which identifies a row in a diff --git a/client/src/com/vaadin/client/widget/grid/RowStyleGenerator.java b/client/src/com/vaadin/client/widget/grid/RowStyleGenerator.java index ba2d6bc238..67abda0be6 100644 --- a/client/src/com/vaadin/client/widget/grid/RowStyleGenerator.java +++ b/client/src/com/vaadin/client/widget/grid/RowStyleGenerator.java @@ -17,8 +17,6 @@ package com.vaadin.client.widget.grid; import java.io.Serializable; -import com.vaadin.client.ui.grid.Grid; - /** * Callback interface for generating custom style names for data rows * diff --git a/client/src/com/vaadin/client/ui/grid/datasources/ListDataSource.java b/client/src/com/vaadin/client/widget/grid/datasources/ListDataSource.java index 04617b05f0..1b1e182411 100644 --- a/client/src/com/vaadin/client/ui/grid/datasources/ListDataSource.java +++ b/client/src/com/vaadin/client/widget/grid/datasources/ListDataSource.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.datasources; +package com.vaadin.client.widget.grid.datasources; import java.util.ArrayList; import java.util.Arrays; @@ -26,8 +26,8 @@ import java.util.ListIterator; import com.vaadin.client.data.DataChangeHandler; import com.vaadin.client.data.DataSource; -import com.vaadin.client.ui.grid.events.SelectAllEvent; -import com.vaadin.client.ui.grid.events.SelectAllHandler; +import com.vaadin.client.widget.grid.events.SelectAllEvent; +import com.vaadin.client.widget.grid.events.SelectAllHandler; import com.vaadin.shared.util.SharedUtil; /** diff --git a/client/src/com/vaadin/client/ui/grid/datasources/ListSorter.java b/client/src/com/vaadin/client/widget/grid/datasources/ListSorter.java index 374a12396d..ff999801a0 100644 --- a/client/src/com/vaadin/client/ui/grid/datasources/ListSorter.java +++ b/client/src/com/vaadin/client/widget/grid/datasources/ListSorter.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.datasources; +package com.vaadin.client.widget.grid.datasources; import java.util.Comparator; import java.util.HashMap; @@ -22,17 +22,16 @@ import java.util.Map; import com.google.gwt.event.shared.HandlerRegistration; import com.vaadin.client.data.DataSource; -import com.vaadin.client.ui.grid.Grid; -import com.vaadin.client.ui.grid.GridColumn; -import com.vaadin.client.ui.grid.sort.SortEvent; -import com.vaadin.client.ui.grid.sort.SortHandler; -import com.vaadin.client.ui.grid.sort.SortOrder; +import com.vaadin.client.widget.grid.sort.SortEvent; +import com.vaadin.client.widget.grid.sort.SortHandler; +import com.vaadin.client.widget.grid.sort.SortOrder; +import com.vaadin.client.widgets.Grid; import com.vaadin.shared.ui.grid.SortDirection; /** * Provides sorting facility from Grid for the {@link ListDataSource} in-memory * data source. - * + * * @since * @author Vaadin Ltd * @param <T> @@ -41,7 +40,7 @@ import com.vaadin.shared.ui.grid.SortDirection; public class ListSorter<T> { private Grid<T> grid; - private Map<GridColumn<?, T>, Comparator<?>> comparators; + private Map<Grid.Column<?, T>, Comparator<?>> comparators; private HandlerRegistration sortHandlerRegistration; public ListSorter(Grid<T> grid) { @@ -51,15 +50,14 @@ public class ListSorter<T> { } this.grid = grid; - comparators = new HashMap<GridColumn<?, T>, Comparator<?>>(); + comparators = new HashMap<Grid.Column<?, T>, Comparator<?>>(); - sortHandlerRegistration = grid - .addSortHandler(new SortHandler<T>() { - @Override - public void sort(SortEvent<T> event) { - ListSorter.this.sort(event.getOrder()); - } - }); + sortHandlerRegistration = grid.addSortHandler(new SortHandler<T>() { + @Override + public void sort(SortEvent<T> event) { + ListSorter.this.sort(event.getOrder()); + } + }); } /** @@ -77,14 +75,14 @@ public class ListSorter<T> { * which includes all standard data classes like String, Number derivatives * and Dates). Any existing comparator can be removed by passing in a * non-null GridColumn and a null Comparator. - * + * * @param column * a grid column. May not be null. * @param comparator * comparator method for the values returned by the grid column. * If null, any existing comparator is removed. */ - public <C> void setComparator(GridColumn<C, T> column, + public <C> void setComparator(Grid.Column<C, T> column, Comparator<C> comparator) { if (column == null) { throw new IllegalArgumentException( @@ -99,14 +97,14 @@ public class ListSorter<T> { /** * Retrieve the comparator assigned for a specific grid column. - * + * * @param column * a grid column. May not be null. * @return a comparator, or null if no comparator for the specified grid * column has been set. */ @SuppressWarnings("unchecked") - public <C> Comparator<C> getComparator(GridColumn<C, T> column) { + public <C> Comparator<C> getComparator(Grid.Column<C, T> column) { if (column == null) { throw new IllegalArgumentException( "Column reference can not be null"); @@ -124,7 +122,7 @@ public class ListSorter<T> { /** * Apply sorting to the current ListDataSource. - * + * * @param order * the sort order list provided by the grid sort event */ @@ -143,7 +141,7 @@ public class ListSorter<T> { for (SortOrder o : order) { - GridColumn column = o.getColumn(); + Grid.Column column = o.getColumn(); Comparator cmp = ListSorter.this.comparators.get(column); int result = 0; Object value_a = column.getValue(a); diff --git a/client/src/com/vaadin/client/ui/grid/events/AbstractGridKeyEventHandler.java b/client/src/com/vaadin/client/widget/grid/events/AbstractGridKeyEventHandler.java index 8dcd24305b..a0a02ef865 100644 --- a/client/src/com/vaadin/client/ui/grid/events/AbstractGridKeyEventHandler.java +++ b/client/src/com/vaadin/client/widget/grid/events/AbstractGridKeyEventHandler.java @@ -13,10 +13,10 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.events; +package com.vaadin.client.widget.grid.events; import com.google.gwt.event.shared.EventHandler; -import com.vaadin.client.ui.grid.Grid.AbstractGridKeyEvent; +import com.vaadin.client.widgets.Grid.AbstractGridKeyEvent; /** * Base interface of all handlers for {@link AbstractGridKeyEvent}s. diff --git a/client/src/com/vaadin/client/ui/grid/events/AbstractGridMouseEventHandler.java b/client/src/com/vaadin/client/widget/grid/events/AbstractGridMouseEventHandler.java index 24a8952f07..3b920800aa 100644 --- a/client/src/com/vaadin/client/ui/grid/events/AbstractGridMouseEventHandler.java +++ b/client/src/com/vaadin/client/widget/grid/events/AbstractGridMouseEventHandler.java @@ -13,10 +13,10 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.events; +package com.vaadin.client.widget.grid.events; import com.google.gwt.event.shared.EventHandler; -import com.vaadin.client.ui.grid.Grid.AbstractGridMouseEvent; +import com.vaadin.client.widgets.Grid.AbstractGridMouseEvent; /** * Base interface of all handlers for {@link AbstractGridMouseEvent}s. diff --git a/client/src/com/vaadin/client/ui/grid/events/BodyClickHandler.java b/client/src/com/vaadin/client/widget/grid/events/BodyClickHandler.java index 7110097b85..6bcdf7662b 100644 --- a/client/src/com/vaadin/client/ui/grid/events/BodyClickHandler.java +++ b/client/src/com/vaadin/client/widget/grid/events/BodyClickHandler.java @@ -13,9 +13,9 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.events; +package com.vaadin.client.widget.grid.events; -import com.vaadin.client.ui.grid.events.AbstractGridMouseEventHandler.GridClickHandler; +import com.vaadin.client.widget.grid.events.AbstractGridMouseEventHandler.GridClickHandler; /** * Handler for {@link GridClickEvent}s that happen in the body of the Grid. diff --git a/client/src/com/vaadin/client/ui/grid/events/BodyKeyDownHandler.java b/client/src/com/vaadin/client/widget/grid/events/BodyKeyDownHandler.java index 6df8160194..312cea4c76 100644 --- a/client/src/com/vaadin/client/ui/grid/events/BodyKeyDownHandler.java +++ b/client/src/com/vaadin/client/widget/grid/events/BodyKeyDownHandler.java @@ -13,9 +13,9 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.events; +package com.vaadin.client.widget.grid.events; -import com.vaadin.client.ui.grid.events.AbstractGridKeyEventHandler.GridKeyDownHandler; +import com.vaadin.client.widget.grid.events.AbstractGridKeyEventHandler.GridKeyDownHandler; /** * Handler for {@link GridKeyDownEvent}s that happen when the focused cell is in diff --git a/client/src/com/vaadin/client/ui/grid/events/BodyKeyPressHandler.java b/client/src/com/vaadin/client/widget/grid/events/BodyKeyPressHandler.java index 347dc0c842..273a5a45be 100644 --- a/client/src/com/vaadin/client/ui/grid/events/BodyKeyPressHandler.java +++ b/client/src/com/vaadin/client/widget/grid/events/BodyKeyPressHandler.java @@ -13,9 +13,9 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.events; +package com.vaadin.client.widget.grid.events; -import com.vaadin.client.ui.grid.events.AbstractGridKeyEventHandler.GridKeyPressHandler; +import com.vaadin.client.widget.grid.events.AbstractGridKeyEventHandler.GridKeyPressHandler; /** * Handler for {@link GridKeyPressEvent}s that happen when the focused cell is diff --git a/client/src/com/vaadin/client/ui/grid/events/BodyKeyUpHandler.java b/client/src/com/vaadin/client/widget/grid/events/BodyKeyUpHandler.java index fe8ee1f4cc..5f86f52cd1 100644 --- a/client/src/com/vaadin/client/ui/grid/events/BodyKeyUpHandler.java +++ b/client/src/com/vaadin/client/widget/grid/events/BodyKeyUpHandler.java @@ -13,9 +13,9 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.events; +package com.vaadin.client.widget.grid.events; -import com.vaadin.client.ui.grid.events.AbstractGridKeyEventHandler.GridKeyUpHandler; +import com.vaadin.client.widget.grid.events.AbstractGridKeyEventHandler.GridKeyUpHandler; /** * Handler for {@link GridKeyUpEvent}s that happen when the focused cell is in diff --git a/client/src/com/vaadin/client/ui/grid/events/FooterClickHandler.java b/client/src/com/vaadin/client/widget/grid/events/FooterClickHandler.java index d9e91ded22..ad86f1e5df 100644 --- a/client/src/com/vaadin/client/ui/grid/events/FooterClickHandler.java +++ b/client/src/com/vaadin/client/widget/grid/events/FooterClickHandler.java @@ -13,9 +13,9 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.events; +package com.vaadin.client.widget.grid.events; -import com.vaadin.client.ui.grid.events.AbstractGridMouseEventHandler.GridClickHandler; +import com.vaadin.client.widget.grid.events.AbstractGridMouseEventHandler.GridClickHandler; /** * Handler for {@link GridClickEvent}s that happen in the footer of the Grid. diff --git a/client/src/com/vaadin/client/ui/grid/events/FooterKeyDownHandler.java b/client/src/com/vaadin/client/widget/grid/events/FooterKeyDownHandler.java index 8c71e9d0f7..9e3c6a4241 100644 --- a/client/src/com/vaadin/client/ui/grid/events/FooterKeyDownHandler.java +++ b/client/src/com/vaadin/client/widget/grid/events/FooterKeyDownHandler.java @@ -13,9 +13,9 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.events; +package com.vaadin.client.widget.grid.events; -import com.vaadin.client.ui.grid.events.AbstractGridKeyEventHandler.GridKeyDownHandler; +import com.vaadin.client.widget.grid.events.AbstractGridKeyEventHandler.GridKeyDownHandler; /** * Handler for {@link GridKeyDownEvent}s that happen when the focused cell is in diff --git a/client/src/com/vaadin/client/ui/grid/events/FooterKeyPressHandler.java b/client/src/com/vaadin/client/widget/grid/events/FooterKeyPressHandler.java index 75780c7049..b2995f743b 100644 --- a/client/src/com/vaadin/client/ui/grid/events/FooterKeyPressHandler.java +++ b/client/src/com/vaadin/client/widget/grid/events/FooterKeyPressHandler.java @@ -13,9 +13,9 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.events; +package com.vaadin.client.widget.grid.events; -import com.vaadin.client.ui.grid.events.AbstractGridKeyEventHandler.GridKeyPressHandler; +import com.vaadin.client.widget.grid.events.AbstractGridKeyEventHandler.GridKeyPressHandler; /** * Handler for {@link GridKeyPressEvent}s that happen when the focused cell is diff --git a/client/src/com/vaadin/client/ui/grid/events/FooterKeyUpHandler.java b/client/src/com/vaadin/client/widget/grid/events/FooterKeyUpHandler.java index 436c23ed48..dcf8f5cfc0 100644 --- a/client/src/com/vaadin/client/ui/grid/events/FooterKeyUpHandler.java +++ b/client/src/com/vaadin/client/widget/grid/events/FooterKeyUpHandler.java @@ -13,9 +13,9 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.events; +package com.vaadin.client.widget.grid.events; -import com.vaadin.client.ui.grid.events.AbstractGridKeyEventHandler.GridKeyUpHandler; +import com.vaadin.client.widget.grid.events.AbstractGridKeyEventHandler.GridKeyUpHandler; /** * Handler for {@link GridKeyUpEvent}s that happen when the focused cell is in diff --git a/client/src/com/vaadin/client/ui/grid/events/GridClickEvent.java b/client/src/com/vaadin/client/widget/grid/events/GridClickEvent.java index 1d85f0b41a..aeade4721e 100644 --- a/client/src/com/vaadin/client/ui/grid/events/GridClickEvent.java +++ b/client/src/com/vaadin/client/widget/grid/events/GridClickEvent.java @@ -13,12 +13,13 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.events; +package com.vaadin.client.widget.grid.events; import com.google.gwt.dom.client.BrowserEvents; -import com.vaadin.client.ui.grid.Grid; -import com.vaadin.client.ui.grid.Grid.AbstractGridMouseEvent; -import com.vaadin.client.ui.grid.events.AbstractGridMouseEventHandler.GridClickHandler; +import com.vaadin.client.widget.grid.events.AbstractGridMouseEventHandler.GridClickHandler; +import com.vaadin.client.widgets.Grid; +import com.vaadin.client.widgets.Grid.AbstractGridMouseEvent; +import com.vaadin.client.widgets.Grid.Section; /** * Represents native mouse click event in Grid. @@ -38,10 +39,10 @@ public class GridClickEvent extends AbstractGridMouseEvent<GridClickHandler> { } @Override - protected void doDispatch(GridClickHandler handler, GridSection section) { - if ((section == GridSection.BODY && handler instanceof BodyClickHandler) - || (section == GridSection.HEADER && handler instanceof HeaderClickHandler) - || (section == GridSection.FOOTER && handler instanceof FooterClickHandler)) { + protected void doDispatch(GridClickHandler handler, Section section) { + if ((section == Section.BODY && handler instanceof BodyClickHandler) + || (section == Section.HEADER && handler instanceof HeaderClickHandler) + || (section == Section.FOOTER && handler instanceof FooterClickHandler)) { handler.onClick(this); } } diff --git a/client/src/com/vaadin/client/ui/grid/events/GridKeyDownEvent.java b/client/src/com/vaadin/client/widget/grid/events/GridKeyDownEvent.java index dd6469d349..6d0787be37 100644 --- a/client/src/com/vaadin/client/ui/grid/events/GridKeyDownEvent.java +++ b/client/src/com/vaadin/client/widget/grid/events/GridKeyDownEvent.java @@ -13,13 +13,14 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.events; +package com.vaadin.client.widget.grid.events; import com.google.gwt.dom.client.BrowserEvents; import com.google.gwt.event.dom.client.KeyCodes; -import com.vaadin.client.ui.grid.Grid; -import com.vaadin.client.ui.grid.Grid.AbstractGridKeyEvent; -import com.vaadin.client.ui.grid.events.AbstractGridKeyEventHandler.GridKeyDownHandler; +import com.vaadin.client.widget.grid.events.AbstractGridKeyEventHandler.GridKeyDownHandler; +import com.vaadin.client.widgets.Grid; +import com.vaadin.client.widgets.Grid.AbstractGridKeyEvent; +import com.vaadin.client.widgets.Grid.Section; /** * Represents native key down event in Grid. @@ -34,10 +35,10 @@ public class GridKeyDownEvent extends AbstractGridKeyEvent<GridKeyDownHandler> { } @Override - protected void doDispatch(GridKeyDownHandler handler, GridSection section) { - if ((section == GridSection.BODY && handler instanceof BodyKeyDownHandler) - || (section == GridSection.HEADER && handler instanceof HeaderKeyDownHandler) - || (section == GridSection.FOOTER && handler instanceof FooterKeyDownHandler)) { + protected void doDispatch(GridKeyDownHandler handler, Section section) { + if ((section == Section.BODY && handler instanceof BodyKeyDownHandler) + || (section == Section.HEADER && handler instanceof HeaderKeyDownHandler) + || (section == Section.FOOTER && handler instanceof FooterKeyDownHandler)) { handler.onKeyDown(this); } } diff --git a/client/src/com/vaadin/client/ui/grid/events/GridKeyPressEvent.java b/client/src/com/vaadin/client/widget/grid/events/GridKeyPressEvent.java index 7b0edc413c..2cb63aca28 100644 --- a/client/src/com/vaadin/client/ui/grid/events/GridKeyPressEvent.java +++ b/client/src/com/vaadin/client/widget/grid/events/GridKeyPressEvent.java @@ -13,12 +13,13 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.events; +package com.vaadin.client.widget.grid.events; import com.google.gwt.dom.client.BrowserEvents; -import com.vaadin.client.ui.grid.Grid; -import com.vaadin.client.ui.grid.Grid.AbstractGridKeyEvent; -import com.vaadin.client.ui.grid.events.AbstractGridKeyEventHandler.GridKeyPressHandler; +import com.vaadin.client.widget.grid.events.AbstractGridKeyEventHandler.GridKeyPressHandler; +import com.vaadin.client.widgets.Grid; +import com.vaadin.client.widgets.Grid.AbstractGridKeyEvent; +import com.vaadin.client.widgets.Grid.Section; /** * Represents native key press event in Grid. @@ -34,10 +35,10 @@ public class GridKeyPressEvent extends } @Override - protected void doDispatch(GridKeyPressHandler handler, GridSection section) { - if ((section == GridSection.BODY && handler instanceof BodyKeyPressHandler) - || (section == GridSection.HEADER && handler instanceof HeaderKeyPressHandler) - || (section == GridSection.FOOTER && handler instanceof FooterKeyPressHandler)) { + protected void doDispatch(GridKeyPressHandler handler, Section section) { + if ((section == Section.BODY && handler instanceof BodyKeyPressHandler) + || (section == Section.HEADER && handler instanceof HeaderKeyPressHandler) + || (section == Section.FOOTER && handler instanceof FooterKeyPressHandler)) { handler.onKeyPress(this); } } diff --git a/client/src/com/vaadin/client/ui/grid/events/GridKeyUpEvent.java b/client/src/com/vaadin/client/widget/grid/events/GridKeyUpEvent.java index 4e177932eb..ddfce5f478 100644 --- a/client/src/com/vaadin/client/ui/grid/events/GridKeyUpEvent.java +++ b/client/src/com/vaadin/client/widget/grid/events/GridKeyUpEvent.java @@ -13,13 +13,14 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.events; +package com.vaadin.client.widget.grid.events; import com.google.gwt.dom.client.BrowserEvents; import com.google.gwt.event.dom.client.KeyCodes; -import com.vaadin.client.ui.grid.Grid; -import com.vaadin.client.ui.grid.Grid.AbstractGridKeyEvent; -import com.vaadin.client.ui.grid.events.AbstractGridKeyEventHandler.GridKeyUpHandler; +import com.vaadin.client.widget.grid.events.AbstractGridKeyEventHandler.GridKeyUpHandler; +import com.vaadin.client.widgets.Grid; +import com.vaadin.client.widgets.Grid.AbstractGridKeyEvent; +import com.vaadin.client.widgets.Grid.Section; /** * Represents native key up event in Grid. @@ -34,10 +35,10 @@ public class GridKeyUpEvent extends AbstractGridKeyEvent<GridKeyUpHandler> { } @Override - protected void doDispatch(GridKeyUpHandler handler, GridSection section) { - if ((section == GridSection.BODY && handler instanceof BodyKeyUpHandler) - || (section == GridSection.HEADER && handler instanceof HeaderKeyUpHandler) - || (section == GridSection.FOOTER && handler instanceof FooterKeyUpHandler)) { + protected void doDispatch(GridKeyUpHandler handler, Section section) { + if ((section == Section.BODY && handler instanceof BodyKeyUpHandler) + || (section == Section.HEADER && handler instanceof HeaderKeyUpHandler) + || (section == Section.FOOTER && handler instanceof FooterKeyUpHandler)) { handler.onKeyUp(this); } } diff --git a/client/src/com/vaadin/client/ui/grid/events/HeaderClickHandler.java b/client/src/com/vaadin/client/widget/grid/events/HeaderClickHandler.java index 3c8896a8af..6f9158df0d 100644 --- a/client/src/com/vaadin/client/ui/grid/events/HeaderClickHandler.java +++ b/client/src/com/vaadin/client/widget/grid/events/HeaderClickHandler.java @@ -13,9 +13,9 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.events; +package com.vaadin.client.widget.grid.events; -import com.vaadin.client.ui.grid.events.AbstractGridMouseEventHandler.GridClickHandler; +import com.vaadin.client.widget.grid.events.AbstractGridMouseEventHandler.GridClickHandler; /** * Handler for {@link GridClickEvent}s that happen in the header of the Grid. diff --git a/client/src/com/vaadin/client/ui/grid/events/HeaderKeyDownHandler.java b/client/src/com/vaadin/client/widget/grid/events/HeaderKeyDownHandler.java index df074c7cd7..c3824c9b63 100644 --- a/client/src/com/vaadin/client/ui/grid/events/HeaderKeyDownHandler.java +++ b/client/src/com/vaadin/client/widget/grid/events/HeaderKeyDownHandler.java @@ -13,9 +13,9 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.events; +package com.vaadin.client.widget.grid.events; -import com.vaadin.client.ui.grid.events.AbstractGridKeyEventHandler.GridKeyDownHandler; +import com.vaadin.client.widget.grid.events.AbstractGridKeyEventHandler.GridKeyDownHandler; /** * Handler for {@link GridKeyDownEvent}s that happen when the focused cell is in diff --git a/client/src/com/vaadin/client/ui/grid/events/HeaderKeyPressHandler.java b/client/src/com/vaadin/client/widget/grid/events/HeaderKeyPressHandler.java index d34102a7a4..2d30838f38 100644 --- a/client/src/com/vaadin/client/ui/grid/events/HeaderKeyPressHandler.java +++ b/client/src/com/vaadin/client/widget/grid/events/HeaderKeyPressHandler.java @@ -13,9 +13,9 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.events; +package com.vaadin.client.widget.grid.events; -import com.vaadin.client.ui.grid.events.AbstractGridKeyEventHandler.GridKeyPressHandler; +import com.vaadin.client.widget.grid.events.AbstractGridKeyEventHandler.GridKeyPressHandler; /** * Handler for {@link GridKeyPressEvent}s that happen when the focused cell is diff --git a/client/src/com/vaadin/client/ui/grid/events/HeaderKeyUpHandler.java b/client/src/com/vaadin/client/widget/grid/events/HeaderKeyUpHandler.java index ac459189b6..fee147398a 100644 --- a/client/src/com/vaadin/client/ui/grid/events/HeaderKeyUpHandler.java +++ b/client/src/com/vaadin/client/widget/grid/events/HeaderKeyUpHandler.java @@ -13,9 +13,9 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.events; +package com.vaadin.client.widget.grid.events; -import com.vaadin.client.ui.grid.events.AbstractGridKeyEventHandler.GridKeyUpHandler; +import com.vaadin.client.widget.grid.events.AbstractGridKeyEventHandler.GridKeyUpHandler; /** * Handler for {@link GridKeyUpEvent}s that happen when the focused cell is in diff --git a/client/src/com/vaadin/client/ui/grid/events/ScrollEvent.java b/client/src/com/vaadin/client/widget/grid/events/ScrollEvent.java index 751823f9a5..7e190821c8 100644 --- a/client/src/com/vaadin/client/ui/grid/events/ScrollEvent.java +++ b/client/src/com/vaadin/client/widget/grid/events/ScrollEvent.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.events; +package com.vaadin.client.widget.grid.events; import com.google.gwt.event.shared.GwtEvent; diff --git a/client/src/com/vaadin/client/ui/grid/events/ScrollHandler.java b/client/src/com/vaadin/client/widget/grid/events/ScrollHandler.java index 473b18071a..74fe05ec05 100644 --- a/client/src/com/vaadin/client/ui/grid/events/ScrollHandler.java +++ b/client/src/com/vaadin/client/widget/grid/events/ScrollHandler.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.events; +package com.vaadin.client.widget.grid.events; import com.google.gwt.event.shared.EventHandler; diff --git a/client/src/com/vaadin/client/ui/grid/events/SelectAllEvent.java b/client/src/com/vaadin/client/widget/grid/events/SelectAllEvent.java index 0fb32478ea..2198441ae0 100644 --- a/client/src/com/vaadin/client/ui/grid/events/SelectAllEvent.java +++ b/client/src/com/vaadin/client/widget/grid/events/SelectAllEvent.java @@ -13,10 +13,10 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.events; +package com.vaadin.client.widget.grid.events; import com.google.gwt.event.shared.GwtEvent; -import com.vaadin.client.ui.grid.selection.SelectionModel; +import com.vaadin.client.widget.grid.selection.SelectionModel; /** * A select all event, fired by the Grid when it needs all rows in data source diff --git a/client/src/com/vaadin/client/ui/grid/events/SelectAllHandler.java b/client/src/com/vaadin/client/widget/grid/events/SelectAllHandler.java index b93eedf315..ee30497a65 100644 --- a/client/src/com/vaadin/client/ui/grid/events/SelectAllHandler.java +++ b/client/src/com/vaadin/client/widget/grid/events/SelectAllHandler.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.events; +package com.vaadin.client.widget.grid.events; import com.google.gwt.event.shared.EventHandler; diff --git a/client/src/com/vaadin/client/ui/grid/selection/AbstractRowHandleSelectionModel.java b/client/src/com/vaadin/client/widget/grid/selection/AbstractRowHandleSelectionModel.java index f55229d86c..7458bf61a1 100644 --- a/client/src/com/vaadin/client/ui/grid/selection/AbstractRowHandleSelectionModel.java +++ b/client/src/com/vaadin/client/widget/grid/selection/AbstractRowHandleSelectionModel.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.selection; +package com.vaadin.client.widget.grid.selection; import com.vaadin.client.data.DataSource.RowHandle; diff --git a/client/src/com/vaadin/client/ui/grid/selection/ClickSelectHandler.java b/client/src/com/vaadin/client/widget/grid/selection/ClickSelectHandler.java index 48562329cc..205d879506 100644 --- a/client/src/com/vaadin/client/ui/grid/selection/ClickSelectHandler.java +++ b/client/src/com/vaadin/client/widget/grid/selection/ClickSelectHandler.java @@ -13,12 +13,12 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.selection; +package com.vaadin.client.widget.grid.selection; import com.google.gwt.event.shared.HandlerRegistration; -import com.vaadin.client.ui.grid.Grid; -import com.vaadin.client.ui.grid.events.BodyClickHandler; -import com.vaadin.client.ui.grid.events.GridClickEvent; +import com.vaadin.client.widget.grid.events.BodyClickHandler; +import com.vaadin.client.widget.grid.events.GridClickEvent; +import com.vaadin.client.widgets.Grid; /** * Generic class to perform selections when clicking on cells in body of Grid. diff --git a/client/src/com/vaadin/client/ui/grid/selection/HasSelectionHandlers.java b/client/src/com/vaadin/client/widget/grid/selection/HasSelectionHandlers.java index 1afdd016aa..0666e8fa30 100644 --- a/client/src/com/vaadin/client/ui/grid/selection/HasSelectionHandlers.java +++ b/client/src/com/vaadin/client/widget/grid/selection/HasSelectionHandlers.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.selection; +package com.vaadin.client.widget.grid.selection; import com.google.gwt.event.shared.HandlerRegistration; diff --git a/client/src/com/vaadin/client/ui/grid/selection/MultiSelectionRenderer.java b/client/src/com/vaadin/client/widget/grid/selection/MultiSelectionRenderer.java index 2b5e3b79a4..d2cc06f753 100644 --- a/client/src/com/vaadin/client/ui/grid/selection/MultiSelectionRenderer.java +++ b/client/src/com/vaadin/client/widget/grid/selection/MultiSelectionRenderer.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.selection; +package com.vaadin.client.widget.grid.selection; import java.util.Collection; import java.util.HashSet; @@ -33,11 +33,11 @@ import com.google.gwt.user.client.Event; import com.google.gwt.user.client.Event.NativePreviewEvent; import com.google.gwt.user.client.Event.NativePreviewHandler; import com.vaadin.client.Util; -import com.vaadin.client.ui.grid.Cell; -import com.vaadin.client.ui.grid.FlyweightCell; -import com.vaadin.client.ui.grid.Grid; -import com.vaadin.client.ui.grid.renderers.ComplexRenderer; -import com.vaadin.client.ui.grid.selection.SelectionModel.Multi.Batched; +import com.vaadin.client.renderers.ComplexRenderer; +import com.vaadin.client.widget.escalator.Cell; +import com.vaadin.client.widget.escalator.FlyweightCell; +import com.vaadin.client.widget.grid.selection.SelectionModel.Multi.Batched; +import com.vaadin.client.widgets.Grid; /* This class will probably not survive the final merge of all selection functionality. */ public class MultiSelectionRenderer<T> extends ComplexRenderer<Boolean> { diff --git a/client/src/com/vaadin/client/ui/grid/selection/SelectionEvent.java b/client/src/com/vaadin/client/widget/grid/selection/SelectionEvent.java index 6a36474d12..9a3275cbad 100644 --- a/client/src/com/vaadin/client/ui/grid/selection/SelectionEvent.java +++ b/client/src/com/vaadin/client/widget/grid/selection/SelectionEvent.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.selection; +package com.vaadin.client.widget.grid.selection; import java.util.ArrayList; import java.util.Collection; @@ -21,7 +21,7 @@ import java.util.Collections; import java.util.List; import com.google.gwt.event.shared.GwtEvent; -import com.vaadin.client.ui.grid.Grid; +import com.vaadin.client.widgets.Grid; /** * Event object describing a change in Grid row selection state. @@ -53,8 +53,7 @@ public class SelectionEvent<T> extends GwtEvent<SelectionHandler> { * a batched selection/deselection action * @see SelectionModel.Multi.Batched */ - public SelectionEvent(Grid<T> grid, T added, T removed, - boolean batched) { + public SelectionEvent(Grid<T> grid, T added, T removed, boolean batched) { this.grid = grid; this.batched = batched; @@ -116,8 +115,8 @@ public class SelectionEvent<T> extends GwtEvent<SelectionHandler> { } /** - * Get all rows added to the selection since the last - * {@link SelectionEvent}. + * Get all rows added to the selection since the last {@link SelectionEvent} + * . * * @return a collection of added rows. Empty collection if no rows were * added. diff --git a/client/src/com/vaadin/client/ui/grid/selection/SelectionHandler.java b/client/src/com/vaadin/client/widget/grid/selection/SelectionHandler.java index 0f687cfac3..9eba6b4c57 100644 --- a/client/src/com/vaadin/client/ui/grid/selection/SelectionHandler.java +++ b/client/src/com/vaadin/client/widget/grid/selection/SelectionHandler.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.selection; +package com.vaadin.client.widget.grid.selection; import com.google.gwt.event.shared.EventHandler; diff --git a/client/src/com/vaadin/client/ui/grid/selection/SelectionModel.java b/client/src/com/vaadin/client/widget/grid/selection/SelectionModel.java index cfbe76b707..b711dd22a7 100644 --- a/client/src/com/vaadin/client/ui/grid/selection/SelectionModel.java +++ b/client/src/com/vaadin/client/widget/grid/selection/SelectionModel.java @@ -13,12 +13,12 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.selection; +package com.vaadin.client.widget.grid.selection; import java.util.Collection; -import com.vaadin.client.ui.grid.Grid; -import com.vaadin.client.ui.grid.Renderer; +import com.vaadin.client.renderers.Renderer; +import com.vaadin.client.widgets.Grid; /** * Common interface for all selection models. @@ -141,9 +141,9 @@ public interface SelectionModel<T> { * into one, and a final selection event will be fired when * {@link #commitBatchSelect()} is called. * <p> - * <em>Note:</em> {@link SelectionEvent SelectionChangeEvents} - * will still be fired for each selection/deselection. You should - * check whether the event is a part of a batch or not with + * <em>Note:</em> {@link SelectionEvent SelectionChangeEvents} will + * still be fired for each selection/deselection. You should check + * whether the event is a part of a batch or not with * {@link SelectionEvent#isBatchedSelection()}. */ public void startBatchSelect(); diff --git a/client/src/com/vaadin/client/ui/grid/selection/SelectionModelMulti.java b/client/src/com/vaadin/client/widget/grid/selection/SelectionModelMulti.java index a00376fa6e..2fa1b7c9d9 100644 --- a/client/src/com/vaadin/client/ui/grid/selection/SelectionModelMulti.java +++ b/client/src/com/vaadin/client/widget/grid/selection/SelectionModelMulti.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.selection; +package com.vaadin.client.widget.grid.selection; import java.util.ArrayList; import java.util.Arrays; @@ -23,8 +23,8 @@ import java.util.LinkedHashSet; import java.util.Set; import com.vaadin.client.data.DataSource.RowHandle; -import com.vaadin.client.ui.grid.Grid; -import com.vaadin.client.ui.grid.Renderer; +import com.vaadin.client.renderers.Renderer; +import com.vaadin.client.widgets.Grid; /** * Multi-row selection model. @@ -107,8 +107,8 @@ public class SelectionModelMulti<T> extends AbstractRowHandleSelectionModel<T> @SuppressWarnings("unchecked") final LinkedHashSet<RowHandle<T>> selectedRowsClone = (LinkedHashSet<RowHandle<T>>) selectedRows .clone(); - SelectionEvent<T> event = new SelectionEvent<T>(grid, - null, getSelectedRows(), isBeingBatchSelected()); + SelectionEvent<T> event = new SelectionEvent<T>(grid, null, + getSelectedRows(), isBeingBatchSelected()); selectedRows.clear(); if (isBeingBatchSelected()) { diff --git a/client/src/com/vaadin/client/ui/grid/selection/SelectionModelNone.java b/client/src/com/vaadin/client/widget/grid/selection/SelectionModelNone.java index 8192237da0..68d547e54e 100644 --- a/client/src/com/vaadin/client/ui/grid/selection/SelectionModelNone.java +++ b/client/src/com/vaadin/client/widget/grid/selection/SelectionModelNone.java @@ -13,14 +13,14 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.selection; +package com.vaadin.client.widget.grid.selection; import java.util.Collection; import java.util.Collections; import com.vaadin.client.data.DataSource.RowHandle; -import com.vaadin.client.ui.grid.Grid; -import com.vaadin.client.ui.grid.Renderer; +import com.vaadin.client.renderers.Renderer; +import com.vaadin.client.widgets.Grid; /** * No-row selection model. diff --git a/client/src/com/vaadin/client/ui/grid/selection/SelectionModelSingle.java b/client/src/com/vaadin/client/widget/grid/selection/SelectionModelSingle.java index 727da8d4af..387c4d75e3 100644 --- a/client/src/com/vaadin/client/ui/grid/selection/SelectionModelSingle.java +++ b/client/src/com/vaadin/client/widget/grid/selection/SelectionModelSingle.java @@ -13,14 +13,14 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.selection; +package com.vaadin.client.widget.grid.selection; import java.util.Collection; import java.util.Collections; import com.vaadin.client.data.DataSource.RowHandle; -import com.vaadin.client.ui.grid.Grid; -import com.vaadin.client.ui.grid.Renderer; +import com.vaadin.client.renderers.Renderer; +import com.vaadin.client.widgets.Grid; /** * Single-row selection model. @@ -83,8 +83,7 @@ public class SelectionModelSingle<T> extends AbstractRowHandleSelectionModel<T> T removed = getSelectedRow(); if (selectByHandle(grid.getDataSource().getHandle(row))) { - grid.fireEvent(new SelectionEvent<T>(grid, row, removed, - false)); + grid.fireEvent(new SelectionEvent<T>(grid, row, removed, false)); return true; } diff --git a/client/src/com/vaadin/client/ui/grid/selection/SpaceSelectHandler.java b/client/src/com/vaadin/client/widget/grid/selection/SpaceSelectHandler.java index c92ebacfd1..3a3d0354fd 100644 --- a/client/src/com/vaadin/client/ui/grid/selection/SpaceSelectHandler.java +++ b/client/src/com/vaadin/client/widget/grid/selection/SpaceSelectHandler.java @@ -13,18 +13,18 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.selection; +package com.vaadin.client.widget.grid.selection; import com.google.gwt.event.dom.client.KeyCodes; import com.google.gwt.event.shared.HandlerRegistration; -import com.vaadin.client.ui.grid.Cell; -import com.vaadin.client.ui.grid.DataAvailableEvent; -import com.vaadin.client.ui.grid.DataAvailableHandler; -import com.vaadin.client.ui.grid.Grid; -import com.vaadin.client.ui.grid.events.BodyKeyDownHandler; -import com.vaadin.client.ui.grid.events.BodyKeyUpHandler; -import com.vaadin.client.ui.grid.events.GridKeyDownEvent; -import com.vaadin.client.ui.grid.events.GridKeyUpEvent; +import com.vaadin.client.widget.escalator.Cell; +import com.vaadin.client.widget.grid.DataAvailableEvent; +import com.vaadin.client.widget.grid.DataAvailableHandler; +import com.vaadin.client.widget.grid.events.BodyKeyDownHandler; +import com.vaadin.client.widget.grid.events.BodyKeyUpHandler; +import com.vaadin.client.widget.grid.events.GridKeyDownEvent; +import com.vaadin.client.widget.grid.events.GridKeyUpEvent; +import com.vaadin.client.widgets.Grid; import com.vaadin.shared.ui.grid.ScrollDestination; /** diff --git a/client/src/com/vaadin/client/ui/grid/sort/Sort.java b/client/src/com/vaadin/client/widget/grid/sort/Sort.java index dc6025a8ac..2b536a6e6e 100644 --- a/client/src/com/vaadin/client/ui/grid/sort/Sort.java +++ b/client/src/com/vaadin/client/widget/grid/sort/Sort.java @@ -13,12 +13,12 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.sort; +package com.vaadin.client.widget.grid.sort; import java.util.ArrayList; import java.util.List; -import com.vaadin.client.ui.grid.GridColumn; +import com.vaadin.client.widgets.Grid; import com.vaadin.shared.ui.grid.SortDirection; /** @@ -42,7 +42,7 @@ public class Sort { * @param direction * a sort direction */ - private Sort(GridColumn<?, ?> column, SortDirection direction) { + private Sort(Grid.Column<?, ?> column, SortDirection direction) { previous = null; count = 1; order = new SortOrder(column, direction); @@ -62,7 +62,8 @@ public class Sort { * @param direction * a sort direction */ - private Sort(Sort previous, GridColumn<?, ?> column, SortDirection direction) { + private Sort(Sort previous, Grid.Column<?, ?> column, + SortDirection direction) { this.previous = previous; count = previous.count + 1; order = new SortOrder(column, direction); @@ -85,7 +86,7 @@ public class Sort { * a grid column object reference * @return a sort instance, typed to the grid data type */ - public static Sort by(GridColumn<?, ?> column) { + public static Sort by(Grid.Column<?, ?> column) { return by(column, SortDirection.ASCENDING); } @@ -98,7 +99,7 @@ public class Sort { * indicator of sort direction - either ascending or descending * @return a sort instance, typed to the grid data type */ - public static Sort by(GridColumn<?, ?> column, SortDirection direction) { + public static Sort by(Grid.Column<?, ?> column, SortDirection direction) { return new Sort(column, direction); } @@ -111,7 +112,7 @@ public class Sort { * a grid column object reference * @return a sort instance, typed to the grid data type */ - public Sort then(GridColumn<?, ?> column) { + public Sort then(Grid.Column<?, ?> column) { return then(column, SortDirection.ASCENDING); } @@ -126,7 +127,7 @@ public class Sort { * indicator of sort direction - either ascending or descending * @return a sort instance, typed to the grid data type */ - public Sort then(GridColumn<?, ?> column, SortDirection direction) { + public Sort then(Grid.Column<?, ?> column, SortDirection direction) { return new Sort(this, column, direction); } diff --git a/client/src/com/vaadin/client/ui/grid/sort/SortEvent.java b/client/src/com/vaadin/client/widget/grid/sort/SortEvent.java index 02640766b5..3473e1e258 100644 --- a/client/src/com/vaadin/client/ui/grid/sort/SortEvent.java +++ b/client/src/com/vaadin/client/widget/grid/sort/SortEvent.java @@ -13,12 +13,12 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.sort; +package com.vaadin.client.widget.grid.sort; import java.util.List; import com.google.gwt.event.shared.GwtEvent; -import com.vaadin.client.ui.grid.Grid; +import com.vaadin.client.widgets.Grid; /** * A sort event, fired by the Grid when it needs its data source to provide data diff --git a/client/src/com/vaadin/client/ui/grid/sort/SortHandler.java b/client/src/com/vaadin/client/widget/grid/sort/SortHandler.java index d9b72e3343..bc7d78e97f 100644 --- a/client/src/com/vaadin/client/ui/grid/sort/SortHandler.java +++ b/client/src/com/vaadin/client/widget/grid/sort/SortHandler.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.sort; +package com.vaadin.client.widget.grid.sort; import com.google.gwt.event.shared.EventHandler; diff --git a/client/src/com/vaadin/client/ui/grid/sort/SortOrder.java b/client/src/com/vaadin/client/widget/grid/sort/SortOrder.java index 8878e18872..eb7d14a64d 100644 --- a/client/src/com/vaadin/client/ui/grid/sort/SortOrder.java +++ b/client/src/com/vaadin/client/widget/grid/sort/SortOrder.java @@ -13,9 +13,9 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid.sort; +package com.vaadin.client.widget.grid.sort; -import com.vaadin.client.ui.grid.GridColumn; +import com.vaadin.client.widgets.Grid; import com.vaadin.shared.ui.grid.SortDirection; /** @@ -28,7 +28,7 @@ import com.vaadin.shared.ui.grid.SortDirection; */ public class SortOrder { - private final GridColumn<?, ?> column; + private final Grid.Column<?, ?> column; private final SortDirection direction; /** @@ -38,7 +38,7 @@ public class SortOrder { * @param column * a grid column descriptor object */ - public SortOrder(GridColumn<?, ?> column) { + public SortOrder(Grid.Column<?, ?> column) { this(column, SortDirection.ASCENDING); } @@ -50,7 +50,7 @@ public class SortOrder { * @param direction * a sorting direction value (ascending or descending) */ - public SortOrder(GridColumn<?, ?> column, SortDirection direction) { + public SortOrder(Grid.Column<?, ?> column, SortDirection direction) { if (column == null) { throw new IllegalArgumentException( "Grid column reference can not be null!"); @@ -68,7 +68,7 @@ public class SortOrder { * * @return a grid column reference */ - public GridColumn<?, ?> getColumn() { + public Grid.Column<?, ?> getColumn() { return column; } diff --git a/client/src/com/vaadin/client/ui/grid/Escalator.java b/client/src/com/vaadin/client/widgets/Escalator.java index 092341a56e..d598be61a4 100644 --- a/client/src/com/vaadin/client/ui/grid/Escalator.java +++ b/client/src/com/vaadin/client/widgets/Escalator.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid; +package com.vaadin.client.widgets; import java.util.ArrayList; import java.util.HashMap; @@ -53,15 +53,26 @@ import com.google.gwt.user.client.ui.Widget; import com.vaadin.client.DeferredWorker; import com.vaadin.client.Profiler; import com.vaadin.client.Util; -import com.vaadin.client.ui.grid.Escalator.JsniUtil.TouchHandlerBundle; -import com.vaadin.client.ui.grid.PositionFunction.AbsolutePosition; -import com.vaadin.client.ui.grid.PositionFunction.Translate3DPosition; -import com.vaadin.client.ui.grid.PositionFunction.TranslatePosition; -import com.vaadin.client.ui.grid.PositionFunction.WebkitTranslate3DPosition; -import com.vaadin.client.ui.grid.ScrollbarBundle.HorizontalScrollbarBundle; -import com.vaadin.client.ui.grid.ScrollbarBundle.VerticalScrollbarBundle; -import com.vaadin.client.ui.grid.events.ScrollEvent; -import com.vaadin.client.ui.grid.events.ScrollHandler; +import com.vaadin.client.widget.escalator.Cell; +import com.vaadin.client.widget.escalator.ColumnConfiguration; +import com.vaadin.client.widget.escalator.EscalatorUpdater; +import com.vaadin.client.widget.escalator.FlyweightCell; +import com.vaadin.client.widget.escalator.FlyweightRow; +import com.vaadin.client.widget.escalator.PositionFunction; +import com.vaadin.client.widget.escalator.PositionFunction.AbsolutePosition; +import com.vaadin.client.widget.escalator.PositionFunction.Translate3DPosition; +import com.vaadin.client.widget.escalator.PositionFunction.TranslatePosition; +import com.vaadin.client.widget.escalator.PositionFunction.WebkitTranslate3DPosition; +import com.vaadin.client.widget.escalator.Row; +import com.vaadin.client.widget.escalator.RowContainer; +import com.vaadin.client.widget.escalator.RowVisibilityChangeEvent; +import com.vaadin.client.widget.escalator.RowVisibilityChangeHandler; +import com.vaadin.client.widget.escalator.ScrollbarBundle; +import com.vaadin.client.widget.escalator.ScrollbarBundle.HorizontalScrollbarBundle; +import com.vaadin.client.widget.escalator.ScrollbarBundle.VerticalScrollbarBundle; +import com.vaadin.client.widget.grid.events.ScrollEvent; +import com.vaadin.client.widget.grid.events.ScrollHandler; +import com.vaadin.client.widgets.Escalator.JsniUtil.TouchHandlerBundle; import com.vaadin.shared.ui.grid.GridState; import com.vaadin.shared.ui.grid.HeightMode; import com.vaadin.shared.ui.grid.Range; @@ -397,7 +408,7 @@ public class Escalator extends Widget implements RequiresResize, DeferredWorker // we need to store "this", since it won't be preserved on call. var self = this; return $entry(function (e) { - self.@com.vaadin.client.ui.grid.Escalator.JsniUtil.TouchHandlerBundle::touchStart(*)(e); + self.@com.vaadin.client.widgets.Escalator.JsniUtil.TouchHandlerBundle::touchStart(*)(e); }); }-*/; @@ -406,7 +417,7 @@ public class Escalator extends Widget implements RequiresResize, DeferredWorker // we need to store "this", since it won't be preserved on call. var self = this; return $entry(function (e) { - self.@com.vaadin.client.ui.grid.Escalator.JsniUtil.TouchHandlerBundle::touchMove(*)(e); + self.@com.vaadin.client.widgets.Escalator.JsniUtil.TouchHandlerBundle::touchMove(*)(e); }); }-*/; @@ -415,7 +426,7 @@ public class Escalator extends Widget implements RequiresResize, DeferredWorker // we need to store "this", since it won't be preserved on call. var self = this; return $entry(function (e) { - self.@com.vaadin.client.ui.grid.Escalator.JsniUtil.TouchHandlerBundle::touchEnd(*)(e); + self.@com.vaadin.client.widgets.Escalator.JsniUtil.TouchHandlerBundle::touchEnd(*)(e); }); }-*/; @@ -699,11 +710,11 @@ public class Escalator extends Widget implements RequiresResize, DeferredWorker protected native JavaScriptObject createScrollListenerFunction( Escalator esc) /*-{ - var vScroll = esc.@com.vaadin.client.ui.grid.Escalator::verticalScrollbar; - var vScrollElem = vScroll.@com.vaadin.client.ui.grid.ScrollbarBundle::getElement()(); + var vScroll = esc.@com.vaadin.client.widgets.Escalator::verticalScrollbar; + var vScrollElem = vScroll.@com.vaadin.client.widget.escalator.ScrollbarBundle::getElement()(); - var hScroll = esc.@com.vaadin.client.ui.grid.Escalator::horizontalScrollbar; - var hScrollElem = hScroll.@com.vaadin.client.ui.grid.ScrollbarBundle::getElement()(); + var hScroll = esc.@com.vaadin.client.widgets.Escalator::horizontalScrollbar; + var hScrollElem = hScroll.@com.vaadin.client.widget.escalator.ScrollbarBundle::getElement()(); return $entry(function(e) { var target = e.target || e.srcElement; // IE8 uses e.scrElement @@ -712,9 +723,9 @@ public class Escalator extends Widget implements RequiresResize, DeferredWorker // the scrollTop/Left was manually modified), the bundles have old cache // values. We need to make sure that the caches are kept up to date. if (target === vScrollElem) { - vScroll.@com.vaadin.client.ui.grid.ScrollbarBundle::updateScrollPosFromDom()(); + vScroll.@com.vaadin.client.widget.escalator.ScrollbarBundle::updateScrollPosFromDom()(); } else if (target === hScrollElem) { - hScroll.@com.vaadin.client.ui.grid.ScrollbarBundle::updateScrollPosFromDom()(); + hScroll.@com.vaadin.client.widget.escalator.ScrollbarBundle::updateScrollPosFromDom()(); } else { $wnd.console.error("unexpected scroll target: "+target); } @@ -734,7 +745,7 @@ public class Escalator extends Widget implements RequiresResize, DeferredWorker deltaY = -0.5*e.wheelDelta; } - @com.vaadin.client.ui.grid.Escalator.JsniUtil::moveScrollFromEvent(*)(esc, deltaX, deltaY, e); + @com.vaadin.client.widgets.Escalator.JsniUtil::moveScrollFromEvent(*)(esc, deltaX, deltaY, e); }); }-*/; @@ -895,9 +906,9 @@ public class Escalator extends Widget implements RequiresResize, DeferredWorker */ /*-{ if (element.addEventListener) { - element.addEventListener("scroll", this.@com.vaadin.client.ui.grid.JsniWorkaround::scrollListenerFunction); + element.addEventListener("scroll", this.@com.vaadin.client.widgets.JsniWorkaround::scrollListenerFunction); } else { - element.attachEvent("onscroll", this.@com.vaadin.client.ui.grid.JsniWorkaround::scrollListenerFunction); + element.attachEvent("onscroll", this.@com.vaadin.client.widgets.JsniWorkaround::scrollListenerFunction); } }-*/; @@ -912,9 +923,9 @@ public class Escalator extends Widget implements RequiresResize, DeferredWorker */ /*-{ if (element.addEventListener) { - element.removeEventListener("scroll", this.@com.vaadin.client.ui.grid.JsniWorkaround::scrollListenerFunction); + element.removeEventListener("scroll", this.@com.vaadin.client.widgets.JsniWorkaround::scrollListenerFunction); } else { - element.detachEvent("onscroll", this.@com.vaadin.client.ui.grid.JsniWorkaround::scrollListenerFunction); + element.detachEvent("onscroll", this.@com.vaadin.client.widgets.JsniWorkaround::scrollListenerFunction); } }-*/; @@ -931,10 +942,10 @@ public class Escalator extends Widget implements RequiresResize, DeferredWorker if (element.addEventListener) { // firefox likes "wheel", while others use "mousewheel" var eventName = element.onwheel===undefined?"mousewheel":"wheel"; - element.addEventListener(eventName, this.@com.vaadin.client.ui.grid.JsniWorkaround::mousewheelListenerFunction); + element.addEventListener(eventName, this.@com.vaadin.client.widgets.JsniWorkaround::mousewheelListenerFunction); } else { // IE8 - element.attachEvent("onmousewheel", this.@com.vaadin.client.ui.grid.JsniWorkaround::mousewheelListenerFunction); + element.attachEvent("onmousewheel", this.@com.vaadin.client.widgets.JsniWorkaround::mousewheelListenerFunction); } }-*/; @@ -951,10 +962,10 @@ public class Escalator extends Widget implements RequiresResize, DeferredWorker if (element.addEventListener) { // firefox likes "wheel", while others use "mousewheel" var eventName = element.onwheel===undefined?"mousewheel":"wheel"; - element.removeEventListener(eventName, this.@com.vaadin.client.ui.grid.JsniWorkaround::mousewheelListenerFunction); + element.removeEventListener(eventName, this.@com.vaadin.client.widgets.JsniWorkaround::mousewheelListenerFunction); } else { // IE8 - element.detachEvent("onmousewheel", this.@com.vaadin.client.ui.grid.JsniWorkaround::mousewheelListenerFunction); + element.detachEvent("onmousewheel", this.@com.vaadin.client.widgets.JsniWorkaround::mousewheelListenerFunction); } }-*/; @@ -969,10 +980,10 @@ public class Escalator extends Widget implements RequiresResize, DeferredWorker */ /*-{ if (element.addEventListener) { - element.addEventListener("touchstart", this.@com.vaadin.client.ui.grid.JsniWorkaround::touchStartFunction); - element.addEventListener("touchmove", this.@com.vaadin.client.ui.grid.JsniWorkaround::touchMoveFunction); - element.addEventListener("touchend", this.@com.vaadin.client.ui.grid.JsniWorkaround::touchEndFunction); - element.addEventListener("touchcancel", this.@com.vaadin.client.ui.grid.JsniWorkaround::touchEndFunction); + element.addEventListener("touchstart", this.@com.vaadin.client.widgets.JsniWorkaround::touchStartFunction); + element.addEventListener("touchmove", this.@com.vaadin.client.widgets.JsniWorkaround::touchMoveFunction); + element.addEventListener("touchend", this.@com.vaadin.client.widgets.JsniWorkaround::touchEndFunction); + element.addEventListener("touchcancel", this.@com.vaadin.client.widgets.JsniWorkaround::touchEndFunction); } else { // this would be IE8, but we don't support it with touch } @@ -989,10 +1000,10 @@ public class Escalator extends Widget implements RequiresResize, DeferredWorker */ /*-{ if (element.removeEventListener) { - element.removeEventListener("touchstart", this.@com.vaadin.client.ui.grid.JsniWorkaround::touchStartFunction); - element.removeEventListener("touchmove", this.@com.vaadin.client.ui.grid.JsniWorkaround::touchMoveFunction); - element.removeEventListener("touchend", this.@com.vaadin.client.ui.grid.JsniWorkaround::touchEndFunction); - element.removeEventListener("touchcancel", this.@com.vaadin.client.ui.grid.JsniWorkaround::touchEndFunction); + element.removeEventListener("touchstart", this.@com.vaadin.client.widgets.JsniWorkaround::touchStartFunction); + element.removeEventListener("touchmove", this.@com.vaadin.client.widgets.JsniWorkaround::touchMoveFunction); + element.removeEventListener("touchend", this.@com.vaadin.client.widgets.JsniWorkaround::touchEndFunction); + element.removeEventListener("touchcancel", this.@com.vaadin.client.widgets.JsniWorkaround::touchEndFunction); } else { // this would be IE8, but we don't support it with touch } diff --git a/client/src/com/vaadin/client/ui/grid/Grid.java b/client/src/com/vaadin/client/widgets/Grid.java index ef804fbe1d..e50fcb8ba6 100644 --- a/client/src/com/vaadin/client/ui/grid/Grid.java +++ b/client/src/com/vaadin/client/widgets/Grid.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.client.ui.grid; +package com.vaadin.client.widgets; import java.util.ArrayList; import java.util.Arrays; @@ -60,51 +60,64 @@ import com.vaadin.client.DeferredWorker; import com.vaadin.client.Util; import com.vaadin.client.data.DataChangeHandler; import com.vaadin.client.data.DataSource; +import com.vaadin.client.renderers.ComplexRenderer; +import com.vaadin.client.renderers.Renderer; +import com.vaadin.client.renderers.WidgetRenderer; import com.vaadin.client.ui.SubPartAware; -import com.vaadin.client.ui.grid.EditorRowHandler.EditorRowRequest; -import com.vaadin.client.ui.grid.EditorRowHandler.EditorRowRequest.RequestCallback; -import com.vaadin.client.ui.grid.Escalator.AbstractRowContainer; -import com.vaadin.client.ui.grid.ScrollbarBundle.Direction; -import com.vaadin.client.ui.grid.events.AbstractGridKeyEventHandler; -import com.vaadin.client.ui.grid.events.AbstractGridMouseEventHandler; -import com.vaadin.client.ui.grid.events.BodyClickHandler; -import com.vaadin.client.ui.grid.events.BodyKeyDownHandler; -import com.vaadin.client.ui.grid.events.BodyKeyPressHandler; -import com.vaadin.client.ui.grid.events.BodyKeyUpHandler; -import com.vaadin.client.ui.grid.events.FooterClickHandler; -import com.vaadin.client.ui.grid.events.FooterKeyDownHandler; -import com.vaadin.client.ui.grid.events.FooterKeyPressHandler; -import com.vaadin.client.ui.grid.events.FooterKeyUpHandler; -import com.vaadin.client.ui.grid.events.GridClickEvent; -import com.vaadin.client.ui.grid.events.GridKeyDownEvent; -import com.vaadin.client.ui.grid.events.GridKeyPressEvent; -import com.vaadin.client.ui.grid.events.GridKeyUpEvent; -import com.vaadin.client.ui.grid.events.HeaderClickHandler; -import com.vaadin.client.ui.grid.events.HeaderKeyDownHandler; -import com.vaadin.client.ui.grid.events.HeaderKeyPressHandler; -import com.vaadin.client.ui.grid.events.HeaderKeyUpHandler; -import com.vaadin.client.ui.grid.events.ScrollEvent; -import com.vaadin.client.ui.grid.events.ScrollHandler; -import com.vaadin.client.ui.grid.events.SelectAllEvent; -import com.vaadin.client.ui.grid.events.SelectAllHandler; -import com.vaadin.client.ui.grid.renderers.ComplexRenderer; -import com.vaadin.client.ui.grid.renderers.WidgetRenderer; -import com.vaadin.client.ui.grid.selection.HasSelectionHandlers; -import com.vaadin.client.ui.grid.selection.SelectionEvent; -import com.vaadin.client.ui.grid.selection.SelectionHandler; -import com.vaadin.client.ui.grid.selection.SelectionModel; -import com.vaadin.client.ui.grid.selection.SelectionModel.Multi; -import com.vaadin.client.ui.grid.selection.SelectionModelMulti; -import com.vaadin.client.ui.grid.selection.SelectionModelNone; -import com.vaadin.client.ui.grid.selection.SelectionModelSingle; -import com.vaadin.client.ui.grid.sort.Sort; -import com.vaadin.client.ui.grid.sort.SortEvent; -import com.vaadin.client.ui.grid.sort.SortHandler; -import com.vaadin.client.ui.grid.sort.SortOrder; +import com.vaadin.client.widget.escalator.Cell; +import com.vaadin.client.widget.escalator.ColumnConfiguration; +import com.vaadin.client.widget.escalator.EscalatorUpdater; +import com.vaadin.client.widget.escalator.FlyweightCell; +import com.vaadin.client.widget.escalator.Row; +import com.vaadin.client.widget.escalator.RowContainer; +import com.vaadin.client.widget.escalator.RowVisibilityChangeEvent; +import com.vaadin.client.widget.escalator.RowVisibilityChangeHandler; +import com.vaadin.client.widget.escalator.ScrollbarBundle.Direction; import com.vaadin.client.widget.grid.CellReference; import com.vaadin.client.widget.grid.CellStyleGenerator; +import com.vaadin.client.widget.grid.DataAvailableEvent; +import com.vaadin.client.widget.grid.DataAvailableHandler; +import com.vaadin.client.widget.grid.EditorRowHandler; +import com.vaadin.client.widget.grid.EditorRowHandler.EditorRowRequest; +import com.vaadin.client.widget.grid.EditorRowHandler.EditorRowRequest.RequestCallback; +import com.vaadin.client.widget.grid.GridUtil; import com.vaadin.client.widget.grid.RowReference; import com.vaadin.client.widget.grid.RowStyleGenerator; +import com.vaadin.client.widget.grid.events.AbstractGridKeyEventHandler; +import com.vaadin.client.widget.grid.events.AbstractGridMouseEventHandler; +import com.vaadin.client.widget.grid.events.BodyClickHandler; +import com.vaadin.client.widget.grid.events.BodyKeyDownHandler; +import com.vaadin.client.widget.grid.events.BodyKeyPressHandler; +import com.vaadin.client.widget.grid.events.BodyKeyUpHandler; +import com.vaadin.client.widget.grid.events.FooterClickHandler; +import com.vaadin.client.widget.grid.events.FooterKeyDownHandler; +import com.vaadin.client.widget.grid.events.FooterKeyPressHandler; +import com.vaadin.client.widget.grid.events.FooterKeyUpHandler; +import com.vaadin.client.widget.grid.events.GridClickEvent; +import com.vaadin.client.widget.grid.events.GridKeyDownEvent; +import com.vaadin.client.widget.grid.events.GridKeyPressEvent; +import com.vaadin.client.widget.grid.events.GridKeyUpEvent; +import com.vaadin.client.widget.grid.events.HeaderClickHandler; +import com.vaadin.client.widget.grid.events.HeaderKeyDownHandler; +import com.vaadin.client.widget.grid.events.HeaderKeyPressHandler; +import com.vaadin.client.widget.grid.events.HeaderKeyUpHandler; +import com.vaadin.client.widget.grid.events.ScrollEvent; +import com.vaadin.client.widget.grid.events.ScrollHandler; +import com.vaadin.client.widget.grid.events.SelectAllEvent; +import com.vaadin.client.widget.grid.events.SelectAllHandler; +import com.vaadin.client.widget.grid.selection.HasSelectionHandlers; +import com.vaadin.client.widget.grid.selection.SelectionEvent; +import com.vaadin.client.widget.grid.selection.SelectionHandler; +import com.vaadin.client.widget.grid.selection.SelectionModel; +import com.vaadin.client.widget.grid.selection.SelectionModel.Multi; +import com.vaadin.client.widget.grid.selection.SelectionModelMulti; +import com.vaadin.client.widget.grid.selection.SelectionModelNone; +import com.vaadin.client.widget.grid.selection.SelectionModelSingle; +import com.vaadin.client.widget.grid.sort.Sort; +import com.vaadin.client.widget.grid.sort.SortEvent; +import com.vaadin.client.widget.grid.sort.SortHandler; +import com.vaadin.client.widget.grid.sort.SortOrder; +import com.vaadin.client.widgets.Escalator.AbstractRowContainer; import com.vaadin.shared.ui.grid.GridColumnState; import com.vaadin.shared.ui.grid.GridConstants; import com.vaadin.shared.ui.grid.GridStaticCellType; @@ -120,30 +133,29 @@ import com.vaadin.shared.util.SharedUtil; * * <h1>Columns</h1> * <p> - * Each column in Grid is represented by a {@link GridColumn}. Each + * Each column in Grid is represented by a {@link Column}. Each * {@code GridColumn} has a custom implementation for - * {@link GridColumn#getValue(Object)} that gets the row object as an argument, - * and returns the value for that particular column, extracted from the row - * object. + * {@link Column#getValue(Object)} that gets the row object as an argument, and + * returns the value for that particular column, extracted from the row object. * <p> * Each column also has a Renderer. Its function is to take the value that is * given by the {@code GridColumn} and display it to the user. A simple column - * might have a {@link com.vaadin.client.ui.grid.renderers.TextRenderer - * TextRenderer} that simply takes in a {@code String} and displays it as the - * cell's content. A more complex renderer might be - * {@link com.vaadin.client.ui.grid.renderers.ProgressBarRenderer - * ProgressBarRenderer} that takes in a floating point number, and displays a - * progress bar instead, based on the given number. + * might have a {@link com.vaadin.client.renderers.TextRenderer TextRenderer} + * that simply takes in a {@code String} and displays it as the cell's content. + * A more complex renderer might be + * {@link com.vaadin.client.renderers.ProgressBarRenderer ProgressBarRenderer} + * that takes in a floating point number, and displays a progress bar instead, + * based on the given number. * <p> - * <em>See:</em> {@link #addColumn(GridColumn)}, - * {@link #addColumn(GridColumn, int)} and {@link #addColumns(GridColumn...)}. - * <em>Also</em> {@link GridColumn#setRenderer(Renderer)}. + * <em>See:</em> {@link #addColumn(Column)}, {@link #addColumn(Column, int)} and + * {@link #addColumns(Column...)}. <em>Also</em> + * {@link Column#setRenderer(Renderer)}. * * <h1>Data Sources</h1> * <p> * Grid gets its data from a {@link DataSource}, providing row objects to Grid * from a user-defined endpoint. It can be either a local in-memory data source - * (e.g. {@link com.vaadin.client.ui.grid.datasources.ListDataSource + * (e.g. {@link com.vaadin.client.widget.grid.datasources.ListDataSource * ListDataSource}) or even a remote one, retrieving data from e.g. a REST API * (see {@link com.vaadin.client.data.AbstractRemoteDataSource * AbstractRemoteDataSource}). @@ -159,6 +171,13 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, SubPartAware, DeferredWorker { /** + * Enum describing different sections of Grid. + */ + public enum Section { + HEADER, BODY, FOOTER + } + + /** * Abstract base class for Grid header and footer sections. * * @param <ROWTYPE> @@ -345,14 +364,14 @@ public class Grid<T> extends ResizeComposite implements */ abstract static class StaticRow<CELLTYPE extends StaticCell> { - private Map<GridColumn<?, ?>, CELLTYPE> cells = new HashMap<GridColumn<?, ?>, CELLTYPE>(); + private Map<Column<?, ?>, CELLTYPE> cells = new HashMap<Column<?, ?>, CELLTYPE>(); private StaticSection<?> section; /** * Map from set of spanned columns to cell meta data. */ - private Map<Set<GridColumn<?, ?>>, CELLTYPE> cellGroups = new HashMap<Set<GridColumn<?, ?>>, CELLTYPE>(); + private Map<Set<Column<?, ?>>, CELLTYPE> cellGroups = new HashMap<Set<Column<?, ?>>, CELLTYPE>(); /** * A custom style name for the row or null if none is set. @@ -368,8 +387,8 @@ public class Grid<T> extends ResizeComposite implements * @return the cell on given column, merged cell for merged columns, * null if not found */ - public CELLTYPE getCell(GridColumn<?, ?> column) { - Set<GridColumn<?, ?>> cellGroup = getCellGroupForColumn(column); + public CELLTYPE getCell(Column<?, ?> column) { + Set<Column<?, ?>> cellGroup = getCellGroupForColumn(column); if (cellGroup != null) { return cellGroups.get(cellGroup); } @@ -384,14 +403,14 @@ public class Grid<T> extends ResizeComposite implements * @return the remaining visible cell after the merge, or the cell * on first column if all are hidden */ - public CELLTYPE join(GridColumn<?, ?>... columns) { + public CELLTYPE join(Column<?, ?>... columns) { if (columns.length <= 1) { throw new IllegalArgumentException( "You can't merge less than 2 columns together."); } - HashSet<GridColumn<?, ?>> columnGroup = new HashSet<GridColumn<?, ?>>(); - for (GridColumn<?, ?> column : columns) { + HashSet<Column<?, ?>> columnGroup = new HashSet<Column<?, ?>>(); + for (Column<?, ?> column : columns) { if (!cells.containsKey(column)) { throw new IllegalArgumentException( "Given column does not exists on row " + column); @@ -425,10 +444,10 @@ public class Grid<T> extends ResizeComposite implements "You can't merge less than 2 cells together."); } - GridColumn<?, ?>[] columns = new GridColumn<?, ?>[cells.length]; + Column<?, ?>[] columns = new Column<?, ?>[cells.length]; int j = 0; - for (GridColumn<?, ?> column : this.cells.keySet()) { + for (Column<?, ?> column : this.cells.keySet()) { CELLTYPE cell = this.cells.get(column); if (!this.cells.containsValue(cells[j])) { throw new IllegalArgumentException( @@ -444,9 +463,8 @@ public class Grid<T> extends ResizeComposite implements return join(columns); } - private Set<GridColumn<?, ?>> getCellGroupForColumn( - GridColumn<?, ?> column) { - for (Set<GridColumn<?, ?>> group : cellGroups.keySet()) { + private Set<Column<?, ?>> getCellGroupForColumn(Column<?, ?> column) { + for (Set<Column<?, ?>> group : cellGroups.keySet()) { if (group.contains(column)) { return group; } @@ -461,10 +479,10 @@ public class Grid<T> extends ResizeComposite implements cell.setColspan(1); } - List<GridColumn<?, ?>> columnOrder = new ArrayList<GridColumn<?, ?>>( + List<Column<?, ?>> columnOrder = new ArrayList<Column<?, ?>>( section.grid.getColumns()); // Set colspan for grouped cells - for (Set<GridColumn<?, ?>> group : cellGroups.keySet()) { + for (Set<Column<?, ?>> group : cellGroups.keySet()) { if (!checkCellGroupAndOrder(columnOrder, group)) { cellGroups.get(group).setColspan(1); } else { @@ -476,8 +494,7 @@ public class Grid<T> extends ResizeComposite implements } private boolean checkCellGroupAndOrder( - List<GridColumn<?, ?>> columnOrder, - Set<GridColumn<?, ?>> cellGroup) { + List<Column<?, ?>> columnOrder, Set<Column<?, ?>> cellGroup) { if (!columnOrder.containsAll(cellGroup)) { return false; } @@ -497,13 +514,13 @@ public class Grid<T> extends ResizeComposite implements return false; } - protected void addCell(GridColumn<?, ?> column) { + protected void addCell(Column<?, ?> column) { CELLTYPE cell = createCell(); cell.setSection(getSection()); cells.put(column, cell); } - protected void removeCell(GridColumn<?, ?> column) { + protected void removeCell(Column<?, ?> column) { cells.remove(column); } @@ -711,13 +728,13 @@ public class Grid<T> extends ResizeComposite implements return isVisible() ? getRowCount() : 0; } - protected void addColumn(GridColumn<?, ?> column) { + protected void addColumn(Column<?, ?> column) { for (ROWTYPE row : rows) { row.addCell(column); } } - protected void removeColumn(GridColumn<?, ?> column) { + protected void removeColumn(Column<?, ?> column) { for (ROWTYPE row : rows) { row.removeCell(column); } @@ -927,7 +944,7 @@ public class Grid<T> extends ResizeComposite implements private DivElement editorOverlay = DivElement.as(DOM.createDiv()); - private Map<GridColumn<?, T>, Widget> columnToWidget = new HashMap<GridColumn<?, T>, Widget>(); + private Map<Column<?, T>, Widget> columnToWidget = new HashMap<Column<?, T>, Widget>(); private boolean enabled = false; private State state = State.INACTIVE; @@ -1133,7 +1150,7 @@ public class Grid<T> extends ResizeComposite implements * the column * @return the widget if the editor row is open, null otherwise */ - protected Widget getWidget(GridColumn<?, T> column) { + protected Widget getWidget(Column<?, T> column) { return columnToWidget.get(column); } @@ -1174,7 +1191,7 @@ public class Grid<T> extends ResizeComposite implements editorOverlay.appendChild(cell); - GridColumn<?, T> column = grid.getColumn(i); + Column<?, T> column = grid.getColumn(i); if (column == grid.selectionColumn) { continue; } @@ -1271,13 +1288,6 @@ public class Grid<T> extends ResizeComposite implements public static abstract class AbstractGridKeyEvent<HANDLER extends AbstractGridKeyEventHandler> extends KeyEvent<HANDLER> { - /** - * Enum describing different sections of Grid. - */ - public enum GridSection { - HEADER, BODY, FOOTER - } - private Grid<?> grid; protected Cell focusedCell; private final Type<HANDLER> associatedType = new Type<HANDLER>( @@ -1314,19 +1324,19 @@ public class Grid<T> extends ResizeComposite implements && !grid.isElementInChildWidget(Element.as(target))) { focusedCell = grid.cellFocusHandler.getFocusedCell(); - GridSection section = GridSection.FOOTER; + Section section = Section.FOOTER; final RowContainer container = grid.cellFocusHandler.containerWithFocus; if (container == grid.escalator.getHeader()) { - section = GridSection.HEADER; + section = Section.HEADER; } else if (container == grid.escalator.getBody()) { - section = GridSection.BODY; + section = Section.BODY; } doDispatch(handler, section); } } - protected abstract void doDispatch(HANDLER handler, GridSection section); + protected abstract void doDispatch(HANDLER handler, Section section); @Override public Type<HANDLER> getAssociatedType() { @@ -1337,13 +1347,6 @@ public class Grid<T> extends ResizeComposite implements public static abstract class AbstractGridMouseEvent<HANDLER extends AbstractGridMouseEventHandler> extends MouseEvent<HANDLER> { - /** - * Enum describing different sections of Grid. - */ - public enum GridSection { - HEADER, BODY, FOOTER - } - private Grid<?> grid; protected Cell targetCell; private final Type<HANDLER> associatedType = new Type<HANDLER>( @@ -1400,17 +1403,17 @@ public class Grid<T> extends ResizeComposite implements return; } - GridSection section = GridSection.FOOTER; + Section section = Section.FOOTER; if (container == grid.escalator.getHeader()) { - section = GridSection.HEADER; + section = Section.HEADER; } else if (container == grid.escalator.getBody()) { - section = GridSection.BODY; + section = Section.BODY; } doDispatch(handler, section); } - protected abstract void doDispatch(HANDLER handler, GridSection section); + protected abstract void doDispatch(HANDLER handler, Section section); @Override public Type<HANDLER> getAssociatedType() { @@ -1808,7 +1811,7 @@ public class Grid<T> extends ResizeComposite implements } } - public final class SelectionColumn extends GridColumn<Boolean, T> { + public final class SelectionColumn extends Column<Boolean, T> { private boolean initDone = false; SelectionColumn(final Renderer<Boolean> selectColumnRenderer) { @@ -1848,7 +1851,7 @@ public class Grid<T> extends ResizeComposite implements } @Override - public GridColumn<Boolean, T> setWidth(double pixels) { + public Column<Boolean, T> setWidth(double pixels) { if (pixels != getWidth() && initDone) { throw new UnsupportedOperationException("The selection " + "column cannot be modified after init"); @@ -1865,7 +1868,7 @@ public class Grid<T> extends ResizeComposite implements } @Override - public GridColumn<Boolean, T> setExpandRatio(int ratio) { + public Column<Boolean, T> setExpandRatio(int ratio) { throw new UnsupportedOperationException( "can't change the expand ratio of the selection column"); } @@ -1876,7 +1879,7 @@ public class Grid<T> extends ResizeComposite implements } @Override - public GridColumn<Boolean, T> setMaximumWidth(double pixels) { + public Column<Boolean, T> setMaximumWidth(double pixels) { throw new UnsupportedOperationException( "can't change the maximum width of the selection column"); } @@ -1887,7 +1890,7 @@ public class Grid<T> extends ResizeComposite implements } @Override - public GridColumn<Boolean, T> setMinimumWidth(double pixels) { + public Column<Boolean, T> setMinimumWidth(double pixels) { throw new UnsupportedOperationException( "can't change the minimum width of the selection column"); } @@ -1934,7 +1937,7 @@ public class Grid<T> extends ResizeComposite implements */ public void sort(Cell cell, boolean multisort) { - final GridColumn<?, T> column = getColumn(cell.getColumn()); + final Column<?, T> column = getColumn(cell.getColumn()); if (!column.isSortable()) { return; } @@ -2056,10 +2059,10 @@ public class Grid<T> extends ResizeComposite implements * immediately (ignoring lazy loading completely), or * <code>false</code> if the command should be run after a * while (duplicate non-immediately invocations are ignored). - * @see GridColumn#setWidth(double) - * @see GridColumn#setExpandRatio(int) - * @see GridColumn#setMinimumWidth(double) - * @see GridColumn#setMaximumWidth(double) + * @see Column#setWidth(double) + * @see Column#setExpandRatio(int) + * @see Column#setMinimumWidth(double) + * @see Column#setMaximumWidth(double) */ public void schedule() { if (!isScheduled) { @@ -2091,7 +2094,7 @@ public class Grid<T> extends ResizeComposite implements boolean someColumnExpands = false; int totalRatios = 0; double reservedPixels = 0; - final Set<GridColumn<?, ?>> columnsToExpand = new HashSet<GridColumn<?, ?>>(); + final Set<Column<?, ?>> columnsToExpand = new HashSet<Column<?, ?>>(); /* * Set all fixed widths and also calculate the size-to-fit widths @@ -2100,7 +2103,7 @@ public class Grid<T> extends ResizeComposite implements * This way we know with how many pixels we have left to expand the * rest. */ - for (GridColumn<?, ?> column : getColumns()) { + for (Column<?, ?> column : getColumns()) { final double widthAsIs = column.getWidth(); final boolean isFixedWidth = widthAsIs >= 0; final double widthFixed = Math.max(widthAsIs, @@ -2135,7 +2138,7 @@ public class Grid<T> extends ResizeComposite implements if (!someColumnExpands) { assert totalRatios == 0 : "totalRatios should've been 0"; assert columnsToExpand.isEmpty() : "columnsToExpand should've been empty"; - for (GridColumn<?, ?> column : getColumns()) { + for (Column<?, ?> column : getColumns()) { final double width = column.getWidth(); final int expandRatio = column.getExpandRatio(); if (width < 0 && expandRatio < 0) { @@ -2165,9 +2168,9 @@ public class Grid<T> extends ResizeComposite implements do { aColumnHasMaxedOut = false; final double widthPerRatio = pixelsToDistribute / totalRatios; - final Iterator<GridColumn<?, ?>> i = columnsToExpand.iterator(); + final Iterator<Column<?, ?>> i = columnsToExpand.iterator(); while (i.hasNext()) { - final GridColumn<?, ?> column = i.next(); + final Column<?, ?> column = i.next(); final int expandRatio = getExpandRatio(column, someColumnExpands); final double autoWidth = column.getWidthActual(); @@ -2201,7 +2204,7 @@ public class Grid<T> extends ResizeComposite implements * to the remaining columns. */ final double widthPerRatio = pixelsToDistribute / totalRatios; - for (GridColumn<?, ?> column : columnsToExpand) { + for (Column<?, ?> column : columnsToExpand) { final int expandRatio = getExpandRatio(column, someColumnExpands); final double autoWidth = column.getWidthActual(); @@ -2228,7 +2231,7 @@ public class Grid<T> extends ResizeComposite implements * remove those pixels from other columns */ double pixelsToRemoveFromOtherColumns = 0; - for (GridColumn<?, T> column : getColumns()) { + for (Column<?, T> column : getColumns()) { /* * We can't iterate over columnsToExpand, even though that * would be convenient. This is because some column without @@ -2258,12 +2261,12 @@ public class Grid<T> extends ResizeComposite implements * their ratios. Recalculate the sum of remaining ratios. */ totalRatios = 0; - for (GridColumn<?, ?> column : columnsToExpand) { + for (Column<?, ?> column : columnsToExpand) { totalRatios += getExpandRatio(column, someColumnExpands); } final double pixelsToRemovePerRatio = pixelsToRemoveFromOtherColumns / totalRatios; - for (GridColumn<?, ?> column : columnsToExpand) { + for (Column<?, ?> column : columnsToExpand) { final double pixelsToRemove = pixelsToRemovePerRatio * getExpandRatio(column, someColumnExpands); column.doSetWidth(column.getWidthActual() - pixelsToRemove); @@ -2274,7 +2277,7 @@ public class Grid<T> extends ResizeComposite implements private boolean gridWasTooNarrowAndEverythingWasFixedAlready() { double freeSpace = escalator.getInnerWidth(); - for (GridColumn<?, ?> column : getColumns()) { + for (Column<?, ?> column : getColumns()) { if (column.getWidth() >= 0) { freeSpace -= column.getWidth(); } else if (column.getMinimumWidth() >= 0) { @@ -2283,7 +2286,7 @@ public class Grid<T> extends ResizeComposite implements } if (freeSpace < 0) { - for (GridColumn<?, ?> column : getColumns()) { + for (Column<?, ?> column : getColumns()) { column.doSetWidth(column.getWidth()); boolean wasFixedWidth = column.getWidth() <= 0; @@ -2298,7 +2301,7 @@ public class Grid<T> extends ResizeComposite implements return freeSpace < 0; } - private int getExpandRatio(GridColumn<?, ?> column, + private int getExpandRatio(Column<?, ?> column, boolean someColumnExpands) { int expandRatio = column.getExpandRatio(); if (expandRatio > 0) { @@ -2316,7 +2319,7 @@ public class Grid<T> extends ResizeComposite implements * Returns the maximum width of the column, or {@link Double#MAX_VALUE} * if defined as negative. */ - private double getMaxWidth(GridColumn<?, ?> column) { + private double getMaxWidth(Column<?, ?> column) { double maxWidth = column.getMaximumWidth(); if (maxWidth >= 0) { return maxWidth; @@ -2329,7 +2332,7 @@ public class Grid<T> extends ResizeComposite implements * Returns the minimum width of the column, or {@link Double#MIN_VALUE} * if defined as negative. */ - private double getMinWidth(GridColumn<?, ?> column) { + private double getMinWidth(Column<?, ?> column) { double minWidth = column.getMinimumWidth(); if (minWidth >= 0) { return minWidth; @@ -2361,7 +2364,7 @@ public class Grid<T> extends ResizeComposite implements /** * List of columns in the grid. Order defines the visible order. */ - private List<GridColumn<?, T>> columns = new ArrayList<GridColumn<?, T>>(); + private List<Column<?, T>> columns = new ArrayList<Column<?, T>>(); /** * The datasource currently in use. <em>Note:</em> it is <code>null</code> @@ -2476,7 +2479,7 @@ public class Grid<T> extends ResizeComposite implements /** * Base class for grid columns internally used by the Grid. The user should - * use {@link GridColumn} when creating new columns. + * use {@link Column} when creating new columns. * * @param <C> * the column type @@ -2484,7 +2487,7 @@ public class Grid<T> extends ResizeComposite implements * @param <T> * the row type */ - static abstract class AbstractGridColumn<C, T> { + public static abstract class Column<C, T> { /** * Default renderer for GridColumns. Renders everything into text @@ -2499,7 +2502,7 @@ public class Grid<T> extends ResizeComposite implements public void render(FlyweightCell cell, Object data) { if (!warned) { getLogger().warning( - AbstractGridColumn.this.toString() + ": " + Column.this.toString() + ": " + DEFAULT_RENDERER_WARNING); warned = true; } @@ -2534,7 +2537,7 @@ public class Grid<T> extends ResizeComposite implements /** * Constructs a new column with a simple TextRenderer. */ - public AbstractGridColumn() { + public Column() { setRenderer(new DefaultTextRenderer()); } @@ -2547,8 +2550,7 @@ public class Grid<T> extends ResizeComposite implements * @throws IllegalArgumentException * if given header text is null */ - public AbstractGridColumn(String headerText) - throws IllegalArgumentException { + public Column(String headerText) throws IllegalArgumentException { this(); setHeaderText(headerText); } @@ -2562,7 +2564,7 @@ public class Grid<T> extends ResizeComposite implements * @throws IllegalArgumentException * if given Renderer is null */ - public AbstractGridColumn(Renderer<? super C> renderer) + public Column(Renderer<? super C> renderer) throws IllegalArgumentException { setRenderer(renderer); } @@ -2578,8 +2580,8 @@ public class Grid<T> extends ResizeComposite implements * @throws IllegalArgumentException * if given Renderer or header text is null */ - public AbstractGridColumn(String headerText, - Renderer<? super C> renderer) throws IllegalArgumentException { + public Column(String headerText, Renderer<? super C> renderer) + throws IllegalArgumentException { this(renderer); setHeaderText(headerText); } @@ -2617,7 +2619,7 @@ public class Grid<T> extends ResizeComposite implements * @throws IllegalArgumentException * if given header text is null */ - public GridColumn<C, T> setHeaderText(String headerText) { + public Column<C, T> setHeaderText(String headerText) { if (headerText == null) { throw new IllegalArgumentException( "Header text cannot be null."); @@ -2630,13 +2632,13 @@ public class Grid<T> extends ResizeComposite implements } } - return (GridColumn<C, T>) this; + return this; } private void updateHeader() { HeaderRow row = grid.getHeader().getDefaultRow(); if (row != null) { - row.getCell((GridColumn<?, ?>) this).setText(headerText); + row.getCell(this).setText(headerText); } } @@ -2676,7 +2678,7 @@ public class Grid<T> extends ResizeComposite implements * @throws IllegalArgumentException * if given Renderer is null */ - public GridColumn<C, T> setRenderer(Renderer<? super C> renderer) + public Column<C, T> setRenderer(Renderer<? super C> renderer) throws IllegalArgumentException { if (renderer == null) { throw new IllegalArgumentException("Renderer cannot be null."); @@ -2687,7 +2689,7 @@ public class Grid<T> extends ResizeComposite implements grid.refreshBody(); } - return (GridColumn<C, T>) this; + return this; } /** @@ -2701,12 +2703,12 @@ public class Grid<T> extends ResizeComposite implements * @param pixels * the width in pixels or negative for auto sizing */ - public GridColumn<C, T> setWidth(double pixels) { + public Column<C, T> setWidth(double pixels) { if (widthUser != pixels) { widthUser = pixels; scheduleColumnWidthRecalculator(); } - return (GridColumn<C, T>) this; + return this; } void doSetWidth(double pixels) { @@ -2760,7 +2762,7 @@ public class Grid<T> extends ResizeComposite implements * <code>true</code> when column sort indicators are visible. * @return the column itself */ - public GridColumn<C, T> setSortable(boolean sortable) { + public Column<C, T> setSortable(boolean sortable) { if (this.sortable != sortable) { this.sortable = sortable; if (grid != null) { @@ -2768,7 +2770,7 @@ public class Grid<T> extends ResizeComposite implements } } - return (GridColumn<C, T>) this; + return this; } /** @@ -2820,7 +2822,7 @@ public class Grid<T> extends ResizeComposite implements * the minimum width * @return this column */ - public GridColumn<C, T> setMinimumWidth(double pixels) { + public Column<C, T> setMinimumWidth(double pixels) { final double maxwidth = getMaximumWidth(); if (pixels >= 0 && pixels > maxwidth && maxwidth >= 0) { throw new IllegalArgumentException("New minimum width (" @@ -2832,7 +2834,7 @@ public class Grid<T> extends ResizeComposite implements minimumWidthPx = pixels; scheduleColumnWidthRecalculator(); } - return (GridColumn<C, T>) this; + return this; } /** @@ -2854,7 +2856,7 @@ public class Grid<T> extends ResizeComposite implements * while (duplicate non-immediately invocations are ignored). * @return this column */ - public GridColumn<C, T> setMaximumWidth(double pixels) { + public Column<C, T> setMaximumWidth(double pixels) { final double minwidth = getMinimumWidth(); if (pixels >= 0 && pixels < minwidth && minwidth >= 0) { throw new IllegalArgumentException("New maximum width (" @@ -2866,7 +2868,7 @@ public class Grid<T> extends ResizeComposite implements maximumWidthPx = pixels; scheduleColumnWidthRecalculator(); } - return (GridColumn<C, T>) this; + return this; } /** @@ -2899,12 +2901,12 @@ public class Grid<T> extends ResizeComposite implements * value. * @return this column */ - public GridColumn<C, T> setExpandRatio(int ratio) { + public Column<C, T> setExpandRatio(int ratio) { if (expandRatio != ratio) { expandRatio = ratio; scheduleColumnWidthRecalculator(); } - return (GridColumn<C, T>) this; + return this; } /** @@ -2914,7 +2916,7 @@ public class Grid<T> extends ResizeComposite implements * * @return this column */ - public GridColumn<C, T> clearExpandRatio() { + public Column<C, T> clearExpandRatio() { return setExpandRatio(-1); } @@ -3067,7 +3069,7 @@ public class Grid<T> extends ResizeComposite implements cellFocusHandler.updateFocusedRowStyle(row); for (FlyweightCell cell : cellsToUpdate) { - GridColumn<?, T> column = getColumn(cell.getColumn()); + Column<?, T> column = getColumn(cell.getColumn()); assert column != null : "Column was not found from cell (" + cell.getColumn() + "," + cell.getRow() + ")"; @@ -3188,7 +3190,7 @@ public class Grid<T> extends ResizeComposite implements @Override public void update(Row row, Iterable<FlyweightCell> cellsToUpdate) { StaticSection.StaticRow<?> staticRow = section.getRow(row.getRow()); - final List<GridColumn<?, T>> columns = getColumns(); + final List<Column<?, T>> columns = getColumns(); setCustomStyleName(row.getElement(), staticRow.getStyleName()); @@ -3229,7 +3231,7 @@ public class Grid<T> extends ResizeComposite implements cleanup(cell); - GridColumn<?, ?> column = getColumn(cell.getColumn()); + Column<?, ?> column = getColumn(cell.getColumn()); SortOrder sortingOrder = getSortOrder(column); if (!headerRow.isDefault() || !column.isSortable() || sortingOrder == null) { @@ -3258,7 +3260,7 @@ public class Grid<T> extends ResizeComposite implements /** * Finds the sort order for this column */ - private SortOrder getSortOrder(GridColumn<?, ?> column) { + private SortOrder getSortOrder(Column<?, ?> column) { for (SortOrder order : Grid.this.getSortOrder()) { if (order.getColumn() == column) { return order; @@ -3281,7 +3283,7 @@ public class Grid<T> extends ResizeComposite implements @Override public void postAttach(Row row, Iterable<FlyweightCell> attachedCells) { StaticSection.StaticRow<?> gridRow = section.getRow(row.getRow()); - List<GridColumn<?, T>> columns = getColumns(); + List<Column<?, T>> columns = getColumns(); for (FlyweightCell cell : attachedCells) { StaticSection.StaticCell metadata = gridRow.getCell(columns @@ -3311,7 +3313,7 @@ public class Grid<T> extends ResizeComposite implements if (section.getRowCount() > row.getRow()) { StaticSection.StaticRow<?> gridRow = section.getRow(row .getRow()); - List<GridColumn<?, T>> columns = getColumns(); + List<Column<?, T>> columns = getColumns(); for (FlyweightCell cell : cellsToDetach) { StaticSection.StaticCell metadata = gridRow.getCell(columns .get(cell.getColumn())); @@ -3536,9 +3538,9 @@ public class Grid<T> extends ResizeComposite implements * @param columns * the columns to add */ - public void addColumns(GridColumn<?, T>... columns) { + public void addColumns(Column<?, T>... columns) { int count = getColumnCount(); - for (GridColumn<?, T> column : columns) { + for (Column<?, T> column : columns) { addColumn(column, count++); } } @@ -3550,7 +3552,7 @@ public class Grid<T> extends ResizeComposite implements * the column to add * @return given column */ - public GridColumn<?, T> addColumn(GridColumn<?, T> column) { + public Column<?, T> addColumn(Column<?, T> column) { addColumn(column, getColumnCount()); return column; } @@ -3568,7 +3570,7 @@ public class Grid<T> extends ResizeComposite implements * if Grid's current selection model renders a selection column, * and {@code index} is 0. */ - public GridColumn<?, T> addColumn(GridColumn<?, T> column, int index) { + public Column<?, T> addColumn(Column<?, T> column, int index) { if (column == selectionColumn) { throw new IllegalArgumentException("The selection column many " + "not be added manually"); @@ -3581,7 +3583,7 @@ public class Grid<T> extends ResizeComposite implements return column; } - private void addColumnSkipSelectionColumnCheck(GridColumn<?, T> column, + private void addColumnSkipSelectionColumnCheck(Column<?, T> column, int index) { // Register column with grid columns.add(index, column); @@ -3590,7 +3592,7 @@ public class Grid<T> extends ResizeComposite implements footer.addColumn(column); // Register this grid instance with the column - ((AbstractGridColumn<?, T>) column).setGrid(this); + ((Column<?, T>) column).setGrid(this); // Add to escalator escalator.getColumnConfiguration().insertColumns(index, 1); @@ -3625,7 +3627,7 @@ public class Grid<T> extends ResizeComposite implements } private Renderer<?> findRenderer(FlyweightCell cell) { - GridColumn<?, T> column = getColumn(cell.getColumn()); + Column<?, T> column = getColumn(cell.getColumn()); assert column != null : "Could not find column at index:" + cell.getColumn(); return column.getRenderer(); @@ -3637,7 +3639,7 @@ public class Grid<T> extends ResizeComposite implements * @param column * the column to remove */ - public void removeColumn(GridColumn<?, T> column) { + public void removeColumn(Column<?, T> column) { if (column != null && column.equals(selectionColumn)) { throw new IllegalArgumentException( "The selection column may not be removed manually."); @@ -3646,7 +3648,7 @@ public class Grid<T> extends ResizeComposite implements removeColumnSkipSelectionColumnCheck(column); } - private void removeColumnSkipSelectionColumnCheck(GridColumn<?, T> column) { + private void removeColumnSkipSelectionColumnCheck(Column<?, T> column) { int columnIndex = columns.indexOf(column); // Remove from column configuration @@ -3658,7 +3660,7 @@ public class Grid<T> extends ResizeComposite implements footer.removeColumn(column); // de-register column with grid - ((AbstractGridColumn<?, T>) column).setGrid(null); + ((Column<?, T>) column).setGrid(null); columns.remove(columnIndex); } @@ -3677,9 +3679,9 @@ public class Grid<T> extends ResizeComposite implements * * @return A unmodifiable list of the columns in the grid */ - public List<GridColumn<?, T>> getColumns() { - return Collections.unmodifiableList(new ArrayList<GridColumn<?, T>>( - columns)); + public List<Column<?, T>> getColumns() { + return Collections + .unmodifiableList(new ArrayList<Column<?, T>>(columns)); } /** @@ -3691,8 +3693,7 @@ public class Grid<T> extends ResizeComposite implements * @throws IllegalArgumentException * if the column index does not exist in the grid */ - public GridColumn<?, T> getColumn(int index) - throws IllegalArgumentException { + public Column<?, T> getColumn(int index) throws IllegalArgumentException { if (index < 0 || index >= columns.size()) { throw new IllegalStateException("Column not found."); } @@ -3706,7 +3707,7 @@ public class Grid<T> extends ResizeComposite implements * column in grid * @return column index, or <code>-1</code> if not in this Grid */ - protected int indexOfColumn(GridColumn<?, T> column) { + protected int indexOfColumn(Column<?, T> column) { return columns.indexOf(column); } @@ -4509,7 +4510,7 @@ public class Grid<T> extends ResizeComposite implements Cell cell) { if (container == escalator.getBody() && cell != null) { - GridColumn<?, T> gridColumn = getColumn(cell.getColumn()); + Column<?, T> gridColumn = getColumn(cell.getColumn()); boolean enterKey = event.getType().equals(BrowserEvents.KEYDOWN) && event.getKeyCode() == KeyCodes.KEY_ENTER; boolean doubleClick = event.getType() @@ -4816,7 +4817,7 @@ public class Grid<T> extends ResizeComposite implements // Clear field so frozen column logic in the remove method knows // what to do - GridColumn<?, T> colToRemove = selectionColumn; + Column<?, T> colToRemove = selectionColumn; selectionColumn = null; removeColumnSkipSelectionColumnCheck(colToRemove); cellFocusHandler.offsetRangeBy(-1); @@ -5003,7 +5004,7 @@ public class Grid<T> extends ResizeComposite implements * @param column * a grid column reference */ - public <C> void sort(GridColumn<C, T> column) { + public <C> void sort(Column<C, T> column) { sort(column, SortDirection.ASCENDING); } @@ -5015,7 +5016,7 @@ public class Grid<T> extends ResizeComposite implements * @param direction * a sort direction value */ - public <C> void sort(GridColumn<C, T> column, SortDirection direction) { + public <C> void sort(Column<C, T> column, SortDirection direction) { sort(Sort.by(column, direction)); } @@ -5052,7 +5053,7 @@ public class Grid<T> extends ResizeComposite implements /** * Finds the sorting order for this column */ - private SortOrder getSortOrder(GridColumn<?, ?> column) { + private SortOrder getSortOrder(Column<?, ?> column) { for (SortOrder order : getSortOrder()) { if (order.getColumn() == column) { return order; @@ -5329,19 +5330,19 @@ public class Grid<T> extends ResizeComposite implements * @param orderedColumns * array of columns in wanted order */ - public void setColumnOrder(GridColumn<?, T>... orderedColumns) { + public void setColumnOrder(Column<?, T>... orderedColumns) { ColumnConfiguration conf = getEscalator().getColumnConfiguration(); // Trigger ComplexRenderer.destroy for old content conf.removeColumns(0, conf.getColumnCount()); - List<GridColumn<?, T>> newOrder = new ArrayList<GridColumn<?, T>>(); + List<Column<?, T>> newOrder = new ArrayList<Column<?, T>>(); if (selectionColumn != null) { newOrder.add(selectionColumn); } int i = 0; - for (GridColumn<?, T> column : orderedColumns) { + for (Column<?, T> column : orderedColumns) { if (columns.contains(column)) { newOrder.add(column); ++i; @@ -5361,7 +5362,7 @@ public class Grid<T> extends ResizeComposite implements conf.insertColumns(0, columns.size()); // Update column widths. - for (GridColumn<?, T> column : columns) { + for (Column<?, T> column : columns) { column.reapplyWidth(); } @@ -5532,7 +5533,7 @@ public class Grid<T> extends ResizeComposite implements * the column * @return the widget if the editor row is open, null otherwise */ - public Widget getEditorRowWidget(GridColumn<?, T> column) { + public Widget getEditorRowWidget(Column<?, T> column) { return editorRow.getWidget(column); } diff --git a/client/tests/src/com/vaadin/client/ui/grid/ListDataSourceTest.java b/client/tests/src/com/vaadin/client/ui/grid/ListDataSourceTest.java index 5970d9c609..24ccd6c57e 100644 --- a/client/tests/src/com/vaadin/client/ui/grid/ListDataSourceTest.java +++ b/client/tests/src/com/vaadin/client/ui/grid/ListDataSourceTest.java @@ -25,7 +25,7 @@ import org.easymock.EasyMock; import org.junit.Test; import com.vaadin.client.data.DataChangeHandler; -import com.vaadin.client.ui.grid.datasources.ListDataSource; +import com.vaadin.client.widget.grid.datasources.ListDataSource; public class ListDataSourceTest { diff --git a/server/src/com/vaadin/ui/Grid.java b/server/src/com/vaadin/ui/Grid.java index 6957a5bd3d..a482f819b7 100644 --- a/server/src/com/vaadin/ui/Grid.java +++ b/server/src/com/vaadin/ui/Grid.java @@ -2217,7 +2217,7 @@ public class Grid extends AbstractComponent implements SelectionNotifier, /** * An abstract base class for server-side Grid renderers. - * {@link com.vaadin.client.ui.grid.Renderer Grid renderers}. This class + * {@link com.vaadin.client.widget.grid.Renderer Grid renderers}. This class * currently extends the AbstractExtension superclass, but this fact should * be regarded as an implementation detail and subject to change in a future * major or minor Vaadin revision. diff --git a/server/src/com/vaadin/ui/renderer/Renderer.java b/server/src/com/vaadin/ui/renderer/Renderer.java index 6adddd1a20..0c704495a4 100644 --- a/server/src/com/vaadin/ui/renderer/Renderer.java +++ b/server/src/com/vaadin/ui/renderer/Renderer.java @@ -22,7 +22,7 @@ import elemental.json.JsonValue; /** * A ClientConnector for controlling client-side - * {@link com.vaadin.client.ui.grid.Renderer Grid renderers}. Renderers + * {@link com.vaadin.client.widget.grid.Renderer Grid renderers}. Renderers * currently extend the Extension interface, but this fact should be regarded as * an implementation detail and subject to change in a future major or minor * Vaadin revision. diff --git a/uitest/src/com/vaadin/tests/widgetset/client/grid/EscalatorBasicClientFeaturesWidget.java b/uitest/src/com/vaadin/tests/widgetset/client/grid/EscalatorBasicClientFeaturesWidget.java index 3565b9de8b..aafff7953c 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/grid/EscalatorBasicClientFeaturesWidget.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/grid/EscalatorBasicClientFeaturesWidget.java @@ -8,11 +8,11 @@ import com.google.gwt.core.client.Scheduler.ScheduledCommand; import com.google.gwt.dom.client.TableCellElement; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.HTML; -import com.vaadin.client.ui.grid.Escalator; -import com.vaadin.client.ui.grid.EscalatorUpdater; -import com.vaadin.client.ui.grid.FlyweightCell; -import com.vaadin.client.ui.grid.Row; -import com.vaadin.client.ui.grid.RowContainer; +import com.vaadin.client.widget.escalator.EscalatorUpdater; +import com.vaadin.client.widget.escalator.FlyweightCell; +import com.vaadin.client.widget.escalator.Row; +import com.vaadin.client.widget.escalator.RowContainer; +import com.vaadin.client.widgets.Escalator; public class EscalatorBasicClientFeaturesWidget extends PureGWTTestApplication<Escalator> { diff --git a/uitest/src/com/vaadin/tests/widgetset/client/grid/EscalatorProxy.java b/uitest/src/com/vaadin/tests/widgetset/client/grid/EscalatorProxy.java index 88ad1fcd5a..0efb040517 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/grid/EscalatorProxy.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/grid/EscalatorProxy.java @@ -17,11 +17,11 @@ package com.vaadin.tests.widgetset.client.grid; import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.TableRowElement; -import com.vaadin.client.ui.grid.Cell; -import com.vaadin.client.ui.grid.ColumnConfiguration; -import com.vaadin.client.ui.grid.Escalator; -import com.vaadin.client.ui.grid.EscalatorUpdater; -import com.vaadin.client.ui.grid.RowContainer; +import com.vaadin.client.widget.escalator.Cell; +import com.vaadin.client.widget.escalator.ColumnConfiguration; +import com.vaadin.client.widget.escalator.EscalatorUpdater; +import com.vaadin.client.widget.escalator.RowContainer; +import com.vaadin.client.widgets.Escalator; import com.vaadin.tests.widgetset.client.grid.EscalatorBasicClientFeaturesWidget.LogWidget; public class EscalatorProxy extends Escalator { diff --git a/uitest/src/com/vaadin/tests/widgetset/client/grid/GridBasicClientFeaturesWidget.java b/uitest/src/com/vaadin/tests/widgetset/client/grid/GridBasicClientFeaturesWidget.java index bc17e98f73..a0b73ce91e 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/grid/GridBasicClientFeaturesWidget.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/grid/GridBasicClientFeaturesWidget.java @@ -36,41 +36,40 @@ import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.TextBox; import com.vaadin.client.data.DataSource; import com.vaadin.client.data.DataSource.RowHandle; +import com.vaadin.client.renderers.DateRenderer; +import com.vaadin.client.renderers.HtmlRenderer; +import com.vaadin.client.renderers.NumberRenderer; +import com.vaadin.client.renderers.Renderer; +import com.vaadin.client.renderers.TextRenderer; import com.vaadin.client.ui.VLabel; -import com.vaadin.client.ui.grid.Cell; -import com.vaadin.client.ui.grid.EditorRowHandler; -import com.vaadin.client.ui.grid.FlyweightCell; -import com.vaadin.client.ui.grid.Grid; -import com.vaadin.client.ui.grid.Grid.FooterRow; -import com.vaadin.client.ui.grid.Grid.HeaderRow; -import com.vaadin.client.ui.grid.Grid.SelectionMode; -import com.vaadin.client.ui.grid.GridColumn; -import com.vaadin.client.ui.grid.Renderer; -import com.vaadin.client.ui.grid.datasources.ListDataSource; -import com.vaadin.client.ui.grid.datasources.ListSorter; -import com.vaadin.client.ui.grid.events.BodyKeyDownHandler; -import com.vaadin.client.ui.grid.events.BodyKeyPressHandler; -import com.vaadin.client.ui.grid.events.BodyKeyUpHandler; -import com.vaadin.client.ui.grid.events.FooterKeyDownHandler; -import com.vaadin.client.ui.grid.events.FooterKeyPressHandler; -import com.vaadin.client.ui.grid.events.FooterKeyUpHandler; -import com.vaadin.client.ui.grid.events.GridKeyDownEvent; -import com.vaadin.client.ui.grid.events.GridKeyPressEvent; -import com.vaadin.client.ui.grid.events.GridKeyUpEvent; -import com.vaadin.client.ui.grid.events.HeaderKeyDownHandler; -import com.vaadin.client.ui.grid.events.HeaderKeyPressHandler; -import com.vaadin.client.ui.grid.events.HeaderKeyUpHandler; -import com.vaadin.client.ui.grid.events.ScrollEvent; -import com.vaadin.client.ui.grid.events.ScrollHandler; -import com.vaadin.client.ui.grid.renderers.DateRenderer; -import com.vaadin.client.ui.grid.renderers.HtmlRenderer; -import com.vaadin.client.ui.grid.renderers.NumberRenderer; -import com.vaadin.client.ui.grid.renderers.TextRenderer; -import com.vaadin.client.ui.grid.selection.SelectionModel.None; +import com.vaadin.client.widget.escalator.Cell; +import com.vaadin.client.widget.escalator.FlyweightCell; import com.vaadin.client.widget.grid.CellReference; import com.vaadin.client.widget.grid.CellStyleGenerator; +import com.vaadin.client.widget.grid.EditorRowHandler; import com.vaadin.client.widget.grid.RowReference; import com.vaadin.client.widget.grid.RowStyleGenerator; +import com.vaadin.client.widget.grid.datasources.ListDataSource; +import com.vaadin.client.widget.grid.datasources.ListSorter; +import com.vaadin.client.widget.grid.events.BodyKeyDownHandler; +import com.vaadin.client.widget.grid.events.BodyKeyPressHandler; +import com.vaadin.client.widget.grid.events.BodyKeyUpHandler; +import com.vaadin.client.widget.grid.events.FooterKeyDownHandler; +import com.vaadin.client.widget.grid.events.FooterKeyPressHandler; +import com.vaadin.client.widget.grid.events.FooterKeyUpHandler; +import com.vaadin.client.widget.grid.events.GridKeyDownEvent; +import com.vaadin.client.widget.grid.events.GridKeyPressEvent; +import com.vaadin.client.widget.grid.events.GridKeyUpEvent; +import com.vaadin.client.widget.grid.events.HeaderKeyDownHandler; +import com.vaadin.client.widget.grid.events.HeaderKeyPressHandler; +import com.vaadin.client.widget.grid.events.HeaderKeyUpHandler; +import com.vaadin.client.widget.grid.events.ScrollEvent; +import com.vaadin.client.widget.grid.events.ScrollHandler; +import com.vaadin.client.widget.grid.selection.SelectionModel.None; +import com.vaadin.client.widgets.Grid; +import com.vaadin.client.widgets.Grid.FooterRow; +import com.vaadin.client.widgets.Grid.HeaderRow; +import com.vaadin.client.widgets.Grid.SelectionMode; import com.vaadin.tests.widgetset.client.grid.GridBasicClientFeaturesWidget.Data; /** @@ -95,7 +94,7 @@ public class GridBasicClientFeaturesWidget extends private class TestEditorRowHandler implements EditorRowHandler<List<Data>> { - private Map<GridColumn<?, ?>, TextBox> widgets = new HashMap<GridColumn<?, ?>, TextBox>(); + private Map<Grid.Column<?, ?>, TextBox> widgets = new HashMap<Grid.Column<?, ?>, TextBox>(); private Label log = new Label(); @@ -146,7 +145,7 @@ public class GridBasicClientFeaturesWidget extends } @Override - public TextBox getWidget(GridColumn<?, List<Data>> column) { + public TextBox getWidget(Grid.Column<?, List<Data>> column) { if (grid.getColumns().indexOf(column) == 0 && !(grid.getSelectionModel() instanceof None)) { return null; @@ -263,7 +262,7 @@ public class GridBasicClientFeaturesWidget extends final int c = col; - GridColumn<String, List<Data>> column = new GridColumn<String, List<Data>>( + Grid.Column<String, List<Data>> column = new Grid.Column<String, List<Data>>( createRenderer(Renderers.TEXT_RENDERER)) { @Override public String getValue(List<Data> row) { @@ -280,7 +279,7 @@ public class GridBasicClientFeaturesWidget extends // Integer row number { final int c = col++; - GridColumn<Integer, List<Data>> column = new GridColumn<Integer, List<Data>>( + Grid.Column<Integer, List<Data>> column = new Grid.Column<Integer, List<Data>>( createRenderer(Renderers.NUMBER_RENDERER)) { @Override public Integer getValue(List<Data> row) { @@ -294,7 +293,7 @@ public class GridBasicClientFeaturesWidget extends // Some date { final int c = col++; - GridColumn<Date, List<Data>> column = new GridColumn<Date, List<Data>>( + Grid.Column<Date, List<Data>> column = new Grid.Column<Date, List<Data>>( createRenderer(Renderers.DATE_RENDERER)) { @Override public Date getValue(List<Data> row) { @@ -308,7 +307,7 @@ public class GridBasicClientFeaturesWidget extends // Row number as a HTML string { final int c = col++; - GridColumn<String, List<Data>> column = new GridColumn<String, List<Data>>( + Grid.Column<String, List<Data>> column = new Grid.Column<String, List<Data>>( createRenderer(Renderers.HTML_RENDERER)) { @Override public String getValue(List<Data> row) { @@ -322,7 +321,7 @@ public class GridBasicClientFeaturesWidget extends // Random integer value { final int c = col++; - GridColumn<Integer, List<Data>> column = new GridColumn<Integer, List<Data>>( + Grid.Column<Integer, List<Data>> column = new Grid.Column<Integer, List<Data>>( createRenderer(Renderers.NUMBER_RENDERER)) { @Override public Integer getValue(List<Data> row) { @@ -336,7 +335,7 @@ public class GridBasicClientFeaturesWidget extends // Random integer value between 0 and 5 { final int c = col++; - GridColumn<Integer, List<Data>> column = new GridColumn<Integer, List<Data>>( + Grid.Column<Integer, List<Data>> column = new Grid.Column<Integer, List<Data>>( createRenderer(Renderers.NUMBER_RENDERER)) { @Override public Integer getValue(List<Data> row) { @@ -350,7 +349,7 @@ public class GridBasicClientFeaturesWidget extends HeaderRow row = grid.getDefaultHeaderRow(); for (int i = 0; i < col; ++i) { String caption = "Header (0," + i + ")"; - GridColumn<?, ?> column = grid.getColumn(i); + Grid.Column<?, ?> column = grid.getColumn(i); // Lets use some different cell types if (i % 3 == 0) { // No-op @@ -557,7 +556,7 @@ public class GridBasicClientFeaturesWidget extends @Override public String getStyle( CellReference<List<Data>> cellReference) { - GridColumn<?, List<Data>> column = cellReference + Grid.Column<?, List<Data>> column = cellReference .getColumn(); if (column == grid.getColumn(2)) { return "two"; @@ -610,7 +609,7 @@ public class GridBasicClientFeaturesWidget extends for (int i = 0; i < COLUMNS; i++) { final int index = i; - final GridColumn<?, List<Data>> column = grid.getColumn(index); + final Grid.Column<?, List<Data>> column = grid.getColumn(index); addMenuCommand("Sortable", new ScheduledCommand() { @Override public void execute() { @@ -853,7 +852,7 @@ public class GridBasicClientFeaturesWidget extends public void execute() { row.join( grid.getColumns().toArray( - new GridColumn[grid.getColumnCount()])) + new Grid.Column[grid.getColumnCount()])) .setText("Join all columns"); ; @@ -969,7 +968,7 @@ public class GridBasicClientFeaturesWidget extends public void execute() { row.join( grid.getColumns().toArray( - new GridColumn[grid.getColumnCount()])) + new Grid.Column[grid.getColumnCount()])) .setText("Join all columns"); ; diff --git a/uitest/src/com/vaadin/tests/widgetset/client/grid/GridClientColumnRendererConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/grid/GridClientColumnRendererConnector.java index 3290c67467..6c85f2d941 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/grid/GridClientColumnRendererConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/grid/GridClientColumnRendererConnector.java @@ -30,24 +30,23 @@ import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.HasWidgets; import com.vaadin.client.data.DataChangeHandler; import com.vaadin.client.data.DataSource; +import com.vaadin.client.renderers.ComplexRenderer; +import com.vaadin.client.renderers.DateRenderer; +import com.vaadin.client.renderers.HtmlRenderer; +import com.vaadin.client.renderers.NumberRenderer; +import com.vaadin.client.renderers.Renderer; +import com.vaadin.client.renderers.TextRenderer; +import com.vaadin.client.renderers.WidgetRenderer; import com.vaadin.client.ui.AbstractComponentConnector; -import com.vaadin.client.ui.grid.Cell; -import com.vaadin.client.ui.grid.FlyweightCell; -import com.vaadin.client.ui.grid.Grid; -import com.vaadin.client.ui.grid.GridColumn; -import com.vaadin.client.ui.grid.Renderer; -import com.vaadin.client.ui.grid.datasources.ListDataSource; -import com.vaadin.client.ui.grid.datasources.ListSorter; -import com.vaadin.client.ui.grid.renderers.ComplexRenderer; -import com.vaadin.client.ui.grid.renderers.DateRenderer; -import com.vaadin.client.ui.grid.renderers.HtmlRenderer; -import com.vaadin.client.ui.grid.renderers.NumberRenderer; -import com.vaadin.client.ui.grid.renderers.TextRenderer; -import com.vaadin.client.ui.grid.renderers.WidgetRenderer; -import com.vaadin.client.ui.grid.sort.Sort; -import com.vaadin.client.ui.grid.sort.SortEvent; -import com.vaadin.client.ui.grid.sort.SortHandler; -import com.vaadin.client.ui.grid.sort.SortOrder; +import com.vaadin.client.widget.escalator.Cell; +import com.vaadin.client.widget.escalator.FlyweightCell; +import com.vaadin.client.widget.grid.datasources.ListDataSource; +import com.vaadin.client.widget.grid.datasources.ListSorter; +import com.vaadin.client.widget.grid.sort.Sort; +import com.vaadin.client.widget.grid.sort.SortEvent; +import com.vaadin.client.widget.grid.sort.SortHandler; +import com.vaadin.client.widget.grid.sort.SortOrder; +import com.vaadin.client.widgets.Grid; import com.vaadin.shared.ui.Connect; import com.vaadin.tests.widgetset.server.grid.GridClientColumnRenderers; @@ -143,7 +142,7 @@ public class GridClientColumnRendererConnector extends } // Add a column to display the data in - GridColumn<String, String> c = createColumnWithRenderer(Renderers.TEXT_RENDERER); + Grid.Column<String, String> c = createColumnWithRenderer(Renderers.TEXT_RENDERER); grid.addColumn(c); grid.getDefaultHeaderRow().getCell(c).setText("Column 1"); @@ -177,7 +176,7 @@ public class GridClientColumnRendererConnector extends @Override public void addColumn(Renderers renderer) { - GridColumn<?, String> column; + Grid.Column<?, String> column; if (renderer == Renderers.NUMBER_RENDERER) { column = createNumberColumnWithRenderer(renderer); } else if (renderer == Renderers.DATE_RENDERER) { @@ -221,7 +220,7 @@ public class GridClientColumnRendererConnector extends // Make sorter sort the numbers in natural order sorter.setComparator( - (GridColumn<String, String>) grid.getColumn(0), + (Grid.Column<String, String>) grid.getColumn(0), new Comparator<String>() { @Override public int compare(String o1, String o2) { @@ -246,7 +245,7 @@ public class GridClientColumnRendererConnector extends // Make shuffler return random order shuffler.setComparator( - (GridColumn<String, String>) grid.getColumn(0), + (Grid.Column<String, String>) grid.getColumn(0), new Comparator<String>() { @Override public int compare(String o1, String o2) { @@ -347,9 +346,9 @@ public class GridClientColumnRendererConnector extends } } - private GridColumn<String, String> createColumnWithRenderer( + private Grid.Column<String, String> createColumnWithRenderer( Renderers renderer) { - return new GridColumn<String, String>(createRenderer(renderer)) { + return new Grid.Column<String, String>(createRenderer(renderer)) { @Override public String getValue(String row) { @@ -358,9 +357,9 @@ public class GridClientColumnRendererConnector extends }; } - private GridColumn<Number, String> createNumberColumnWithRenderer( + private Grid.Column<Number, String> createNumberColumnWithRenderer( Renderers renderer) { - return new GridColumn<Number, String>(createRenderer(renderer)) { + return new Grid.Column<Number, String>(createRenderer(renderer)) { @Override public Number getValue(String row) { @@ -369,9 +368,9 @@ public class GridClientColumnRendererConnector extends }; } - private GridColumn<Date, String> createDateColumnWithRenderer( + private Grid.Column<Date, String> createDateColumnWithRenderer( Renderers renderer) { - return new GridColumn<Date, String>(createRenderer(renderer)) { + return new Grid.Column<Date, String>(createRenderer(renderer)) { @Override public Date getValue(String row) { diff --git a/uitest/src/com/vaadin/tests/widgetset/client/grid/GridClientDataSourcesWidget.java b/uitest/src/com/vaadin/tests/widgetset/client/grid/GridClientDataSourcesWidget.java index aca11cfab3..e352b10064 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/grid/GridClientDataSourcesWidget.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/grid/GridClientDataSourcesWidget.java @@ -21,10 +21,9 @@ import java.util.List; import com.google.gwt.core.client.Scheduler; import com.google.gwt.core.client.Scheduler.ScheduledCommand; import com.vaadin.client.data.AbstractRemoteDataSource; -import com.vaadin.client.ui.grid.Grid; -import com.vaadin.client.ui.grid.Grid.SelectionMode; -import com.vaadin.client.ui.grid.GridColumn; -import com.vaadin.client.ui.grid.renderers.TextRenderer; +import com.vaadin.client.renderers.TextRenderer; +import com.vaadin.client.widgets.Grid; +import com.vaadin.client.widgets.Grid.SelectionMode; public class GridClientDataSourcesWidget extends PureGWTTestApplication<Grid<String[]>> { @@ -159,13 +158,13 @@ public class GridClientDataSourcesWidget extends private final ScheduledCommand setRestishCommand = new ScheduledCommand() { @Override public void execute() { - for (GridColumn<?, String[]> column : grid.getColumns()) { + for (Grid.Column<?, String[]> column : grid.getColumns()) { grid.removeColumn(column); } restishDataSource = new RestishDataSource(); grid.setDataSource(restishDataSource); - grid.addColumn(new GridColumn<String, String[]>("column", + grid.addColumn(new Grid.Column<String, String[]>("column", new TextRenderer()) { @Override diff --git a/uitest/src/com/vaadin/tests/widgetset/client/grid/GridColumnAutoWidthClientWidget.java b/uitest/src/com/vaadin/tests/widgetset/client/grid/GridColumnAutoWidthClientWidget.java index 04fe3bbbdd..6fadf95b63 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/grid/GridColumnAutoWidthClientWidget.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/grid/GridColumnAutoWidthClientWidget.java @@ -19,18 +19,17 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.vaadin.client.ui.grid.Grid; -import com.vaadin.client.ui.grid.Grid.SelectionMode; -import com.vaadin.client.ui.grid.GridColumn; -import com.vaadin.client.ui.grid.datasources.ListDataSource; -import com.vaadin.client.ui.grid.renderers.HtmlRenderer; +import com.vaadin.client.renderers.HtmlRenderer; +import com.vaadin.client.widget.grid.datasources.ListDataSource; +import com.vaadin.client.widgets.Grid; +import com.vaadin.client.widgets.Grid.SelectionMode; public class GridColumnAutoWidthClientWidget extends PureGWTTestApplication<Grid<List<String>>> { private Grid<List<String>> grid; - private class Col extends GridColumn<String, List<String>> { + private class Col extends Grid.Column<String, List<String>> { public Col(String header) { super(header, new HtmlRenderer()); setExpandRatio(0); diff --git a/uitest/src/com/vaadin/tests/widgetset/client/grid/IntArrayRendererConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/grid/IntArrayRendererConnector.java index fd3ea4de5e..88ccf93479 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/grid/IntArrayRendererConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/grid/IntArrayRendererConnector.java @@ -16,8 +16,8 @@ package com.vaadin.tests.widgetset.client.grid; import com.vaadin.client.connectors.AbstractRendererConnector; -import com.vaadin.client.ui.grid.FlyweightCell; -import com.vaadin.client.ui.grid.Renderer; +import com.vaadin.client.renderers.Renderer; +import com.vaadin.client.widget.escalator.FlyweightCell; import com.vaadin.shared.ui.Connect; @Connect(com.vaadin.tests.components.grid.IntArrayRenderer.class) diff --git a/uitest/src/com/vaadin/tests/widgetset/client/grid/RowAwareRendererConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/grid/RowAwareRendererConnector.java index a49dd41d7f..25a56b2010 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/grid/RowAwareRendererConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/grid/RowAwareRendererConnector.java @@ -23,10 +23,10 @@ import com.google.gwt.dom.client.DivElement; import com.google.gwt.dom.client.NativeEvent; import com.google.gwt.user.client.DOM; import com.vaadin.client.connectors.AbstractRendererConnector; -import com.vaadin.client.ui.grid.Cell; -import com.vaadin.client.ui.grid.FlyweightCell; -import com.vaadin.client.ui.grid.Renderer; -import com.vaadin.client.ui.grid.renderers.ComplexRenderer; +import com.vaadin.client.renderers.ComplexRenderer; +import com.vaadin.client.renderers.Renderer; +import com.vaadin.client.widget.escalator.Cell; +import com.vaadin.client.widget.escalator.FlyweightCell; import com.vaadin.shared.communication.ServerRpc; import com.vaadin.shared.ui.Connect; |