Class Forms
java.lang.Object
ch.tocco.nice2.model.form.api.Forms
Deprecated.
Static utility functions for dealing with forms.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringbuildFormName(String entityName, String scope) Deprecated.Builds the form name according to the current rules.static booleancomponentContainsChildrenOfClass(Component component, Class<?> fieldClass) Deprecated.Check recursively if the given component or it's subcomponents equals the givenClasse.g.static booleancomponentContainsChildrenOfClasses(Component component, List<Class<?>> classList) Deprecated.Check recursively if the given component or it's subcomponents equals one of the givenClasses in the Liststatic Collection<DataComponent> getAllDataComponents(Component component) Deprecated.Search for all data components recursively.static ComponentWrapperHandlergetDefaultLangOnlyWrapper(LocaleResolverService localeService) Deprecated.static ComponentWrapperHandlergetLocalizedFormWrapper(LocaleResolverService localeService) Deprecated.Wraps all form components recursively to hide those that are localized and are not for the current user/request's language.static @Nullable TablegetMainTable(Form form) Deprecated.Returns the "primary" table from within a form.static booleanhideNonDefaultLocalizedFields(String formScope) Deprecated.Tells if form components that are localized, but not for the current locale, must be hidden.
-
Method Details
-
buildFormName
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
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
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
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
Deprecated.Check recursively if the given component or it's subcomponents equals the givenClasse.g. if you wanna skip all components with the classImageField -
componentContainsChildrenOfClasses
-