]> source.dussan.org Git - vaadin-framework.git/commitdiff
Remove unused Sidebar code from Grid (#18659)
authorTeemu Suo-Anttila <teemusa@vaadin.com>
Wed, 26 Aug 2015 12:40:22 +0000 (15:40 +0300)
committerVaadin Code Review <review@vaadin.com>
Wed, 26 Aug 2015 13:14:45 +0000 (13:14 +0000)
Change-Id: I5476579668c3bf8d05e92862bcd40237bd58b95c

client/src/com/vaadin/client/widgets/Grid.java

index 8cd97715a8eb66d299d3b55246e9879fbbdb0f37..580d0da72b0e40c2044205480e23e299bdfb98b6 100644 (file)
@@ -3494,46 +3494,6 @@ public class Grid<T> extends ResizeComposite implements
             return content.getParent() == rootContainer;
         }
 
-        /**
-         * Adds or moves the given widget to the end of the sidebar.
-         * 
-         * @param widget
-         *            the widget to add or move
-         */
-        public void add(Widget widget) {
-            content.add(widget);
-            updateVisibility();
-        }
-
-        /**
-         * Removes the given widget from the sidebar.
-         * 
-         * @param widget
-         *            the widget to remove
-         */
-        public void remove(Widget widget) {
-            content.remove(widget);
-            // updateVisibility is called by remove listener
-        }
-
-        /**
-         * Inserts given widget to the given index inside the sidebar. If the
-         * widget is already in the sidebar, then it is moved to the new index.
-         * <p>
-         * See
-         * {@link FlowPanel#insert(com.google.gwt.user.client.ui.IsWidget, int)}
-         * for further details.
-         * 
-         * @param widget
-         *            the widget to insert
-         * @param beforeIndex
-         *            0-based index position for the widget.
-         */
-        public void insert(Widget widget, int beforeIndex) {
-            content.insert(widget, beforeIndex);
-            updateVisibility();
-        }
-
         @Override
         public void setStylePrimaryName(String styleName) {
             super.setStylePrimaryName(styleName);
@@ -3968,8 +3928,8 @@ public class Grid<T> extends ResizeComposite implements
         }
 
         private boolean isSidebarOnDraggedRow() {
-            return eventCell.getRowIndex() == 0 && getSidebar().isInDOM()
-                    && !getSidebar().isOpen();
+            return eventCell.getRowIndex() == 0 && sidebar.isInDOM()
+                    && !sidebar.isOpen();
         }
 
         /**
@@ -3979,8 +3939,7 @@ public class Grid<T> extends ResizeComposite implements
         private double getSidebarBoundaryComparedTo(double left) {
             if (isSidebarOnDraggedRow()) {
                 double absoluteLeft = left + getElement().getAbsoluteLeft();
-                double sidebarLeft = getSidebar().getElement()
-                        .getAbsoluteLeft();
+                double sidebarLeft = sidebar.getElement().getAbsoluteLeft();
                 double diff = absoluteLeft - sidebarLeft;
 
                 if (diff > 0) {
@@ -8104,15 +8063,15 @@ public class Grid<T> extends ResizeComposite implements
 
     @Override
     protected void doAttachChildren() {
-        if (getSidebar().getParent() == this) {
-            onAttach(getSidebar());
+        if (sidebar.getParent() == this) {
+            onAttach(sidebar);
         }
     }
 
     @Override
     protected void doDetachChildren() {
-        if (getSidebar().getParent() == this) {
-            onDetach(getSidebar());
+        if (sidebar.getParent() == this) {
+            onDetach(sidebar);
         }
     }
 
@@ -8232,19 +8191,6 @@ public class Grid<T> extends ResizeComposite implements
         autoColumnWidthsRecalculator.schedule();
     }
 
-    /**
-     * Returns the sidebar for this grid.
-     * <p>
-     * The grid's sidebar shows the column hiding options for those columns that
-     * have been set as {@link Column#setHidable(boolean) hidable}.
-     * 
-     * @since 7.5.0
-     * @return the sidebar widget for this grid
-     */
-    private Sidebar getSidebar() {
-        return sidebar;
-    }
-
     /**
      * Gets the customizable menu bar that is by default used for toggling
      * column hidability. The application developer is allowed to add their