Package uibooster.model
Klasse FormBuilder
java.lang.Object
uibooster.model.FormBuilder
- Bekannte direkte Unterklassen:
FormBuilderElementTyped
,RowFormBuilder
-
Konstruktorübersicht
KonstruktorBeschreibungFormBuilder
(String title, UiBoosterOptions options) FormBuilder
(FormBuilder formBuilder) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungAdds a button to the form.Adds a button to the form.addButton
(String label, String buttonLabel, ButtonClickListener onClick) Adds a button to the form.addButton
(String label, String buttonLabel, ButtonClickListener onClick, Color backgroundColor) Adds a button to the form.addButton
(String label, String buttonLabel, ButtonClickListener onClick, Color backgroundColor, Color textColor) Adds a button to the form.addButton
(String buttonLabel, ButtonClickListener onClick) Adds a button to the form.addButton
(String buttonLabel, ButtonClickListener onClick, Color backgroundColor) Adds a button to the form.addButton
(String buttonLabel, ButtonClickListener onClick, Color backgroundColor, Color textColor) Adds a button to the form.addCheckbox
(String label) Adds true/false option as checkbox to the form.addCheckbox
(String label, boolean initialValue) Adds true/false option as checkbox to the form.addCheckbox
(String headline, String label) Adds true/false option as checkbox to the form.addCheckbox
(String headline, String label, boolean initialValue) Adds true/false option as checkbox to the form.addColorPicker
(String label) Adds a color picker to the form.addColorPicker
(String label, Color initialColor) Adds a color picker to the form.<T> FormBuilderElementTyped
<T> addCustomElement
(FormElement<T> element) Adds the given self implemented FormElement to the form.addDatePicker
(String label) Adds a date picker to the form.addFontChooser
(String label) Adds a font chooser to the form.addFontChooser
(String label, Font initialFont) Adds a font chooser to the form.addHtmlText
(String label, String htmlContent) Adds a html interpreted text to the form.addHtmlText
(String label, String htmlContent, int width, int height) Adds a html interpreted text to the form.Adds an image to the form.Adds an image to the form.addImageCentered
(String imagePath) Adds an image centered to the form.Adds just a label to the form.addList
(String label, ListElement... elements) Adds a list with more complex elements to the form.addMultipleSelection
(String label, boolean hideFilter, String... elements) Adds a scrollable and searchable list of elements to the form, which allows to choose multiple elements.addMultipleSelection
(String label, boolean hideFilter, List<String> elements) Adds a scrollable and searchable list of elements to the form, which allows to choose multiple elements.addMultipleSelection
(String label, String... elements) Adds a scrollable and searchable list of elements to the form, which allows to choose multiple elements.addMultipleSelection
(String label, List<String> elements) Adds a scrollable and searchable list of elements to the form, which allows to choose multiple elements.addProgress
(String label, int min, int max, int initial) Adds a progress bar to the form.addSelection
(String label, String... possibilities) Adds a selection list to the form, which allows to choose one option.addSelection
(String label, List<String> possibilities) Adds a selection list to the form, which allows to choose one option.addSelectionWithCheckboxes
(String label, String... possibilities) Adds a selection with checkboxes to the form, which allows to choose multiple options.addSelectionWithCheckboxes
(String label, List<String> possibilities) Adds a selection with checkboxes to the form, which allows to choose multiple options.addSelectionWithCheckboxes
(String label, List<String> possibilities, List<String> initialSelectedPossibilities) Adds a selection with checkboxes to the form, which allows to choose multiple options.Adds a slider to the form, which allows to choose a value in between some bounds.Adds an editable table with custom data to the form.Adds table with custom data to the form.Adds an input text field to the form.Adds an input text field to the form with an initial text.Adds an input text field to the form with an initial text.addTextArea
(String label) Adds an input text area with 3 lines to the form.addTextArea
(String label, int rows) Adds an input text area with specified number of lines to the form.addTextArea
(String label, int rows, String initialText) Adds an input text area with specified number of lines to the form and an initial text.addTextArea
(String label, int rows, String initialText, boolean readonly) Adds an input text area with specified number of lines to the form and an initial text.addTextArea
(String label, String initialText) Adds an input text area with 3 lines to the form and an initial text.Allows to define some settings for the created window of the form.endRow()
Stops the current created row.run()
Creates the previous defined form as non-blocking dialog and shows the window.setChangeListener
(FormElementChangeListener onChange) Defines a listener which detects all changes in this form.setCloseListener
(FormCloseListener closeListener) Defines a listener which detects the closing of the window of form.setInitListener
(FormInitializedListener formInitializedListener) Defines a listener which is called onced after the creation of the form.setMargin
(int elementLeft, int elementTop, int elementRight, int elementBottom) Defines a margin for the lastly added element to set the space around this element in pixel.show()
Creates the previous defined form as blocking dialog and shows the window.startRow()
Starts a new row to set multiple elements next to each other.startRow
(int hGap, int vGap) Starts a new row to set multiple elements next to each other.startRow
(int elementLeft, int elementTop, int elementRight, int elementBottom) Starts a new row to set multiple elements next to each other.Starts a new row to set multiple elements next to each other.Starts a new row to set multiple elements next to each other.Starts a new row to set multiple elements next to each other.
-
Konstruktordetails
-
FormBuilder
-
FormBuilder
-
-
Methodendetails
-
addText
Adds an input text field to the form.- Parameter:
label
- expects the label for this input element
-
addText
Adds an input text field to the form with an initial text.- Parameter:
label
- expects the label for this input elementinitialText
- expects a text which will be set into the text field
-
addText
Adds an input text field to the form with an initial text.- Parameter:
label
- expects the label for this input elementinitialText
- expects a text which will be set into the text field.readonly
- if readonly is set to true, the input field is not changable for the user
-
addTextArea
Adds an input text area with 3 lines to the form.- Parameter:
label
- expects the label for this input element
-
addTextArea
Adds an input text area with specified number of lines to the form.- Parameter:
label
- expects the label for this input elementrows
- expects the number of lines
-
addTextArea
Adds an input text area with 3 lines to the form and an initial text.- Parameter:
label
- expects the label for this input elementinitialText
- expects a text which will be set into the text area
-
addTextArea
Adds an input text area with specified number of lines to the form and an initial text.- Parameter:
label
- expects the label for this input elementrows
- expects the number of linesinitialText
- expects a text which will be set into the text area
-
addTextArea
public FormBuilderElementTyped<String> addTextArea(String label, int rows, String initialText, boolean readonly) Adds an input text area with specified number of lines to the form and an initial text.- Parameter:
label
- expects the label for this input elementrows
- expects the number of linesinitialText
- expects a text which will be set into the text areareadonly
- if readonly is set to true, the input field is not changable for the user
-
addSelection
Adds a selection list to the form, which allows to choose one option.- Parameter:
label
- expects the label for this input elementpossibilities
- expects a list of possible texts options
-
addSelection
Adds a selection list to the form, which allows to choose one option.- Parameter:
label
- expects the label for this input elementpossibilities
- expects a list of possible texts options- Gibt zurück:
-
addSelectionWithCheckboxes
public FormBuilderElementTyped<String> addSelectionWithCheckboxes(String label, List<String> possibilities) Adds a selection with checkboxes to the form, which allows to choose multiple options.- Parameter:
label
- expects the label for this input elementpossibilities
- expects a list of possible texts options
-
addSelectionWithCheckboxes
public FormBuilderElementTyped<String> addSelectionWithCheckboxes(String label, List<String> possibilities, List<String> initialSelectedPossibilities) Adds a selection with checkboxes to the form, which allows to choose multiple options.- Parameter:
label
- expects the label for this input elementpossibilities
- expects a list of possible texts optionsinitialSelectedPossibilities
- expects the initial
-
addSelectionWithCheckboxes
public FormBuilderElementTyped<String> addSelectionWithCheckboxes(String label, String... possibilities) Adds a selection with checkboxes to the form, which allows to choose multiple options.- Parameter:
label
- expects the label for this input elementpossibilities
- expects a list of possible texts options
-
addCustomElement
Adds the given self implemented FormElement to the form.- Parameter:
element
- expects an implementation of FormElement
-
addLabel
Adds just a label to the form.- Parameter:
label
- expects the label
-
addButton
Adds a button to the form.- Parameter:
buttonLabel
- expects the text which is shown on the buttononClick
- expects an implementation of Runnable, which is executed when the button is clicked
-
addButton
Adds a button to the form.- Parameter:
buttonLabel
- expects the text which is shown on the buttononClick
- expects an implementation of Runnable, which is executed when the button is clicked
-
addButton
public FormBuilderElementTyped<String> addButton(String buttonLabel, ButtonClickListener onClick, Color backgroundColor) Adds a button to the form.- Parameter:
buttonLabel
- expects the text which is shown on the buttononClick
- expects an implementation of Runnable, which is executed when the button is clickedbackgroundColor
- expects a color for the tint of this button background
-
addButton
public FormBuilderElementTyped<String> addButton(String buttonLabel, ButtonClickListener onClick, Color backgroundColor, Color textColor) Adds a button to the form.- Parameter:
buttonLabel
- expects the text which is shown on the buttononClick
- expects an implementation of Runnable, which is executed when the button is clickedbackgroundColor
- expects a color for the tint of this button backgroundtextColor
- expects a color for the text in this button
-
addButton
public FormBuilderElementTyped<String> addButton(String label, String buttonLabel, Runnable onClick) Adds a button to the form.- Parameter:
label
- expects the label for this input elementbuttonLabel
- expects the text which is shown on the buttononClick
- expects an implementation of Runnable, which is executed when the button is clicked
-
addButton
public FormBuilderElementTyped<String> addButton(String label, String buttonLabel, ButtonClickListener onClick) Adds a button to the form.- Parameter:
label
- expects the label for this input elementbuttonLabel
- expects the text which is shown on the buttononClick
- expects an implementation of Runnable, which is executed when the button is clicked
-
addButton
public FormBuilderElementTyped<String> addButton(String label, String buttonLabel, ButtonClickListener onClick, Color backgroundColor, Color textColor) Adds a button to the form.- Parameter:
label
- expects the label for this input elementbuttonLabel
- expects the text which is shown on the buttononClick
- expects an implementation of Runnable, which is executed when the button is clickedbackgroundColor
- expects a color for the tint of this button backgroundtextColor
- expects a color for the text in this button
-
addButton
public FormBuilderElementTyped<String> addButton(String label, String buttonLabel, ButtonClickListener onClick, Color backgroundColor) Adds a button to the form.- Parameter:
label
- expects the label for this input elementbuttonLabel
- expects the text which is shown on the buttononClick
- expects an implementation of Runnable, which is executed when the button is clickedbackgroundColor
- expects a color for the tint of this button background
-
addProgress
Adds a progress bar to the form.- Parameter:
label
- expects the label for this input elementmin
- expects the minimum value of the progress barmax
- expects the maximum value of the progress barinitial
- expects the current value of the progress bar
-
addSlider
public FormBuilderElementTyped<Integer> addSlider(String label, int min, int max, int init, int majorTick, int minorTick) Adds a slider to the form, which allows to choose a value in between some bounds.- Parameter:
label
- expects the label for this input elementmin
- expects the minimum value of the slidermax
- expects the maximum value of the sliderinit
- expects the current value of the slidermajorTick
- expects the step size for the bigger major tickminorTick
- expects the step size for the smaller minor tick
-
addDatePicker
Adds a date picker to the form.- Parameter:
label
- expects the label for this input element
-
addColorPicker
Adds a color picker to the form.- Parameter:
label
- expects the label for this input element
-
addColorPicker
Adds a color picker to the form.- Parameter:
label
- expects the label for this input elementinitialColor
- expects a color which is set to the picker as default
-
addFontChooser
Adds a font chooser to the form.- Parameter:
label
- expects the label for this input element
-
addFontChooser
Adds a font chooser to the form.- Parameter:
label
- expects the label for this input elementinitialFont
- expects a font which is set to the chooser as default
-
addMultipleSelection
Adds a scrollable and searchable list of elements to the form, which allows to choose multiple elements.- Parameter:
label
- expects the label for this input elementelements
- expects a list of options as text
-
addMultipleSelection
public FormBuilderElementTyped<List<String>> addMultipleSelection(String label, boolean hideFilter, String... elements) Adds a scrollable and searchable list of elements to the form, which allows to choose multiple elements.- Parameter:
label
- expects the label for this input elementhideFilter
- if set to true, the input text field for the search will be not shownelements
- expects a list of options as text
-
addMultipleSelection
public FormBuilderElementTyped<List<String>> addMultipleSelection(String label, List<String> elements) Adds a scrollable and searchable list of elements to the form, which allows to choose multiple elements.- Parameter:
label
- expects the label for this input elementelements
- expects a list of options as text
-
addMultipleSelection
public FormBuilderElementTyped<List<String>> addMultipleSelection(String label, boolean hideFilter, List<String> elements) Adds a scrollable and searchable list of elements to the form, which allows to choose multiple elements.- Parameter:
label
- expects the label for this input elementhideFilter
- if set to true, the input text field for the search will be not shownelements
- expects a list of options as text
-
addList
Adds a list with more complex elements to the form.- Parameter:
label
- expects the label for this input elementelements
- expects a list of objects with type ListElement
-
addTable
public FormBuilderElementTyped<TableData> addTable(String label, List<String> header, String[][] data, boolean isEditable) Adds table with custom data to the form.- Parameter:
label
- expects the label for this input elementheader
- expects a list of column namesdata
- expects the data as two-dimensional array of Strings. It has to match with the number of column namesisEditable
- true if the data should changeable by the user, otherwise set false for immutable data
-
addTable
public FormBuilderElementTyped<TableData> addTable(String label, List<String> header, String[][] data) Adds an editable table with custom data to the form.- Parameter:
label
- expects the label for this input elementheader
- expects a list of column namesdata
- expects the data as two-dimensional array of Strings. It has to match with the number of column names
-
addImage
Adds an image to the form.- Parameter:
imagePath
- expects the path to the image file
-
addImageCentered
Adds an image centered to the form.- Parameter:
imagePath
- expects the path to the image file
-
addImage
Adds an image to the form.- Parameter:
label
- expects the label for this input elementimagePath
- expects the path to the image filecentered
- true if the image should be centered, false it's aligned to the left
-
addCheckbox
Adds true/false option as checkbox to the form.- Parameter:
label
- expects a text which is displayed next to the checkbox
-
addCheckbox
Adds true/false option as checkbox to the form.- Parameter:
headline
- expects a text for this input element, which is displayed over the input elementlabel
- expects a text which is displayed next to the checkbox
-
addCheckbox
public FormBuilderElementTyped<Boolean> addCheckbox(String headline, String label, boolean initialValue) Adds true/false option as checkbox to the form.- Parameter:
headline
- expects a text for this input element, which is displayed over the input elementlabel
- expects a text which is displayed next to the checkboxinitialValue
- executes a value which is set up for the checkbox
-
addCheckbox
Adds true/false option as checkbox to the form.- Parameter:
label
- expects a text which is displayed next to the checkboxinitialValue
- executes a value which is set up for the checkbox
-
addHtmlText
Adds a html interpreted text to the form. It supports HTML 3.2- Parameter:
label
- expects the label for this input elementhtmlContent
- expected html content
-
addHtmlText
public FormBuilderElementTyped<String> addHtmlText(String label, String htmlContent, int width, int height) Adds a html interpreted text to the form. It supports HTML 3.2- Parameter:
label
- expects the label for this input elementhtmlContent
- expects html contentwidth
- expects the width in pixel which the component has to used preferredheight
- expects the height in pixel which the component has to used preferred
-
setChangeListener
Defines a listener which detects all changes in this form. It allows to react to different events for the added form elements.- Parameter:
onChange
- expects an implementation of FormElementChangeListener
-
setCloseListener
Defines a listener which detects the closing of the window of form. It allows to react on f.e. exit- Parameter:
closeListener
- expects an implementation of FormElementCloseListener
-
setInitListener
Defines a listener which is called onced after the creation of the form.- Parameter:
formInitializedListener
- expects an implementation of FormInitializedListener
-
setMargin
Defines a margin for the lastly added element to set the space around this element in pixel. If setMargin is called before any element is added the given margin will set as default values for upcoming elements.- Parameter:
elementLeft
- expects a margin space to the left in pixelelementTop
- expects a margin space to top in pixelelementRight
- expects a margin space to the right in pixelelementBottom
- expects a margin space to bottom in pixel
-
andWindow
Allows to define some settings for the created window of the form. The settings have to be closed with save()-method -
show
Creates the previous defined form as blocking dialog and shows the window. It blocks the process until the window is closed. After that it returns the user input as Form.- Gibt zurück:
- an object with the user filled data
-
run
Creates the previous defined form as non-blocking dialog and shows the window. The window is started in a new thread and allows to run the following code. It returns an object which is synchronized with the form. This form-object contains every user input as long as the dialog runs.- Gibt zurück:
- an object which allows access to the user filled data.
-
startRow
Starts a new row to set multiple elements next to each other. It allows to set elements in the same row. The row has to end with the endRow()-method. -
startRow
Starts a new row to set multiple elements next to each other. It allows to set elements in the same row. The row has to end with the endRow()-method. The gap params allow to set some space for the row in horizontal and vertical direction.- Parameter:
hGap
- expects a space in horizontal direction in pixel. The space is the sum of left und right spacing.vGap
- expects a space in vertical direction in pixel. The space is the sum of left und right spacing.
-
startRow
public RowFormBuilder startRow(int elementLeft, int elementTop, int elementRight, int elementBottom) Starts a new row to set multiple elements next to each other. It allows to set elements in the same row. The row has to end with the endRow()-method. The margin defines the space around this row in pixel.- Parameter:
elementLeft
- expects a margin space to the left in pixelelementTop
- expects a margin space to top in pixelelementRight
- expects a margin space to the right in pixelelementBottom
- expects a margin space to bottom in pixel
-
startRow
Starts a new row to set multiple elements next to each other. It allows to set elements in the same row. The row has to end with the endRow()-method.- Parameter:
label
- expects the label for this input element
-
startRow
Starts a new row to set multiple elements next to each other. It allows to set elements in the same row. The row has to end with the endRow()-method. The gap params allow to set some space for the row in horizontal and vertical direction.- Parameter:
label
- expects the label for this input elementhGap
- expects a space in horizontal direction in pixel. The space is the sum of left und right spacing.vGap
- expects a space in vertical direction in pixel. The space is the sum of left und right spacing.
-
startRow
public RowFormBuilder startRow(String label, int elementLeft, int elementTop, int elementRight, int elementBottom) Starts a new row to set multiple elements next to each other. It allows to set elements in the same row. The row has to end with the endRow()-method. The margin defines the space around this row in pixel.- Parameter:
label
- expects the label for this input elementelementLeft
- expects a margin space to the left in pixelelementTop
- expects a margin space to top in pixelelementRight
- expects a margin space to the right in pixelelementBottom
- expects a margin space to bottom in pixel
-
endRow
Stops the current created row. It has to be used after startRow()-method.
-