Class Field<T>
java.lang.Object
no.ntnu.idatt1002.demo.view.components.Field<T>
A field for a form.
The field class is responsible for rendering the correct input field based on the type of the field.
There are three types of fields:
- NUMBER: A field for numbers. Returns the number typed
- STRING: A field for strings. Returns the string typed
- LIST: A field for selecting from a list of options. Returns the index of the selected item
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enum for the different types of fields. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
private String
private javafx.scene.layout.VBox
private Field.FieldType
private T
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Field
(Field.FieldType type, String placeholder) private
Field
(Field.FieldType type, String name, List<? extends Storable> options) private
-
Method Summary
-
Field Details
-
type
-
placeholder
-
value
-
mapOptions
-
options
-
name
-
renderedField
private javafx.scene.layout.VBox renderedField
-
-
Constructor Details
-
Field
-
Field
-
Field
-
-
Method Details
-
ofNumber
Create a new field of type number.- Returns:
- a new field of type number.
-
ofString
-
ofList
Create a new field of type list.- Returns:
- a new field of type list.
-
ofMap
-
getRenderedField
public javafx.scene.Node getRenderedField() -
getType
-
getValue
-
setValue
-
render
private void render()
-