Package org.jboss.hal.core.mbui.form
Class ModelNodeForm.Builder<T extends ModelNode>
- java.lang.Object
-
- org.jboss.hal.core.mbui.form.ModelNodeForm.Builder<T>
-
- Enclosing class:
- ModelNodeForm<T extends ModelNode>
public static class ModelNodeForm.Builder<T extends ModelNode> extends Object
Builder to create forms based on resource metadata. By default the form includes all non-deprecated attributes with"storage" => "configuration".
-
-
Method Summary
-
-
-
Method Detail
-
include
public ModelNodeForm.Builder<T> include(String[] attributes)
-
include
public ModelNodeForm.Builder<T> include(Iterable<String> attributes)
-
include
public ModelNodeForm.Builder<T> include(String first, String... rest)
-
exclude
public ModelNodeForm.Builder<T> exclude(String[] attributes)
-
exclude
public ModelNodeForm.Builder<T> exclude(Iterable<String> attributes)
-
exclude
public ModelNodeForm.Builder<T> exclude(String first, String... rest)
-
addOnly
public ModelNodeForm.Builder<T> addOnly()
Use this flag if you just want to use the form to add model nodes. The attributes will be taken from the ATTRIBUTES child node.
-
fromRequestProperties
public ModelNodeForm.Builder<T> fromRequestProperties()
Use this flag if you just want to use the form to add model nodes. The attributes will be taken from the REQUEST_PROPERTIES node of the ADD operation.
-
readOnly
public ModelNodeForm.Builder<T> readOnly()
Makes the form read-only.
-
unsorted
public ModelNodeForm.Builder<T> unsorted()
Doesn't sort the attributes alphabetically.
-
requiredOnly
public ModelNodeForm.Builder<T> requiredOnly()
Includes only required attributes
-
includeRuntime
public ModelNodeForm.Builder<T> includeRuntime()
Includes also attributes with"storage" => "runtime"
-
showDeprecated
public ModelNodeForm.Builder<T> showDeprecated()
Includes also deprecated attributes
-
dontVerifyExcludes
public ModelNodeForm.Builder<T> dontVerifyExcludes()
-
omitNoAttributesWarning
public ModelNodeForm.Builder<T> omitNoAttributesWarning(boolean omitNoAttributesWarning)
-
singleton
public ModelNodeForm.Builder<T> singleton(Supplier<Operation> ping, Callback addAction)
Use this method if you want to manage a singleton resource. This will create a form with anSingletonStateMachine.The specified operation is used to check whether the resource exists.
If the resource does not exist, a default empty state is displayed. The empty state will contain a button which will trigger the specified add action.
-
singleton
public ModelNodeForm.Builder<T> singleton(Supplier<Operation> ping, EmptyState emptyState)
Use this method if you want to manage a singleton resource. This will create a form with anSingletonStateMachine.The specified operation is used to check whether the resource exists.
If the resource does not exist, the specified empty state is displayed. The empty state must have a button which triggers the creation of the singleton resource.
Please make sure that the primary action of the empty state has a constraint attached to it.
-
customFormItem
public ModelNodeForm.Builder<T> customFormItem(String attribute, FormItemProvider provider)
-
unboundFormItem
public ModelNodeForm.Builder<T> unboundFormItem(FormItem formItem)
-
unboundFormItem
public ModelNodeForm.Builder<T> unboundFormItem(FormItem formItem, int position)
-
unboundFormItem
public ModelNodeForm.Builder<T> unboundFormItem(FormItem formItem, int position, com.google.gwt.safehtml.shared.SafeHtml helpText)
-
onSave
public ModelNodeForm.Builder<T> onSave(Form.SaveCallback<T> saveCallback)
-
onCancel
public ModelNodeForm.Builder<T> onCancel(Form.CancelCallback<T> cancelCallback)
-
prepareReset
public ModelNodeForm.Builder<T> prepareReset(Form.PrepareReset<T> prepareReset)
-
prepareRemove
public ModelNodeForm.Builder<T> prepareRemove(Form.PrepareRemove<T> removeCallback)
-
panelForOptionalAttributes
public ModelNodeForm.Builder<T> panelForOptionalAttributes()
By default the non-requried attributes are displayed together with the required attributes. Call this method to put the non-required attributes on a collapsible panel beneath the required attributes.
-
build
public ModelNodeForm<T> build()
Creates and returns the form.
-
-