com.vaadin.polymer.iron.widget.IronLocation Maven / Gradle / Ivy
/*
* This code was generated with Vaadin Web Component GWT API Generator,
* from iron-location project by The Polymer Authors
* that is licensed with http://polymer.github.io/LICENSE.txt license.
*/
package com.vaadin.polymer.iron.widget;
import com.vaadin.polymer.iron.*;
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;
/**
* The iron-location
element manages binding to and from the current URL.
* iron-location is the first, and lowest level element in the Polymer team’s
routing system. This is a beta release of iron-location as we continue work
on higher level elements, and as such iron-location may undergo breaking
changes.
* Properties
* When the URL is: /search?query=583#details
iron-location’s properties will be:
*
* - path:
'/search'
* - query:
'query=583'
* - hash:
'details'
*
* These bindings are bidirectional. Modifying them will in turn modify the URL.
* iron-location is only active while it is attached to the document.
* Links
* While iron-location is active in the document it will intercept clicks on links
within your site, updating the URL pushing the updated URL out through the
databinding system. iron-location only intercepts clicks with the intent to
open in the same window, so middle mouse clicks and ctrl/cmd clicks work fine.
* You can customize this behavior with the urlSpaceRegex
.
* Dwell Time
* iron-location protects against accidental history spamming by only adding
entries to the user’s history if the URL stays unchanged for dwellTime
milliseconds.
*/
public class IronLocation extends PolymerWidget {
/**
* Default Constructor.
*/
public IronLocation() {
this("");
}
/**
* Constructor used by UIBinder to create widgets with content.
*/
public IronLocation(String html) {
super(IronLocationElement.TAG, IronLocationElement.SRC, html);
}
/**
* Gets a handle to the Polymer object's underlying DOM element.
*/
public IronLocationElement getPolymerElement() {
return (IronLocationElement) getElement();
}
/**
* If the user was on a URL for less than dwellTime
milliseconds, it
won’t be added to the browser’s history, but instead will be replaced
by the next entry.
* This is to prevent large numbers of entries from clogging up the user’s
browser history. Disable by setting to a negative number.
*
* JavaScript Info:
* @property dwellTime
* @type Number
*
*/
public double getDwellTime() {
return getPolymerElement().getDwellTime();
}
/**
* If the user was on a URL for less than dwellTime
milliseconds, it
won’t be added to the browser’s history, but instead will be replaced
by the next entry.
* This is to prevent large numbers of entries from clogging up the user’s
browser history. Disable by setting to a negative number.
*
* JavaScript Info:
* @property dwellTime
* @type Number
*
*/
public void setDwellTime(double value) {
getPolymerElement().setDwellTime(value);
}
/**
* A regexp that defines the set of URLs that should be considered part
of this web app.
* Clicking on a link that matches this regex won’t result in a full page
navigation, but will instead just update the URL state in place.
* This regexp is given everything after the origin in an absolute
URL. So to match just URLs that start with /search/ do:
url-space-regex=”^/search/“
*
* JavaScript Info:
* @property urlSpaceRegex
* @type (string|RegExp)
*
*/
public Object getUrlSpaceRegex() {
return getPolymerElement().getUrlSpaceRegex();
}
/**
* A regexp that defines the set of URLs that should be considered part
of this web app.
* Clicking on a link that matches this regex won’t result in a full page
navigation, but will instead just update the URL state in place.
* This regexp is given everything after the origin in an absolute
URL. So to match just URLs that start with /search/ do:
url-space-regex=”^/search/“
*
* JavaScript Info:
* @property urlSpaceRegex
* @type (string|RegExp)
*
*/
public void setUrlSpaceRegex(Object value) {
getPolymerElement().setUrlSpaceRegex(value);
}
/**
* The hash component of the URL.
*
* JavaScript Info:
* @property hash
* @type String
*
*/
public String getHash() {
return getPolymerElement().getHash();
}
/**
* The hash component of the URL.
*
* JavaScript Info:
* @property hash
* @type String
*
*/
public void setHash(String value) {
getPolymerElement().setHash(value);
}
/**
* The pathname component of the URL.
*
* JavaScript Info:
* @property path
* @type String
*
*/
public String getPath() {
return getPolymerElement().getPath();
}
/**
* The pathname component of the URL.
*
* JavaScript Info:
* @property path
* @type String
*
*/
public void setPath(String value) {
getPolymerElement().setPath(value);
}
/**
* The query string portion of the URL.
*
* JavaScript Info:
* @property query
* @type String
*
*/
public String getQuery() {
return getPolymerElement().getQuery();
}
/**
* The query string portion of the URL.
*
* JavaScript Info:
* @property query
* @type String
*
*/
public void setQuery(String value) {
getPolymerElement().setQuery(value);
}
// Needed in UIBinder
/**
* If the user was on a URL for less than dwellTime
milliseconds, it
won’t be added to the browser’s history, but instead will be replaced
by the next entry.
* This is to prevent large numbers of entries from clogging up the user’s
browser history. Disable by setting to a negative number.
*
* JavaScript Info:
* @attribute dwell-time
*
*/
public void setDwellTime(String value) {
Polymer.property(this.getPolymerElement(), "dwellTime", value);
}
// Needed in UIBinder
/**
* A regexp that defines the set of URLs that should be considered part
of this web app.
* Clicking on a link that matches this regex won’t result in a full page
navigation, but will instead just update the URL state in place.
* This regexp is given everything after the origin in an absolute
URL. So to match just URLs that start with /search/ do:
url-space-regex=”^/search/“
*
* JavaScript Info:
* @attribute url-space-regex
*
*/
public void setUrlSpaceRegex(String value) {
Polymer.property(this.getPolymerElement(), "urlSpaceRegex", value);
}
}