com.vaadin.polymer.paper.widget.PaperDropdownMenuLight Maven / Gradle / Ivy
/*
* This code was generated with Vaadin Web Component GWT API Generator,
* from paper-dropdown-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.iron.widget.event.IronFormElementRegisterEvent;
import com.vaadin.polymer.iron.widget.event.IronFormElementRegisterEventHandler;
import com.vaadin.polymer.iron.widget.event.IronFormElementUnregisterEvent;
import com.vaadin.polymer.iron.widget.event.IronFormElementUnregisterEventHandler;
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;
/**
* Material design: Dropdown menus
* This is a faster, lighter version of paper-dropdown-menu
, that does not
use a <paper-input>
internally. Use this element if you’re concerned about
the performance of this element, i.e., if you plan on using many dropdowns on
the same page. Note that this element has a slightly different styling API
than paper-dropdown-menu
.
* paper-dropdown-menu-light
is similar to a native browser select element.
paper-dropdown-menu-light
works with selectable content. The currently selected
item is displayed in the control. If no item is selected, the label
is
displayed instead.
* Example:
* <paper-dropdown-menu-light label="Your favourite pastry">
* <paper-listbox class="dropdown-content">
* <paper-item>Croissant</paper-item>
* <paper-item>Donut</paper-item>
* <paper-item>Financier</paper-item>
* <paper-item>Madeleine</paper-item>
* </paper-listbox>
* </paper-dropdown-menu-light>
*
*
*
This example renders a dropdown menu with 4 options.
* The child element with the class dropdown-content
is used as the dropdown
menu. This can be a paper-listbox
, or any other or
element that acts like an iron-selector
.
* Specifically, the menu child must fire an
iron-select
event when one of its
children is selected, and an iron-deselect
event when a child is deselected. The selected or deselected item must
be passed as the event’s detail.item
property.
* Applications can listen for the iron-select
and iron-deselect
events
to react when options are selected and deselected.
* Styling
* The following custom properties and mixins are also available for styling:
*
*
*
* Custom property
* Description
* Default
*
*
*
*
* --paper-dropdown-menu
* A mixin that is applied to the element host
* {}
*
*
* --paper-dropdown-menu-disabled
* A mixin that is applied to the element host when disabled
* {}
*
*
* --paper-dropdown-menu-ripple
* A mixin that is applied to the internal ripple
* {}
*
*
* --paper-dropdown-menu-button
* A mixin that is applied to the internal menu button
* {}
*
*
* --paper-dropdown-menu-icon
* A mixin that is applied to the internal icon
* {}
*
*
* --paper-dropdown-menu-disabled-opacity
* The opacity of the dropdown when disabled
* 0.33
*
*
* --paper-dropdown-menu-color
* The color of the input/label/underline when the dropdown is unfocused
* --primary-text-color
*
*
* --paper-dropdown-menu-focus-color
* The color of the label/underline when the dropdown is focused
* --primary-color
*
*
* --paper-dropdown-error-color
* The color of the label/underline when the dropdown is invalid
* --error-color
*
*
* --paper-dropdown-menu-label
* Mixin applied to the label
* {}
*
*
* --paper-dropdown-menu-input
* Mixin appled to the input
* {}
*
*
*
* Note that in this element, the underline is just the bottom border of the “input”.
To style it:
* <style is=custom-style>
* paper-dropdown-menu-light.custom {
* --paper-dropdown-menu-input: {
* border-bottom: 2px dashed lavender;
* };
* </style>
*
*
*
*/
public class PaperDropdownMenuLight extends PolymerWidget {
/**
* Default Constructor.
*/
public PaperDropdownMenuLight() {
this("");
}
/**
* Constructor used by UIBinder to create widgets with content.
*/
public PaperDropdownMenuLight(String html) {
super(PaperDropdownMenuLightElement.TAG, PaperDropdownMenuLightElement.SRC, html);
}
/**
* Gets a handle to the Polymer object's underlying DOM element.
*/
public PaperDropdownMenuLightElement getPolymerElement() {
return (PaperDropdownMenuLightElement) getElement();
}
/**
* If true, the button is a toggle and is currently in the active state.
*
* JavaScript Info:
* @property active
* @type Boolean
* @behavior PaperTab
*/
public boolean getActive() {
return getPolymerElement().getActive();
}
/**
* If true, the button is a toggle and is currently in the active state.
*
* JavaScript Info:
* @property active
* @type Boolean
* @behavior PaperTab
*/
public void setActive(boolean value) {
getPolymerElement().setActive(value);
}
/**
*
*
* JavaScript Info:
* @property keyBindings
* @type Object
*
*/
public JavaScriptObject getKeyBindings() {
return getPolymerElement().getKeyBindings();
}
/**
*
*
* JavaScript Info:
* @property keyBindings
* @type Object
*
*/
public void setKeyBindings(JavaScriptObject value) {
getPolymerElement().setKeyBindings(value);
}
/**
* The last selected item. An item is selected if the dropdown menu has
a child with class dropdown-content
, and that child triggers an
iron-select
event with the selected item
in the detail
.
*
* JavaScript Info:
* @property selectedItem
* @type ?Object
*
*/
public JavaScriptObject getSelectedItem() {
return getPolymerElement().getSelectedItem();
}
/**
* The last selected item. An item is selected if the dropdown menu has
a child with class dropdown-content
, and that child triggers an
iron-select
event with the selected item
in the detail
.
*
* JavaScript Info:
* @property selectedItem
* @type ?Object
*
*/
public void setSelectedItem(JavaScriptObject value) {
getPolymerElement().setSelectedItem(value);
}
/**
* The EventTarget that will be firing relevant KeyboardEvents. Set it to
null
to disable the listeners.
*
* JavaScript Info:
* @property keyEventTarget
* @type ?EventTarget
* @behavior VaadinDatePicker
*/
public JavaScriptObject getKeyEventTarget() {
return getPolymerElement().getKeyEventTarget();
}
/**
* The EventTarget that will be firing relevant KeyboardEvents. Set it to
null
to disable the listeners.
*
* JavaScript Info:
* @property keyEventTarget
* @type ?EventTarget
* @behavior VaadinDatePicker
*/
public void setKeyEventTarget(JavaScriptObject value) {
getPolymerElement().setKeyEventTarget(value);
}
/**
* Set to true to mark the input as required. If used in a form, a
custom element that uses this behavior should also use
Polymer.IronValidatableBehavior and define a custom validation method.
Otherwise, a required
element will always be considered valid.
It’s also strongly recommended to provide a visual style for the element
when its value is invalid.
*
* JavaScript Info:
* @property required
* @type Boolean
* @behavior VaadinDatePicker
*/
public boolean getRequired() {
return getPolymerElement().getRequired();
}
/**
* Set to true to mark the input as required. If used in a form, a
custom element that uses this behavior should also use
Polymer.IronValidatableBehavior and define a custom validation method.
Otherwise, a required
element will always be considered valid.
It’s also strongly recommended to provide a visual style for the element
when its value is invalid.
*
* JavaScript Info:
* @property required
* @type Boolean
* @behavior VaadinDatePicker
*/
public void setRequired(boolean value) {
getPolymerElement().setRequired(value);
}
/**
* If true, the element will not produce a ripple effect when interacted
with via the pointer.
*
* JavaScript Info:
* @property noink
* @type Boolean
* @behavior PaperTab
*/
public boolean getNoink() {
return getPolymerElement().getNoink();
}
/**
* If true, the element will not produce a ripple effect when interacted
with via the pointer.
*
* JavaScript Info:
* @property noink
* @type Boolean
* @behavior PaperTab
*/
public void setNoink(boolean value) {
getPolymerElement().setNoink(value);
}
/**
* By default, the dropdown will constrain scrolling on the page
to itself when opened.
Set to true in order to prevent scroll from being constrained
to the dropdown when it opens.
*
* JavaScript Info:
* @property allowOutsideScroll
* @type Boolean
*
*/
public boolean getAllowOutsideScroll() {
return getPolymerElement().getAllowOutsideScroll();
}
/**
* By default, the dropdown will constrain scrolling on the page
to itself when opened.
Set to true in order to prevent scroll from being constrained
to the dropdown when it opens.
*
* JavaScript Info:
* @property allowOutsideScroll
* @type Boolean
*
*/
public void setAllowOutsideScroll(boolean value) {
getPolymerElement().setAllowOutsideScroll(value);
}
/**
* Set to true to disable animations when opening and closing the
dropdown.
*
* JavaScript Info:
* @property noAnimations
* @type Boolean
*
*/
public boolean getNoAnimations() {
return getPolymerElement().getNoAnimations();
}
/**
* Set to true to disable animations when opening and closing the
dropdown.
*
* JavaScript Info:
* @property noAnimations
* @type Boolean
*
*/
public void setNoAnimations(boolean value) {
getPolymerElement().setNoAnimations(value);
}
/**
*
*
* JavaScript Info:
* @property hasContent
* @type Boolean
*
*/
public boolean getHasContent() {
return getPolymerElement().getHasContent();
}
/**
*
*
* JavaScript Info:
* @property hasContent
* @type Boolean
*
*/
public void setHasContent(boolean value) {
getPolymerElement().setHasContent(value);
}
/**
* Set to true to disable the floating label. Bind this to the
<paper-input-container>
‘s noLabelFloat
property.
*
* JavaScript Info:
* @property noLabelFloat
* @type Boolean
*
*/
public boolean getNoLabelFloat() {
return getPolymerElement().getNoLabelFloat();
}
/**
* Set to true to disable the floating label. Bind this to the
<paper-input-container>
‘s noLabelFloat
property.
*
* JavaScript Info:
* @property noLabelFloat
* @type Boolean
*
*/
public void setNoLabelFloat(boolean value) {
getPolymerElement().setNoLabelFloat(value);
}
/**
* True if the element is currently being pressed by a “pointer,” which
is loosely defined as mouse or touch input (but specifically excluding
keyboard input).
*
* JavaScript Info:
* @property pointerDown
* @type Boolean
* @behavior PaperTab
*/
public boolean getPointerDown() {
return getPolymerElement().getPointerDown();
}
/**
* True if the element is currently being pressed by a “pointer,” which
is loosely defined as mouse or touch input (but specifically excluding
keyboard input).
*
* JavaScript Info:
* @property pointerDown
* @type Boolean
* @behavior PaperTab
*/
public void setPointerDown(boolean value) {
getPolymerElement().setPointerDown(value);
}
/**
* If true, the user is currently holding down the button.
*
* JavaScript Info:
* @property pressed
* @type Boolean
* @behavior PaperTab
*/
public boolean getPressed() {
return getPolymerElement().getPressed();
}
/**
* If true, the user is currently holding down the button.
*
* JavaScript Info:
* @property pressed
* @type Boolean
* @behavior PaperTab
*/
public void setPressed(boolean value) {
getPolymerElement().setPressed(value);
}
/**
* True if the input device that caused the element to receive focus
was a keyboard.
*
* JavaScript Info:
* @property receivedFocusFromKeyboard
* @type Boolean
* @behavior PaperTab
*/
public boolean getReceivedFocusFromKeyboard() {
return getPolymerElement().getReceivedFocusFromKeyboard();
}
/**
* True if the input device that caused the element to receive focus
was a keyboard.
*
* JavaScript Info:
* @property receivedFocusFromKeyboard
* @type Boolean
* @behavior PaperTab
*/
public void setReceivedFocusFromKeyboard(boolean value) {
getPolymerElement().setReceivedFocusFromKeyboard(value);
}
/**
* If true, the button toggles the active state with each tap or press
of the spacebar.
*
* JavaScript Info:
* @property toggles
* @type Boolean
* @behavior PaperTab
*/
public boolean getToggles() {
return getPolymerElement().getToggles();
}
/**
* If true, the button toggles the active state with each tap or press
of the spacebar.
*
* JavaScript Info:
* @property toggles
* @type Boolean
* @behavior PaperTab
*/
public void setToggles(boolean value) {
getPolymerElement().setToggles(value);
}
/**
* Set to true to always float the label. Bind this to the
<paper-input-container>
‘s alwaysFloatLabel
property.
*
* JavaScript Info:
* @property alwaysFloatLabel
* @type Boolean
*
*/
public boolean getAlwaysFloatLabel() {
return getPolymerElement().getAlwaysFloatLabel();
}
/**
* Set to true to always float the label. Bind this to the
<paper-input-container>
‘s alwaysFloatLabel
property.
*
* JavaScript Info:
* @property alwaysFloatLabel
* @type Boolean
*
*/
public void setAlwaysFloatLabel(boolean value) {
getPolymerElement().setAlwaysFloatLabel(value);
}
/**
* True if the dropdown is open. Otherwise, false.
*
* JavaScript Info:
* @property opened
* @type Boolean
*
*/
public boolean getOpened() {
return getPolymerElement().getOpened();
}
/**
* True if the dropdown is open. Otherwise, false.
*
* JavaScript Info:
* @property opened
* @type Boolean
*
*/
public void setOpened(boolean value) {
getPolymerElement().setOpened(value);
}
/**
* True if the last call to validate
is invalid.
*
* JavaScript Info:
* @property invalid
* @type Boolean
* @behavior VaadinDatePicker
*/
public boolean getInvalid() {
return getPolymerElement().getInvalid();
}
/**
* True if the last call to validate
is invalid.
*
* JavaScript Info:
* @property invalid
* @type Boolean
* @behavior VaadinDatePicker
*/
public void setInvalid(boolean value) {
getPolymerElement().setInvalid(value);
}
/**
* If true, this property will cause the implementing element to
automatically stop propagation on any handled KeyboardEvents.
*
* JavaScript Info:
* @property stopKeyboardEventPropagation
* @type Boolean
* @behavior VaadinDatePicker
*/
public boolean getStopKeyboardEventPropagation() {
return getPolymerElement().getStopKeyboardEventPropagation();
}
/**
* If true, this property will cause the implementing element to
automatically stop propagation on any handled KeyboardEvents.
*
* JavaScript Info:
* @property stopKeyboardEventPropagation
* @type Boolean
* @behavior VaadinDatePicker
*/
public void setStopKeyboardEventPropagation(boolean value) {
getPolymerElement().setStopKeyboardEventPropagation(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);
}
/**
* The aria attribute to be set if the button is a toggle and in the
active state.
*
* JavaScript Info:
* @property ariaActiveAttribute
* @type String
* @behavior PaperTab
*/
public String getAriaActiveAttribute() {
return getPolymerElement().getAriaActiveAttribute();
}
/**
* The aria attribute to be set if the button is a toggle and in the
active state.
*
* JavaScript Info:
* @property ariaActiveAttribute
* @type String
* @behavior PaperTab
*/
public void setAriaActiveAttribute(String value) {
getPolymerElement().setAriaActiveAttribute(value);
}
/**
* The name of this element.
*
* JavaScript Info:
* @property name
* @type String
* @behavior VaadinDatePicker
*/
public String getName() {
return getPolymerElement().getName();
}
/**
* The name of this element.
*
* JavaScript Info:
* @property name
* @type String
* @behavior VaadinDatePicker
*/
public void setName(String value) {
getPolymerElement().setName(value);
}
/**
* The value for this element that will be used when submitting in
a form. It is read only, and will always have the same value
as selectedItemLabel
.
*
* JavaScript Info:
* @property value
* @type String
*
*/
public String getValue() {
return getPolymerElement().getValue();
}
/**
* The value for this element that will be used when submitting in
a form. It is read only, and will always have the same value
as selectedItemLabel
.
*
* JavaScript Info:
* @property value
* @type String
*
*/
public void setValue(String value) {
getPolymerElement().setValue(value);
}
/**
* The derived “label” of the currently selected item. This value
is the label
property on the selected item if set, or else the
trimmed text content of the selected item.
*
* JavaScript Info:
* @property selectedItemLabel
* @type String
*
*/
public String getSelectedItemLabel() {
return getPolymerElement().getSelectedItemLabel();
}
/**
* The derived “label” of the currently selected item. This value
is the label
property on the selected item if set, or else the
trimmed text content of the selected item.
*
* JavaScript Info:
* @property selectedItemLabel
* @type String
*
*/
public void setSelectedItemLabel(String value) {
getPolymerElement().setSelectedItemLabel(value);
}
/**
* The orientation against which to align the menu dropdown
vertically relative to the dropdown trigger.
*
* JavaScript Info:
* @property verticalAlign
* @type String
*
*/
public String getVerticalAlign() {
return getPolymerElement().getVerticalAlign();
}
/**
* The orientation against which to align the menu dropdown
vertically relative to the dropdown trigger.
*
* JavaScript Info:
* @property verticalAlign
* @type String
*
*/
public void setVerticalAlign(String value) {
getPolymerElement().setVerticalAlign(value);
}
/**
* The label for the dropdown.
*
* JavaScript Info:
* @property label
* @type String
*
*/
public String getLabel() {
return getPolymerElement().getLabel();
}
/**
* The label for the dropdown.
*
* JavaScript Info:
* @property label
* @type String
*
*/
public void setLabel(String value) {
getPolymerElement().setLabel(value);
}
/**
* The orientation against which to align the menu dropdown
horizontally relative to the dropdown trigger.
*
* JavaScript Info:
* @property horizontalAlign
* @type String
*
*/
public String getHorizontalAlign() {
return getPolymerElement().getHorizontalAlign();
}
/**
* The orientation against which to align the menu dropdown
horizontally relative to the dropdown trigger.
*
* JavaScript Info:
* @property horizontalAlign
* @type String
*
*/
public void setHorizontalAlign(String value) {
getPolymerElement().setHorizontalAlign(value);
}
/**
* Namespace for this validator. This property is deprecated and should
not be used. For all intents and purposes, please consider it a
read-only, config-time property.
*
* JavaScript Info:
* @property validatorType
* @type String
* @behavior VaadinDatePicker
*/
public String getValidatorType() {
return getPolymerElement().getValidatorType();
}
/**
* Namespace for this validator. This property is deprecated and should
not be used. For all intents and purposes, please consider it a
read-only, config-time property.
*
* JavaScript Info:
* @property validatorType
* @type String
* @behavior VaadinDatePicker
*/
public void setValidatorType(String value) {
getPolymerElement().setValidatorType(value);
}
/**
* Name of the validator to use.
*
* JavaScript Info:
* @property validator
* @type String
* @behavior VaadinDatePicker
*/
public String getValidator() {
return getPolymerElement().getValidator();
}
/**
* Name of the validator to use.
*
* JavaScript Info:
* @property validator
* @type String
* @behavior VaadinDatePicker
*/
public void setValidator(String value) {
getPolymerElement().setValidator(value);
}
/**
* The placeholder for the dropdown.
*
* JavaScript Info:
* @property placeholder
* @type String
*
*/
public String getPlaceholder() {
return getPolymerElement().getPlaceholder();
}
/**
* The placeholder for the dropdown.
*
* JavaScript Info:
* @property placeholder
* @type String
*
*/
public void setPlaceholder(String value) {
getPolymerElement().setPlaceholder(value);
}
// Needed in UIBinder
/**
*
*
* JavaScript Info:
* @attribute key-bindings
* @behavior PaperTab
*/
public void setKeyBindings(String value) {
Polymer.property(this.getPolymerElement(), "keyBindings", value);
}
// Needed in UIBinder
/**
* The EventTarget that will be firing relevant KeyboardEvents. Set it to
null
to disable the listeners.
*
* JavaScript Info:
* @attribute key-event-target
* @behavior VaadinDatePicker
*/
public void setKeyEventTarget(String value) {
Polymer.property(this.getPolymerElement(), "keyEventTarget", value);
}
// Needed in UIBinder
/**
* The last selected item. An item is selected if the dropdown menu has
a child with class dropdown-content
, and that child triggers an
iron-select
event with the selected item
in the detail
.
*
* JavaScript Info:
* @attribute selected-item
*
*/
public void setSelectedItem(String value) {
Polymer.property(this.getPolymerElement(), "selectedItem", value);
}
/**
* Can be used to imperatively add a key binding to the implementing
element. This is the imperative equivalent of declaring a keybinding
in the keyBindings
prototype property.
*
* JavaScript Info:
* @method addOwnKeyBinding
* @param {} eventString
* @param {} handlerName
* @behavior VaadinDatePicker
*
*/
public void addOwnKeyBinding(Object eventString, Object handlerName) {
getPolymerElement().addOwnKeyBinding(eventString, handlerName);
}
/**
* Show the dropdown content.
*
* JavaScript Info:
* @method open
*
*
*/
public void open() {
getPolymerElement().open();
}
/**
* Hide the dropdown content.
*
* JavaScript Info:
* @method close
*
*
*/
public void close() {
getPolymerElement().close();
}
/**
* When called, will remove all imperatively-added key bindings.
*
* JavaScript Info:
* @method removeOwnKeyBindings
* @behavior VaadinDatePicker
*
*/
public void removeOwnKeyBindings() {
getPolymerElement().removeOwnKeyBindings();
}
/**
* Returns true if this element currently contains a ripple effect.
*
* JavaScript Info:
* @method hasRipple
* @behavior PaperTab
* @return {boolean}
*/
public boolean hasRipple() {
return getPolymerElement().hasRipple();
}
/**
*
*
* JavaScript Info:
* @method hasValidator
* @behavior VaadinDatePicker
* @return {boolean}
*/
public boolean hasValidator() {
return getPolymerElement().hasValidator();
}
/**
* Returns the <paper-ripple>
element used by this element to create
ripple effects. The element’s ripple is created on demand, when
necessary, and calling this method will force the
ripple to be created.
*
* JavaScript Info:
* @method getRipple
* @behavior PaperTab
*
*/
public void getRipple() {
getPolymerElement().getRipple();
}
/**
* Returns true if the value
is valid, and updates invalid
. If you want
your element to have custom validation logic, do not override this method;
override _getValidity(value)
instead.
*
* JavaScript Info:
* @method validate
* @param {Object} value
* @behavior VaadinDatePicker
* @return {boolean}
*/
public boolean validate(JavaScriptObject value) {
return getPolymerElement().validate(value);
}
/**
* Returns true if a keyboard event matches eventString
.
*
* JavaScript Info:
* @method keyboardEventMatchesKeys
* @param {KeyboardEvent} event
* @param {string} eventString
* @behavior VaadinDatePicker
* @return {boolean}
*/
public boolean keyboardEventMatchesKeys(JavaScriptObject event, String eventString) {
return getPolymerElement().keyboardEventMatchesKeys(event, eventString);
}
/**
* Ensures this element contains a ripple effect. For startup efficiency
the ripple effect is dynamically on demand when needed.
*
* JavaScript Info:
* @method ensureRipple
* @param {!Event=} optTriggeringEvent
* @behavior PaperTab
*
*/
public void ensureRipple(JavaScriptObject optTriggeringEvent) {
getPolymerElement().ensureRipple(optTriggeringEvent);
}
/**
* Fired when the element is added to an iron-form
.
*
* JavaScript Info:
* @event iron-form-element-register
*/
public HandlerRegistration addIronFormElementRegisterHandler(IronFormElementRegisterEventHandler handler) {
return addDomHandler(handler, IronFormElementRegisterEvent.TYPE);
}
/**
* Fired when the element is removed from an iron-form
.
*
* JavaScript Info:
* @event iron-form-element-unregister
*/
public HandlerRegistration addIronFormElementUnregisterHandler(IronFormElementUnregisterEventHandler handler) {
return addDomHandler(handler, IronFormElementUnregisterEvent.TYPE);
}
}