com.vaadin.polymer.iron.widget.IronMeta Maven / Gradle / Ivy
/*
* This code was generated with Vaadin Web Component GWT API Generator,
* from iron-meta 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;
/**
* iron-meta
is a generic element you can use for sharing information across the DOM tree.
It uses monostate pattern such that any
instance of iron-meta has access to the shared
information. You can use iron-meta
to share whatever you want (or create an extension
[like x-meta] for enhancements).
* The iron-meta
instances containing your actual data can be loaded in an import,
or constructed in any way you see fit. The only requirement is that you create them
before you try to access them.
* Examples:
* If I create an instance like this:
* <iron-meta key="info" value="foo/bar"></iron-meta>
*
*
*
Note that value=”foo/bar” is the metadata I’ve defined. I could define more
attributes or use child nodes to define additional metadata.
* Now I can access that element (and it’s metadata) from any iron-meta instance
via the byKey method, e.g.
* meta.byKey('info');
*
*
*
Pure imperative form would be like:
* document.createElement('iron-meta').byKey('info');
*
*
*
Or, in a Polymer element, you can include a meta in your template:
* <iron-meta id="meta"></iron-meta>
* ...
* this.$.meta.byKey('info');
*
*
*
*/
public class IronMeta extends PolymerWidget {
/**
* Default Constructor.
*/
public IronMeta() {
this("");
}
/**
* Constructor used by UIBinder to create widgets with content.
*/
public IronMeta(String html) {
super(IronMetaElement.TAG, IronMetaElement.SRC, html);
}
/**
* Gets a handle to the Polymer object's underlying DOM element.
*/
public IronMetaElement getPolymerElement() {
return (IronMetaElement) getElement();
}
/**
* Array of all meta-data values for the given type.
*
* JavaScript Info:
* @property list
* @type Array
*
*/
public JsArray getList() {
return getPolymerElement().getList();
}
/**
* Array of all meta-data values for the given type.
*
* JavaScript Info:
* @property list
* @type Array
*
*/
public void setList(JsArray value) {
getPolymerElement().setList(value);
}
/**
* If true, value
is set to the iron-meta instance itself.
*
* JavaScript Info:
* @property self
* @type Boolean
*
*/
public boolean getSelf() {
return getPolymerElement().getSelf();
}
/**
* If true, value
is set to the iron-meta instance itself.
*
* JavaScript Info:
* @property self
* @type Boolean
*
*/
public void setSelf(boolean value) {
getPolymerElement().setSelf(value);
}
/**
* The meta-data to store or retrieve.
*
* JavaScript Info:
* @property value
* @type Object
*
*/
public JavaScriptObject getValue() {
return getPolymerElement().getValue();
}
/**
* The meta-data to store or retrieve.
*
* JavaScript Info:
* @property value
* @type Object
*
*/
public void setValue(JavaScriptObject value) {
getPolymerElement().setValue(value);
}
/**
* The key used to store value
under the type
namespace.
*
* JavaScript Info:
* @property key
* @type String
*
*/
public String getKey() {
return getPolymerElement().getKey();
}
/**
* The key used to store value
under the type
namespace.
*
* JavaScript Info:
* @property key
* @type String
*
*/
public void setKey(String value) {
getPolymerElement().setKey(value);
}
/**
* The type of meta-data. All meta-data of the same type is stored
together.
*
* JavaScript Info:
* @property type
* @type String
*
*/
public String getType() {
return getPolymerElement().getType();
}
/**
* The type of meta-data. All meta-data of the same type is stored
together.
*
* JavaScript Info:
* @property type
* @type String
*
*/
public void setType(String value) {
getPolymerElement().setType(value);
}
// Needed in UIBinder
/**
* Array of all meta-data values for the given type.
*
* JavaScript Info:
* @attribute list
*
*/
public void setList(String value) {
Polymer.property(this.getPolymerElement(), "list", value);
}
// Needed in UIBinder
/**
* The meta-data to store or retrieve.
*
* JavaScript Info:
* @attribute value
*
*/
public void setValue(String value) {
Polymer.property(this.getPolymerElement(), "value", value);
}
/**
* Only runs if someone invokes the factory/constructor directly
e.g. new Polymer.IronMeta()
*
* JavaScript Info:
* @method factoryImpl
* @param {{type: (string|undefined), key: (string|undefined), value}=} config
*
*
*/
public void factoryImpl(Object config) {
getPolymerElement().factoryImpl(config);
}
/**
* Retrieves meta data value by key.
*
* JavaScript Info:
* @method byKey
* @param {string} key
*
* @return {JavaScriptObject}
*/
public JavaScriptObject byKey(String key) {
return getPolymerElement().byKey(key);
}
}