Package org.jboss.hal.core.mbui
Class ResourceElement.Builder
- java.lang.Object
-
- org.jboss.hal.core.mbui.ResourceElement.Builder
-
- Enclosing class:
- ResourceElement
public static class ResourceElement.Builder extends Object
-
-
Constructor Summary
Constructors Constructor Description Builder(String baseId, String resource, Metadata metadata, MbuiContext mbuiContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourceElement.BuilderaddComplexObjectAttribute(String name)Adds a complex attribute of typeOBJECT.ResourceElement.BuilderaddComplexObjectAttribute(String name, FormValidation formValidation)Adds a complex attribute of typeOBJECT.ResourceElement.BuilderaddComplexObjectAttributeForm(String name, Form<ModelNode> form)Adds a custom form for a complex attribute of typeOBJECTResourceElementbuild()ResourceElement.Buildercolumn(String name, Column.RenderCallback<NamedNode,String> render)ResourceElement.Buildercolumns(String first, String... rest)Columns for the main table.ResourceElement.BuildercustomFormItem(String attribute, FormItemProvider formItemProvider)Sets a custom form itemResourceElement.BuildernameColumn()ResourceElement.BuilderonAdd(Callback callback)Defines the callback which is executed to add the main resource.ResourceElement.BuilderonCrud(Callback callback)Defines the callback which is used after all CRUD actions.ResourceElement.BuildersetComplexListAttribute(String name, Iterable<String> columns)Sets the complex attribute of typeLIST.ResourceElement.BuildersetComplexListAttribute(String name, Iterable<String> columns, Iterable<String> addAttributes)Sets the complex attribute of typeLIST.ResourceElement.BuildersetComplexListAttribute(String name, Iterable<String> columns, Iterable<String> addAttributes, Function<ModelNode,String> identifier)Sets the complex attribute of typeLIST.ResourceElement.BuildersetComplexListAttribute(String name, Iterable<String> columns, Function<ModelNode,String> identifier)Sets the complex attribute of typeLIST.ResourceElement.BuildersetComplexListAttribute(String name, String column)Sets the complex attribute of typeLIST.ResourceElement.BuildersetComplexListAttribute(String name, String column, Iterable<String> addAttributes)Sets the complex attribute of typeLIST.ResourceElement.BuildersetComplexListAttribute(String name, String column, Iterable<String> addAttributes, Function<ModelNode,String> identifier)Sets the complex attribute of typeLIST.ResourceElement.BuildersetComplexListAttribute(String name, String column, Function<ModelNode,String> identifier)Sets the complex attribute of typeLIST.ResourceElement.Buildertype(String type)Overrides the human readable type of the main resource which is built by default using theLabelBuilder.
-
-
-
Constructor Detail
-
Builder
public Builder(String baseId, String resource, Metadata metadata, MbuiContext mbuiContext)
-
-
Method Detail
-
type
public ResourceElement.Builder type(String type)
Overrides the human readable type of the main resource which is built by default using theLabelBuilder.
-
columns
public ResourceElement.Builder columns(String first, String... rest)
Columns for the main table.
-
column
public ResourceElement.Builder column(String name, Column.RenderCallback<NamedNode,String> render)
-
nameColumn
public ResourceElement.Builder nameColumn()
-
addComplexObjectAttribute
public ResourceElement.Builder addComplexObjectAttribute(String name)
Adds a complex attribute of typeOBJECT. The operation checks whether the resource contains the complex attribute.
-
addComplexObjectAttributeForm
public ResourceElement.Builder addComplexObjectAttributeForm(String name, Form<ModelNode> form)
Adds a custom form for a complex attribute of typeOBJECT
-
customFormItem
public ResourceElement.Builder customFormItem(String attribute, FormItemProvider formItemProvider)
Sets a custom form item
-
addComplexObjectAttribute
public ResourceElement.Builder addComplexObjectAttribute(String name, FormValidation formValidation)
Adds a complex attribute of typeOBJECT. The operation checks whether the resource contains the complex attribute. Also adds a form validation for the specific complex attribute form.
-
setComplexListAttribute
public ResourceElement.Builder setComplexListAttribute(String name, String column)
Sets the complex attribute of typeLIST.- Parameters:
name- The name of the complex attributecolumn- The column for the table on the sub-page
-
setComplexListAttribute
public ResourceElement.Builder setComplexListAttribute(String name, String column, Iterable<String> addAttributes)
Sets the complex attribute of typeLIST.- Parameters:
name- The name of the complex attributecolumn- The column for the table on the sub-pageaddAttributes- attributes for the add resource dialog
-
setComplexListAttribute
public ResourceElement.Builder setComplexListAttribute(String name, String column, Function<ModelNode,String> identifier)
Sets the complex attribute of typeLIST.- Parameters:
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 entries
-
setComplexListAttribute
public ResourceElement.Builder setComplexListAttribute(String name, String column, Iterable<String> addAttributes, Function<ModelNode,String> identifier)
Sets the complex attribute of typeLIST.- Parameters:
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 entries
-
setComplexListAttribute
public ResourceElement.Builder setComplexListAttribute(String name, Iterable<String> columns)
Sets the complex attribute of typeLIST.- Parameters:
name- The name of the complex attributecolumns- The columns for the table on the sub-page
-
setComplexListAttribute
public ResourceElement.Builder setComplexListAttribute(String name, Iterable<String> columns, Iterable<String> addAttributes)
Sets the complex attribute of typeLIST.- Parameters:
name- The name of the complex attributecolumns- The columns for the table on the sub-pageaddAttributes- attributes for the add resource dialog
-
setComplexListAttribute
public ResourceElement.Builder setComplexListAttribute(String name, Iterable<String> columns, Function<ModelNode,String> identifier)
Sets the complex attribute of typeLIST.- Parameters:
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 entries
-
setComplexListAttribute
public ResourceElement.Builder setComplexListAttribute(String name, Iterable<String> columns, Iterable<String> addAttributes, Function<ModelNode,String> identifier)
Sets the complex attribute of typeLIST.- Parameters:
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 entries
-
onAdd
public ResourceElement.Builder onAdd(Callback callback)
Defines the callback which is executed to add the main resource. If not specifiedCrudOperations.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).
-
onCrud
public ResourceElement.Builder onCrud(Callback callback)
Defines the callback which is used after all CRUD actions.
-
build
public ResourceElement build()
-
-