public abstract class ComponentsHelper
extends java.lang.Object
Constructor and Description |
---|
ComponentsHelper() |
Modifier and Type | Method and Description |
---|---|
static int |
convertFromSizeUnit(SizeUnit unit)
Deprecated.
|
static SizeUnit |
convertToSizeUnit(int unit)
Deprecated.
|
static void |
createActions(ListComponent owner)
Deprecated.
|
static void |
createActions(ListComponent owner,
java.util.EnumSet<ListActionType> actions)
Deprecated.
|
static boolean |
createActionsByMetaAnnotations(PickerField pickerField)
Deprecated.
|
static void |
fillErrorMessages(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.Focusable |
focusChildComponent(ComponentContainer container) |
static void |
focusComponent(Component component)
Focus component (or its nearest focusable parent) and activate all its parents,
for instance: select Tab, expand GroupBox.
|
static Component |
getComponent(ComponentContainer container,
java.lang.String id) |
static java.lang.String |
getComponentHeight(Component c) |
static java.lang.String |
getComponentPath(Component c) |
static java.util.Collection<Component> |
getComponents(ComponentContainer 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 FrameOwner |
getFrameController(Frame frame)
Deprecated.
Simply use
Frame.getFrameOwner() call. |
static java.lang.String |
getFullFrameId(Frame frame) |
static Window |
getParentWindow(ScreenFragment frameOwner) |
static Screen |
getScreen(ScreenFragment frameOwner) |
static ScreenContext |
getScreenContext(Component.BelongToFrame component)
Get screen context for UI component.
|
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 Window |
getWindowNN(Component.BelongToFrame component) |
static void |
handleFilteredAttributes(Field component,
Datasource datasource,
MetaPropertyPath mpp)
Deprecated.
Is not required anymore. Implemented in
ValueBinder . |
static boolean |
hasFullHeight(Component c)
Deprecated.
|
static boolean |
hasFullWidth(Component c)
Deprecated.
|
static void |
traverseComponents(ComponentContainer container,
java.util.function.Consumer<Component> visitor)
Visit all components below the specified container.
|
static void |
traverseValidatable(ComponentContainer container,
java.util.function.Consumer<Validatable> visitor)
Visit all
Validatable components below the specified container. |
static boolean |
walkComponents(ComponentContainer container,
ComponentFinder finder)
Iterates over all components applying finder instance.
|
static void |
walkComponents(ComponentContainer container,
ComponentVisitor visitor)
Visit all components below the specified container.
|
public static java.util.Collection<Component> getComponents(ComponentContainer container)
container
- container to start frompublic static void traverseComponents(ComponentContainer container, java.util.function.Consumer<Component> visitor)
container
- container to start fromvisitor
- visitor instancepublic static void traverseValidatable(ComponentContainer container, java.util.function.Consumer<Validatable> visitor)
Validatable
components below the specified container.container
- container to start fromvisitor
- visitor instance@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(ComponentContainer 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(ComponentContainer container, ComponentVisitor visitor)
container
- container to start fromvisitor
- visitor instancepublic static boolean walkComponents(ComponentContainer container, ComponentFinder finder)
true
.
If no component is found returns false
.container
- container to start fromfinder
- finder instancetrue
if component has been found, false
otherwisepublic static java.lang.String getFilterComponentPath(Filter filter)
@Nullable public static Window getWindow(Component.BelongToFrame component)
component
- component instance@Nonnull public static Window getWindowNN(Component.BelongToFrame component)
public static ScreenContext getScreenContext(Component.BelongToFrame component)
component
- componentjava.lang.IllegalStateException
- in case window cannot be inferred@Nullable public static Screen getScreen(ScreenFragment frameOwner)
@Nullable public static Window getParentWindow(ScreenFragment frameOwner)
@Nullable public static Window getWindowImplementation(Component.BelongToFrame component)
component
- component instance@Deprecated public static FrameOwner getFrameController(Frame frame)
Frame.getFrameOwner()
call.public 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 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 getComponentHeight(Component c)
@Deprecated public static boolean hasFullWidth(Component c)
@Deprecated public static boolean hasFullHeight(Component c)
@Deprecated public static void createActions(ListComponent owner)
owner
- List, Table or Tree component@Deprecated public static void createActions(ListComponent owner, java.util.EnumSet<ListActionType> actions)
owner
- List, Table or Tree componentactions
- set of actions to createpublic static void fillErrorMessages(Validatable component, ValidationException e, ValidationErrors errors)
component
- validatable componente
- exceptionerrors
- errors container@Deprecated public static void handleFilteredAttributes(Field component, Datasource datasource, MetaPropertyPath mpp)
ValueBinder
.public static int findActionById(java.util.List<Action> actionList, java.lang.String actionId)
@Deprecated public static boolean createActionsByMetaAnnotations(PickerField pickerField)
GuiActionSupport.createActionsByMetaAnnotations(PickerField)
instead.Lookup
annotation on entity attribute to the given PickerField.@Deprecated public static SizeUnit convertToSizeUnit(int unit)
@Deprecated public static int convertFromSizeUnit(SizeUnit unit)
public static void focusComponent(Component component)
component
- component@Nullable public static Component.Focusable focusChildComponent(ComponentContainer container)