Module io.github.mmm.ui.tvm.core
Package io.github.mmm.ui.tvm.widget
Class TvmWidget<W extends org.teavm.jso.JSObject>
- java.lang.Object
-
- io.github.mmm.ui.api.widget.AbstractUiWidget
-
- io.github.mmm.ui.spi.widget.AbstractUiNativeWidget
-
- io.github.mmm.ui.spi.widget.AbstractUiNativeWidgetWrapper<W>
-
- io.github.mmm.ui.tvm.widget.TvmWidget<W>
-
- Type Parameters:
W- type ofTeaVM widget.
- All Implemented Interfaces:
EventSource<UiEvent,UiEventListener>,AttributeReadEnabled,AttributeReadId,AttributeReadValid,AttributeReadVisible,AttributeWriteEnabled,AttributeWriteId,AttributeWriteReadOnly,AttributeWriteTooltip,AttributeWriteValidationFailure,AttributeWriteVisible,UiNativeWidget,UiWidget,UiNativeWidgetWrapper<W>
- Direct Known Subclasses:
TvmWidgetHtmlElement
public abstract class TvmWidget<W extends org.teavm.jso.JSObject> extends AbstractUiNativeWidgetWrapper<W>
Implementation ofUiNativeWidgetfor TeaVM.- Since:
- 1.0.0
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringATR_ARIA_HIDDENAttribute name"aria-hidden".protected static StringATR_ARIA_LABELAttribute name"aria-label".protected static StringATR_ARIA_SELECTEDAttribute name"aria-selected".protected static StringATR_COLSPANAttribute name"colspan".protected static StringATR_FORAttribute name"for".protected static StringATR_IDAttribute name"id".protected static StringATR_LISTAttribute name"list".protected static StringATR_MAXAttribute name"max".protected static StringATR_MINAttribute name"min".protected static StringATR_REQUIREDAttribute name"required".protected static StringATR_ROLEAttribute name"role".protected static StringATR_ROWSPANAttribute name"rowspan".protected static StringATR_STYLEAttribute name"style".protected static StringATR_TABINDEXAttribute name"tabindex".protected static StringCLASS_COLLAPSECSS class namefor collapse icon.protected static StringCLASS_ERRORCSS class namefor error icon.protected static StringCLASS_EXPANDCSS class namefor expand icon.protected static StringCLASS_INFOCSS class namefor info icon.protected static StringCLASS_QUESTIONCSS class namefor question icon.protected static StringCLASS_WARNINGCSS class namefor warning icon.protected static org.teavm.jso.dom.html.HTMLDocumentDOCThe ownerDocumentof the HTML.protected static StringEVENT_TYPE_BLUREvent type"blur".protected static StringEVENT_TYPE_CHANGEEvent type"change".protected static StringEVENT_TYPE_CLICKEvent type"click".protected static StringEVENT_TYPE_FOCUSEvent type"focus".protected static StringEVENT_TYPE_INPUTEvent type"input".protected static StringEVENT_TYPE_KEYDOWNEvent type"keydown".protected static StringEVENT_TYPE_POINTERDOWNEvent type"pointerdown".protected static StringEVENT_TYPE_POINTERMOVEEvent type"pointermove".protected static StringEVENT_TYPE_POINTERUPEvent type"pointerup".protected static StringROLE_PRESENTATIONRole"presentation".protected static StringSTYLE_COLLAPSEDCSS style for a collapsed widget (hiding its children).protected static StringSTYLE_COLLAPSIBLECSS style for a collapsible widget (can be collapsed/expanded by the end-user).protected static StringSTYLE_DISABLEDCSS style for a disabled widget that does not support disabling natively (e.g.protected static StringSTYLE_RESIZABLECSS style for a resizable widget.protected static StringTAG_NAME_UI_ICONTag nameof UI icon.protected Wwidget-
Fields inherited from interface io.github.mmm.ui.api.attribute.AttributeWriteValidationFailure
STYLE_INVALID
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract org.teavm.jso.dom.html.HTMLElementgetElement()static org.teavm.jso.dom.xml.NodegetTopNode(UiWidget uiWidget)org.teavm.jso.JSObjectgetTopWidget()WgetWidget()protected static voidinsertAt(org.teavm.jso.dom.xml.Node parent, org.teavm.jso.dom.xml.Node child, int index)protected static voidinsertFirst(org.teavm.jso.dom.xml.Node parent, org.teavm.jso.dom.xml.Node child)static org.teavm.jso.dom.html.HTMLAnchorElementnewAnchor()static org.teavm.jso.dom.html.HTMLElementnewASide()static org.teavm.jso.dom.html.HTMLAudioElementnewAudio()static org.teavm.jso.dom.html.HTMLButtonElementnewButton()static org.teavm.jso.dom.html.HTMLCanvasElementnewCanvas()static org.teavm.jso.dom.html.HTMLElementnewDatalist()static org.teavm.jso.dom.html.HTMLElementnewDiv()static org.teavm.jso.dom.html.HTMLElementnewElement(String tag)static org.teavm.jso.dom.html.HTMLElementnewFieldSet()static org.teavm.jso.dom.html.HTMLElementnewFooter()static org.teavm.jso.dom.html.HTMLFormElementnewForm()static org.teavm.jso.dom.html.HTMLElementnewHeader()static org.teavm.jso.dom.html.HTMLElementnewHr()static org.teavm.jso.dom.html.HTMLElementnewIcon(String name)static org.teavm.jso.dom.html.HTMLImageElementnewImage()static org.teavm.jso.dom.html.HTMLInputElementnewInput()static org.teavm.jso.dom.html.HTMLInputElementnewInput(String type)static org.teavm.jso.dom.html.HTMLElementnewLabel()static org.teavm.jso.dom.html.HTMLElementnewLegend()static org.teavm.jso.dom.html.HTMLElementnewLi()static org.teavm.jso.dom.html.HTMLElementnewMain()static org.teavm.jso.dom.html.HTMLElementnewNav()static org.teavm.jso.dom.html.HTMLOptionElementnewOption(org.teavm.jso.dom.html.HTMLDocument document)static org.teavm.jso.dom.html.HTMLOptionElementnewOption(org.teavm.jso.dom.html.HTMLElement parent, String value)static org.teavm.jso.dom.html.HTMLElementnewOutput()static org.teavm.jso.dom.html.HTMLElementnewSection()static org.teavm.jso.dom.html.HTMLSelectElementnewSelect()static org.teavm.jso.dom.html.HTMLElementnewSpan()static org.teavm.jso.dom.html.HTMLElementnewTable()static org.teavm.jso.dom.html.HTMLElementnewTableBody()static org.teavm.jso.dom.html.HTMLElementnewTableDataCell()static org.teavm.jso.dom.html.HTMLElementnewTableFoot()static org.teavm.jso.dom.html.HTMLElementnewTableHead()static org.teavm.jso.dom.html.HTMLElementnewTableHeaderCell()static org.teavm.jso.dom.html.HTMLElementnewTableRow()static org.teavm.jso.dom.html.HTMLTextAreaElementnewTextArea()static org.teavm.jso.dom.html.HTMLElementnewUl()static org.teavm.jso.dom.html.HTMLVideoElementnewVideo()protected voidonClick(org.teavm.jso.dom.events.Event event)protected static voidremoveAllChildren(org.teavm.jso.dom.xml.Node node)protected voidsetEnabledNative(boolean enabled)protected voidsetIdNative(String id)protected voidsetReadOnlyNative(boolean readOnly)protected voidsetWidget(W widget)-
Methods inherited from class io.github.mmm.ui.spi.widget.AbstractUiNativeWidgetWrapper
createDefaultStyles, createStyles, getId, getStyles, getTooltip, onStylesChanged, setId, setTooltip, setTooltipNative
-
Methods inherited from class io.github.mmm.ui.spi.widget.AbstractUiNativeWidget
addListener, dispose, doDispose, doGetEnabledState, doGetVisibleState, doSetEnabledState, doSetEnabledState, doSetValidationFailure, doSetVisibleState, doSetVisibleState, ensureHandlers, fireEvent, getEventAdapter, getParent, getProgrammaticEventType, getReadOnlyFixed, getValidationFailure, hasListeners, isDisposed, isEnabled, isInitiallyVisible, isReadOnly, isValid, isVisible, isVisibleWithoutRoot, registerHandlers, removeListener, requireNotDisposed, setEnabled, setParent, setProgrammaticEventType, setReadOnly, setReadOnlyFixed, setValidationFailure, setVisible, setVisibleNative, unwrap, validateDown
-
Methods inherited from class io.github.mmm.ui.api.widget.AbstractUiWidget
isEmpty, setParent, unwrap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.github.mmm.ui.api.attribute.AttributeWriteValidationFailure
setValidationFailure
-
Methods inherited from interface io.github.mmm.event.EventSource
addListener, addListener, addWeakListener, removeListener
-
Methods inherited from interface io.github.mmm.ui.api.widget.UiWidget
cast, dispose, getModificationTimestamp, getParent, getReadOnlyFixed, isDisposed, isEnabled, isEnabled, isFocused, isModified, isReadOnly, isValid, isVisible, isVisible, reset, setEnabled, setEnabled, setFocused, setReadOnly, setReadOnlyFixed, setVisible, setVisible, validate, validate, validate, validateDown, validateUp
-
-
-
-
Field Detail
-
DOC
protected static final org.teavm.jso.dom.html.HTMLDocument DOC
The ownerDocumentof the HTML.
-
TAG_NAME_UI_ICON
protected static final String TAG_NAME_UI_ICON
Tag nameof UI icon.- See Also:
- Constant Field Values
-
ATR_ID
protected static final String ATR_ID
Attribute name"id".- See Also:
- Constant Field Values
-
ATR_STYLE
protected static final String ATR_STYLE
Attribute name"style".- See Also:
- Constant Field Values
-
ATR_ROLE
protected static final String ATR_ROLE
Attribute name"role".- See Also:
- Constant Field Values
-
ATR_ARIA_HIDDEN
protected static final String ATR_ARIA_HIDDEN
Attribute name"aria-hidden".- See Also:
- Constant Field Values
-
ATR_ARIA_LABEL
protected static final String ATR_ARIA_LABEL
Attribute name"aria-label".- See Also:
- Constant Field Values
-
ATR_ARIA_SELECTED
protected static final String ATR_ARIA_SELECTED
Attribute name"aria-selected".- See Also:
- Constant Field Values
-
ATR_TABINDEX
protected static final String ATR_TABINDEX
Attribute name"tabindex".- See Also:
- Constant Field Values
-
ATR_FOR
protected static final String ATR_FOR
Attribute name"for".- See Also:
- Constant Field Values
-
ATR_LIST
protected static final String ATR_LIST
Attribute name"list".- See Also:
- Constant Field Values
-
ATR_MIN
protected static final String ATR_MIN
Attribute name"min".- See Also:
- Constant Field Values
-
ATR_MAX
protected static final String ATR_MAX
Attribute name"max".- See Also:
- Constant Field Values
-
ATR_REQUIRED
protected static final String ATR_REQUIRED
Attribute name"required".- See Also:
- Constant Field Values
-
ATR_COLSPAN
protected static final String ATR_COLSPAN
Attribute name"colspan".- See Also:
- Constant Field Values
-
ATR_ROWSPAN
protected static final String ATR_ROWSPAN
Attribute name"rowspan".- See Also:
- Constant Field Values
-
ROLE_PRESENTATION
protected static final String ROLE_PRESENTATION
Role"presentation".- See Also:
- Constant Field Values
-
EVENT_TYPE_BLUR
protected static final String EVENT_TYPE_BLUR
Event type"blur".- See Also:
- Constant Field Values
-
EVENT_TYPE_FOCUS
protected static final String EVENT_TYPE_FOCUS
Event type"focus".- See Also:
- Constant Field Values
-
EVENT_TYPE_CLICK
protected static final String EVENT_TYPE_CLICK
Event type"click".- See Also:
- Constant Field Values
-
EVENT_TYPE_INPUT
protected static final String EVENT_TYPE_INPUT
Event type"input".- See Also:
- Constant Field Values
-
EVENT_TYPE_CHANGE
protected static final String EVENT_TYPE_CHANGE
Event type"change".- See Also:
- Constant Field Values
-
EVENT_TYPE_KEYDOWN
protected static final String EVENT_TYPE_KEYDOWN
Event type"keydown".- See Also:
- Constant Field Values
-
EVENT_TYPE_POINTERDOWN
protected static final String EVENT_TYPE_POINTERDOWN
Event type"pointerdown".- See Also:
- Constant Field Values
-
EVENT_TYPE_POINTERMOVE
protected static final String EVENT_TYPE_POINTERMOVE
Event type"pointermove".- See Also:
- Constant Field Values
-
EVENT_TYPE_POINTERUP
protected static final String EVENT_TYPE_POINTERUP
Event type"pointerup".- See Also:
- Constant Field Values
-
CLASS_ERROR
protected static final String CLASS_ERROR
CSS class namefor error icon.- See Also:
- Constant Field Values
-
CLASS_WARNING
protected static final String CLASS_WARNING
CSS class namefor warning icon.- See Also:
- Constant Field Values
-
CLASS_INFO
protected static final String CLASS_INFO
CSS class namefor info icon.- See Also:
- Constant Field Values
-
CLASS_EXPAND
protected static final String CLASS_EXPAND
CSS class namefor expand icon.- See Also:
- Constant Field Values
-
CLASS_COLLAPSE
protected static final String CLASS_COLLAPSE
CSS class namefor collapse icon.- See Also:
- Constant Field Values
-
CLASS_QUESTION
protected static final String CLASS_QUESTION
CSS class namefor question icon.- See Also:
- Constant Field Values
-
STYLE_COLLAPSED
protected static final String STYLE_COLLAPSED
CSS style for a collapsed widget (hiding its children).- See Also:
- Constant Field Values
-
STYLE_COLLAPSIBLE
protected static final String STYLE_COLLAPSIBLE
CSS style for a collapsible widget (can be collapsed/expanded by the end-user).- See Also:
- Constant Field Values
-
STYLE_DISABLED
protected static final String STYLE_DISABLED
CSS style for a disabled widget that does not support disabling natively (e.g. anchor).- See Also:
- Constant Field Values
-
STYLE_RESIZABLE
protected static final String STYLE_RESIZABLE
CSS style for a resizable widget.- See Also:
- Constant Field Values
-
widget
protected W extends org.teavm.jso.JSObject widget
- See Also:
getWidget()
-
-
Constructor Detail
-
TvmWidget
public TvmWidget(W widget)
The constructor.- Parameters:
widget- theTeaVM widget.
-
-
Method Detail
-
getTopWidget
public org.teavm.jso.JSObject getTopWidget()
- Returns:
- the top-level native widget of this wrapper. In many cases this is the same as
UiNativeWidgetWrapper.getWidget()but in some cases this may be some kind of internal composite containing themain widget.
-
getWidget
public W getWidget()
- Returns:
- the underlying native widget wrapped by this
UiNativeWidget.
-
getElement
public abstract org.teavm.jso.dom.html.HTMLElement getElement()
- Returns:
- the
HTMLElementrepresenting this widget.
-
setIdNative
protected void setIdNative(String id)
- Specified by:
setIdNativein classAbstractUiNativeWidgetWrapper<W extends org.teavm.jso.JSObject>- Parameters:
id- the newID.
-
setReadOnlyNative
protected void setReadOnlyNative(boolean readOnly)
- Specified by:
setReadOnlyNativein classAbstractUiNativeWidget- Parameters:
readOnly- the new value ofAbstractUiNativeWidget.isReadOnly().
-
setEnabledNative
protected void setEnabledNative(boolean enabled)
- Specified by:
setEnabledNativein classAbstractUiNativeWidget- Parameters:
enabled- the newenabled state. Usetrueto enable andfalseto disable this widget.
-
onClick
protected void onClick(org.teavm.jso.dom.events.Event event)
- Parameters:
event- the clickEvent.
-
removeAllChildren
protected static void removeAllChildren(org.teavm.jso.dom.xml.Node node)
- Parameters:
node- theNodeto remove all children from.
-
getTopNode
public static org.teavm.jso.dom.xml.Node getTopNode(UiWidget uiWidget)
- Parameters:
uiWidget- theUiWidget.- Returns:
- the
containingJavaFxNode.
-
insertFirst
protected static void insertFirst(org.teavm.jso.dom.xml.Node parent, org.teavm.jso.dom.xml.Node child)- Parameters:
parent- the parentNode.child- the childNodeto insert as first child.
-
insertAt
protected static void insertAt(org.teavm.jso.dom.xml.Node parent, org.teavm.jso.dom.xml.Node child, int index)- Parameters:
parent- the parentNode.child- the childNodeto insert as child at the given index. May be-1toinsert at the end.index- the position to insert thechildat.
-
newButton
public static org.teavm.jso.dom.html.HTMLButtonElement newButton()
- Returns:
- a new
HTMLButtonElement.
-
newAnchor
public static org.teavm.jso.dom.html.HTMLAnchorElement newAnchor()
- Returns:
- a new
HTMLAnchorElement.
-
newInput
public static org.teavm.jso.dom.html.HTMLInputElement newInput()
- Returns:
- a new
HTMLInputElement.
-
newInput
public static org.teavm.jso.dom.html.HTMLInputElement newInput(String type)
- Parameters:
type- theinput type.- Returns:
- a new
HTMLInputElement.
-
newOutput
public static org.teavm.jso.dom.html.HTMLElement newOutput()
- Returns:
- a new
output element.
-
newTextArea
public static org.teavm.jso.dom.html.HTMLTextAreaElement newTextArea()
- Returns:
- a new
HTMLTextAreaElement.
-
newSelect
public static org.teavm.jso.dom.html.HTMLSelectElement newSelect()
- Returns:
- a new
HTMLSelectElement.
-
newForm
public static org.teavm.jso.dom.html.HTMLFormElement newForm()
- Returns:
- a new
HTMLFormElement.
-
newImage
public static org.teavm.jso.dom.html.HTMLImageElement newImage()
- Returns:
- a new
HTMLImageElement.
-
newVideo
public static org.teavm.jso.dom.html.HTMLVideoElement newVideo()
- Returns:
- a new
HTMLVideoElement.
-
newAudio
public static org.teavm.jso.dom.html.HTMLAudioElement newAudio()
- Returns:
- a new
HTMLAudioElement.
-
newCanvas
public static org.teavm.jso.dom.html.HTMLCanvasElement newCanvas()
- Returns:
- a new
HTMLCanvasElement.
-
newFieldSet
public static org.teavm.jso.dom.html.HTMLElement newFieldSet()
- Returns:
- a new
fieldset element.
-
newLegend
public static org.teavm.jso.dom.html.HTMLElement newLegend()
- Returns:
- a new
legend element.
-
newLabel
public static org.teavm.jso.dom.html.HTMLElement newLabel()
- Returns:
- a new
label element.
-
newDiv
public static org.teavm.jso.dom.html.HTMLElement newDiv()
- Returns:
- a new
div element.
-
newNav
public static org.teavm.jso.dom.html.HTMLElement newNav()
- Returns:
- a new
nav(igation) element.
-
newUl
public static org.teavm.jso.dom.html.HTMLElement newUl()
- Returns:
- a new
unordered list element.
-
newLi
public static org.teavm.jso.dom.html.HTMLElement newLi()
- Returns:
- a new
list item element.
-
newSpan
public static org.teavm.jso.dom.html.HTMLElement newSpan()
- Returns:
- a new
span element.
-
newHr
public static org.teavm.jso.dom.html.HTMLElement newHr()
- Returns:
- a new
horizontal ruler.
-
newDatalist
public static org.teavm.jso.dom.html.HTMLElement newDatalist()
- Returns:
- a new
datalist element.
-
newOption
public static org.teavm.jso.dom.html.HTMLOptionElement newOption(org.teavm.jso.dom.html.HTMLDocument document)
- Parameters:
document- theHTMLDocument.- Returns:
- a new
option.
-
newOption
public static org.teavm.jso.dom.html.HTMLOptionElement newOption(org.teavm.jso.dom.html.HTMLElement parent, String value)- Parameters:
parent- the parentHTMLElement- typically adatalist.value- the value of the option.- Returns:
- a new
option.
-
newTable
public static org.teavm.jso.dom.html.HTMLElement newTable()
- Returns:
- a new
table element.
-
newTableHead
public static org.teavm.jso.dom.html.HTMLElement newTableHead()
- Returns:
- a new
table header element.
-
newTableBody
public static org.teavm.jso.dom.html.HTMLElement newTableBody()
- Returns:
- a new
table body element.
-
newTableFoot
public static org.teavm.jso.dom.html.HTMLElement newTableFoot()
- Returns:
- a new
table footer element.
-
newTableRow
public static org.teavm.jso.dom.html.HTMLElement newTableRow()
- Returns:
- a new
table row(tr).
-
newTableDataCell
public static org.teavm.jso.dom.html.HTMLElement newTableDataCell()
- Returns:
- a new
table data cell(td).
-
newTableHeaderCell
public static org.teavm.jso.dom.html.HTMLElement newTableHeaderCell()
- Returns:
- a new
table header cell(th).
-
newHeader
public static org.teavm.jso.dom.html.HTMLElement newHeader()
- Returns:
- a new
header element.
-
newFooter
public static org.teavm.jso.dom.html.HTMLElement newFooter()
- Returns:
- a new
footer element.
-
newSection
public static org.teavm.jso.dom.html.HTMLElement newSection()
- Returns:
- a new
section element.
-
newASide
public static org.teavm.jso.dom.html.HTMLElement newASide()
- Returns:
- a new
aside element.
-
newMain
public static org.teavm.jso.dom.html.HTMLElement newMain()
- Returns:
- a new
main element.
-
newElement
public static org.teavm.jso.dom.html.HTMLElement newElement(String tag)
- Parameters:
tag- thetag name.- Returns:
- a new
div element.
-
newIcon
public static org.teavm.jso.dom.html.HTMLElement newIcon(String name)
- Parameters:
name- theCSS class nameof the icon.- Returns:
- a new
HTMLElement.
-
-