All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vaadin.polymer.paper.widget.PaperSubmenu Maven / Gradle / Ivy

There is a newer version: 1.9.3.1
Show newest version
/*
 * This code was generated with Vaadin Web Component GWT API Generator, 
 * from paper-menu project by The Polymer Authors
 * that is licensed with http://polymer.github.io/LICENSE.txt license.
 */
package com.vaadin.polymer.paper.widget;

import com.vaadin.polymer.paper.element.*;

import com.vaadin.polymer.paper.widget.event.PaperSubmenuCloseEvent;
import com.vaadin.polymer.paper.widget.event.PaperSubmenuCloseEventHandler;

import com.vaadin.polymer.paper.widget.event.PaperSubmenuOpenEvent;
import com.vaadin.polymer.paper.widget.event.PaperSubmenuOpenEventHandler;

import com.vaadin.polymer.PolymerWidget;
import com.vaadin.polymer.elemental.*;
import com.google.gwt.core.client.JsArray;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.core.client.JavaScriptObject;

/**
 * 

<paper-submenu> is a nested menu inside of a parent <paper-menu>. It
consists of a trigger that expands or collapses another <paper-menu>:

*
<paper-menu>
 *   <paper-submenu>
 *     <paper-item class="menu-trigger">Topics</paper-item>
 *     <paper-menu class="menu-content">
 *       <paper-item>Topic 1</paper-item>
 *       <paper-item>Topic 2</paper-item>
 *       <paper-item>Topic 3</paper-item>
 *     </paper-menu>
 *   </paper-submenu>
 *   <paper-submenu>
 *     <paper-item class="menu-trigger">Faves</paper-item>
 *     <paper-menu class="menu-content">
 *       <paper-item>Fave 1</paper-item>
 *       <paper-item>Fave 2</paper-item>
 *     </paper-menu>
 *   </paper-submenu>
 *   <paper-submenu disabled>
 *     <paper-item class="menu-trigger">Unavailable</paper-item>
 *     <paper-menu class="menu-content">
 *       <paper-item>Disabled 1</paper-item>
 *       <paper-item>Disabled 2</paper-item>
 *     </paper-menu>
 *   </paper-submenu>
 * </paper-menu>
 * 
 * 
 * 

Just like in <paper-menu>, the focused item is highlighted, and the selected
item has bolded text. Please see the <paper-menu> docs for which attributes
(such as multi and selected), and styling options are available for the
menu-content menu.

*/ public class PaperSubmenu extends PolymerWidget { /** * Default Constructor. */ public PaperSubmenu() { this(""); } /** * Constructor used by UIBinder to create widgets with content. */ public PaperSubmenu(String html) { super(PaperSubmenuElement.TAG, PaperSubmenuElement.SRC, html); getPolymerElement().addEventListener( com.vaadin.polymer.paper.element.event.PaperSubmenuCloseEvent.NAME, new com.vaadin.polymer.paper.element.event.PaperSubmenuCloseEvent.Listener() { @Override protected void handleEvent(com.vaadin.polymer.paper.element.event.PaperSubmenuCloseEvent event) { fireEvent(new PaperSubmenuCloseEvent(event)); } }); getPolymerElement().addEventListener( com.vaadin.polymer.paper.element.event.PaperSubmenuOpenEvent.NAME, new com.vaadin.polymer.paper.element.event.PaperSubmenuOpenEvent.Listener() { @Override protected void handleEvent(com.vaadin.polymer.paper.element.event.PaperSubmenuOpenEvent event) { fireEvent(new PaperSubmenuOpenEvent(event)); } }); } /** * Gets a handle to the Polymer object's underlying DOM element. */ public PaperSubmenuElement getPolymerElement() { try { return (PaperSubmenuElement) getElement(); } catch (ClassCastException e) { jsinteropError(); return null; } } /** *

Collapse the submenu content.

* * JavaScript Info: * @method close * */ public void close() { getPolymerElement().close(); } /** * * * JavaScript Info: * @method dettached * */ public void dettached() { getPolymerElement().dettached(); } /** *

Expand the submenu content.

* * JavaScript Info: * @method open * */ public void open() { getPolymerElement().open(); } /** *

Set opened to true to show the collapse element and to false to hide it.

* * JavaScript Info: * @property opened * @type Boolean * */ public boolean getOpened(){ return getPolymerElement().getOpened(); } /** *

Set opened to true to show the collapse element and to false to hide it.

* * JavaScript Info: * @property opened * @type Boolean * */ public void setOpened(boolean value) { getPolymerElement().setOpened(value); } /** * * * JavaScript Info: * @method attached * */ public void attached() { getPolymerElement().attached(); } /** *

If true, the user cannot interact with this element.

* * JavaScript Info: * @property disabled * @type Boolean * @behavior PaperTab */ public boolean getDisabled(){ return getPolymerElement().getDisabled(); } /** *

If true, the user cannot interact with this element.

* * JavaScript Info: * @property disabled * @type Boolean * @behavior PaperTab */ public void setDisabled(boolean value) { getPolymerElement().setDisabled(value); } /** *

If true, the element currently has focus.

* * JavaScript Info: * @property focused * @type Boolean * @behavior PaperTab */ public boolean getFocused(){ return getPolymerElement().getFocused(); } /** *

If true, the element currently has focus.

* * JavaScript Info: * @property focused * @type Boolean * @behavior PaperTab */ public void setFocused(boolean value) { getPolymerElement().setFocused(value); } /** * * * JavaScript Info: * @property observers * @type Array * @behavior PaperTab */ public JsArray getObservers(){ return getPolymerElement().getObservers(); } /** * * * JavaScript Info: * @property observers * @type Array * @behavior PaperTab */ public void setObservers(JsArray value) { getPolymerElement().setObservers(value); } /** *

Fired when the submenu is closed.

* * JavaScript Info: * @event paper-submenu-close */ public HandlerRegistration addPaperSubmenuCloseHandler(PaperSubmenuCloseEventHandler handler) { return addHandler(handler, PaperSubmenuCloseEvent.TYPE); } /** *

Fired when the submenu is opened.

* * JavaScript Info: * @event paper-submenu-open */ public HandlerRegistration addPaperSubmenuOpenHandler(PaperSubmenuOpenEventHandler handler) { return addHandler(handler, PaperSubmenuOpenEvent.TYPE); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy