Class StringFormField
java.lang.Object
com.github.tadukoo.view.form.field.FormField<String>
com.github.tadukoo.view.form.field.StringFormField
String Form Field is a
FormField that uses a String. This could be an input prompt or a title
(See StringFormField.StringFieldType)- Since:
- Alpha v.0.2
- Version:
- Alpha v.0.3
- Author:
- Logan Ferree (Tadukoo)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumString Field Type is used to determine type of String fieldstatic classBuilder to be used to create aStringFormField.Nested classes/interfaces inherited from class com.github.tadukoo.view.form.field.FormField
FormField.FormFieldBuilder<Type> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intNumber of columns used to determine the width of this fieldprivate final booleanWhether this field can be edited or notprivate final StringFormField.StringFieldTypeThetypeof String field -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateStringFormField(String key, String defaultValue, LabelType labelType, SizablePaint labelForegroundPaint, SizablePaint labelBackgroundPaint, FontFamily labelFontFamily, int labelFontStyle, int labelFontSize, ShapeInfo labelShape, Border labelBorder, int rowPos, int colPos, int rowSpan, int colSpan, boolean logFontResourceLoaderWarnings, com.github.tadukoo.util.logger.EasyLogger logger, GraphicsEnvironment graphEnv, String fontFolder, FontResourceLoader fontResourceLoader, StringFormField.StringFieldType stringFieldType, boolean editable, int columns) Creates a new StringFormField with the given parameters -
Method Summary
Modifier and TypeMethodDescriptionbuilder()intCreates theJComponentto be used for this field.getValue(JComponent component) Takes in theJComponentfor this field and grabs the data off of it, returning it in the proper format for the field to be repopulated on the form.booleanMethods inherited from class com.github.tadukoo.view.form.field.FormField
getColPos, getColSpan, getDefaultValue, getFontFolder, getFontResourceLoader, getGraphEnv, getKey, getLabelBackgroundPaint, getLabelBorder, getLabelFontFamily, getLabelFontSize, getLabelFontStyle, getLabelForegroundPaint, getLabelShape, getLabelType, getLogger, getRowPos, getRowSpan, getType, logFontResourceLoaderWarnings
-
Field Details
-
stringFieldType
Thetypeof String field -
editable
private final boolean editableWhether this field can be edited or not -
columns
private final int columnsNumber of columns used to determine the width of this field
-
-
Constructor Details
-
StringFormField
private StringFormField(String key, String defaultValue, LabelType labelType, SizablePaint labelForegroundPaint, SizablePaint labelBackgroundPaint, FontFamily labelFontFamily, int labelFontStyle, int labelFontSize, ShapeInfo labelShape, Border labelBorder, int rowPos, int colPos, int rowSpan, int colSpan, boolean logFontResourceLoaderWarnings, com.github.tadukoo.util.logger.EasyLogger logger, GraphicsEnvironment graphEnv, String fontFolder, FontResourceLoader fontResourceLoader, StringFormField.StringFieldType stringFieldType, boolean editable, int columns) Creates a new StringFormField with the given parameters- Parameters:
key- The name of this field (used as a key in Forms)defaultValue- The starting value of the fieldlabelType- TheLabelTypeto use for this fieldlabelForegroundPaint- TheSizablePaintfor the foreground of the LabellabelBackgroundPaint- TheSizablePaintfor the background of the LabellabelFontFamily- TheFontFamilyfor the Label's fontlabelFontStyle- The font style for the LabellabelFontSize- The font size for the LabellabelShape- TheShapeInfoto use for the LabellabelBorder- TheBorderto use for the LabelrowPos- The row position of this fieldcolPos- The column position of this fieldrowSpan- The row span of this fieldcolSpan- The column span of this fieldlogFontResourceLoaderWarnings- Whether to log warnings generated by the FontResourceLoader - can be ignored if you specify your own FontResourceLoaderlogger- AnEasyLoggerthat will be sent to the FontResourceLoader by default - can be ignored if you specify your own FontResourceLoadergraphEnv- TheGraphicsEnvironmentto load a font to in the FontResourceLoader - can be ignored if you specify your own FontResourceLoaderfontFolder- The path to the fonts folder to find font files in if needed in the FontResourceLoader - can be ignored if you specify your own FontResourceLoaderfontResourceLoader- TheFontResourceLoaderto use for fonts on this fieldstringFieldType- Thetypeof String fieldeditable- Whether this field can be edited or notcolumns- Number of columns used to determine the width of this field
-
-
Method Details
-
builder
- Returns:
- A new
StringFormField.StringFormFieldBuilderto use to make aStringFormField
-
getStringFieldType
- Returns:
- The
typeof String field
-
isEditable
public boolean isEditable()- Returns:
- Whether this field can be edited or not
-
getColumns
public int getColumns()- Returns:
- Number of columns used to determine the width of the field
-
getComponent
Creates theJComponentto be used for this field.- Specified by:
getComponentin classFormField<String>- Returns:
- A newly created
JComponentto use on the form
-
getValue
Takes in theJComponentfor this field and grabs the data off of it, returning it in the proper format for the field to be repopulated on the form.- Specified by:
getValuein classFormField<String>- Parameters:
component- TheJComponentassociated with this field- Returns:
- The data extracted from the
JComponent
-