|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sage.accpac.sm.ViewField
@ThreadSafe public final class ViewField
Represents a field in an Accpac view FIXME documentation
Nested Class Summary | |
---|---|
static class |
ViewField.ViewFieldPresentationType
Indicates the type of presentation information defined for a field. |
static class |
ViewField.ViewFieldType
Defines the possible data types of a view field. |
Method Summary | |
---|---|
int |
getAttributes()
Gets the view-specific boolean attributes of the field. |
int |
getDecimalPlaces()
Gets the number of decimal places to which the number field will be stored. |
java.lang.String |
getDescription()
Gets the description of the field. |
int |
getID()
Gets the identifier of the field. |
int |
getLengthEstimate()
Return a realistic length limit for this field. |
int |
getMaxDigits()
Gets the maximum number of digits that will be stored. |
int |
getMaxLength()
returns the maximum number of characters that might (but only might) fit in this field. |
java.lang.Object |
getMaxValue()
Gets the maximum value allowed for this field The maximum value is based solely on the field type, without regard to business logic dictating whether the value is acceptable according to its context. |
java.lang.Object |
getMinValue()
Gets the minimum value allowed for this field The minimum value is based solely on the field type, without regard to business logic dictating whether the value is acceptable according to its context. |
java.lang.String |
getName()
Gets the name of the field. |
int |
getPrecision()
Gets the precision of the field. |
ViewFieldPresentationList |
getPresentationList()
Gets a ViewFieldPresentationList object that stores the presentation list defined for the field. |
java.lang.String |
getPresentationMask()
Gets the presentation mask of the field that controls its display format. |
ViewField.ViewFieldPresentationType |
getPresentationType()
Gets the presentation type of the field. |
ViewField.ViewFieldType |
getType()
Gets the data type of the field |
java.lang.Object |
getValue()
Get the current value of the field |
View |
getView()
Gets the View object this field belongs to |
boolean |
hasDynamicPresentation()
returns true if and only if the presentation of the field can change. |
boolean |
hasDynamicType()
returns true if and only if the 'type' information of the field can change. |
boolean |
isEditable()
returns true if and only if the value can be changed by the caller. |
boolean |
isEnabled()
returns true if and only if the field can be meaningfully used. |
boolean |
isRequired()
returns true if and only if the value must be changed interactively before the record can be inserted. |
boolean |
mightChange()
returns true if and only if the value of the field might change non-interactively. |
boolean |
mustCheckEditable()
returns true if and only if the caller must check regularly that the field is editable. |
int |
setToMax()
Sets the field value to the maximum value |
int |
setToMin()
Sets the field value to the minimum value |
int |
setValue(java.lang.Object newValue,
boolean verify)
Assign a new value to the field. |
int |
setValueOptionalField(java.lang.Object newValue,
boolean verify,
int length)
Assign a new value to the field in an optional field. |
boolean |
wasChanged()
returns true if and only if the value of the field has been changed since the last operation that retrieved or initialized the current record of the view |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public int getAttributes()
This gets a bitmap of the up to 16 view-specific attributes that view implementers can assign a meaning to.
For the Accpac-specific attributes that relate to the viewAttribs function use the appropriate specific function below.
hasDynamicPresentation()
,
hasDynamicType()
,
mightChange()
,
wasChanged()
,
isEditable()
,
isEnabled()
,
#isInKey()
,
isRequired()
,
mustCheckEditable()
public int getDecimalPlaces()
java.lang.UnsupportedOperationException
- if the field is not a Decimal field.public java.lang.String getDescription()
public int getID()
This is frequently referred to in view documentation as the "field index".
public int getLengthEstimate()
java.lang.UnsupportedOperationException
- if this field is not a character fieldhasDynamicType()
,
getMaxLength()
public int getMaxLength()
This is the largest number of characters (Unicode Code Points) that could possibly fit in the field. It is always possible that a string of this length will not fit.
See the description of getLengthEstimate()
for a discussion of the
influence of character encoding.
java.lang.UnsupportedOperationException
- if this field is not a character fieldgetLengthEstimate()
public int getMaxDigits()
getDecimalPlaces
for how many
of them are after the decimal point.
java.lang.UnsupportedOperationException
- if the field is not a Decimal field.public java.lang.Object getMaxValue()
public java.lang.Object getMinValue()
public java.lang.String getName()
public int getPrecision()
getDecimalPlaces()
.
public ViewFieldPresentationList getPresentationList()
hasDynamicPresentation()
,
getPresentationType()
public java.lang.String getPresentationMask()
hasDynamicPresentation()
,
getPresentationType()
public ViewField.ViewFieldPresentationType getPresentationType()
hasDynamicPresentation()
,
getPresentationMask()
,
getPresentationList()
public ViewField.ViewFieldType getType()
public java.lang.Object getValue()
public View getView()
public boolean hasDynamicPresentation()
This is true if the field has a mask and the mask may change, or if the field has a presentation list and that list may change.
It would be very unusual for the presentation type itself to change.
getPresentationType()
,
getPresentationMask()
,
getPresentationList()
public boolean hasDynamicType()
Typically this means that the precision of a decimal type may change.
getDecimalPlaces()
,
getLengthEstimate()
public boolean isEditable()
If mustCheckEditable()
is true then this property can change but
if it returns false then the property will remain the same.
mustCheckEditable()
,
FieldChangeEvent.isEditable()
public boolean isEnabled()
If this returns false most field operations are not permitted and will result in an exception being thrown.
FieldChangeEvent.isEnabled()
public boolean isRequired()
FieldChangeEvent.isRequired()
public boolean mightChange()
Clearly if this is true then isEditable()
is false.
public boolean mustCheckEditable()
If this returns true then the caller must use isEditable()
regularly to check that the field is still editable as that can change at
any time. If this returns false then the result of isEditable()
will not change during the time the view is open and so the isEditable
result can be cached.
isEditable()
public int setToMax()
public int setToMin()
public int setValue(java.lang.Object newValue, boolean verify)
public int setValueOptionalField(java.lang.Object newValue, boolean verify, int length)
newValue
- the value to which the field will be setverify
- whether the value should be verified. (NB some verification may
also occur even if this is false)length
- the length to assume
StringTooLongException
- if the value is or is converted to a string and the string does
not fit in the bytes provided
UncheckedCharacterCodingException
- if the value is or is converted to a string and there is a
coding problem with the string (such as wrong character set)public boolean wasChanged()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |