public abstract class ComponentsHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String[] |
UNIT_SYMBOLS |
Constructor and Description |
---|
ComponentsHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
createActions(ListComponent owner)
Creates standard Create, Edit and Remove actions for the component
|
static void |
createActions(ListComponent owner,
java.util.EnumSet<ListActionType> actions)
Creates standard actions for the component
|
static boolean |
createActionsByMetaAnnotations(PickerField pickerField)
INTERNAL.
|
static void |
fillErrorMessages(Component.Validatable component,
ValidationException e,
ValidationErrors errors)
Place component with error message to validation errors container.
|
static Action |
findAction(java.lang.String actionName,
Frame frame)
Searches for an action by name.
|
static int |
findActionById(java.util.List<Action> actionList,
java.lang.String actionId) |
static Component |
findComponent(Frame frame,
java.lang.String id)
Searches for a component by identifier, down by the hierarchy of frames.
|
static Component |
getComponent(Component.Container container,
java.lang.String id) |
static java.lang.String |
getComponentHeigth(Component c) |
static java.lang.String |
getComponentPath(Component c) |
static java.util.Collection<Component> |
getComponents(Component.Container container)
Returns the collection of components within the specified container and all of its children.
|
static java.lang.String |
getComponentWidth(Component c) |
static java.lang.String |
getFilterComponentPath(Filter filter) |
static Component |
getFrameComponent(Frame frame,
java.lang.String id) |
static Frame |
getFrameController(Frame frame) |
static java.lang.String |
getFullFrameId(Frame frame) |
static Window |
getWindow(Component.BelongToFrame component)
Get the topmost window for the specified component.
|
static Component |
getWindowComponent(Window window,
java.lang.String id) |
static Window |
getWindowImplementation(Component.BelongToFrame component)
Get the topmost window for the specified component.
|
static void |
handleFilteredAttributes(Field component,
Datasource datasource,
MetaPropertyPath mpp)
Set field's "required" flag to false if the value has been filtered by Row Level Security
This is necessary to allow user to submit form with filtered attribute even if attribute is required
|
static boolean |
hasFullHeight(Component c) |
static boolean |
hasFullWidth(Component c) |
static int |
indexOf(java.lang.Iterable<Component> components,
Component component)
Deprecated.
Use guava
Iterables.indexOf(Iterable, Predicate) |
static java.lang.String |
preprocessHtmlMessage(java.lang.String message)
Converts \n and \t symbols to HTML form.
|
static boolean |
walkComponents(Component.Container container,
ComponentFinder finder)
Find first component by predicate
|
static void |
walkComponents(Component.Container container,
ComponentVisitor visitor)
Visit all components below the specified container.
|
public static java.util.Collection<Component> getComponents(Component.Container container)
container
- container to start from@Nullable public static Component getWindowComponent(Window window, java.lang.String id)
@Nullable public static Component getFrameComponent(Frame frame, java.lang.String id)
@Nullable public static Component getComponent(Component.Container container, java.lang.String id)
@Nullable public static Component findComponent(Frame frame, java.lang.String id)
frame
- frame to start fromid
- component identifierpublic static void walkComponents(Component.Container container, ComponentVisitor visitor)
container
- container to start fromvisitor
- visitor instancepublic static boolean walkComponents(Component.Container container, ComponentFinder finder)
container
- container to start fromfinder
- finder instancepublic static java.lang.String getFilterComponentPath(Filter filter)
@Nullable public static Window getWindow(Component.BelongToFrame component)
component
- component instance@Nullable public static Window getWindowImplementation(Component.BelongToFrame component)
component
- component instancepublic static java.lang.String getFullFrameId(Frame frame)
@Nullable public static Action findAction(java.lang.String actionName, Frame frame)
actionName
- action name, can be a path to an action contained in some Component.ActionsHolder
frame
- current framejava.lang.IllegalStateException
- if the component denoted by the path doesn't exist or is not an ActionsHolderpublic static java.lang.String getComponentPath(Component c)
public static java.lang.String getComponentWidth(Component c)
public static java.lang.String getComponentHeigth(Component c)
public static boolean hasFullWidth(Component c)
public static boolean hasFullHeight(Component c)
public static void createActions(ListComponent owner)
owner
- List, Table or Tree componentpublic static void createActions(ListComponent owner, java.util.EnumSet<ListActionType> actions)
owner
- List, Table or Tree componentactions
- set of actions to createpublic static java.lang.String preprocessHtmlMessage(java.lang.String message)
message
- HTML textpublic static void fillErrorMessages(Component.Validatable component, ValidationException e, ValidationErrors errors)
component
- validatable componente
- exceptionerrors
- errors container@Deprecated public static int indexOf(java.lang.Iterable<Component> components, Component component)
Iterables.indexOf(Iterable, Predicate)
public static void handleFilteredAttributes(Field component, Datasource datasource, MetaPropertyPath mpp)
public static int findActionById(java.util.List<Action> actionList, java.lang.String actionId)
public static boolean createActionsByMetaAnnotations(PickerField pickerField)
Lookup
annotation on entity attribute to the given PickerField.