|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.itracker.model.AbstractEntity
org.itracker.model.CustomField
public class CustomField
A custom field that can be added to an Issue.
Allows the user to dynamically extend the set of attributes/properties of the Issue class.
A CustomField must be configured to be used in a Project in order to extend the attributes/properties of all Issues created for that project. A CustomField may be used in more than 1 project. (Project - CustomField is a M-N relathionship).
A CustomField has a type, which indicates the data type of its value.
The special type LIST, allows to associate a list of string
options to a CustomField, which are the enumeration of possible values for
that field.
Each option value is represented by a CustomFieldValue instance. There's a
1-N relationship between CustomField - CustomFieldValue. A CustomFieldValue
can only belong to 1 CustomField (composition).
A value of a CustomField for a given Issue is represented by an IssueField instance. (CustomField - IssueField is a 1-N relationship).
CustomFieldValue,
IssueField,
Serialized Form| Nested Class Summary | |
|---|---|
static class |
CustomField.DateFormat
Date format for fields of type DATE. |
static class |
CustomField.NameComparator
|
static class |
CustomField.Type
Enumeration of possible data types. |
| Nested classes/interfaces inherited from class org.itracker.model.AbstractEntity |
|---|
AbstractEntity.CreateDateComparator, AbstractEntity.IdComparator, AbstractEntity.LastModifiedDateComparator |
| Field Summary | |
|---|---|
static SimpleDateFormat |
DEFAULT_DATE_FORMAT
Dateformat able to parse datepicker generated date string (dd/MM/yyyy) |
static Comparator<CustomField> |
NAME_COMPARATOR
|
| Fields inherited from class org.itracker.model.AbstractEntity |
|---|
CREATE_DATE_COMPARATOR, ID_COMPARATOR, LAST_MODIFIED_DATE_COMPARATOR |
| Constructor Summary | |
|---|---|
CustomField()
Default constructor (required by Hibernate). |
|
CustomField(String name,
CustomField.Type type)
Deprecated. |
|
| Method Summary | |
|---|---|
void |
addOption(String value,
String label)
Deprecated. this can not be in the entity, replace by Utility or service. |
void |
checkAssignable(String value,
Locale locale,
ResourceBundle bundle)
Checks if the given value is assignable to this custom field. |
String |
getDateFormat()
|
CustomField.Type |
getFieldType()
|
String |
getOptionNameByValue(String optionValue)
Deprecated. this can not be in the entity, replace by Utility or service. FIXME: Don't know, this seems not to be working. Removed use from FormatCustomFieldTag |
List<CustomFieldValue> |
getOptions()
|
boolean |
isRequired()
|
boolean |
isSortOptionsByName()
|
void |
setDateFormat(String dateFormat)
|
void |
setFieldType(CustomField.Type type)
|
void |
setOptions(List<CustomFieldValue> options)
|
void |
setRequired(boolean required)
|
void |
setSortOptionsByName(boolean sortOptionsByName)
|
String |
toString()
|
| Methods inherited from class org.itracker.model.AbstractEntity |
|---|
clone, compareTo, equals, getCreateDate, getId, getLastModifiedDate, hashCode, isNew, setCreateDate, setId, setLastModifiedDate |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Field Detail |
|---|
public static final Comparator<CustomField> NAME_COMPARATOR
public static final SimpleDateFormat DEFAULT_DATE_FORMAT
| Constructor Detail |
|---|
public CustomField()
PENDING: should be private so that it can only be used by
Hibernate, to ensure that the fields which form an instance's identity
are always initialized/never null.
@Deprecated
public CustomField(String name,
CustomField.Type type)
| Method Detail |
|---|
public CustomField.Type getFieldType()
public void setFieldType(CustomField.Type type)
public String getDateFormat()
public void setDateFormat(String dateFormat)
public boolean isRequired()
public void setRequired(boolean required)
public List<CustomFieldValue> getOptions()
public void setOptions(List<CustomFieldValue> options)
public void addOption(String value,
String label)
New options are put at the end of the list even if they should be sorted.
This method is mainly used to build a new custom field so it can be saved
later.
value - the option valuelabel - the label/name for the new optionpublic String getOptionNameByValue(String optionValue)
FormatCustomFieldTag
optionValue - the value to lookup the name for
public boolean isSortOptionsByName()
public void setSortOptionsByName(boolean sortOptionsByName)
sortOptionsByName - public String toString()
toString in class Object
public void checkAssignable(String value,
Locale locale,
ResourceBundle bundle)
throws IssueException
value - custom field datalocale - bundle -
IssueException - if it isn'tIssueField.setValue(String, Locale, ResourceBundle)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||