|
LEONARDI Application Composer - 8.9.0.40 by W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleon.info.LyTag
leon.info.LyInfo
leon.info.LyObjectInfo
leon.info.LyFieldInfo
leon.info.LyChoiceFieldInfo
public final class LyChoiceFieldInfo
This class implements the description of an enumerated field (choice with finite number of options) of a class info. Choice fields are defined with a set of options (LyChoiceOption).
Options are pairs of displayable values and internal value.
Choice fieldInfo may also accept "multiple" values : several options may be selected simultaneously.
See also tag
LyChoiceOption
Nested Class Summary | |
---|---|
static class |
LyChoiceFieldInfo.SortBy
"Sort by" values. |
static class |
LyChoiceFieldInfo.Type
Choice types. |
Nested classes/interfaces inherited from class leon.info.LyTag |
---|
LyTag.Model |
Field Summary | |
---|---|
static java.lang.String |
__version
|
Fields inherited from class leon.info.LyObjectInfo |
---|
__VERSION, NULL, PART_ALL, PART_BIND, PART_DATA, PART_GUI, PART_LABEL |
Fields inherited from interface leon.data.LyField |
---|
__VERSION |
Method Summary | |
---|---|
LyValue |
buildFieldValue(java.lang.Object value)
Builds the appropriate LyValue corresponding to this field for the given value object. |
java.lang.String |
checkValue(LyEnvironment environment,
java.lang.Object fieldValue)
Checks the given value : the value must correspond to options of the choice. |
int |
compare(java.lang.Object value1,
java.lang.Object value2,
java.util.BitSet modifiers)
Compare two values of this fieldInfo. |
boolean |
contains(java.lang.Object value1,
java.lang.Object value2,
java.util.BitSet modifiers)
Checks if the second value is contained in the first one, for this field. |
boolean |
doGroupsHaveValue()
Checks whether options groups have value or not. |
LyChoiceItem |
getChoiceItem(short index)
Gets an item from the items list at a given position. |
LyChoiceItem |
getChoiceItem(java.lang.String string)
Gets an item from the items list by its id, name or value. |
short |
getChoiceItemCount()
Gets items count. |
LyChoiceOption |
getChoiceOption(short index)
Gets an option from the option list at a given position. |
LyChoiceOption |
getChoiceOption(java.lang.String string)
Gets an item from the items list by its id, name or value. |
LyChoiceOption |
getChoiceOptionByValue(java.lang.Object value)
Gets an option from the option list from the internal value. |
short |
getChoiceOptionCount()
Gets options count. |
LyChoiceOptionGroup |
getChoiceOptionGroup()
Accessor to the choice option group associated with this choice field. |
LyInfoList<LyChoiceOptionGroup> |
getChoiceOptionGroups()
|
LyInfoList<LyChoiceOptionGroup> |
getChoiceOptionGroups(boolean godown)
Utility method to retrieve options group of this choice field. |
LyInfoList<LyChoiceOptionGroup> |
getChoiceOptionGroups(LyChoiceOption option)
Get all groups where the given option is found. |
short |
getChoiceOptionIndex(java.lang.Object value)
Gets the internal index (position) of an option from its internal value, its id or its name. |
LyInfoList<LyChoiceOption> |
getChoiceOptions()
Returns the list of options available on this choice field. |
LyInfoList<LyChoiceOption> |
getChoiceOptions(boolean sorted)
Returns the sorted list of options available on this choice field. |
LyChoiceFieldInfo |
getContextField()
Gets the context field for this choice field info. |
LyFilterExpression.Condition[] |
getFilterConditions()
Returns the filter conditions authorized on this field. |
short |
getIndex(LyChoiceItem item)
Gets index of given item in the items list. |
short |
getIndex(LyChoiceOption option)
Gets index of given option in the options list. |
int |
getNCols()
Gets the preferred number of columns shown to the user at the same time. |
java.lang.Object |
getPeerValue(java.lang.Object value,
java.lang.Class<?> objectClass,
LyObject instance)
Returns an object of the given class from a value of this fieldInfo. |
LyChoiceFieldInfo.SortBy |
getSortBy()
Accessor to the type of sorting for this choice field. |
LyInfoList<LyChoiceOption> |
getTableOptions()
Utility method to retrieve options with table attribute set. |
LyChoiceFieldInfo.Type |
getType()
Accessor to the choice type. |
java.lang.Class<?> |
getValueClass()
Returns class of values for this field. |
java.lang.Object |
getValueFromObject(java.lang.Object object,
LyObject instance)
Constructs a value for this fieldInfo from an object for a given instance. |
boolean |
isDictionary()
Compute if the choice is a dictionary or not. |
boolean |
isMultiple()
Accessor to the multiple property. |
boolean |
isNot()
Accessor to the not property. |
java.lang.Object |
parse(java.lang.String stringValue)
Builds internal value for an instance of LyChoiceFieldInfo from a string (previously constructed by toString). |
java.lang.String |
toName(java.lang.Object fieldValue)
Returns the specified value for this field as a "displayable" string. |
java.lang.String |
toName(java.lang.Object fieldValue,
java.lang.String separator)
Returns the specified value for this field as a "displayable" string. |
java.lang.String |
toShortName(java.lang.Object fieldValue)
Returns the specified value for this field as a short "displayable" string This method is used when presenting values in tables. |
java.lang.String |
toString(java.lang.Object fieldValue)
Converts the specified value for this field to an "internal" string (string that enables reconstruction through parse method). |
Methods inherited from class leon.info.LyObjectInfo |
---|
clone, getAlias, getData, getDataList, getDatas, getFilePrefix, getGroup, getInternalAlias, getInternalFilePrefix, getInternalName, getMarks, getName, getTemplate, getTip, getUserData, hasMark, hasMarks, hasTemplate, isTemplate, putData, putData, removeData, toName |
Methods inherited from class leon.info.LyInfo |
---|
getApplication, getFile, getId, getInclude, isIncluded, isInternal, isInternal, isLoaded, isLocked, load, setApplication, setFile, toString |
Methods inherited from class leon.info.LyTag |
---|
getCommentsEnd, getCommentsStart, getEnvironment, getModelType, getParent, getRootProject, hasAncestor, isExtern, setCommentsEnd, setCommentsStart, wasCloned |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface leon.data.LyField |
---|
getId |
Methods inherited from interface leon.parser.LyCommentInterface |
---|
getCommentsEnd, getCommentsStart, setCommentsEnd, setCommentsStart |
Field Detail |
---|
public static final java.lang.String __version
Method Detail |
---|
public java.lang.Class<?> getValueClass()
getValueClass
in interface LyField
getValueClass
in class LyFieldInfo
LyObject.getValue(leon.info.LyFieldInfo)
public LyValue buildFieldValue(java.lang.Object value)
buildFieldValue
in interface LyField
buildFieldValue
in class LyFieldInfo
value
- Value from which the LyValue is built.
LyChoiceValue
,
LyBooleanValue
public java.lang.Object getValueFromObject(java.lang.Object object, LyObject instance)
Short, String | Short |
BitSet, Number, boolean[], String[] | BitSet |
getValueFromObject
in class LyFieldInfo
object
- The peer value.instance
- Instance containing the required value (could be null). This instance is
provided to be able to construct a value for complex bindings (bindings
involving other fields).
LyUnsupportedFieldBindingException
- If the requested conversion if none of the
supported conversions.LyFieldInfo.getPeerValue(java.lang.Object, java.lang.Class>, leon.data.LyObject)
,
LyFieldBinding
public java.lang.Object getPeerValue(java.lang.Object value, java.lang.Class<?> objectClass, LyObject instance)
Short | Number, String |
BitSet | BitSet, Long, Integer, boolean[], String[], Object[] |
getPeerValue
in class LyFieldInfo
value
- Value of this fieldInfo. This value is an instance of the class
returned by getValueClass method.objectClass
- Expected class of the physical value.instance
- Instance containing the given value (could be null).
LyUnsupportedFieldBindingException
- If the requested conversion if none of the
supported conversions.LyFieldInfo.getValueClass()
public java.lang.Object parse(java.lang.String stringValue) throws LyFieldInfoFormatException
parse
in class LyFieldInfo
stringValue
- The value presented as a string as produced by the toString method.
LyFieldInfoFormatException
- If the string can't be parsed properly.toString(java.lang.Object)
public java.lang.String toName(java.lang.Object fieldValue)
toName
in class LyFieldInfo
LyFieldInfo.getValueClass()
public java.lang.String toName(java.lang.Object fieldValue, java.lang.String separator)
Object
- fieldValue : The fieldValue to display.String
- separator : The value of separator between field values.
public java.lang.String toShortName(java.lang.Object fieldValue)
toShortName
in class LyFieldInfo
LyFieldInfo.getValueClass()
,
LyFieldInfo.toName(java.lang.Object)
public java.lang.String toString(java.lang.Object fieldValue)
toString
in class LyFieldInfo
parse(java.lang.String)
public java.lang.String checkValue(LyEnvironment environment, java.lang.Object fieldValue)
checkValue
in class LyFieldInfo
environment
- Environment giving the user language if a message has to be produced.
LyFieldInfo.getValueClass()
public int compare(java.lang.Object value1, java.lang.Object value2, java.util.BitSet modifiers)
compare
in class LyFieldInfo
value1
- First value.value2
- Second value.modifiers
- Modifiers used for checking (see MOD_XXX constants of LyFilterExpression).
LyFieldInfo.getValueClass()
public LyFilterExpression.Condition[] getFilterConditions()
getFilterConditions
in class LyFieldInfo
LyFilterExpression
public boolean contains(java.lang.Object value1, java.lang.Object value2, java.util.BitSet modifiers)
contains
in class LyFieldInfo
value1
- First value.value2
- Second value.modifiers
- Modifiers used for checking (see MOD_XXX constants of
LyFilterExpression).
public LyChoiceFieldInfo.Type getType()
public boolean isMultiple()
isMultiple
in class LyFieldInfo
public boolean isNot()
public LyChoiceFieldInfo.SortBy getSortBy()
public LyChoiceOption getChoiceOption(short index)
index
- Index of the searched option.
public short getIndex(LyChoiceOption option)
option
- Searched option.
public short getChoiceOptionCount()
public LyInfoList<LyChoiceOption> getChoiceOptions()
public LyInfoList<LyChoiceOption> getChoiceOptions(boolean sorted)
sorted
- Boolean indicating if list must be sorted according to sortBy criterion.
public LyChoiceOptionGroup getChoiceOptionGroup()
public LyInfoList<LyChoiceOptionGroup> getChoiceOptionGroups(LyChoiceOption option)
public LyChoiceItem getChoiceItem(short index)
index
- Index of the searched item.
public short getIndex(LyChoiceItem item)
item
- Searched item.
public short getChoiceItemCount()
public LyChoiceOption getChoiceOption(java.lang.String string)
string
- Searched string (id, name or value transformed in String).
public LyChoiceItem getChoiceItem(java.lang.String string)
string
- Searched string (id, name or value transformed in String).
public LyChoiceOption getChoiceOptionByValue(java.lang.Object value)
value
- Internal value from which an option is searched.
public short getChoiceOptionIndex(java.lang.Object value)
value
- Value (or id, or name) from which an option is searched.
java.lang.IllegalArgumentException
- if no option corresponds to the given value (or id, or
name).public int getNCols()
public LyChoiceFieldInfo getContextField()
public LyInfoList<LyChoiceOption> getTableOptions()
public LyInfoList<LyChoiceOptionGroup> getChoiceOptionGroups()
public LyInfoList<LyChoiceOptionGroup> getChoiceOptionGroups(boolean godown)
public boolean isDictionary()
choice
- the choice
public boolean doGroupsHaveValue()
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |