com.vaadin.polymer.prism.widget.PrismHighlighter Maven / Gradle / Ivy
/*
* This code was generated with Vaadin Web Component GWT API Generator,
* from prism-element project by The Polymer Project Authors (https://polymer.github.io/AUTHORS.txt)
* that is licensed with http://polymer.github.io/LICENSE.txt license.
*/
package com.vaadin.polymer.prism.widget;
import com.vaadin.polymer.prism.element.*;
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;
/**
* Syntax highlighting via Prism.
* Place a <prism-highlighter>
in your document, preferably as a direct child of
<body>
. It will listen for syntax-highlight
events on its parent element,
and annotate the code being provided via that event.
* The syntax-highlight
event’s detail is expected to have a code
property
containing the source to highlight. The event detail can optionally contain a
lang
property, containing a string like "html"
, "js"
, etc.
* This flow is supported by <marked-element>
.
*/
public class PrismHighlighter extends PolymerWidget {
/**
* Default Constructor.
*/
public PrismHighlighter() {
this("");
}
/**
* Constructor used by UIBinder to create widgets with content.
*/
public PrismHighlighter(String html) {
super(PrismHighlighterElement.TAG, PrismHighlighterElement.SRC, html);
}
/**
* Gets a handle to the Polymer object's underlying DOM element.
*/
public PrismHighlighterElement getPolymerElement() {
return (PrismHighlighterElement) getElement();
}
/**
*
*
* JavaScript Info:
* @method attached
*
*/
public void attached() {
getPolymerElement().attached();
}
/**
*
*
* JavaScript Info:
* @method detached
*
*/
public void detached() {
getPolymerElement().detached();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy