Package org.pepstock.charba.client.dom
Class DOMBuilder
- java.lang.Object
- 
- org.pepstock.charba.client.dom.DOMBuilder
 
- 
 public final class DOMBuilder extends Object Singleton utility to create and manage DOM element.- Author:
- Andrea "Stock" Stocchero
 
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CanvascreateCanvasElement()Creates a <canvas> element.DivcreateDivElement()Creates a <div> element.HeadingcreateHeadingElement()Creates a <h3> element.ImgcreateImageElement()Creates a <img> element.ImgcreateImageElement(String src)Creates a <img> element with the full URL of the image.LineBreakcreateLineBreakElement()Creates a <br> element.ScriptcreateScriptElement()Creates a <script> element.SpancreateSpanElement()Creates a <span> element.StylecreateStyleElement()Creates a <style> element.TableCellcreateTableCellElement()Creates a <td> element.TablecreateTableElement()Creates a <table> element.TableRowcreateTableRowElement()Creates a <tr> element.TextNodecreateTextNode(String data)Creates a text node.StringcreateUniqueChartId()Creates an unique id for CHARBA charts id.static DOMBuilderget()Returns the singleton instance of the builder.booleanisCanvasSupported()Returnstrueif the canvas is supported by browser.booleanisUniqueChartId(String id)Returnstrueif the passed id is a CHARBA charts id.
 
- 
- 
- 
Method Detail- 
getpublic static DOMBuilder get() Returns the singleton instance of the builder.- Returns:
- the singleton instance of the builder
 
 - 
createUniqueChartIdpublic String createUniqueChartId() Creates an unique id for CHARBA charts id.- Returns:
- an unique id for CHARBA charts id
 
 - 
isUniqueChartIdpublic boolean isUniqueChartId(String id) Returnstrueif the passed id is a CHARBA charts id.- Parameters:
- id- an id instance to check
- Returns:
- trueif the passed id is a CHARBA charts id
 
 - 
isCanvasSupportedpublic boolean isCanvasSupported() Returnstrueif the canvas is supported by browser.- Returns:
- trueif the canvas is supported by browser
 
 - 
createCanvasElementpublic Canvas createCanvasElement() Creates a <canvas> element.- Returns:
- the newly created element
 
 - 
createDivElementpublic Div createDivElement() Creates a <div> element.- Returns:
- a <div> element
 
 - 
createScriptElementpublic Script createScriptElement() Creates a <script> element.- Returns:
- a <script> element
 
 - 
createStyleElementpublic Style createStyleElement() Creates a <style> element.- Returns:
- a <style> element
 
 - 
createLineBreakElementpublic LineBreak createLineBreakElement() Creates a <br> element.- Returns:
- a <br> element
 
 - 
createSpanElementpublic Span createSpanElement() Creates a <span> element.- Returns:
- a <span> element
 
 - 
createImageElementpublic Img createImageElement() Creates a <img> element.- Returns:
- a <img> element
 
 - 
createImageElementpublic Img createImageElement(String src) Creates a <img> element with the full URL of the image.- Parameters:
- src- the full URL of the image
- Returns:
- a <img> element
 
 - 
createTableElementpublic Table createTableElement() Creates a <table> element.- Returns:
- a <table> element
 
 - 
createTableRowElementpublic TableRow createTableRowElement() Creates a <tr> element.- Returns:
- a <tr> element
 
 - 
createTableCellElementpublic TableCell createTableCellElement() Creates a <td> element.- Returns:
- a <td> element
 
 - 
createHeadingElementpublic Heading createHeadingElement() Creates a <h3> element.- Returns:
- a <h3> element
 
 
- 
 
-