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

com.vaadin.polymer.paper.widget.PaperTabs 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-tabs 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.iron.widget.event.IronDeselectEvent;
import com.vaadin.polymer.iron.widget.event.IronDeselectEventHandler;

import com.vaadin.polymer.iron.widget.event.IronSelectEvent;
import com.vaadin.polymer.iron.widget.event.IronSelectEventHandler;

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-tabs makes it easy to explore and switch between different views or functional aspects of
an app, or to browse categorized data sets.

*

Use selected property to get or set the selected tab.

*

Example:

*
<paper-tabs selected="0">
 *   <paper-tab>TAB 1</paper-tab>
 *   <paper-tab>TAB 2</paper-tab>
 *   <paper-tab>TAB 3</paper-tab>
 * </paper-tabs>
 * 
 * 
 * 

See paper-tab for more information about
paper-tab.

*

A common usage for paper-tabs is to use it along with iron-pages to switch
between different views.

*
<paper-tabs selected="{{selected}}">
 *   <paper-tab>Tab 1</paper-tab>
 *   <paper-tab>Tab 2</paper-tab>
 *   <paper-tab>Tab 3</paper-tab>
 * </paper-tabs>
 * 
 * <iron-pages selected="{{selected}}">
 *   <div>Page 1</div>
 *   <div>Page 2</div>
 *   <div>Page 3</div>
 * </iron-pages>
 * 
 * 
 * 
 * 

To use links in tabs, add link attribute to paper-tab and put an <a>
element in paper-tab.

*

Example:

*
<paper-tabs selected="0">
 *   <paper-tab link>
 *     <a href="#link1" class="horizontal center-center layout">TAB ONE</a>
 *   </paper-tab>
 *   <paper-tab link>
 *     <a href="#link2" class="horizontal center-center layout">TAB TWO</a>
 *   </paper-tab>
 *   <paper-tab link>
 *     <a href="#link3" class="horizontal center-center layout">TAB THREE</a>
 *   </paper-tab>
 * </paper-tabs>
 * 
 * 
 * 

Styling

*

The following custom properties and mixins are available for styling:

