com.vaadin.polymer.iron.widget.IronDocViewer Maven / Gradle / Ivy
/*
* This code was generated with Vaadin Web Component GWT API Generator,
* from iron-doc-viewer 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.iron.widget.event.IronDocViewerComponentSelectedEvent;
import com.vaadin.polymer.iron.widget.event.IronDocViewerComponentSelectedEventHandler;
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;
/**
* Renders documentation describing an element’s API.
* iron-doc-viewer
renders element and behavior descriptions as extracted by
Hydrolysis. You can provide them
either via binding…
* <iron-doc-viewer descriptor="{{elementDescriptor}}"></iron-doc-viewer>
*
*
*
…or by placing the element descriptor in JSON as the text content of an
iron-doc-viewer
:
* <iron-doc-viewer>
* {
* "is": "awesome-sauce",
* "properties": [
* {"name": "isAwesome", "type": "boolean", "desc": "Is it awesome?"},
* ]
* }
* </iron-doc-viewer>
*
*
*
However, be aware that due to current limitations in Polymer 0.8, changes to
the text content will not be respected, only the initial value will be loaded.
If you wish to update the documented element, please set it via the descriptor
property.
*/
public class IronDocViewer extends PolymerWidget {
/**
* Default Constructor.
*/
public IronDocViewer() {
this("");
}
/**
* Constructor used by UIBinder to create widgets with content.
*/
public IronDocViewer(String html) {
super(IronDocViewerElement.TAG, IronDocViewerElement.SRC, html);
}
/**
* Gets a handle to the Polymer object's underlying DOM element.
*/
public IronDocViewerElement getPolymerElement() {
return (IronDocViewerElement) getElement();
}
/**
* The Hydrolysis-generated
element descriptor to display details for.
* Alternatively, the element descriptor can be provided as JSON via the text content
of this element.
*
* JavaScript Info:
* @property descriptor
* @type hydrolysis.ElementDescriptor
*
*/
public JavaScriptObject getDescriptor() {
return getPolymerElement().getDescriptor();
}
/**
* The Hydrolysis-generated
element descriptor to display details for.
* Alternatively, the element descriptor can be provided as JSON via the text content
of this element.
*
* JavaScript Info:
* @property descriptor
* @type hydrolysis.ElementDescriptor
*
*/
public void setDescriptor(JavaScriptObject value) {
getPolymerElement().setDescriptor(value);
}
/**
* Prefix for fragment identifiers used in anchors.
For static routing iron-component-page
can
set this to a string identifying the current component.
*
* JavaScript Info:
* @property prefix
* @type String
*
*/
public String getPrefix() {
return getPolymerElement().getPrefix();
}
/**
* Prefix for fragment identifiers used in anchors.
For static routing iron-component-page
can
set this to a string identifying the current component.
*
* JavaScript Info:
* @property prefix
* @type String
*
*/
public void setPrefix(String value) {
getPolymerElement().setPrefix(value);
}
// Needed in UIBinder
/**
* The Hydrolysis-generated
element descriptor to display details for.
* Alternatively, the element descriptor can be provided as JSON via the text content
of this element.
*
* JavaScript Info:
* @attribute descriptor
*
*/
public void setDescriptor(String value) {
Polymer.property(this.getPolymerElement(), "descriptor", value);
}
/**
* Scrolls to the currently selected anchor, as identified
by the URL hash. Whichever element or script is in charge
of routing should call this method on initial page load and
on hashchange events.
*
* JavaScript Info:
* @method scrollToAnchor
* @param {} hash
*
*
*/
public void scrollToAnchor(Object hash) {
getPolymerElement().scrollToAnchor(hash);
}
/**
* Broadcast when another component is clicked on
*
* JavaScript Info:
* @event iron-doc-viewer-component-selected
*/
public HandlerRegistration addIronDocViewerComponentSelectedHandler(IronDocViewerComponentSelectedEventHandler handler) {
return addDomHandler(handler, IronDocViewerComponentSelectedEvent.TYPE);
}
}