Package com.adobe.granite.ui.components
Class ComponentHelper.Options
- java.lang.Object
-
- com.adobe.granite.ui.components.Options
-
- com.adobe.granite.ui.components.ComponentHelper.Options
-
- Enclosing class:
- ComponentHelper
public static class ComponentHelper.Options extends Options
An options to be passed to the included resource's renderer.
-
-
Constructor Summary
Constructors Constructor Description Options()
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Resource
layoutResource()
Returns the layout resource.ComponentHelper.Options
layoutResource(Resource r)
Sets the layout resource.ComponentHelper.Options
rootField(boolean flag)
Setstrue
to make the renderer (the field) should render itself as root field;false
otherwise.ComponentHelper.Options
tag(Tag tag)
Sets the tag.
-
-
-
Method Detail
-
tag
@Nonnull public ComponentHelper.Options tag(@CheckForNull Tag tag)
Sets the tag.
-
rootField
@Nonnull public ComponentHelper.Options rootField(boolean flag)
Setstrue
to make the renderer (the field) should render itself as root field;false
otherwise.A root field is a field that acts in its own context, instead of as part of a composite field. For example, sizing field consists of weight and height fields. So sizing field is a composite field and wants to leverage the existing number field for width and height. In this case when sizing field is including (
ComponentHelper.include(Resource, Options)
) the number field, it should set this option asfalse
.The field implementation is free to interpret the exact behaviour of root/non-root field. Most likely scenario, the root field will handle it own sizing state (e.g. inline-block/block state), while non root field will not, where the parent composite field is managing it.
-
layoutResource
@CheckForNull public Resource layoutResource()
Returns the layout resource.- Returns:
- the layout resource
-
layoutResource
@Nonnull public ComponentHelper.Options layoutResource(@CheckForNull Resource r)
Sets the layout resource.- Parameters:
r
- the layout resource to set- Returns:
- this instance
-
-