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

com.vaadin.polymer.app.widget.AppScrollposControl Maven / Gradle / Ivy

The newest version!
/*
 * This code was generated with Vaadin Web Component GWT API Generator, 
 * from app-layout project by The Polymer Authors
 * that is licensed with https://polymer.github.io/LICENSE.txt license.
 */
package com.vaadin.polymer.app.widget;

import com.vaadin.polymer.app.*;

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;

/**
 * 

app-scrollpos-control is a manager for saving and restoring the scroll position when multiple
pages are sharing the same document scroller.

*

Example:

*
<app-scrollpos-control selected="{{page}}"></app-scrollpos-control>
 * 
 * <app-drawer-layout>
 * 
 *   <app-drawer>
 *     <paper-menu selected="{{page}}">
 *       <paper-item>Home</paper-item>
 *       <paper-item>About</paper-item>
 *       <paper-item>Schedule</paper-item>
 *       <paper-item>Account</paper-item>
 *     </paper-menu>
 *   </app-drawer>
 * 
 *   <div>
 *     <app-toolbar>
 *       <paper-icon-button icon="menu" drawer-toggle></paper-icon-button>
 *     </app-toolbar>
 *     <iron-pages selected="{{page}}">
 *       <sample-content size="100"></sample-content>
 *       <sample-content size="100"></sample-content>
 *       <sample-content size="100"></sample-content>
 *       <sample-content size="100"></sample-content>
 *     </iron-pages>
 *   </div>
 * 
 * </app-drawer-layout>
 * 
*/ public class AppScrollposControl extends PolymerWidget { /** * Default Constructor. */ public AppScrollposControl() { this(""); } /** * Constructor used by UIBinder to create widgets with content. */ public AppScrollposControl(String html) { super(AppScrollposControlElement.TAG, AppScrollposControlElement.SRC, html); } /** * Gets a handle to the Polymer object's underlying DOM element. */ public AppScrollposControlElement getPolymerElement() { return (AppScrollposControlElement) getElement(); } /** *

Reset the scroll position to 0.

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

Reset the scroll position to 0.

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

Specifies the element that will handle the scroll event
on the behalf of the current element. This is typically a reference to an element,
but there are a few more posibilities:

*

Elements id

*
<div id="scrollable-element" style="overflow: auto;">
     *  <x-element scroll-target="scrollable-element">
     *    <!-- Content-->
     *  </x-element>
     * </div>
     * 
*

In this case, the scrollTarget will point to the outer div element.

*

Document scrolling

*

For document scrolling, you can use the reserved word document:

*
<x-element scroll-target="document">
     *   <!-- Content -->
     * </x-element>
     * 
*

Elements reference

*
appHeader.scrollTarget = document.querySelector('#scrollable-element');
     * 
* * JavaScript Info: * @property scrollTarget * @type Element * @behavior IronScrollThreshold */ public Element getScrollTarget() { return getPolymerElement().getScrollTarget(); } /** *

Specifies the element that will handle the scroll event
on the behalf of the current element. This is typically a reference to an element,
but there are a few more posibilities:

*

Elements id

*
<div id="scrollable-element" style="overflow: auto;">
     *  <x-element scroll-target="scrollable-element">
     *    <!-- Content-->
     *  </x-element>
     * </div>
     * 
*

In this case, the scrollTarget will point to the outer div element.

*

Document scrolling

*

For document scrolling, you can use the reserved word document:

*
<x-element scroll-target="document">
     *   <!-- Content -->
     * </x-element>
     * 
*

Elements reference

*
appHeader.scrollTarget = document.querySelector('#scrollable-element');
     * 
* * JavaScript Info: * @property scrollTarget * @type Element * @behavior IronScrollThreshold */ public void setScrollTarget(Element value) { getPolymerElement().setScrollTarget(value); } /** *

The selected page.

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

The selected page.

* * JavaScript Info: * @property selected * @type String * */ public void setSelected(String value) { getPolymerElement().setSelected(value); } // Needed in UIBinder /** *

Specifies the element that will handle the scroll event
on the behalf of the current element. This is typically a reference to an element,
but there are a few more posibilities:

*

Elements id

*
<div id="scrollable-element" style="overflow: auto;">
     *  <x-element scroll-target="scrollable-element">
     *    <!-- Content-->
     *  </x-element>
     * </div>
     * 
*

In this case, the scrollTarget will point to the outer div element.

*

Document scrolling

*

For document scrolling, you can use the reserved word document:

*
<x-element scroll-target="document">
     *   <!-- Content -->
     * </x-element>
     * 
*

Elements reference

*
appHeader.scrollTarget = document.querySelector('#scrollable-element');
     * 
* * JavaScript Info: * @attribute scroll-target * @behavior IronScrollThreshold */ public void setScrollTarget(String value) { Polymer.property(this.getPolymerElement(), "scrollTarget", value); } /** *

Enables or disables the scroll event listener.

* * JavaScript Info: * @method toggleScrollListener * @param {boolean} yes * @behavior IronScrollThreshold * */ public void toggleScrollListener(boolean yes) { getPolymerElement().toggleScrollListener(yes); } /** *

Scrolls the content to a particular place.

* * JavaScript Info: * @method scroll * @param {number} left * @param {number} top * @behavior IronScrollThreshold * */ public void scroll(double left, double top) { getPolymerElement().scroll(left, top); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy