Package pt.tecnico.uilib.forms
Class Form
java.lang.Object
pt.tecnico.uilib.forms.Form
A Form has a set of input fields.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBooleanField(String key, String label)voidaddIntegerField(String key, String label)voidaddRealField(String key, String label)voidaddStringField(String key, String label)booleanField(String key)voidclear()Clear the form.static BooleanCollection<Field<?>>entries()Field<?>integerField(String key)parse()Request the parsing of all the form's fields, clearing previous field values.parse(boolean clear)Request the parsing of all the form's fields.static IntegerrequestInteger(String prompt)static DoublerequestReal(String prompt)static StringrequestString(String prompt)stringField(String key)title()
-
Constructor Details
-
Form
public Form()use default values: static UI and no title -
Form
- Parameters:
title- the title
-
Form
- Parameters:
ui- the dialog drivertitle- the title
-
-
Method Details
-
title
- Returns:
- the title of the Form (can be null)
-
entries
- Returns:
- a copy of the Form's fields
-
field
- Parameters:
key-- Returns:
- a copy of the Input requests of the Form
-
addBooleanField
- Parameters:
key-label-
-
addStringField
- Parameters:
key-label-
-
addRealField
- Parameters:
key-label-
-
addIntegerField
- Parameters:
key-label-
-
booleanField
- Parameters:
key-- Returns:
- field value
-
stringField
- Parameters:
key-- Returns:
- field value
-
realField
- Parameters:
key-- Returns:
- field value
-
integerField
- Parameters:
key-- Returns:
- field value
-
parse
Request the parsing of all the form's fields, clearing previous field values.- Returns:
- the form
-
parse
Request the parsing of all the form's fields.- Parameters:
clear- if true, field values are first cleared; otherwise, previous field values are used as default values.- Returns:
- the form
-
clear
public void clear()Clear the form. -
confirm
-
requestInteger
-
requestReal
-
requestString
-