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

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.

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

  • [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(name, [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])    replaceMe([ctr], c)    requestFocus( )    requestFocusIn([timeout])    resized(pw, ph)    setAt(i, d)    setBackground(v)    setBorder([v])    setBorderLayout([gap])    setBottomPadding(bottom)    setBounds(x, y, w, h)    setByConstraints(constr, c)    setConstraints(ctr)    setEnabled(b)    setFlowLayout([ax], [ay], [dir], [gap])    setId(id)    setKids(a)    setLayout(m)    setLeftPadding(left)    setListLayout([ax], [gap])    setLocation(xx, yy)    setPadding(v)    setParent(o)    setPreferredSize(w, h)    setProperties([path], props)    setRasterLayout([usePsSize])    setRightPadding(right)    setSize(w, h)    setStackLayout([gap])    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

  • 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

  • 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

public chainable setContent (an)

Set the inner content of the wrapped HTML element

public chainable setFont (f)

Set the CSS font of the wrapped HTML element

public chainable setStyle (a, a)

Apply the given CSS style to the wrapped HTML element

  • 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

  • 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


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