Class Forms

java.lang.Object
ch.tocco.nice2.model.form.api.Forms

@Deprecated public class Forms extends Object
Deprecated.
Static utility functions for dealing with forms.
  • Method Details

    • buildFormName

      public static String buildFormName(String entityName, String scope)
      Deprecated.
      Builds the form name according to the current rules.

      See https://wiki.tocco.ch/wiki/index.php/Namenskonventionen

      Parameters:
      entityName - eg "Sub_project", is taken as is.
      scope - eg "detail", is converted to lower case.
      Returns:
      The form name.
    • getMainTable

      @Nullable public static @Nullable Table getMainTable(Form form)
      Deprecated.
      Returns the "primary" table from within a form.

      This is for forms that are made just for a table, aka "grid" view.

      The method does not loop into children, so if your table is nested then this method won't find it atm.

      Parameters:
      form - The form to look into.
      Returns:
      The first table, or null if none.
    • getAllDataComponents

      public static Collection<DataComponent> getAllDataComponents(Component component)
      Deprecated.
      Search for all data components recursively.
      Parameters:
      component - component (e.g. form) to search for data components recursively
      Returns:
      a collection of all data components found
    • hideNonDefaultLocalizedFields

      public static boolean hideNonDefaultLocalizedFields(String formScope) throws IllegalArgumentException
      Deprecated.
      Tells if form components that are localized, but not for the current locale, must be hidden.
      Parameters:
      formScope - In upper case, for example "SEARCH"
      Throws:
      IllegalArgumentException - When the scope is unknown.
      See Also:
    • getLocalizedFormWrapper

      public static ComponentWrapperHandler getLocalizedFormWrapper(LocaleResolverService localeService)
      Deprecated.
      Wraps all form components recursively to hide those that are localized and are not for the current user/request's language.
      Parameters:
      localeService - Inject it to yourself so that you can pass it here.
      See Also:
    • getDefaultLangOnlyWrapper

      public static ComponentWrapperHandler getDefaultLangOnlyWrapper(LocaleResolverService localeService)
      Deprecated.
    • componentContainsChildrenOfClass

      public static boolean componentContainsChildrenOfClass(Component component, Class<?> fieldClass)
      Deprecated.
      Check recursively if the given component or it's subcomponents equals the given Class e.g. if you wanna skip all components with the class ImageField
      Parameters:
      component - the Component which should be checked
      fieldClass - the Class to compare with
    • componentContainsChildrenOfClasses

      public static boolean componentContainsChildrenOfClasses(Component component, List<Class<?>> classList)
      Deprecated.
      Check recursively if the given component or it's subcomponents equals one of the given Classes in the List
      Parameters:
      component - the Component which should be checked
      classList - the Class to compare with