]> source.dussan.org Git - vaadin-framework.git/commitdiff
#3667 Remove deprecated API from MenuBar (setSubMenuIcon & setCollapse)
authorArtur Signell <artur@vaadin.com>
Mon, 19 Dec 2011 11:10:35 +0000 (13:10 +0200)
committerArtur Signell <artur@vaadin.com>
Mon, 19 Dec 2011 11:10:35 +0000 (13:10 +0200)
src/com/vaadin/terminal/gwt/client/ui/VMenuBar.java
src/com/vaadin/ui/MenuBar.java

index b77ebcbbc5d561571104a9d7811041e25d80a740..5ab28de91397b7559f0b966639e06dad0a7be718 100644 (file)
@@ -56,7 +56,6 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable,
     protected ApplicationConnection client;
 
     protected final VMenuBar hostReference = this;
-    protected String submenuIcon = null;
     protected CustomMenuItem moreItem = null;
 
     // Only used by the root menu bar
@@ -198,14 +197,6 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable,
 
         UIDL options = uidl.getChildUIDL(0);
 
-        // FIXME remove in version 7
-        if (options.hasAttribute("submenuIcon")) {
-            submenuIcon = client.translateVaadinUri(uidl.getChildUIDL(0)
-                    .getStringAttribute("submenuIcon"));
-        } else {
-            submenuIcon = null;
-        }
-
         if (uidl.hasAttribute("width")) {
             UIDL moreItemUIDL = options.getChildUIDL(0);
             StringBuffer itemHTML = new StringBuffer();
@@ -316,13 +307,7 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable,
         } else {
             // Add submenu indicator
             if (item.getChildCount() > 0) {
-                // FIXME For compatibility reasons: remove in version 7
                 String bgStyle = "";
-                if (submenuIcon != null) {
-                    bgStyle = " style=\"background-image: url("
-                            + Util.escapeAttribute(submenuIcon)
-                            + "); text-indent: -999px; width: 1em;\"";
-                }
                 itemHTML.append("<span class=\"" + CLASSNAME
                         + "-submenu-indicator\"" + bgStyle + ">&#x25BA;</span>");
             }
index 3469f77ebb72ed7e53f2984f28be29f59f06199f..7ed432a12b3c498745660de75f43a7f12be48982 100644 (file)
@@ -33,20 +33,6 @@ public class MenuBar extends AbstractComponent {
     // Number of items in this menu
     private int numberOfItems = 0;
 
-    /**
-     * @deprecated
-     * @see #setCollapse(boolean)
-     */
-    @Deprecated
-    private boolean collapseItems;
-
-    /**
-     * @deprecated
-     * @see #setSubmenuIcon(Resource)
-     */
-    @Deprecated
-    private Resource submenuIcon;
-
     private MenuItem moreItem;
 
     private boolean openRootOnHover;
@@ -68,10 +54,6 @@ public class MenuBar extends AbstractComponent {
 
         target.startTag("options");
 
-        if (submenuIcon != null) {
-            target.addAttribute("submenuIcon", submenuIcon);
-        }
-
         if (getWidth() > -1) {
             target.startTag("moreItem");
             target.addAttribute("text", moreItem.getText());
@@ -193,7 +175,6 @@ public class MenuBar extends AbstractComponent {
      */
     public MenuBar() {
         menuItems = new ArrayList<MenuItem>();
-        setCollapse(true);
         setMoreMenuItem(null);
     }
 
@@ -310,54 +291,6 @@ public class MenuBar extends AbstractComponent {
         return menuItems.size();
     }
 
-    /**
-     * Set the icon to be used if a sub-menu has children. Defaults to null;
-     * 
-     * @param icon
-     * @deprecated (since 6.2, will be removed in 7.0) Icon is set in theme, no
-     *             need to worry about the visual representation here.
-     */
-    @Deprecated
-    public void setSubmenuIcon(Resource icon) {
-        submenuIcon = icon;
-        requestRepaint();
-    }
-
-    /**
-     * @deprecated
-     * @see #setSubmenuIcon(Resource)
-     */
-    @Deprecated
-    public Resource getSubmenuIcon() {
-        return submenuIcon;
-    }
-
-    /**
-     * Enable or disable collapsing top-level items. Top-level items will
-     * collapse together if there is not enough room for them. Items that don't
-     * fit will be placed under the "More" menu item.
-     * 
-     * Collapsing is enabled by default.
-     * 
-     * @param collapse
-     * @deprecated (since 6.2, will be removed in 7.0) Collapsing is always
-     *             enabled if the MenuBar has a specified width.
-     */
-    @Deprecated
-    public void setCollapse(boolean collapse) {
-        collapseItems = collapse;
-        requestRepaint();
-    }
-
-    /**
-     * @see #setCollapse(boolean)
-     * @deprecated
-     */
-    @Deprecated
-    public boolean getCollapse() {
-        return collapseItems;
-    }
-
     /**
      * Set the item that is used when collapsing the top level menu. All
      * "overflowing" items will be added below this. The item command will be