Class CompositeFormItem

  • All Implemented Interfaces:
    com.google.gwt.event.logical.shared.HasValueChangeHandlers<org.jboss.hal.dmr.ModelNode>, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.TakesValue<org.jboss.hal.dmr.ModelNode>, com.google.gwt.user.client.ui.Focusable, com.google.gwt.user.client.ui.HasEnabled, com.google.gwt.user.client.ui.HasName, com.google.gwt.user.client.ui.HasValue<org.jboss.hal.dmr.ModelNode>, Attachable, FormItem<org.jboss.hal.dmr.ModelNode>, ModelNodeItem

    public abstract class CompositeFormItem
    extends AbstractFormItem<org.jboss.hal.dmr.ModelNode>
    implements ModelNodeItem
    A form item composed from a list of other form items. Extend from this class and add the form items which should be part of the composite in the constructor before the composite form item is attached.

    The composite form item uses the following semantics:

    Layout
    The form items are placed into a div element. In the readonly mode they're separated by hr elements.
    Empty
    The composite form item is empty if all form items are empty.
    Modified
    The composite form item is modified as soon as one of the form items is modified.
    Expressions
    The composite form item does not support expressions.
    Validation
    The composite form item is valid if all form items are valid. Adding new validation handlers is not supported.
    Restricted
    The composite form item is restricted if any of the form items is restricted.
    Enabled
    The composite form item is enabled if all form items are enabled.
    Required
    The composite form item is required if any of the form items is required.
    • Constructor Detail

      • CompositeFormItem

        public CompositeFormItem​(String name,
                                 String label)
    • Method Detail

      • attach

        public void attach()
        Description copied from class: AbstractFormItem
        Calls SuggestHandler.attach() in case there was one registered. If you override this method, please call super.attach() to keep this behaviour.
        Specified by:
        attach in interface Attachable
        Overrides:
        attach in class AbstractFormItem<org.jboss.hal.dmr.ModelNode>
      • getValue

        public org.jboss.hal.dmr.ModelNode getValue()
        Specified by:
        getValue in interface com.google.gwt.user.client.ui.HasValue<org.jboss.hal.dmr.ModelNode>
        Specified by:
        getValue in interface com.google.gwt.user.client.TakesValue<org.jboss.hal.dmr.ModelNode>
        Overrides:
        getValue in class AbstractFormItem<org.jboss.hal.dmr.ModelNode>
      • setValue

        public void setValue​(org.jboss.hal.dmr.ModelNode value,
                             boolean fireEvent)
        Description copied from class: AbstractFormItem
        Sets the form item's value and shows the value in the appearances. Sets the expression value to null. Does not touch the modified and undefined flags. Should be called from business code like form mapping.
        Specified by:
        setValue in interface com.google.gwt.user.client.ui.HasValue<org.jboss.hal.dmr.ModelNode>
        Overrides:
        setValue in class AbstractFormItem<org.jboss.hal.dmr.ModelNode>
      • addValueChangeHandler

        public com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler​(com.google.gwt.event.logical.shared.ValueChangeHandler<org.jboss.hal.dmr.ModelNode> valueChangeHandler)
        Specified by:
        addValueChangeHandler in interface com.google.gwt.event.logical.shared.HasValueChangeHandlers<org.jboss.hal.dmr.ModelNode>
        Overrides:
        addValueChangeHandler in class AbstractFormItem<org.jboss.hal.dmr.ModelNode>
      • clearValue

        public void clearValue()
        Description copied from class: AbstractFormItem
        Sets the value and expression value to null, clears any error marker and shows the default value (if any). Does not touch the modified and undefined flags. Should be called from business code like form mapping.
        Specified by:
        clearValue in interface FormItem<org.jboss.hal.dmr.ModelNode>
        Overrides:
        clearValue in class AbstractFormItem<org.jboss.hal.dmr.ModelNode>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface FormItem<org.jboss.hal.dmr.ModelNode>
        Returns:
        if this form item has no value.
      • supportsExpressions

        public boolean supportsExpressions()
        Specified by:
        supportsExpressions in interface FormItem<org.jboss.hal.dmr.ModelNode>
      • isEnabled

        public boolean isEnabled()
        Specified by:
        isEnabled in interface com.google.gwt.user.client.ui.HasEnabled
        Overrides:
        isEnabled in class AbstractFormItem<org.jboss.hal.dmr.ModelNode>
      • setEnabled

        public void setEnabled​(boolean enabled)
        Specified by:
        setEnabled in interface com.google.gwt.user.client.ui.HasEnabled
        Overrides:
        setEnabled in class AbstractFormItem<org.jboss.hal.dmr.ModelNode>
      • getTabIndex

        public int getTabIndex()
        Specified by:
        getTabIndex in interface com.google.gwt.user.client.ui.Focusable
        Overrides:
        getTabIndex in class AbstractFormItem<org.jboss.hal.dmr.ModelNode>
      • setTabIndex

        public void setTabIndex​(int index)
        Specified by:
        setTabIndex in interface com.google.gwt.user.client.ui.Focusable
        Overrides:
        setTabIndex in class AbstractFormItem<org.jboss.hal.dmr.ModelNode>
      • setFocus

        public void setFocus​(boolean focus)
        Specified by:
        setFocus in interface com.google.gwt.user.client.ui.Focusable
        Overrides:
        setFocus in class AbstractFormItem<org.jboss.hal.dmr.ModelNode>