Package org.javlo.fields
Class Field
- java.lang.Object
-
- org.javlo.fields.Field
-
- All Implemented Interfaces:
Cloneable
,Comparable<Field>
,IRestItem
- Direct Known Subclasses:
FieldBoolean
,FieldColor
,FieldDate
,FieldEmail
,FieldEnormousText
,FieldFile
,FieldFont
,FieldHelp
,FieldInternalLink
,FieldLargeText
,FieldList
,FieldMultiList
,FieldNumber
,FieldSmallText
,FieldWysiwyg
,Heading
,MetaField
,OpenList
,OpenMultiList
,StaticContent
public class Field extends Object implements Cloneable, IRestItem, Comparable<Field>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
Field.FieldBean
-
Field Summary
Fields Modifier and Type Field Description protected IContentVisualComponent
comp
protected static String
DEFAULT_SEARCH_TYPE
protected GlobalContext
globalContext
protected I18nAccess
i18nAccess
static String
LABEL_CSS
protected static int
MESSAGE_ERROR
protected static int
MESSAGE_INFO
Properties
properties
static String
SMALL_PART_SIZE
static String
SMALL_VALUE_SIZE
protected StaticConfig
staticConfig
static String
VALUE_SIZE
-
Method Summary
-
-
-
Field Detail
-
DEFAULT_SEARCH_TYPE
protected static final String DEFAULT_SEARCH_TYPE
- See Also:
- Constant Field Values
-
LABEL_CSS
public static String LABEL_CSS
-
VALUE_SIZE
public static String VALUE_SIZE
-
SMALL_VALUE_SIZE
public static String SMALL_VALUE_SIZE
-
SMALL_PART_SIZE
public static String SMALL_PART_SIZE
-
MESSAGE_ERROR
protected static final int MESSAGE_ERROR
- See Also:
- Constant Field Values
-
MESSAGE_INFO
protected static final int MESSAGE_INFO
- See Also:
- Constant Field Values
-
properties
public Properties properties
-
staticConfig
protected transient StaticConfig staticConfig
-
globalContext
protected transient GlobalContext globalContext
-
i18nAccess
protected transient I18nAccess i18nAccess
-
comp
protected IContentVisualComponent comp
-
-
Method Detail
-
getFormatedValue
public String getFormatedValue(ContentContext ctx)
-
newInstance
public Field newInstance(IContentVisualComponent inComp)
-
getList
public Map<String,String> getList(ContentContext ctx, String listName, Locale locale) throws Exception
- Throws:
Exception
-
getInputName
public String getInputName()
-
getInputLabelName
public String getInputLabelName()
-
validate
public boolean validate()
-
isValid
public boolean isValid()
-
getEditLabelCode
protected String getEditLabelCode()
-
getReferenceComponent
public DynamicComponent getReferenceComponent(ContentContext ctx) throws Exception
for field with i18n false, the value come from default language version of the page.- Throws:
Exception
-
isI18n
public boolean isI18n()
return true if this field is translated.- Returns:
-
getReferenceFieldView
protected String getReferenceFieldView(ContentContext ctx) throws Exception
render the field when he is used as reference value in a other language.- Parameters:
ctx
-- Returns:
- Throws:
Exception
-
referenceEditCode
protected String referenceEditCode(ContentContext ctx) throws Exception
- Throws:
Exception
-
referenceViewCode
protected String referenceViewCode(ContentContext ctx) throws Exception
- Throws:
Exception
-
getReferenceValue
protected String getReferenceValue(ContentContext ctx) throws Exception
- Throws:
Exception
-
getReferenceFormatedValue
protected String getReferenceFormatedValue(ContentContext ctx) throws Exception
- Throws:
Exception
-
getSpecialClass
public String getSpecialClass()
-
getForceModifFieldName
public String getForceModifFieldName()
-
getEditXHTMLCode
public final String getEditXHTMLCode(ContentContext ctx) throws Exception
- Throws:
Exception
-
getEditXHTMLCode
public String getEditXHTMLCode(ContentContext ctx, boolean search) throws Exception
- Throws:
Exception
-
getSearchEditXHTMLCode
public String getSearchEditXHTMLCode(ContentContext ctx) throws Exception
- Throws:
Exception
-
getFieldPrefix
public String getFieldPrefix(ContentContext ctx)
-
getDefaultPrefix
public String getDefaultPrefix()
-
getDefaultSuffix
public String getDefaultSuffix()
-
getViewXHTMLCode
public String getViewXHTMLCode(ContentContext ctx) throws Exception
- Throws:
Exception
-
getViewListXHTMLCode
public String getViewListXHTMLCode(ContentContext ctx) throws Exception
- Throws:
Exception
-
isDiplayedInList
public boolean isDiplayedInList(ContentContext ctx)
-
getCssClass
protected String getCssClass()
-
getDisplayValue
public String getDisplayValue(ContentContext ctx, Locale locale) throws Exception
return the value "displayable"- Parameters:
locale
-- Returns:
- Throws:
Exception
-
getSearchType
public String getSearchType()
-
getFieldSuffix
public String getFieldSuffix(ContentContext ctx)
-
getValue
public String getValue(Locale locale)
try to return value with locale and return default value if not.- Parameters:
locale
-- Returns:
-
getValues
public List<String> getValues(ContentContext ctx, Locale locale) throws Exception
try to return values with locale and return default value if not.- Parameters:
locale
-- Returns:
- Throws:
Exception
-
getValue
public String getValue()
-
getXHTMLValue
public String getXHTMLValue()
-
getHtml
public String getHtml(ContentContext ctx)
-
getInitValue
public String getInitValue()
-
getValues
public Collection<String> getValues()
-
setValue
protected void setValue(Collection<String> values)
-
isSearch
public boolean isSearch()
-
isNeeded
public boolean isNeeded()
-
getMaxSize
public Integer getMaxSize()
-
getWidthEdit
public int getWidthEdit()
-
getOpenRow
public String getOpenRow(ContentContext ctx)
-
getCloseRow
public String getCloseRow(ContentContext ctx)
-
setLast
public void setLast(boolean last)
-
isLast
public boolean isLast()
-
setFirst
public void setFirst(boolean first)
-
isFirst
public boolean isFirst()
-
getMinSize
public Integer getMinSize()
-
getOrder
public int getOrder()
-
setValue
public void setValue(String value)
-
setLabelValue
public void setLabelValue(String value)
-
isLabelDisplayed
public boolean isLabelDisplayed()
-
defaultLabelDisplayed
public boolean defaultLabelDisplayed()
-
getCSSClass
public String getCSSClass()
-
getTag
public String getTag()
-
isLabelEditable
public boolean isLabelEditable()
-
isViewDisplayed
public boolean isViewDisplayed()
-
isPertinent
public boolean isPertinent(ContentContext ctx)
-
getId
public String getId()
-
setId
public void setId(String id)
-
getType
public String getType()
-
getName
public String getName()
-
setName
public void setName(String name)
-
getLabel
protected String getLabel(ContentContext ctx, Locale locale)
-
getUnity
protected String getUnity(ContentContext ctx, Locale locale)
-
getUnity
protected String getUnity(ContentContext ctx)
-
getSearchLabel
protected String getSearchLabel(ContentContext ctx, Locale locale)
-
getUserLabel
protected final String getUserLabel()
-
getUserLabel
public String getUserLabel(ContentContext ctx, Locale locale)
-
setProperties
public void setProperties(Properties properties)
-
getUnicName
protected String getUnicName()
-
process
public boolean process(ContentContext ctx)
process the field- Parameters:
request
-- Returns:
- true if the field is modified.
-
getStaticConfig
public StaticConfig getStaticConfig()
-
setStaticConfig
public void setStaticConfig(StaticConfig staticConfig)
-
getI18nAccess
public I18nAccess getI18nAccess()
-
setI18nAccess
public void setI18nAccess(I18nAccess access)
-
getGlobalContext
public GlobalContext getGlobalContext()
-
setGlobalContext
public void setGlobalContext(GlobalContext globalContext)
-
isNeedRefresh
public boolean isNeedRefresh()
-
setNeedRefresh
public void setNeedRefresh(boolean needRefresh)
-
getMessage
public String getMessage()
-
setMessage
public void setMessage(String message)
-
getMessageType
public int getMessageType()
-
getMessageTypeCSSClass
public String getMessageTypeCSSClass()
-
setMessageType
public void setMessageType(int messageType)
-
getLabel
public String getLabel()
-
setLabel
public void setLabel(String label)
-
setReadOnly
public void setReadOnly(boolean readOnly)
-
isReadOnly
public boolean isReadOnly()
-
isWrapped
public boolean isWrapped()
-
fillRequest
public void fillRequest(ContentContext ctx)
-
newFieldBean
protected Field.FieldBean newFieldBean(ContentContext ctx)
-
getCurrentLocale
public Locale getCurrentLocale()
-
setCurrentLocale
public void setCurrentLocale(Locale currentLocale)
-
isContentCachable
public boolean isContentCachable()
-
initContent
public boolean initContent(ContentContext ctx) throws Exception
- Throws:
Exception
-
reload
public void reload(ContentContext ctx)
-
isTitle
public boolean isTitle()
-
getPageDescription
public String getPageDescription()
-
getReference
public Field getReference(ContentContext ctx) throws Exception
- Throws:
Exception
-
renderSelect
public String renderSelect(ContentContext ctx, String label, String inValue, Map<String,String> inValues, boolean sort, String cssClass) throws Exception
- Throws:
Exception
-
isRealContent
public boolean isRealContent(ContentContext ctx)
-
getSize
public String getSize(ContentContext ctx)
return the size of the component- Parameters:
ctx
-- Returns:
- large, small or normal
-
getContentAsMap
public Map<String,Object> getContentAsMap(ContentContext ctx) throws Exception
- Specified by:
getContentAsMap
in interfaceIRestItem
- Throws:
Exception
-
search
public boolean search(ContentContext ctx, String query)
-
compareTo
public int compareTo(Field o)
- Specified by:
compareTo
in interfaceComparable<Field>
-
getBean
public Field.FieldBean getBean(ContentContext ctx)
-
getPlaceholder
public String getPlaceholder()
-
setPlaceholder
public void setPlaceholder(String placeholder)
-
isValueTranslatable
protected boolean isValueTranslatable()
-
transflateFrom
public boolean transflateFrom(ContentContext ctx, ITranslator translator, String lang)
-
main
public static void main(String[] args)
-
-