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 ofUiNativeWidget
for TeaVM.- Since:
- 1.0.0
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
ATR_ARIA_HIDDEN
Attribute name
"aria-hidden".protected static String
ATR_ARIA_LABEL
Attribute name
"aria-label".protected static String
ATR_ARIA_SELECTED
Attribute name
"aria-selected".protected static String
ATR_COLSPAN
Attribute name
"colspan".protected static String
ATR_FOR
Attribute name
"for".protected static String
ATR_ID
Attribute name
"id".protected static String
ATR_LIST
Attribute name
"list".protected static String
ATR_MAX
Attribute name
"max".protected static String
ATR_MIN
Attribute name
"min".protected static String
ATR_REQUIRED
Attribute name
"required".protected static String
ATR_ROLE
Attribute name
"role".protected static String
ATR_ROWSPAN
Attribute name
"rowspan".protected static String
ATR_STYLE
Attribute name
"style".protected static String
ATR_TABINDEX
Attribute name
"tabindex".protected static String
CLASS_COLLAPSE
CSS class name
for collapse icon.protected static String
CLASS_ERROR
CSS class name
for error icon.protected static String
CLASS_EXPAND
CSS class name
for expand icon.protected static String
CLASS_INFO
CSS class name
for info icon.protected static String
CLASS_QUESTION
CSS class name
for question icon.protected static String
CLASS_WARNING
CSS class name
for warning icon.protected static org.teavm.jso.dom.html.HTMLDocument
DOC
The ownerDocument
of the HTML.protected static String
EVENT_TYPE_BLUR
Event type
"blur".protected static String
EVENT_TYPE_CHANGE
Event type
"change".protected static String
EVENT_TYPE_CLICK
Event type
"click".protected static String
EVENT_TYPE_FOCUS
Event type
"focus".protected static String
EVENT_TYPE_INPUT
Event type
"input".protected static String
EVENT_TYPE_KEYDOWN
Event type
"keydown".protected static String
EVENT_TYPE_POINTERDOWN
Event type
"pointerdown".protected static String
EVENT_TYPE_POINTERMOVE
Event type
"pointermove".protected static String
EVENT_TYPE_POINTERUP
Event type
"pointerup".protected static String
ROLE_PRESENTATION
Role
"presentation".protected static String
STYLE_COLLAPSED
CSS style for a collapsed widget (hiding its children).protected static String
STYLE_COLLAPSIBLE
CSS style for a collapsible widget (can be collapsed/expanded by the end-user).protected static String
STYLE_DISABLED
CSS style for a disabled widget that does not support disabling natively (e.g.protected static String
STYLE_RESIZABLE
CSS style for a resizable widget.protected static String
TAG_NAME_UI_ICON
Tag name
of UI icon.protected W
widget
-
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.HTMLElement
getElement()
static org.teavm.jso.dom.xml.Node
getTopNode(UiWidget uiWidget)
org.teavm.jso.JSObject
getTopWidget()
W
getWidget()
protected static void
insertAt(org.teavm.jso.dom.xml.Node parent, org.teavm.jso.dom.xml.Node child, int index)
protected static void
insertFirst(org.teavm.jso.dom.xml.Node parent, org.teavm.jso.dom.xml.Node child)
static org.teavm.jso.dom.html.HTMLAnchorElement
newAnchor()
static org.teavm.jso.dom.html.HTMLElement
newASide()
static org.teavm.jso.dom.html.HTMLAudioElement
newAudio()
static org.teavm.jso.dom.html.HTMLButtonElement
newButton()
static org.teavm.jso.dom.html.HTMLCanvasElement
newCanvas()
static org.teavm.jso.dom.html.HTMLElement
newDatalist()
static org.teavm.jso.dom.html.HTMLElement
newDiv()
static org.teavm.jso.dom.html.HTMLElement
newElement(String tag)
static org.teavm.jso.dom.html.HTMLElement
newFieldSet()
static org.teavm.jso.dom.html.HTMLElement
newFooter()
static org.teavm.jso.dom.html.HTMLFormElement
newForm()
static org.teavm.jso.dom.html.HTMLElement
newHeader()
static org.teavm.jso.dom.html.HTMLElement
newHr()
static org.teavm.jso.dom.html.HTMLElement
newIcon(String name)
static org.teavm.jso.dom.html.HTMLImageElement
newImage()
static org.teavm.jso.dom.html.HTMLInputElement
newInput()
static org.teavm.jso.dom.html.HTMLInputElement
newInput(String type)
static org.teavm.jso.dom.html.HTMLElement
newLabel()
static org.teavm.jso.dom.html.HTMLElement
newLegend()
static org.teavm.jso.dom.html.HTMLElement
newLi()
static org.teavm.jso.dom.html.HTMLElement
newMain()
static org.teavm.jso.dom.html.HTMLElement
newNav()
static org.teavm.jso.dom.html.HTMLOptionElement
newOption(org.teavm.jso.dom.html.HTMLDocument document)
static org.teavm.jso.dom.html.HTMLOptionElement
newOption(org.teavm.jso.dom.html.HTMLElement parent, String value)
static org.teavm.jso.dom.html.HTMLElement
newOutput()
static org.teavm.jso.dom.html.HTMLElement
newSection()
static org.teavm.jso.dom.html.HTMLSelectElement
newSelect()
static org.teavm.jso.dom.html.HTMLElement
newSpan()
static org.teavm.jso.dom.html.HTMLElement
newTable()
static org.teavm.jso.dom.html.HTMLElement
newTableBody()
static org.teavm.jso.dom.html.HTMLElement
newTableDataCell()
static org.teavm.jso.dom.html.HTMLElement
newTableFoot()
static org.teavm.jso.dom.html.HTMLElement
newTableHead()
static org.teavm.jso.dom.html.HTMLElement
newTableHeaderCell()
static org.teavm.jso.dom.html.HTMLElement
newTableRow()
static org.teavm.jso.dom.html.HTMLTextAreaElement
newTextArea()
static org.teavm.jso.dom.html.HTMLElement
newUl()
static org.teavm.jso.dom.html.HTMLVideoElement
newVideo()
protected void
onClick(org.teavm.jso.dom.events.Event event)
protected static void
removeAllChildren(org.teavm.jso.dom.xml.Node node)
protected void
setEnabledNative(boolean enabled)
protected void
setIdNative(String id)
protected void
setReadOnlyNative(boolean readOnly)
protected void
setWidget(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 ownerDocument
of the HTML.
-
TAG_NAME_UI_ICON
protected static final String TAG_NAME_UI_ICON
Tag name
of 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 name
for error icon.- See Also:
- Constant Field Values
-
CLASS_WARNING
protected static final String CLASS_WARNING
CSS class name
for warning icon.- See Also:
- Constant Field Values
-
CLASS_INFO
protected static final String CLASS_INFO
CSS class name
for info icon.- See Also:
- Constant Field Values
-
CLASS_EXPAND
protected static final String CLASS_EXPAND
CSS class name
for expand icon.- See Also:
- Constant Field Values
-
CLASS_COLLAPSE
protected static final String CLASS_COLLAPSE
CSS class name
for collapse icon.- See Also:
- Constant Field Values
-
CLASS_QUESTION
protected static final String CLASS_QUESTION
CSS class name
for 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
HTMLElement
representing this widget.
-
setIdNative
protected void setIdNative(String id)
- Specified by:
setIdNative
in classAbstractUiNativeWidgetWrapper<W extends org.teavm.jso.JSObject>
- Parameters:
id
- the newID
.
-
setReadOnlyNative
protected void setReadOnlyNative(boolean readOnly)
- Specified by:
setReadOnlyNative
in classAbstractUiNativeWidget
- Parameters:
readOnly
- the new value ofAbstractUiNativeWidget.isReadOnly()
.
-
setEnabledNative
protected void setEnabledNative(boolean enabled)
- Specified by:
setEnabledNative
in classAbstractUiNativeWidget
- Parameters:
enabled
- the newenabled state
. Usetrue
to enable andfalse
to 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
- theNode
to remove all children from.
-
getTopNode
public static org.teavm.jso.dom.xml.Node getTopNode(UiWidget uiWidget)
- Parameters:
uiWidget
- theUiWidget
.- Returns:
- the
containing
JavaFxNode
.
-
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 childNode
to 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 childNode
to insert as child at the given index. May be-1
toinsert at the end
.index
- the position to insert thechild
at.
-
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 name
of the icon.- Returns:
- a new
HTMLElement
.
-
-