public class Field
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
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.
|
static java.lang.String |
IS_MIXED_SUFFIX
The suffix that specifies if a property is a mixed value (for bulk editing).
|
Constructor and Description |
---|
Field() |
Field(Config cfg)
Creates a new Field object with the given config.
|
Modifier and Type | Method and Description |
---|---|
static void |
clearBulkEditMode(HttpServletRequest request)
Clears the bulk edit mode
|
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.
|
static java.lang.String |
getRootClass(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.String |
getRootClass(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.String |
getRootClass(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.
|
boolean |
isBulkEditAllowed()
Returns
true if bulk edit is allowed on this field; false
otherwise. |
static boolean |
isBulkEditMode(HttpServletRequest request)
Returns
true if bulk edit mode is set; false otherwise
Bulk edit mode is set if the request has an attribute
BULK_EDIT_MODE_ATTRIBUTE which has the value of true |
static boolean |
isMixed(Config cfg,
Value value)
Returns
true if the field is a mixed value; false otherwise. |
boolean |
isMixed(Value value)
Returns
true if the field is a mixed value; false otherwise. |
static void |
setBulkEditMode(HttpServletRequest request)
Sets the bulk edit mode
|
@Nonnull public static java.lang.String HIDE_IN_DEFAULT_CLASS
@Nonnull public static java.lang.String IS_MIXED_SUFFIX
public Field()
public Field(@Nonnull Config cfg)
cfg
- The config of the component@Nonnull public java.lang.String getRootClass(boolean isEmpty)
isEmpty
- Indicate if the field is empty@Nonnull public java.lang.String getRootClass(@CheckForNull java.lang.String value)
value
- The value of the field componentpublic boolean isMixed(@Nonnull Value value)
true
if the field is a mixed value; false
otherwise.
A field is a mixed value if it has a property named
cfg.get("name") + IS_MIXED_SUFFIX
which has the value of
true
.value
- The form valuepublic boolean isBulkEditAllowed()
true
if bulk edit is allowed on this field; false
otherwise.
A field could be bulk edited if it has a property named allowBulkEdit
which has the value of true
.public static boolean isBulkEditMode(@Nonnull HttpServletRequest request)
true
if bulk edit mode is set; false
otherwise
Bulk edit mode is set if the request has an attribute
BULK_EDIT_MODE_ATTRIBUTE
which has the value of true
request
- The request providing the parameterpublic static void setBulkEditMode(@Nonnull HttpServletRequest request)
request
- The request that would hold the parameterpublic static void clearBulkEditMode(@Nonnull HttpServletRequest request)
request
- The request that was holding the parameter@Nonnull public static java.lang.String getRootClass(@Nonnull Config cfg, boolean isEmpty)
cfg
- The config object of the field componentisEmpty
- Indicate if the field is empty@Nonnull public static java.lang.String getRootClass(@Nonnull Config cfg, @CheckForNull java.lang.String value)
cfg
- The config object of the field componentvalue
- The value of the field componentpublic static boolean isMixed(@Nonnull Config cfg, @Nonnull Value value)
true
if the field is a mixed value; false
otherwise.
A field is a mixed value if it has a property named
cfg.get("name") + IS_MIXED_SUFFIX
which has the value of
true
.cfg
- The config object of the field componentvalue
- The form valueCopyright © 2010 - 2020 Adobe. All Rights Reserved