Class zebkit.ui.web.HtmlElement
extends <zebkit.ui.Panel>
<zebkit.ui.web>

HTML element UI component wrapper class. The class represents an HTML element as if it is standard UI component. It helps to use some standard HTML element as zebkit UI components and embeds it in zebkit UI application layout.

Constructor:
zebkit.ui.web.HtmlElement ([element])

Parameters:
  • [element] <String | HTMLElement>

    an HTML element to be represented as a standard zebkit UI component. If the passed parameter is string it denotes a name of an HTML element. In this case a new HTML element will be created.




public void setAttribute (name, value)
public void setAttributes (attrs)
public void setColor (c)
public void setContent (an)
public void setFont (f)
public void setStyle (a, a)
public void setStyles (styles)
public void update (g)


Inherited methods:
$setConstraints(c)    add(constr, d)    byConstraints([p], c)    byPath(path, [cb])    calcPreferredSize(target)    doLayout( )    fire(event, [path], [params])    focused( )    getBottom( )    getCanvas( )    getComponentAt(x, y)    getHorPadding( )    getLeft( )    getPreferredSize( )    getRight( )    getTop( )    getVerPadding( )    hasFocus( )    indexOf(c)    insert(i, constr, d)    invalidate( )    invalidateLayout( )    kidAdded(index, constr, l)    kidRemoved(i, l)    laidout( )    load(JSON)    off([eventName], [path], [cb])    on([eventName], [path], cb)    paintComponent(g)    paintViewAt(g, ax, ay, v)    properties([path], props)    property([path], name, value)    recalc( )    relocated(px, py)    remove(c)    removeAll( )    removeAt(i)    removeByConstraints(ctr)    removeMe([after])    repaint([x], [y], [w], [h])    requestFocus( )    requestFocusIn([timeout])    resized(pw, ph)    setAt(i, d)    setBackground(v)    setBorder([v])    setBottomPadding(bottom)    setBounds(x, y, w, h)    setByConstraints(constr, c)    setConstraints(ctr)    setEnabled(b)    setId(id)    setKids(a)    setLayout(m)    setLeftPadding(left)    setLocation(xx, yy)    setPadding(v)    setParent(o)    setPreferredSize(w, h)    setProperties([path], props)    setRightPadding(right)    setSize(w, h)    setTopPadding(top)    setVisible(b)    toBack( )    toFront( )    toPreferredHeight( )    toPreferredSize( )    toPreferredWidth( )    toView(target)    validate( )    validateMetric( )    vrp( )   


public chainable setAttribute (name, value)

Set the specified attribute to the wrapped HTML element


Parameters:
  • name <String>

    a name of attribute

  • value <String>

    a value of the attribute

public chainable setAttributes (attrs)

Set the specified attributes set to the wrapped HTML element


Parameters:
  • attrs <Object>

    the dictionary of attributes where name of an attribute is a key of the dictionary and

public chainable setColor (c)

Set the CSS color of the wrapped HTML element


Parameters:
public chainable setContent (an)

Set the inner content of the wrapped HTML element


Parameters:
public chainable setFont (f)

Set the CSS font of the wrapped HTML element


Parameters:
public chainable setStyle (a, a)

Apply the given CSS style to the wrapped HTML element


Parameters:
  • a <String>

    name of the CSS style

  • a <String>

    value the CSS style has to be set

public chainable setStyles (styles)

Apply the given set of CSS styles to the wrapped HTML element


Parameters:
  • styles <Object>

    a dictionary of CSS styles

public void update (g)

Implements "update" method to be aware when the component is visible. It is used to adjust wrapped HTML element visibility and size. Update is the first rendering method that is called, so it is right place to sync HTML element visibility before paint method execution


Parameters:


Inherited attributes:
public zebkit.draw.View bg    public zebkit.draw.View border    public Boolean canHaveFocus    public Object constraints    public Integer height    public Boolean isEnabled    public Boolean isValid    public Boolean isVisible    public Array kids    public zebkit.layout.Layout layout    public zebkit.layout.Layoutable parent    public Integer width    public Integer x    public Integer y   



private <HTMLElement> $container

Every zebkit HTML element is wrapped with a container (div) HTML element. It is required since not all HTML elements are designed to be a container (for instance HTMLCanvas element), where every zebkit has to be a container.

public <HTMLElement> element

Reference to HTML element the UI component wraps

private <Boolean> isDOMElement

Indicates that this component is a DOM element wrapper