Class ComponentFactory

java.lang.Object
org.kuali.rice.krad.uif.util.ComponentFactory

public class ComponentFactory extends Object
Factory class for creating new UIF components from their base definitions in the dictionary.
Author:
Kuali Rice Team (rice.collab@kuali.org)
  • Field Details

  • Constructor Details

    • ComponentFactory

      public ComponentFactory()
  • Method Details

    • getNewInstanceForRefresh

      public static Component getNewInstanceForRefresh(ViewPostMetadata viewPostMetadata, String id)
      Returns a new Component instance for the given bean id from the spring factory.
      Parameters:
      id - id for the component in the view index
      Returns:
      Component new instance
    • getNewComponentInstance

      public static Component getNewComponentInstance(String beanId)
      Returns a new Component instance for the given bean id from the spring factory.
      Parameters:
      beanId - id of the bean definition
      Returns:
      new component instance or null if no such component definition was found
    • getTextControl

      public static TextControl getTextControl()
      Retrieves a new Text control instance from Spring (initialized by the bean definition with the given id)
      Returns:
      TextControl
    • getTextAreaControl

      public static TextAreaControl getTextAreaControl()
      Retrieves a new Text area control instance from Spring (initialized by the bean definition with the given id)
      Returns:
      TextAreaControl
    • getCheckboxControl

      public static CheckboxControl getCheckboxControl()
      Retrieves a new checkbox control instance from Spring (initialized by the bean definition with the given id)
      Returns:
      CheckboxControl
    • getHiddenControl

      public static HiddenControl getHiddenControl()
      Retrieves a new hidden control instance from Spring (initialized by the bean definition with the given id)
      Returns:
      HiddenControl
    • getSelectControl

      public static SelectControl getSelectControl()
      Retrieves a new select control instance from Spring (initialized by the bean definition with the given id)
      Returns:
      SelectControl
    • getCheckboxGroupControl

      public static CheckboxGroupControl getCheckboxGroupControl()
      Retrieves a new checkbox group control instance from Spring (initialized by the bean definition with the given id)

      Return checkbox group set for vertical orientation

      Returns:
      CheckboxGroupControl
    • getCheckboxGroupControlHorizontal

      public static CheckboxGroupControl getCheckboxGroupControlHorizontal()
      Retrieves a new checkbox group control instance from Spring (initialized by the bean definition with the given id)

      Return checkbox group set for horizontal orientation

      Returns:
      CheckboxGroupControl
    • getRadioGroupControl

      public static RadioGroupControl getRadioGroupControl()
      Retrieves a new radio group control instance from Spring (initialized by the bean definition with the given id)

      Return radio group set for vertical orientation

      Returns:
      RadioGroupControl
    • getRadioGroupControlHorizontal

      public static RadioGroupControl getRadioGroupControlHorizontal()
      Retrieves a new radio group control instance from Spring (initialized by the bean definition with the given id)

      Return radio group set for horizontal orientation

      Returns:
      RadioGroupControl
    • getFileControl

      public static FileControl getFileControl()
      Retrieves a new file control instance from Spring (initialized by the bean definition with the given id)
      Returns:
      FileControl
    • getDateControl

      public static TextControl getDateControl()
      Retrieves a new text control instance from Spring (initialized by the bean definition with the given id) configured for a date (enabled data picker)
      Returns:
      TextControl
    • getUserControl

      public static UserControl getUserControl()
      Retrieves a new text control instance from Spring (initialized by the bean definition with the given id) configured for KIM user input
      Returns:
      TextControl
    • getGroupControl

      public static GroupControl getGroupControl()
      Retrieves a new text control instance from Spring (initialized by the bean definition with the given id) configured for KIM group input
      Returns:
      TextControl
    • getDataField

      public static DataField getDataField()
      Retrieves a new data field instance from Spring (initialized by the bean definition with the given id)
      Returns:
      DataField
    • getDataField

      public static DataField getDataField(String propertyName, String label)
      Retrieves a new data field instance from Spring (initialized by the bean definition with the given id) and sets the property name and label to the given parameters
      Parameters:
      propertyName - name of the property the data field should bind to
      label - label for the field
      Returns:
      DataField
    • getInputField

      public static InputField getInputField()
      Retrieves a new input field instance from Spring (initialized by the bean definition with the given id)
      Returns:
      InputField
    • getInputField

      public static InputField getInputField(String propertyName, String label)
      Retrieves a new input field instance from Spring (initialized by the bean definition with the given id) and sets the property name and label to the given parameters
      Parameters:
      propertyName - name of the property the input field should bind to
      label - label for the field
      Returns:
      InputField
    • getInputField

      public static InputField getInputField(String propertyName, String label, UifConstants.ControlType controlType)
      Retrieves a new input field instance from Spring (initialized by the bean definition with the given id) and sets the property name, control, and label to the given parameters
      Parameters:
      propertyName - name of the property the input field should bind to
      label - label for the field
      controlType - enum that identifies the type of control to create for the input field
      Returns:
      InputField
    • getInputField

      public static InputField getInputField(String propertyName, String label, UifConstants.ControlType controlType, String defaultValue)
      Retrieves a new input field instance from Spring (initialized by the bean definition with the given id) and sets the property name, control, defaultValue, and label to the given parameters
      Parameters:
      propertyName - name of the property the input field should bind to
      label - label for the field
      controlType - enum that identifies the type of control to create for the input field
      defaultValue - default value for the property backing the input field
      Returns:
      InputField
    • getInputField

      public static InputField getInputField(String propertyName, String label, UifConstants.ControlType controlType, Class<? extends org.kuali.rice.krad.keyvalues.KeyValuesFinder> optionsFinderClass)
      Retrieves a new input field instance from Spring (initialized by the bean definition with the given id) and sets the property name, control, options finder, and label to the given parameters
      Parameters:
      propertyName - name of the property the input field should bind to
      label - label for the field
      controlType - enum that identifies the type of control to create for the input field
      optionsFinderClass - class that will provide options for the control (assume control type is multi-value)
      Returns:
      InputField
    • getInputField

      public static InputField getInputField(String propertyName, String label, UifConstants.ControlType controlType, List<org.kuali.rice.core.api.util.KeyValue> options)
      Retrieves a new input field instance from Spring (initialized by the bean definition with the given id) and sets the property name, control, options, and label to the given parameters
      Parameters:
      propertyName - name of the property the input field should bind to
      label - label for the field
      controlType - enum that identifies the type of control to create for the input field
      options - list of key value objects to set as the controls options
      Returns:
      InputField
    • getInputField

      public static InputField getInputField(String propertyName, String label, UifConstants.ControlType controlType, int size, int maxLength, int minLength)
      Retrieves a new input field instance from Spring (initialized by the bean definition with the given id) and sets the property name, control, size, min and max length, and label to the given parameters
      Parameters:
      propertyName - name of the property the input field should bind to
      label - label for the field
      controlType - enum that identifies the type of control to create for the input field
      size - size for the control
      maxLength - max length for the field's value (also used for the control)
      minLength - min length for the field's value (also used for the control)
      Returns:
      InputField
    • translateRemotableField

      public static InputField translateRemotableField(org.kuali.rice.core.api.uif.RemotableAttributeField remotableField)
      Builds a new InputField from the properties set on the given RemotableAttributeField

      Note the returned InputField will not be initialized yet. Its state will be that of the initial object returned from the UIF dictionary with the properties set from the remotable attribute field, thus it is really just a more configuration complete field

      Parameters:
      remotableField - field defined by a remove attribute
      Returns:
      AttributeField instance built from remotable field
    • translateRemotableFields

      public static List<InputField> translateRemotableFields(List<org.kuali.rice.core.api.uif.RemotableAttributeField> remotableFields)
      For each remotable field in the given list creates a new InputField instance and sets the corresponding properties from the remotable instance
      Parameters:
      remotableFields - list of remotable fields to translate
      Returns:
      List list of attribute fields built from the remotable field properties
    • buildKeyValuePairs

      protected static List<org.kuali.rice.core.api.util.KeyValue> buildKeyValuePairs(Map<String,String> optionsMap)
      For each option in the given list, create a new KeyValue instance
      Parameters:
      optionsMap - list of options
      Returns:
      List list of key values built from the list of options
    • getControl

      protected static Control getControl(UifConstants.ControlType controlType)
      Gets the control
      Parameters:
      controlType -
      Returns:
      the control based on the control type
    • getErrorsField

      public static ValidationMessages getErrorsField()
      Gets the errors field
      Returns:
      ValidationMessages errors field
    • getAction

      public static Action getAction()
      Gets the action
      Returns:
      action
    • getSecondaryAction

      public static Action getSecondaryAction()
      Returns an instance of a secondary action component.
      Returns:
      action
    • getActionLink

      public static Action getActionLink()
      Gets the action link
      Returns:
      action link
    • getLinkField

      public static LinkField getLinkField()
      Gets the link field
      Returns:
      link field
    • getIframe

      public static Iframe getIframe()
      Gets the iframe
      Returns:
      iframe
    • getImageField

      public static ImageField getImageField()
      Gets the image field
      Returns:
      image field
    • getImage

      public static Image getImage()
      Gets the image component
      Returns:
      image field
    • getSpaceField

      public static SpaceField getSpaceField()
      Gets the space field
      Returns:
      space field
    • getGenericField

      public static GenericField getGenericField()
      Gets the generic field
      Returns:
      generic field
    • getLabel

      public static Label getLabel()
      Gets the label
      Returns:
      label
    • getMessage

      public static Message getMessage()
      Gets the message
      Returns:
      message
    • getMessageField

      public static MessageField getMessageField()
      Gets the message field
      Returns:
      message field
    • getColGroupingField

      public static MessageField getColGroupingField()
      Gets the collection grouping field
      Returns:
      message field
    • getFieldGroup

      public static FieldGroup getFieldGroup()
      Gets the field group
      Returns:
      field group
    • getHorizontalFieldGroup

      public static FieldGroup getHorizontalFieldGroup()
      Gets the horizontal field group
      Returns:
      horizontal field group
    • getGroup

      public static Group getGroup()
      Gets the group
      Returns:
      group
    • getVerticalBoxGroup

      public static Group getVerticalBoxGroup()
      Gets the vertical box group
      Returns:
      group
    • getHorizontalBoxGroup

      public static Group getHorizontalBoxGroup()
      Gets the horizontal box group
      Returns:
      group
    • getVerticalBoxSection

      public static Group getVerticalBoxSection()
      Gets the vertical box section
      Returns:
      group
    • getHorizontalBoxSection

      public static Group getHorizontalBoxSection()
      Gets the horizontal box section
      Returns:
      group
    • getPageGroup

      public static PageGroup getPageGroup()
      Gets the page group
      Returns:
      page group
    • getGroupGridLayout

      public static Group getGroupGridLayout()
      Gets the group grid layout
      Returns:
      group grid layout
    • getGroupWithDisclosureGridLayout

      public static Group getGroupWithDisclosureGridLayout()
    • getGroupBodyOnly

      public static Group getGroupBodyOnly()
      Gets the group body only
      Returns:
      group body only
    • getGroupGridBodyOnly

      public static Group getGroupGridBodyOnly()
      Gets the group grid body only
      Returns:
      group grid body only
    • getTabGroup

      public static TabGroup getTabGroup()
      Gets the tab group
      Returns:
      tab group
    • getNavigationGroup

      public static TabNavigationGroup getNavigationGroup()
      Gets the navigation group
      Returns:
      navigation group
    • getTreeGroup

      public static TreeGroup getTreeGroup()
      Gets the tree group
      Returns:
      tree group
    • getLinkGroup

      public static LinkGroup getLinkGroup()
      Gets the link group
      Returns:
      link group
    • getCollectionGroup

      public static CollectionGroup getCollectionGroup()
      Gets the collection group
      Returns:
      collection group
    • getCollectionWithDisclosureGroup

      public static CollectionGroup getCollectionWithDisclosureGroup()
      Gets the collection group with disclosure behavior
      Returns:
      collection group
    • getCollectionGroupTableLayout

      public static CollectionGroup getCollectionGroupTableLayout()
      Gets the collection group table layout
      Returns:
      collection group table layout
    • getCollectionWithDisclosureGroupTableLayout

      public static CollectionGroup getCollectionWithDisclosureGroupTableLayout()
      Gets the collection group table layout with disclosure behavior
      Returns:
      collection group table layout
    • getListGroup

      public static CollectionGroup getListGroup()
      Gets the list group
      Returns:
      list group
    • getHeader

      public static Header getHeader()
      Gets the header
      Returns:
      header
    • getFooter

      public static Group getFooter()
      Gets the footer
      Returns:
      footer
    • getFooterSaveCloseCancel

      public static Group getFooterSaveCloseCancel()
      Gets the footer save/close/cancel
      Returns:
      footer save/close/cancel
    • getHelpAction

      public static Action getHelpAction()
      Gets the default action component configured for help
      Returns:
      Action for help display
    • getConstraintMessage

      public static Message getConstraintMessage()
      Gets the default constraint message configuration
      Returns:
      Message component for constraint messages
    • getInstructionalMessage

      public static Message getInstructionalMessage()
      Gets the default instructional message configuration
      Returns:
      Message component for instructional messages
    • getImageCaptionHeader

      public static Header getImageCaptionHeader()
      Gets the default image caption header configuration
      Returns:
      Header component for image caption headers
    • getImageCutlineMessage

      public static Message getImageCutlineMessage()
      Gets the default image cutline message configuration
      Returns:
      Message component for image cutlines messages
    • getLightBox

      public static LightBox getLightBox()
      Gets the default lightbox configuration
      Returns:
      Lightbox component
    • getQuickFinder

      public static QuickFinder getQuickFinder()
      Gets the default quickfinder configuration
      Returns:
      QuickFinder component
    • getInquiry

      public static Inquiry getInquiry()
      Gets the default inquiry configuration
      Returns:
      Inquiry component
    • getSessionTimeoutWarningDialog

      public static DialogGroup getSessionTimeoutWarningDialog()
      Gets an instance of the session timeout warning dialog
      Returns:
      instance of session timeout warning dialog
    • getSessionTimeoutDialog

      public static DialogGroup getSessionTimeoutDialog()
      Gets an instance of the session timeout dialog
      Returns:
      instance of session timeout dialog
    • getYesNoDialog

      public static DialogGroup getYesNoDialog()
      Gets an instance of the yes no dialog
      Returns:
      instance of yes no dialog
    • getUrlInfo

      public static UrlInfo getUrlInfo()
      Gets an instance of an UrlInfo
      Returns:
      instance of UrlInfo
    • getInquiryView

      public static InquiryView getInquiryView()
      Gets an empty inquiry view configuration for population.
      Returns:
      InquiryView component
    • getLookupView

      public static LookupView getLookupView()
      Gets an empty lookup view configuration for population.
      Returns:
      LookupView component
    • getLookupCriteriaInputField

      public static LookupInputField getLookupCriteriaInputField()
      Gets a component instance for an input field in the lookup criteria section
      Returns:
      lookup input field instance
    • getLookupCriteriaActiveIndicatorInputField

      public static LookupInputField getLookupCriteriaActiveIndicatorInputField()
      Gets a component instance for an input field for the active indicator in the lookup criteria section
      Returns:
      lookup input field instance