public final class DOMBuilder extends Object
Modifier and Type | Method and Description |
---|---|
Canvas |
createCanvasElement()
Creates a <canvas> element.
|
BaseNativeEvent |
createChangeEvent()
Creates a change event (based on a mouse event, type
BaseEventTypes.CONTEXT_MENU ) for internal use. |
Div |
createDivElement()
Creates a <div> element.
|
Heading |
createHeadingElement()
Creates a <h3> element.
|
Img |
createImageElement()
Creates a <img> element.
|
Img |
createImageElement(String src)
Creates a <img> element with the full URL of the image.
|
LineBreak |
createLineBreakElement()
Creates a <br> element.
|
Script |
createScriptElement()
Creates a <script> element.
|
BaseNativeMouseEvent |
createSelectionEvent(SelectEventInit eventInitDict)
Creates a mouse event, internally used by
DatasetsItemsSelector plugin. |
Span |
createSpanElement()
Creates a <span> element.
|
Style |
createStyleElement()
Creates a <style> element.
|
TableCell |
createTableCellElement()
Creates a <td> element.
|
Table |
createTableElement()
Creates a <table> element.
|
TableRow |
createTableRowElement()
Creates a <tr> element.
|
TextNode |
createTextNode(String data)
Creates a text node.
|
String |
createUniqueChartId()
Creates an unique id for CHARBA charts id.
|
static DOMBuilder |
get()
Returns the singleton instance of the builder.
|
boolean |
isCanvasSupported()
Returns
true if the canvas is supported by browser. |
boolean |
isUniqueChartId(String id)
Returns
true if the passed id is a CHARBA charts id. |
public static DOMBuilder get()
public String createUniqueChartId()
public boolean isUniqueChartId(String id)
true
if the passed id is a CHARBA charts id.id
- an id instance to checktrue
if the passed id is a CHARBA charts idpublic boolean isCanvasSupported()
true
if the canvas is supported by browser.true
if the canvas is supported by browserpublic Canvas createCanvasElement()
public Div createDivElement()
public Script createScriptElement()
public Style createStyleElement()
public LineBreak createLineBreakElement()
public Span createSpanElement()
public Img createImageElement()
public Img createImageElement(String src)
src
- the full URL of the imagepublic Table createTableElement()
public TableRow createTableRowElement()
public TableCell createTableCellElement()
public Heading createHeadingElement()
public TextNode createTextNode(String data)
data
- the text node's initial textpublic BaseNativeEvent createChangeEvent()
BaseEventTypes.CONTEXT_MENU
) for internal use.BaseEventTypes.CONTEXT_MENU
)public BaseNativeMouseEvent createSelectionEvent(SelectEventInit eventInitDict)
DatasetsItemsSelector
plugin.eventInitDict
- event initialization dictionary to configure the eventDatasetsItemsSelector
plugin