com.vaadin.polymer.paper.widget.PaperSubmenu Maven / Gradle / Ivy
/*
* 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.*;
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.*;
import com.vaadin.polymer.elemental.*;
import com.vaadin.polymer.PolymerWidget;
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);
}
/**
* Gets a handle to the Polymer object's underlying DOM element.
*/
public PaperSubmenuElement getPolymerElement() {
return (PaperSubmenuElement) getElement();
}
/**
* 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);
}
/**
* 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);
}
/**
* Collapse the submenu content.
*
* JavaScript Info:
* @method close
*
*
*/
public void close() {
getPolymerElement().close();
}
/**
* Expand the submenu content.
*
* JavaScript Info:
* @method open
*
*
*/
public void open() {
getPolymerElement().open();
}
/**
* Toggle the submenu.
*
* JavaScript Info:
* @method toggle
*
*
*/
public void toggle() {
getPolymerElement().toggle();
}
/**
* Fired when the submenu is closed.
*
* JavaScript Info:
* @event paper-submenu-close
*/
public HandlerRegistration addPaperSubmenuCloseHandler(PaperSubmenuCloseEventHandler handler) {
return addDomHandler(handler, PaperSubmenuCloseEvent.TYPE);
}
/**
* Fired when the submenu is opened.
*
* JavaScript Info:
* @event paper-submenu-open
*/
public HandlerRegistration addPaperSubmenuOpenHandler(PaperSubmenuOpenEventHandler handler) {
return addDomHandler(handler, PaperSubmenuOpenEvent.TYPE);
}
}