diff options
author | Jens Jansson <peppe@vaadin.com> | 2013-06-28 15:09:08 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2013-06-28 12:36:19 +0000 |
commit | 419c6c787508a8b9c14a4613a96f3ac8e48b1981 (patch) | |
tree | 2ee3fadab43f45c3c4a1410d335dae0eb147d7fa /server | |
parent | c107efcb1bdcf1528b56016dc277fdd44513077d (diff) | |
download | vaadin-framework-419c6c787508a8b9c14a4613a96f3ac8e48b1981.tar.gz vaadin-framework-419c6c787508a8b9c14a4613a96f3ac8e48b1981.zip |
Implemented Focusable in MenuBar (#7674)
Change-Id: I31cd6fafffacc16147e63d3878fcf025163deb5b
Diffstat (limited to 'server')
-rw-r--r-- | server/src/com/vaadin/ui/MenuBar.java | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/server/src/com/vaadin/ui/MenuBar.java b/server/src/com/vaadin/ui/MenuBar.java index 2bf5234f24..545a1e9e3e 100644 --- a/server/src/com/vaadin/ui/MenuBar.java +++ b/server/src/com/vaadin/ui/MenuBar.java @@ -26,6 +26,8 @@ import com.vaadin.server.PaintException; import com.vaadin.server.PaintTarget; import com.vaadin.server.Resource; import com.vaadin.shared.ui.menubar.MenuBarConstants; +import com.vaadin.shared.ui.menubar.MenuBarState; +import com.vaadin.ui.Component.Focusable; /** * <p> @@ -35,7 +37,8 @@ import com.vaadin.shared.ui.menubar.MenuBarConstants; * </p> */ @SuppressWarnings("serial") -public class MenuBar extends AbstractComponent implements LegacyComponent { +public class MenuBar extends AbstractComponent implements LegacyComponent, + Focusable { // Items of the top-level menu private final List<MenuItem> menuItems; @@ -49,6 +52,11 @@ public class MenuBar extends AbstractComponent implements LegacyComponent { private boolean htmlContentAllowed; + @Override + protected MenuBarState getState() { + return (MenuBarState) super.getState(); + } + /** Paint (serialise) the component for the client. */ @Override public void paintContent(PaintTarget target) throws PaintException { @@ -386,6 +394,27 @@ public class MenuBar extends AbstractComponent implements LegacyComponent { return htmlContentAllowed; } + @Override + public int getTabIndex() { + return getState().tabIndex; + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.ui.Component.Focusable#setTabIndex(int) + */ + @Override + public void setTabIndex(int tabIndex) { + getState().tabIndex = tabIndex; + } + + @Override + public void focus() { + // Overridden only to make public + super.focus(); + } + /** * This interface contains the layer for menu commands of the * {@link com.vaadin.ui.MenuBar} class. It's method will fire when the user |