Package io.jmix.flowui.app.inputdialog
Class InputParameter
java.lang.Object
io.jmix.flowui.app.inputdialog.InputParameter
Describes field that can be used in
InputDialog
.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic InputParameter
Creates parameter with BigDecimal type.static InputParameter
Creates parameter with Boolean type.static InputParameter
Creates parameter with byte[] type.protected void
checkNullDatatype
(String message) protected void
checkNullDatatypeJavaClass
(String message) protected void
checkNullEntityClass
(String message) protected void
checkNullEnumClass
(String message) static InputParameter
dateParameter
(String id) Creates parameter with Date type.static InputParameter
Creates parameter with DateTime type.static InputParameter
Creates parameter with Double type.static InputParameter
entityParameter
(String id, Class<?> entityClass) Creates parameter with Entity type.static InputParameter
enumParameter
(String id, Class<? extends EnumClass<?>> enumClass) Creates parameter with Enum type.boolean
static InputParameter
fileParameter
(String id) Creates parameter with FileRef (file reference) type.Datatype<?>
Class<?>
Class<?>
Supplier<com.vaadin.flow.component.Component>
getField()
getId()
getLabel()
int
hashCode()
static InputParameter
intParameter
(String id) Creates parameter with Integer type.boolean
boolean
static InputParameter
Creates parameter withLocalDate
type.static InputParameter
Creates parameter withLocalDateTime
type.static InputParameter
Creates parameter withLocalTime
type.static InputParameter
longParameter
(String id) Creates parameter with Long type.static InputParameter
Creates parameter withOffsetDateTime
type.static InputParameter
Creates parameter withOffsetTime
type.static InputParameter
Creates parameter with String type.static InputParameter
Creates parameter with String type.static InputParameter
timeParameter
(String id) Creates parameter with Time type.withDatatype
(Datatype<?> datatype) Sets datatype to the field.protected InputParameter
withDatatypeJavaClass
(Class<?> javaClass) withDefaultValue
(Object defaultValue) Sets default value to the field.withEntityClass
(Class<?> entityClass) Sets entity class.withEnumClass
(Class<? extends EnumClass<?>> enumClass) Sets enum class.Sets field supplier.Sets field id.Sets label to the field.withRequired
(boolean required) Sets required for the field.withRequiredMessage
(String requiredMessage) Sets message that will be shown if the field is not filled, and it isisRequired()
.withTimeZone
(TimeZone timeZone) Sets time zone to the parameter.withUseUserTimeZone
(boolean useUserTimeZone) Sets to the parameter whether to use user'sTimeZone
.
-
Field Details
-
id
-
label
-
requiredMessage
-
required
protected boolean required -
datatype
-
field
-
defaultValue
-
entityClass
-
enumClass
-
timeZone
-
useUserTimeZone
protected boolean useUserTimeZone -
datatypeJavaClass
-
-
Constructor Details
-
InputParameter
- Parameters:
id
- field id
-
-
Method Details
-
getId
- Returns:
- field id
-
withId
Sets field id.- Parameters:
id
- field id- Returns:
- input parameter
-
getLabel
- Returns:
- field caption
-
withLabel
Sets label to the field.- Parameters:
label
- label- Returns:
- input parameter
-
isRequired
public boolean isRequired()- Returns:
- true if field is required
-
withRequired
Sets required for the field.- Parameters:
required
- required option- Returns:
- input parameter
-
getRequiredMessage
- Returns:
- message that will be shown if the field is not filled, and it is
isRequired()
ornull
if not set
-
withRequiredMessage
Sets message that will be shown if the field is not filled, and it isisRequired()
.- Parameters:
requiredMessage
- message- Returns:
- input parameter
-
getDatatype
- Returns:
- field Datatype
-
withDatatype
Sets datatype to the field. Cannot be used withwithEntityClass(Class)
,withEnumClass(Class)
and with predefined static methods.Note, it doesn't support custom Datatype. Use
withField(Supplier)
.- Parameters:
datatype
- datatype- Returns:
- input parameter
-
withDatatypeJavaClass
-
getDatatypeJavaClass
-
getField
- Returns:
- field supplier
-
withField
Sets field supplier.Note, in order to get value from this field you must use an id that is set to the InputParameter, not to the created field.
- Parameters:
field
- supplier- Returns:
- input parameter
-
getDefaultValue
- Returns:
- default value
-
withDefaultValue
Sets default value to the field.- Parameters:
defaultValue
- default value- Returns:
- input parameter
-
getEntityClass
- Returns:
- entity class
-
withEntityClass
Sets entity class. Cannot be used withwithDatatype(Datatype)
,withEnumClass(Class)
and with predefined static methods.- Parameters:
entityClass
- entity class- Returns:
- input parameter
-
getEnumClass
- Returns:
- enum class
-
withEnumClass
Sets enum class. Cannot be used withwithDatatype(Datatype)
,withEntityClass(Class)
and with predefined static methods.- Parameters:
enumClass
- enum class- Returns:
- input parameter
-
getTimeZone
- Returns:
- time zone
-
withTimeZone
Sets time zone to the parameter. InputDialog supports time zones for If time zone not set andisUseUserTimeZone()
is false, component will use system time zone.- Parameters:
timeZone
- time zone to use- Returns:
- input parameter
- See Also:
-
isUseUserTimeZone
public boolean isUseUserTimeZone()- Returns:
true
if the parameter uses user'sTimeZone
.
-
withUseUserTimeZone
Sets to the parameter whether to use user'sTimeZone
. InputDialog supports time zones for Default value isfalse
. If users' time zone is not used and time zone is not set, component will use system time zone.- Parameters:
useUserTimeZone
- whether to use user's time zone or not- Returns:
- input parameter
- See Also:
-
parameter
Creates parameter with String type.- Parameters:
id
- field id- Returns:
- input parameter
-
stringParameter
Creates parameter with String type.- Parameters:
id
- field id- Returns:
- input parameter
-
intParameter
Creates parameter with Integer type.- Parameters:
id
- field id- Returns:
- input parameter
-
doubleParameter
Creates parameter with Double type.- Parameters:
id
- field id- Returns:
- input parameter
-
bigDecimalParameter
Creates parameter with BigDecimal type.- Parameters:
id
- field id- Returns:
- input parameter
-
longParameter
Creates parameter with Long type.- Parameters:
id
- field id- Returns:
- input parameter
-
dateTimeParameter
Creates parameter with DateTime type. To enable time zones for the component usewithUseUserTimeZone(boolean)
orwithTimeZone(TimeZone)
.If
isUseUserTimeZone()
is false and time zone is not set, component will use system time zone.- Parameters:
id
- field id- Returns:
- input parameter
-
dateParameter
Creates parameter with Date type.- Parameters:
id
- field id- Returns:
- input parameter
-
timeParameter
Creates parameter with Time type.- Parameters:
id
- field id- Returns:
- input parameter
-
entityParameter
Creates parameter with Entity type.- Parameters:
id
- field identityClass
- entity class- Returns:
- input parameter
-
booleanParameter
Creates parameter with Boolean type.- Parameters:
id
- field id- Returns:
- input parameter
-
byteArrayParameter
Creates parameter with byte[] type.- Parameters:
id
- field id- Returns:
- input parameter
-
fileParameter
Creates parameter with FileRef (file reference) type.- Parameters:
id
- field id- Returns:
- input parameter
-
enumParameter
Creates parameter with Enum type.- Parameters:
id
- field idenumClass
- enum class- Returns:
- input parameter
-
localDateParameter
Creates parameter withLocalDate
type.- Parameters:
id
- field id- Returns:
- input parameter
-
localTimeParameter
Creates parameter withLocalTime
type.- Parameters:
id
- field id- Returns:
- input parameter
-
localDateTimeParameter
Creates parameter withLocalDateTime
type.- Parameters:
id
- field id- Returns:
- input parameter
-
offsetDateTimeParameter
Creates parameter withOffsetDateTime
type. To enable time zones for the component usewithUseUserTimeZone(boolean)
orwithTimeZone(TimeZone)
.If
isUseUserTimeZone()
is false and time zone is not set, component will use system time zone.- Parameters:
id
- field id- Returns:
- input parameter
-
offsetTimeParameter
Creates parameter withOffsetTime
type.- Parameters:
id
- field id- Returns:
- input parameter
-
checkNullDatatype
-
checkNullEntityClass
-
checkNullEnumClass
-
checkNullDatatypeJavaClass
-
equals
-
hashCode
public int hashCode()
-