public static class ResourceElement.Builder extends Object
| Constructor and Description |
|---|
Builder(String baseId,
String resource,
Metadata metadata,
MbuiContext mbuiContext) |
| Modifier and Type | Method and Description |
|---|---|
ResourceElement.Builder |
addComplexObjectAttribute(String name)
Adds a complex attribute of type
OBJECT. |
ResourceElement.Builder |
addComplexObjectAttribute(String name,
FormValidation formValidation)
Adds a complex attribute of type
OBJECT. |
ResourceElement |
build() |
ResourceElement.Builder |
column(String name,
Column.RenderCallback<NamedNode,?> render) |
ResourceElement.Builder |
columns(String first,
String... rest)
Columns for the main table.
|
ResourceElement.Builder |
onAdd(Callback callback)
Defines the callback which is executed to add the main resource.
|
ResourceElement.Builder |
onCrud(Callback callback)
Defines the callback which is used after all CRUD actions.
|
ResourceElement.Builder |
setComplexListAttribute(String name,
Iterable<String> columns)
Sets the complex attribute of type
LIST. |
ResourceElement.Builder |
setComplexListAttribute(String name,
Iterable<String> columns,
Function<ModelNode,String> identifier)
Sets the complex attribute of type
LIST. |
ResourceElement.Builder |
setComplexListAttribute(String name,
Iterable<String> columns,
Iterable<String> addAttributes)
Sets the complex attribute of type
LIST. |
ResourceElement.Builder |
setComplexListAttribute(String name,
Iterable<String> columns,
Iterable<String> addAttributes,
Function<ModelNode,String> identifier)
Sets the complex attribute of type
LIST. |
ResourceElement.Builder |
setComplexListAttribute(String name,
String column)
Sets the complex attribute of type
LIST. |
ResourceElement.Builder |
setComplexListAttribute(String name,
String column,
Function<ModelNode,String> identifier)
Sets the complex attribute of type
LIST. |
ResourceElement.Builder |
setComplexListAttribute(String name,
String column,
Iterable<String> addAttributes)
Sets the complex attribute of type
LIST. |
ResourceElement.Builder |
setComplexListAttribute(String name,
String column,
Iterable<String> addAttributes,
Function<ModelNode,String> identifier)
Sets the complex attribute of type
LIST. |
ResourceElement.Builder |
type(String type)
Overrides the human readable type of the main resource which is built by default using the
LabelBuilder. |
public Builder(String baseId, String resource, Metadata metadata, MbuiContext mbuiContext)
public ResourceElement.Builder type(String type)
LabelBuilder.public ResourceElement.Builder columns(@NonNls String first, @NonNls String... rest)
public ResourceElement.Builder column(String name, Column.RenderCallback<NamedNode,?> render)
public ResourceElement.Builder addComplexObjectAttribute(String name)
OBJECT. The operation checks whether the resource contains the
complex attribute.public ResourceElement.Builder addComplexObjectAttribute(String name, FormValidation formValidation)
OBJECT. The operation checks whether the resource contains the
complex attribute. Also adds a form validation for the specific complex attribute form.public ResourceElement.Builder setComplexListAttribute(String name, String column)
LIST.name - The name of the complex attributecolumn - The column for the table on the sub-pagepublic ResourceElement.Builder setComplexListAttribute(String name, String column, Iterable<String> addAttributes)
LIST.name - The name of the complex attributecolumn - The column for the table on the sub-pageaddAttributes - attributes for the add resource dialogpublic ResourceElement.Builder setComplexListAttribute(String name, String column, Function<ModelNode,String> identifier)
LIST.name - The name of the complex attributecolumn - The column for the table on the sub-pageidentifier - function to maintain the selection after updating the table entriespublic ResourceElement.Builder setComplexListAttribute(String name, String column, Iterable<String> addAttributes, Function<ModelNode,String> identifier)
LIST.name - The name of the complex attributecolumn - The column for the table on the sub-pageaddAttributes - attributes for the add resource dialogidentifier - function to maintain the selection after updating the table entriespublic ResourceElement.Builder setComplexListAttribute(String name, Iterable<String> columns)
LIST.name - The name of the complex attributecolumns - The columns for the table on the sub-pagepublic ResourceElement.Builder setComplexListAttribute(String name, Iterable<String> columns, Iterable<String> addAttributes)
LIST.name - The name of the complex attributecolumns - The columns for the table on the sub-pageaddAttributes - attributes for the add resource dialogpublic ResourceElement.Builder setComplexListAttribute(String name, Iterable<String> columns, Function<ModelNode,String> identifier)
LIST.name - The name of the complex attributecolumns - The columns for the table on the sub-pageidentifier - function to maintain the selection after updating the table entriespublic ResourceElement.Builder setComplexListAttribute(String name, Iterable<String> columns, Iterable<String> addAttributes, Function<ModelNode,String> identifier)
LIST.name - The name of the complex attributecolumns - The columns for the table on the sub-pageaddAttributes - attributes for the add resource dialogidentifier - function to maintain the selection after updating the table entriespublic ResourceElement.Builder onAdd(Callback callback)
CrudOperations.add(String, String, AddressTemplate, CrudOperations.AddCallback) is used (which opens an
add-resource-dialog with all required
properties of the main resource).
Use this method if you need to customize the add-resource-dialog somehow, e.g. if there's a required
complex attribute which has to be specified).public ResourceElement.Builder onCrud(Callback callback)
public ResourceElement build()
Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.