* * * * * * * * * * * * * * * * * * * * *
Custom propertyDescriptionDefault
--paper-tabs-selection-bar-colorColor for the selection bar--paper-yellow-a100
--paper-tabsMixin applied to the tabs{}
*/ public class PaperTabs extends PaperTabsBase { /** * Default Constructor. */ public PaperTabs() { this(""); } /** * Constructor used by UIBinder to create widgets with content. */ public PaperTabs(String html) { super(PaperTabsElement.TAG, PaperTabsElement.SRC, html); getPolymerElement().addEventListener( com.vaadin.polymer.iron.element.event.IronDeselectEvent.NAME, new com.vaadin.polymer.iron.element.event.IronDeselectEvent.Listener() { @Override protected void handleEvent(com.vaadin.polymer.iron.element.event.IronDeselectEvent event) { fireEvent(new IronDeselectEvent(event)); } }); getPolymerElement().addEventListener( com.vaadin.polymer.iron.element.event.IronSelectEvent.NAME, new com.vaadin.polymer.iron.element.event.IronSelectEvent.Listener() { @Override protected void handleEvent(com.vaadin.polymer.iron.element.event.IronSelectEvent event) { fireEvent(new IronSelectEvent(event)); } }); } /** * Gets a handle to the Polymer object's underlying DOM element. */ public PaperTabsElement getPolymerElement() { return (PaperTabsElement) getElement(); } /** *

If true, the tabs are aligned to bottom (the selection bar appears at the top).

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

If true, the tabs are aligned to bottom (the selection bar appears at the top).

* * JavaScript Info: * @property alignBottom * @type Boolean * */ public void setAlignBottom(boolean value) { getPolymerElement().setAlignBottom(value); } /** *

If true, dragging on the tabs to scroll is disabled.

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

If true, dragging on the tabs to scroll is disabled.

* * JavaScript Info: * @property disableDrag * @type Boolean * */ public void setDisableDrag(boolean value) { getPolymerElement().setDisableDrag(value); } /** *

If true, scroll buttons (left/right arrow) will be hidden for scrollable tabs.

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

If true, scroll buttons (left/right arrow) will be hidden for scrollable tabs.

* * JavaScript Info: * @property hideScrollButtons * @type Boolean * */ public void setHideScrollButtons(boolean value) { getPolymerElement().setHideScrollButtons(value); } /** *

If true, the bottom bar to indicate the selected tab will not be shown.

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

If true, the bottom bar to indicate the selected tab will not be shown.

* * JavaScript Info: * @property noBar * @type Boolean * */ public void setNoBar(boolean value) { getPolymerElement().setNoBar(value); } /** *

If true, the slide effect for the bottom bar is disabled.

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

If true, the slide effect for the bottom bar is disabled.

* * JavaScript Info: * @property noSlide * @type Boolean * */ public void setNoSlide(boolean value) { getPolymerElement().setNoSlide(value); } /** *

If true, ink ripple effect is disabled.

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

If true, ink ripple effect is disabled.

* * JavaScript Info: * @property noink * @type Boolean * */ public void setNoink(boolean value) { getPolymerElement().setNoink(value); } /** *

If true, tabs are scrollable and the tab width is based on the label width.

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

If true, tabs are scrollable and the tab width is based on the label width.

* * JavaScript Info: * @property scrollable * @type Boolean * */ public void setScrollable(boolean value) { getPolymerElement().setScrollable(value); } /** * * * JavaScript Info: * @property selectable * @type String * */ public String getSelectable(){ return getPolymerElement().getSelectable(); } /** * * * JavaScript Info: * @property selectable * @type String * */ public void setSelectable(String value) { getPolymerElement().setSelectable(value); } /** *

Gets or sets the selected element. The default is to use the index of the item.

* * JavaScript Info: * @property selected * @type String * */ public String getSelected(){ return getPolymerElement().getSelected(); } /** *

Gets or sets the selected element. The default is to use the index of the item.

* * JavaScript Info: * @property selected * @type String * */ public void setSelected(String value) { getPolymerElement().setSelected(value); } /** * * * JavaScript Info: * @property hostAttributes * @type Object * */ public JavaScriptObject getHostAttributes(){ return getPolymerElement().getHostAttributes(); } /** * * * JavaScript Info: * @property hostAttributes * @type Object * */ public void setHostAttributes(JavaScriptObject value) { getPolymerElement().setHostAttributes(value); } /** * * * JavaScript Info: * @property listeners * @type Object * */ public JavaScriptObject getListeners(){ return getPolymerElement().getListeners(); } /** * * * JavaScript Info: * @property listeners * @type Object * */ public void setListeners(JavaScriptObject value) { getPolymerElement().setListeners(value); } /** *

Used to assign the closest resizable ancestor to this resizable
if the ancestor detects a request for notifications.

* * JavaScript Info: * @method assignParentResizable * @param {} parentResizable * @behavior NeonAnimatedPages */ public void assignParentResizable(JavaScriptObject parentResizable) { getPolymerElement().assignParentResizable(parentResizable); } /** *

Can be called to manually notify a resizable and its descendant
resizables of a resize change.

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

This method can be overridden to filter nested elements that should or
should not be notified by the current element. Return true if an element
should be notified, or false if it should not be notified.

* * JavaScript Info: * @method resizerShouldNotify * @param {HTMLElement} element * @behavior NeonAnimatedPages */ public void resizerShouldNotify(JavaScriptObject element) { getPolymerElement().resizerShouldNotify(element); } /** *

Used to remove a resizable descendant from the list of descendants
that should be notified of a resize change.

* * JavaScript Info: * @method stopResizeNotificationsFor * @param {} target * @behavior NeonAnimatedPages */ public void stopResizeNotificationsFor(JavaScriptObject target) { getPolymerElement().stopResizeNotificationsFor(target); } /** * * * JavaScript Info: * @method attached * @behavior NeonAnimatedPages */ public void attached() { getPolymerElement().attached(); } /** * * * JavaScript Info: * @method detached * @behavior NeonAnimatedPages */ public void detached() { getPolymerElement().detached(); } /** * * * JavaScript Info: * @property keyBindings * @type Object * @behavior PaperTabs */ public JavaScriptObject getKeyBindings(){ return getPolymerElement().getKeyBindings(); } /** * * * JavaScript Info: * @property keyBindings * @type Object * @behavior PaperTabs */ public void setKeyBindings(JavaScriptObject value) { getPolymerElement().setKeyBindings(value); } /** *

The attribute to use on menu items to look up the item title. Typing the first
letter of an item when the menu is open focuses that item. If unset, textContent
will be used.

* * JavaScript Info: * @property attrForItemTitle * @type String * @behavior PaperTabs */ public String getAttrForItemTitle(){ return getPolymerElement().getAttrForItemTitle(); } /** *

The attribute to use on menu items to look up the item title. Typing the first
letter of an item when the menu is open focuses that item. If unset, textContent
will be used.

* * JavaScript Info: * @property attrForItemTitle * @type String * @behavior PaperTabs */ public void setAttrForItemTitle(String value) { getPolymerElement().setAttrForItemTitle(value); } /** *

Returns the currently focused item.

* * JavaScript Info: * @property focusedItem * @type Object * @behavior PaperTabs */ public JavaScriptObject getFocusedItem(){ return getPolymerElement().getFocusedItem(); } /** *

Returns the currently focused item.

* * JavaScript Info: * @property focusedItem * @type Object * @behavior PaperTabs */ public void setFocusedItem(JavaScriptObject value) { getPolymerElement().setFocusedItem(value); } /** *

Returns the currently focused item.

* * JavaScript Info: * @attribute focused-item * @behavior PaperTabs */ public void setFocusedItem(String value) { getPolymerElement().setAttribute("focused-item", value); } /** * * * JavaScript Info: * @method select * @param {} value * @behavior PaperTabs */ public void select(JavaScriptObject value) { getPolymerElement().select(value); } /** * * * JavaScript Info: * @property observers * @type Array * @behavior PaperTabs */ public JsArray getObservers(){ return getPolymerElement().getObservers(); } /** * * * JavaScript Info: * @property observers * @type Array * @behavior PaperTabs */ public void setObservers(JsArray value) { getPolymerElement().setObservers(value); } /** *

If true, multiple selections are allowed.

* * JavaScript Info: * @property multi * @type Boolean * @behavior PaperTabs */ public boolean getMulti(){ return getPolymerElement().getMulti(); } /** *

If true, multiple selections are allowed.

* * JavaScript Info: * @property multi * @type Boolean * @behavior PaperTabs */ public void setMulti(boolean value) { getPolymerElement().setMulti(value); } /** * * * JavaScript Info: * @method multiChanged * @param {} multi * @behavior PaperTabs */ public void multiChanged(JavaScriptObject multi) { getPolymerElement().multiChanged(multi); } /** *

Returns an array of currently selected items.

* * JavaScript Info: * @property selectedItems * @type Array * @behavior PaperTabs */ public JsArray getSelectedItems(){ return getPolymerElement().getSelectedItems(); } /** *

Returns an array of currently selected items.

* * JavaScript Info: * @property selectedItems * @type Array * @behavior PaperTabs */ public void setSelectedItems(JsArray value) { getPolymerElement().setSelectedItems(value); } /** *

Returns an array of currently selected items.

* * JavaScript Info: * @attribute selected-items * @behavior PaperTabs */ public void setSelectedItems(String value) { getPolymerElement().setAttribute("selected-items", value); } /** *

Gets or sets the selected elements. This is used instead of selected when multi
is true.

* * JavaScript Info: * @property selectedValues * @type Array * @behavior PaperTabs */ public JsArray getSelectedValues(){ return getPolymerElement().getSelectedValues(); } /** *

Gets or sets the selected elements. This is used instead of selected when multi
is true.

* * JavaScript Info: * @property selectedValues * @type Array * @behavior PaperTabs */ public void setSelectedValues(JsArray value) { getPolymerElement().setSelectedValues(value); } /** *

Gets or sets the selected elements. This is used instead of selected when multi
is true.

* * JavaScript Info: * @attribute selected-values * @behavior PaperTabs */ public void setSelectedValues(String value) { getPolymerElement().setAttribute("selected-values", value); } /** *

The event that fires from items when they are selected. Selectable
will listen for this event from items and update the selection state.
Set to empty string to listen to no events.

* * JavaScript Info: * @property activateEvent * @type string * @behavior NeonAnimatedPages */ public String getActivateEvent(){ return getPolymerElement().getActivateEvent(); } /** *

The event that fires from items when they are selected. Selectable
will listen for this event from items and update the selection state.
Set to empty string to listen to no events.

* * JavaScript Info: * @property activateEvent * @type string * @behavior NeonAnimatedPages */ public void setActivateEvent(String value) { getPolymerElement().setActivateEvent(value); } /** *

If you want to use the attribute value of an element for selected instead of the index,
set this to the name of the attribute.

* * JavaScript Info: * @property attrForSelected * @type string * @behavior NeonAnimatedPages */ public String getAttrForSelected(){ return getPolymerElement().getAttrForSelected(); } /** *

If you want to use the attribute value of an element for selected instead of the index,
set this to the name of the attribute.

* * JavaScript Info: * @property attrForSelected * @type string * @behavior NeonAnimatedPages */ public void setAttrForSelected(String value) { getPolymerElement().setAttrForSelected(value); } /** * * * JavaScript Info: * @property excludedLocalNames * @type Object * @behavior NeonAnimatedPages */ public JavaScriptObject getExcludedLocalNames(){ return getPolymerElement().getExcludedLocalNames(); } /** * * * JavaScript Info: * @property excludedLocalNames * @type Object * @behavior NeonAnimatedPages */ public void setExcludedLocalNames(JavaScriptObject value) { getPolymerElement().setExcludedLocalNames(value); } /** *

Returns the index of the given item.

* * JavaScript Info: * @method indexOf * @param {Object} item * @behavior NeonAnimatedPages */ public void indexOf(JavaScriptObject item) { getPolymerElement().indexOf(item); } /** *

Returns an array of selectable items.

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

Selects the next item.

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

Selects the previous item.

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

The attribute to set on elements when selected.

* * JavaScript Info: * @property selectedAttribute * @type string * @behavior NeonAnimatedPages */ public String getSelectedAttribute(){ return getPolymerElement().getSelectedAttribute(); } /** *

The attribute to set on elements when selected.

* * JavaScript Info: * @property selectedAttribute * @type string * @behavior NeonAnimatedPages */ public void setSelectedAttribute(String value) { getPolymerElement().setSelectedAttribute(value); } /** *

The class to set on elements when selected.

* * JavaScript Info: * @property selectedClass * @type string * @behavior NeonAnimatedPages */ public String getSelectedClass(){ return getPolymerElement().getSelectedClass(); } /** *

The class to set on elements when selected.

* * JavaScript Info: * @property selectedClass * @type string * @behavior NeonAnimatedPages */ public void setSelectedClass(String value) { getPolymerElement().setSelectedClass(value); } /** *

Returns the currently selected item.

* * JavaScript Info: * @property selectedItem * @type Object * @behavior NeonAnimatedPages */ public JavaScriptObject getSelectedItem(){ return getPolymerElement().getSelectedItem(); } /** *

Returns the currently selected item.

* * JavaScript Info: * @property selectedItem * @type Object * @behavior NeonAnimatedPages */ public void setSelectedItem(JavaScriptObject value) { getPolymerElement().setSelectedItem(value); } /** *

Returns the currently selected item.

* * JavaScript Info: * @attribute selected-item * @behavior NeonAnimatedPages */ public void setSelectedItem(String value) { getPolymerElement().setAttribute("selected-item", 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 PaperTabs */ public void addOwnKeyBinding(JavaScriptObject eventString, JavaScriptObject handlerName) { getPolymerElement().addOwnKeyBinding(eventString, handlerName); } /** *

The HTMLElement that will be firing relevant KeyboardEvents.

* * JavaScript Info: * @property keyEventTarget * @type Object * @behavior PaperTabs */ public JavaScriptObject getKeyEventTarget(){ return getPolymerElement().getKeyEventTarget(); } /** *

The HTMLElement that will be firing relevant KeyboardEvents.

* * JavaScript Info: * @property keyEventTarget * @type Object * @behavior PaperTabs */ public void setKeyEventTarget(JavaScriptObject value) { getPolymerElement().setKeyEventTarget(value); } /** *

The HTMLElement that will be firing relevant KeyboardEvents.

* * JavaScript Info: * @attribute key-event-target * @behavior PaperTabs */ public void setKeyEventTarget(String value) { getPolymerElement().setAttribute("key-event-target", value); } /** * * * JavaScript Info: * @method keyboardEventMatchesKeys * @param {} event * @param {} eventString * @behavior PaperTabs */ public void keyboardEventMatchesKeys(JavaScriptObject event, JavaScriptObject eventString) { getPolymerElement().keyboardEventMatchesKeys(event, eventString); } /** *

When called, will remove all imperatively-added key bindings.

* * JavaScript Info: * @method removeOwnKeyBindings * @behavior PaperTabs */ public void removeOwnKeyBindings() { getPolymerElement().removeOwnKeyBindings(); } /** * * * JavaScript Info: * @method registered * @behavior PaperTabs */ public void registered() { getPolymerElement().registered(); } /** * * * JavaScript Info: * @event iron-deselect */ public HandlerRegistration addIronDeselectHandler(IronDeselectEventHandler handler) { return addHandler(handler, IronDeselectEvent.TYPE); } /** * * * JavaScript Info: * @event iron-select */ public HandlerRegistration addIronSelectHandler(IronSelectEventHandler handler) { return addHandler(handler, IronSelectEvent.TYPE); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy