Package com.adobe.granite.ui.components
Class Field
- java.lang.Object
-
- com.adobe.granite.ui.components.Field
-
public class Field extends java.lang.ObjectUtility class for form field component.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringHIDE_IN_DEFAULT_CLASSThe name of the CSS class to apply in order to hide empty field components in default mode.static java.lang.StringIS_MIXED_SUFFIXThe suffix that specifies if a property is a mixed value (for bulk editing).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidclearBulkEditMode(javax.servlet.http.HttpServletRequest request)Clears the bulk edit modejava.lang.StringgetRootClass(boolean isEmpty)Returns the CSS class (or space separated class values) that have to be applied to the root element of field component.static java.lang.StringgetRootClass(Config cfg, boolean isEmpty)Returns the CSS class (or space separated class values) that have to be applied to the root element of field component.static java.lang.StringgetRootClass(Config cfg, java.lang.String value)Returns the CSS class (or space separated class values) that have to be applied to the root element of field component.java.lang.StringgetRootClass(java.lang.String value)Returns the CSS class (or space separated class values) that have to be applied to the root element of field component.booleanisBulkEditAllowed()Returnstrueif bulk edit is allowed on this field;falseotherwise.static booleanisBulkEditMode(javax.servlet.http.HttpServletRequest request)Returnstrueif bulk edit mode is set;falseotherwise Bulk edit mode is set if the request has an attributeBULK_EDIT_MODE_ATTRIBUTEwhich has the value oftruestatic booleanisMixed(Config cfg, Value value)Returnstrueif the field is a mixed value;falseotherwise.booleanisMixed(Value value)Returnstrueif the field is a mixed value;falseotherwise.static voidsetBulkEditMode(javax.servlet.http.HttpServletRequest request)Sets the bulk edit mode
-
-
-
Field Detail
-
HIDE_IN_DEFAULT_CLASS
@Nonnull public static java.lang.String HIDE_IN_DEFAULT_CLASS
The name of the CSS class to apply in order to hide empty field components in default mode.
-
IS_MIXED_SUFFIX
@Nonnull public static java.lang.String IS_MIXED_SUFFIX
The suffix that specifies if a property is a mixed value (for bulk editing).
-
-
Constructor Detail
-
Field
public Field()
-
Field
public Field(@Nonnull Config cfg)Creates a new Field object with the given config.- Parameters:
cfg- The config of the component
-
-
Method Detail
-
getRootClass
@Nonnull public java.lang.String getRootClass(boolean isEmpty)
Returns the CSS class (or space separated class values) that have to be applied to the root element of field component. The provided class allows for example to hide empty field components in read only mode.- Parameters:
isEmpty- Indicate if the field is empty- Returns:
- the CSS class (or space separated class values)
-
getRootClass
@Nonnull public java.lang.String getRootClass(@CheckForNull java.lang.String value)Returns the CSS class (or space separated class values) that have to be applied to the root element of field component. The provided class allows for example to hide empty field components in read only mode.- Parameters:
value- The value of the field component- Returns:
- the CSS class (or space separated class values)
-
isMixed
public boolean isMixed(@Nonnull Value value)Returnstrueif the field is a mixed value;falseotherwise. A field is a mixed value if it has a property namedcfg.get("name") + IS_MIXED_SUFFIXwhich has the value oftrue.- Parameters:
value- The form value- Returns:
- True if the field component holds a mixed value, false otherwise
-
isBulkEditAllowed
public boolean isBulkEditAllowed()
Returnstrueif bulk edit is allowed on this field;falseotherwise. A field could be bulk edited if it has a property namedallowBulkEditwhich has the value oftrue.- Returns:
- True if the field component could be bulk edited, false otherwise
-
isBulkEditMode
public static boolean isBulkEditMode(@Nonnull javax.servlet.http.HttpServletRequest request)Returnstrueif bulk edit mode is set;falseotherwise Bulk edit mode is set if the request has an attributeBULK_EDIT_MODE_ATTRIBUTEwhich has the value oftrue- Parameters:
request- The request providing the parameter- Returns:
- True if the bulk edit mode is set
-
setBulkEditMode
public static void setBulkEditMode(@Nonnull javax.servlet.http.HttpServletRequest request)Sets the bulk edit mode- Parameters:
request- The request that would hold the parameter
-
clearBulkEditMode
public static void clearBulkEditMode(@Nonnull javax.servlet.http.HttpServletRequest request)Clears the bulk edit mode- Parameters:
request- The request that was holding the parameter
-
getRootClass
@Nonnull public static java.lang.String getRootClass(@Nonnull Config cfg, boolean isEmpty)Returns the CSS class (or space separated class values) that have to be applied to the root element of field component. The provided class allows for example to hide empty field components in read only mode.- Parameters:
cfg- The config object of the field componentisEmpty- Indicate if the field is empty- Returns:
- the CSS class (or space separated class values)
-
getRootClass
@Nonnull public static java.lang.String getRootClass(@Nonnull Config cfg, @CheckForNull java.lang.String value)Returns the CSS class (or space separated class values) that have to be applied to the root element of field component. The provided class allows for example to hide empty field components in read only mode.- Parameters:
cfg- The config object of the field componentvalue- The value of the field component- Returns:
- the CSS class (or space separated class values)
-
isMixed
public static boolean isMixed(@Nonnull Config cfg, @Nonnull Value value)Returnstrueif the field is a mixed value;falseotherwise. A field is a mixed value if it has a property namedcfg.get("name") + IS_MIXED_SUFFIXwhich has the value oftrue.- Parameters:
cfg- The config object of the field componentvalue- The form value- Returns:
- True if the field component holds a mixed value, false otherwise
-
-