Module io.github.mmm.ui.fx.core
Package io.github.mmm.ui.fx.widget.input
Class FxInput<W extends javafx.scene.layout.Region,V>
- 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.fx.widget.FxWidget<W>
-
- io.github.mmm.ui.fx.widget.FxWidgetStyleable<W>
-
- io.github.mmm.ui.fx.widget.FxWidgetNode<W>
-
- io.github.mmm.ui.fx.widget.FxActiveWidget<W>
-
- io.github.mmm.ui.fx.widget.FxActiveValidatableWidget<W,V>
-
- io.github.mmm.ui.fx.widget.input.FxInput<W,V>
-
- Type Parameters:
W
- type ofJavaFx widget
.V
- type ofvalue
.
- All Implemented Interfaces:
EventSource<UiEvent,UiEventListener>
,AttributeReadEnabled
,AttributeReadId
,AttributeReadValid
,AttributeReadValue<V>
,AttributeReadVisible
,AttributeWriteEnabled
,AttributeWriteId
,AttributeWritePrefix
,AttributeWriteReadOnly
,AttributeWriteSuffix
,AttributeWriteTooltip
,AttributeWriteValidationFailure
,AttributeWriteValue<V>
,AttributeWriteValueForUser<V>
,AttributeWriteVisible
,UiAbstractInput<V>
,UiInput<V>
,UiActiveWidget
,UiNativeWidget
,UiRegularWidget
,UiWidget
,UiValidatableWidget<V>
,UiValuedWidget<V>
,UiNativeWidgetWrapper<W>
- Direct Known Subclasses:
FxAbstractChoice
,FxCheckbox
,FxCompositeInput
,FxRadioButton
,FxTextualInput
public abstract class FxInput<W extends javafx.scene.layout.Region,V> extends FxActiveValidatableWidget<W,V> implements UiInput<V>
Implementation ofUiInput
for JavaFx.- Since:
- 1.0.0
-
-
Field Summary
-
Fields inherited from class io.github.mmm.ui.fx.widget.FxWidget
CLASS_INVALID, CLASS_READ_ONLY, widget
-
Fields inherited from interface io.github.mmm.ui.api.attribute.AttributeWritePrefix
STYLE_PREFIX, STYLE_WITH_PREFIX
-
Fields inherited from interface io.github.mmm.ui.api.attribute.AttributeWriteSuffix
STYLE_SUFFIX, STYLE_WITH_SUFFIX
-
Fields inherited from interface io.github.mmm.ui.api.attribute.AttributeWriteValidationFailure
STYLE_INVALID
-
Fields inherited from interface io.github.mmm.ui.api.widget.UiActiveWidget
ACCESS_KEY_NONE
-
Fields inherited from interface io.github.mmm.ui.api.widget.input.UiInput
STYLE_INPUT
-
Fields inherited from interface io.github.mmm.ui.api.widget.value.UiValidatableWidget
STYLE_MANDATORY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description UiRegularWidget
getContainerWidget()
protected javafx.scene.layout.HBox
getHBox()
String
getName()
FxLabel
getNameWidget()
String
getPrefix()
protected javafx.scene.control.Label
getPrefixLabel()
String
getSuffix()
protected javafx.scene.control.Label
getSuffixLabel()
javafx.scene.Node
getTopWidget()
boolean
hasContainerWidget()
boolean
hasNameWidget()
protected void
initHBox(javafx.scene.layout.HBox box)
protected void
setMandatory(boolean mandatory)
void
setName(String name)
void
setPrefix(String prefix)
protected void
setReadOnlyNative(boolean readOnly)
void
setSuffix(String suffix)
protected abstract void
setValueNative(V value)
void
setVisible(boolean visible, BitMask flagMode)
-
Methods inherited from class io.github.mmm.ui.fx.widget.FxActiveValidatableWidget
doSetValidationFailure, getModificationTimestamp, getOriginalValue, getValidator, onFocusChanged, onValueChanged, setOriginalValue, setValidator, setValue
-
Methods inherited from class io.github.mmm.ui.fx.widget.FxActiveWidget
getAccessKey, isFocused, registerFocusChangeHandler, registerHandlers, setAccessKey, setFocused, setParent
-
Methods inherited from class io.github.mmm.ui.fx.widget.FxWidgetNode
setEnabledNative, setIdNative, setTooltipNative, setVisibleNative
-
Methods inherited from class io.github.mmm.ui.fx.widget.FxWidgetStyleable
createStyles
-
Methods inherited from class io.github.mmm.ui.fx.widget.FxWidget
getTopNode, getWidget, onAction, onClose, onFocusChange, onValueChange, setTooltip, setWidget
-
Methods inherited from class io.github.mmm.ui.spi.widget.AbstractUiNativeWidgetWrapper
createDefaultStyles, getId, getStyles, getTooltip, onStylesChanged, setId, setTooltip
-
Methods inherited from class io.github.mmm.ui.spi.widget.AbstractUiNativeWidget
addListener, dispose, doDispose, doGetEnabledState, doGetVisibleState, doSetEnabledState, doSetEnabledState, doSetVisibleState, doSetVisibleState, ensureHandlers, fireEvent, getEventAdapter, getParent, getProgrammaticEventType, getReadOnlyFixed, getValidationFailure, hasListeners, isDisposed, isEnabled, isInitiallyVisible, isReadOnly, isValid, isVisible, isVisibleWithoutRoot, removeListener, requireNotDisposed, setEnabled, setProgrammaticEventType, setReadOnly, setReadOnlyFixed, setValidationFailure, 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.AttributeReadId
getId
-
Methods inherited from interface io.github.mmm.ui.api.attribute.AttributeWriteId
setId
-
Methods inherited from interface io.github.mmm.ui.api.attribute.AttributeWriteTooltip
getTooltip, setTooltip
-
Methods inherited from interface io.github.mmm.ui.api.attribute.AttributeWriteValidationFailure
getValidationFailure, setValidationFailure, setValidationFailure
-
Methods inherited from interface io.github.mmm.event.EventSource
addListener, addListener, addWeakListener, removeListener
-
Methods inherited from interface io.github.mmm.ui.api.widget.value.UiValidatableWidget
getOriginalValue, getValidator, getValue, getValueOrThrow, isValid, reset, setOriginalValue, setValidator, setValue, setValue, setValueForUser
-
Methods inherited from interface io.github.mmm.ui.api.widget.UiWidget
cast, dispose, getModificationTimestamp, getParent, getReadOnlyFixed, getStyles, isDisposed, isEnabled, isEnabled, isFocused, isModified, isReadOnly, isVisible, isVisible, setEnabled, setEnabled, setFocused, setReadOnly, setReadOnlyFixed, setVisible, validate, validate, validate, validateDown, validateUp
-
-
-
-
Constructor Detail
-
FxInput
public FxInput(W widget)
The constructor.- Parameters:
widget
- theJavaFx widget
.
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getName
in interfaceUiAbstractInput<W extends javafx.scene.layout.Region>
- Returns:
- the
label text
for thename widget
or the title of the form group.
-
setName
public void setName(String name)
- Specified by:
setName
in interfaceUiAbstractInput<W extends javafx.scene.layout.Region>
- Parameters:
name
- the newname
. Prevents lazy initialization of thename widget
.
-
hasNameWidget
public boolean hasNameWidget()
- Specified by:
hasNameWidget
in interfaceUiInput<W extends javafx.scene.layout.Region>
- Returns:
true
if thename widget
has already been created,false
otherwise. Helpful to avoid unintended lazy initialization.
-
getNameWidget
public FxLabel getNameWidget()
- Specified by:
getNameWidget
in interfaceUiInput<W extends javafx.scene.layout.Region>
- Returns:
- the
UiLabel
of this input. May be lazily created on the first call of this method to avoid unnecessary overhead (e.g. if aUiInput
is used for inline editing).
-
hasContainerWidget
public boolean hasContainerWidget()
- Specified by:
hasContainerWidget
in interfaceUiInput<W extends javafx.scene.layout.Region>
- Returns:
true
if thecontainer widget
has already been created,false
otherwise. Helpful to avoid unintended lazy initialization.
-
getContainerWidget
public UiRegularWidget getContainerWidget()
- Specified by:
getContainerWidget
in interfaceUiInput<W extends javafx.scene.layout.Region>
- Returns:
- the
UiRegularWidget
containing both thename widget
and the actual input widget. Will be lazily created on the first call of this method.
-
getTopWidget
public javafx.scene.Node getTopWidget()
- Specified by:
getTopWidget
in interfaceUiNativeWidgetWrapper<W extends javafx.scene.layout.Region>
- Overrides:
getTopWidget
in classFxWidgetNode<W extends javafx.scene.layout.Region>
- 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
.
-
getHBox
protected javafx.scene.layout.HBox getHBox()
- Returns:
- the
HBox
used astop widget
. Will be lazily initialized on the first call of this method.
-
initHBox
protected void initHBox(javafx.scene.layout.HBox box)
- Parameters:
box
- theHBox
used astop widget
.
-
getPrefix
public String getPrefix()
- Specified by:
getPrefix
in interfaceAttributeWritePrefix
- Returns:
- the optional prefix text shown in front of the actual input (e.g. for a currency like $ or £). Will be
null
if not set.
-
setPrefix
public void setPrefix(String prefix)
- Specified by:
setPrefix
in interfaceAttributeWritePrefix
- Parameters:
prefix
- the newprefix
.
-
getPrefixLabel
protected javafx.scene.control.Label getPrefixLabel()
- Returns:
- the
Label
for theprefix
.
-
getSuffix
public String getSuffix()
- Specified by:
getSuffix
in interfaceAttributeWriteSuffix
- Returns:
- the optional suffix text shown after of the actual input (e.g. for a unit, currencies like €, etc.). Will
be
null
if not set.
-
setSuffix
public void setSuffix(String suffix)
- Specified by:
setSuffix
in interfaceAttributeWriteSuffix
- Parameters:
suffix
- the newsuffix
.
-
getSuffixLabel
protected javafx.scene.control.Label getSuffixLabel()
- Returns:
- the
Label
for thesuffix
.
-
setMandatory
protected void setMandatory(boolean mandatory)
- Overrides:
setMandatory
in classFxActiveValidatableWidget<W extends javafx.scene.layout.Region,V>
- Parameters:
mandatory
- the new mandatory (required) flag.
-
setVisible
public void setVisible(boolean visible, BitMask flagMode)
- Specified by:
setVisible
in interfaceUiWidget
- Overrides:
setVisible
in classAbstractUiNativeWidget
- Parameters:
visible
-true
to show this widget (in case its parent is also visible),false
to hide this widget.flagMode
- theBitMask
to apply. SeeUiVisibleFlags
for available options.- See Also:
UiWidget.isVisible()
-
setValueNative
protected abstract void setValueNative(V value)
- Specified by:
setValueNative
in classFxActiveValidatableWidget<W extends javafx.scene.layout.Region,V>
- Parameters:
value
- the newvalue
to set in the native widget.
-
setReadOnlyNative
protected void setReadOnlyNative(boolean readOnly)
- Overrides:
setReadOnlyNative
in classFxWidgetNode<W extends javafx.scene.layout.Region>
- Parameters:
readOnly
- the new value ofAbstractUiNativeWidget.isReadOnly()
.
-
-