Class WFieldSet

    • Constructor Detail

      • WFieldSet

        public WFieldSet​(String title)
        Creates a WFieldSet.
        Parameters:
        title - the fieldset title.
      • WFieldSet

        public WFieldSet​(WComponent title)
        Creates a WFieldSet.
        Parameters:
        title - the fieldset title.
    • Method Detail

      • setFrameType

        public void setFrameType​(WFieldSet.FrameType frameType)
        Parameters:
        frameType - The frameType to set.
      • setTitle

        public void setTitle​(String title)
        Parameters:
        title - The title to set.
      • setTitle

        public void setTitle​(WComponent title)
        Parameters:
        title - The title to set.
      • setMandatory

        public void setMandatory​(boolean mandatory,
                                 String message)
        Set whether or not this field set is mandatory, and customise the error message that will be displayed.
        Parameters:
        mandatory - true for mandatory, false for optional.
        message - the message to display to the user on mandatory validation failure.
      • setMandatory

        public void setMandatory​(boolean mandatory)
        Set whether or not this field set is mandatory.
        Specified by:
        setMandatory in interface Mandatable
        Parameters:
        mandatory - if true, the fieldset is mandatory.
      • isMandatory

        public boolean isMandatory()
        Indicates whether this fieldset is mandatory in the given context.
        Specified by:
        isMandatory in interface Mandatable
        Returns:
        true if this fieldset is mandatory in the given context.
      • validateComponent

        protected void validateComponent​(List<Diagnostic> diags)
        Subclasses may override to provide validation.
        Overrides:
        validateComponent in class AbstractWComponent
        Parameters:
        diags - the list into which any validation diagnostics are added.
      • createMandatoryDiagnostic

        protected Diagnostic createMandatoryDiagnostic()

        This method is called by validateComponent to create the mandatory diagnostic error message if the mandatory validation check does not pass.

        Subclasses may override this method to customise the message, however in most cases it is easier to supply a custom error message pattern to the setMandatory method.

        Returns:
        a new diagnostic for when mandatory validation fails.
      • setMargin

        public void setMargin​(Margin margin)
        Set the margin for the component, or null for no margin.
        Specified by:
        setMargin in interface Marginable
        Parameters:
        margin - the margin for the component
      • getMargin

        public Margin getMargin()
        Get the margin for the component, or null if not set.
        Specified by:
        getMargin in interface Marginable
        Returns:
        the margin for the component, or null if not set
      • toString

        public String toString()
        Description copied from class: AbstractWComponent
        Creates a String representation of this component; usually for debugging purposes.
        Overrides:
        toString in class AbstractWComponent
        Returns:
        a String representation of this component, for debugging purposes.
      • showErrorIndicatorsForComponent

        protected final void showErrorIndicatorsForComponent​(List<Diagnostic> diags)

        This does not affect the diag list at all. The ValidatableComponent should visually mark any fields or blocks that have errors in the given diag list.

        Overrides:
        showErrorIndicatorsForComponent in class AbstractWComponent
        Parameters:
        diags - the list of diagnostics for this component.
      • showWarningIndicatorsForComponent

        protected final void showWarningIndicatorsForComponent​(List<Diagnostic> diags)

        This does not affect the diag list at all. The ValidatableComponent should visually mark any fields or blocks that have warnings in the given diag list.

        Overrides:
        showWarningIndicatorsForComponent in class AbstractWComponent
        Parameters:
        diags - the list of diagnostics for this component.
      • getDiagnostics

        public List<Diagnostic> getDiagnostics​(int severity)
        Specified by:
        getDiagnostics in interface Diagnosable
        Parameters:
        severity - the diagnostic level we are interested in
        Returns:
        the list of diagnostics for the component.
      • getComponentModel

        protected WFieldSet.FieldSetModel getComponentModel()
        Returns the effective component model for this component. Subclass may override this method to narrow the return type to their specific model type.
        Overrides:
        getComponentModel in class AbstractWComponent
        Returns:
        the effective component model
      • getOrCreateComponentModel

        protected WFieldSet.FieldSetModel getOrCreateComponentModel()
        Retrieves the model for this component so that it can be modified. If this method is called during request processing, and a session specific model does not yet exist, then a new model is created. Subclasses may override this method to narrow the return type to their specific model type.
        Overrides:
        getOrCreateComponentModel in class AbstractWComponent
        Returns:
        the model for this component