Example usage for com.google.gwt.user.client.ui Accessibility ROLE_MENUBAR

List of usage examples for com.google.gwt.user.client.ui Accessibility ROLE_MENUBAR

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui Accessibility ROLE_MENUBAR.

Prototype

String ROLE_MENUBAR

To view the source code for com.google.gwt.user.client.ui Accessibility ROLE_MENUBAR.

Click Source Link

Usage

From source file:com.extjs.gxt.ui.client.widget.menu.MenuBar.java

License:sencha.com license

@Override
protected void onRender(Element target, int index) {
    super.onRender(target, index);
    setElement(DOM.createDiv(), target, index);

    el().setTabIndex(-1);/*from w  ww.  j  a  v  a2  s .  c o  m*/
    el().setElementAttribute("hideFocus", "true");

    if (GXT.isAriaEnabled()) {
        Accessibility.setRole(getElement(), Accessibility.ROLE_MENUBAR);
        Accessibility.setState(getElement(), "aria-hidden", "false");
    }

    new KeyNav<ComponentEvent>(this) {
        @Override
        public void onKeyPress(ComponentEvent ce) {
            MenuBar.this.onKeyPress(ce);
        }
    };

    layout();

    sinkEvents(Event.ONCLICK | Event.MOUSEEVENTS | Event.ONFOCUS | Event.ONBLUR);
}

From source file:org.cruxframework.crux.widgets.client.stackmenu.StackMenu.java

License:Apache License

/**
 * Empty constructor// www  . j av  a2 s  .  c om
 */
public StackMenu() {
    this.panel = new FlowPanel();
    this.panel.setStyleName(DEFAULT_STYLE_NAME);
    initWidget(panel);
    Accessibility.setRole(getElement(), Accessibility.ROLE_MENUBAR);
}