public interface Field<T> extends Clearable
table.column
.FieldPanel
Modifier and Type | Method and Description |
---|---|
T |
createValue()
Creates the input Object typically from the textual String input.
|
javax.swing.JLabel |
getJLabel()
Returns a JLabel component labeled with the translated field name.
|
java.lang.String |
getLabel()
Returns the translated name for the field.
|
java.lang.String |
getName()
Returns the unique name of the field.
|
NlsDatabaseKey |
getNlsKey()
Returns the translation key used to name this Field
|
java.lang.String |
getStringValue()
Returns the field value as a String - or an empty String if the field is empty.
|
java.awt.Component |
getUnitComponent()
Returns the unit component for this field if one is set
|
T |
getValue()
Returns the field value as an Object - or null if the field is empty.
|
javax.swing.JComponent |
getWidget()
Returns a JComponent that represents the layoutable GUI component.
|
boolean |
inputEquals(boolean b)
Tests if the field input is equal to the given boolean value.
|
boolean |
inputEquals(double d)
Tests if the field input is equal to the given double number.
|
boolean |
inputEquals(int i)
Tests if the field input is equal to the given int number.
|
boolean |
inputEquals(java.lang.Object o)
Tests if the field input is equal to the given object.
|
boolean |
isEmpty()
Tests if the field has input.
|
boolean |
isLocked()
Tells wasCancelled the field is locked for editing.
|
boolean |
isNotNull()
Tells wasCancelled the field requires input.
|
boolean |
isPrimaryKey()
Tells whether this field is (or is part of) the primary key.
|
boolean |
isRecordTypeField()
Tells whether this field defines the record type (only valid for composed persistent
objects).
|
boolean |
isStretchableX()
Tells whether this field should fill all the horizontal space in it's container.
|
boolean |
isStretchableY()
Tells whether this field should fill all the vertical space in it's container.
|
void |
setInsertDefaultValue()
Requests the field to search for insert-default values in the 'insert_defaults' database table.
|
void |
setLocked(boolean b)
Locks the field for editing.
|
void |
setModifyFlag(ModifyFlag flag)
Gives the field a reference to a ModifyFlag which is set if the field was edited.
|
void |
setNotNull(boolean b)
Sets the field to not-null.
|
void |
setPrimaryKey(boolean isPk)
Tells this field to be the primary key (affects input checking).
|
void |
setStretchableX(boolean isStretchableX)
Tells whether this field should fill all the horizontal space in it's container.
|
void |
setStretchableY(boolean isStretchableY)
Tells whether this field should fill all the vertical space in it's container.
|
void |
setUnitComponent(java.awt.Component comp)
Sets the unit component for this field which is placed behind the field,
when the field is added to a FieldPanel
|
void |
setUnitString(java.lang.String unit)
Sets the unit string for this field which is placed as a JLabel behind the field,
when the field is added to a FieldPanel
|
void |
setValue(T o)
Sets the field value to the given object.
|
java.lang.String |
toString()
Returns a string representation of the field typically it's unique name and it's current
value.
|
java.lang.String |
toString(java.lang.Object o)
Converts the object to a String according to the policy of the affected field component.
|
T |
toValue(java.lang.Object o)
Tries to convert any object value to the target data type of this field.
|
T getValue()
T createValue() throws InvalidFieldInputException
InvalidFieldInputException
- If the input Object cannot be created due to a parsing error.java.lang.String getStringValue()
java.lang.String getName()
table.column
.java.lang.String getLabel()
Translation
javax.swing.JLabel getJLabel()
javax.swing.JComponent getWidget()
java.lang.String toString(java.lang.Object o)
T toValue(java.lang.Object o)
IllegalArgumentException
is thrown when the type is not supported by the field.void setLocked(boolean b)
void setNotNull(boolean b)
boolean isLocked()
boolean isNotNull()
boolean isEmpty()
boolean inputEquals(java.lang.Object o)
boolean inputEquals(int i)
boolean inputEquals(double d)
boolean inputEquals(boolean b)
void setValue(T o)
void setInsertDefaultValue()
java.lang.String toString()
toString
in class java.lang.Object
void setModifyFlag(ModifyFlag flag)
void setPrimaryKey(boolean isPk)
boolean isPrimaryKey()
boolean isRecordTypeField()
boolean isStretchableX()
boolean isStretchableY()
void setStretchableX(boolean isStretchableX)
void setStretchableY(boolean isStretchableY)
void setUnitComponent(java.awt.Component comp)
java.awt.Component getUnitComponent()
setUnitComponent(Component)
void setUnitString(java.lang.String unit)
setUnitComponent(Component)
NlsDatabaseKey getNlsKey()
Copyright © 2014 EsprIT-Systems. All Rights Reserved.