Package ch.tocco.nice2.model.form.api
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 String
buildFormName
(String entityName, String scope) Deprecated.Builds the form name according to the current rules.static boolean
componentContainsChildrenOfClass
(Component component, Class<?> fieldClass) Deprecated.Check recursively if the given component or it's subcomponents equals the givenClass
e.g.static boolean
componentContainsChildrenOfClasses
(Component component, List<Class<?>> classList) Deprecated.Check recursively if the given component or it's subcomponents equals one of the givenClass
es in the Liststatic Collection
<DataComponent> getAllDataComponents
(Component component) Deprecated.Search for all data components recursively.static ComponentWrapperHandler
getDefaultLangOnlyWrapper
(LocaleResolverService localeService) Deprecated.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.static @Nullable Table
getMainTable
(Form form) Deprecated.Returns the "primary" table from within a form.static boolean
hideNonDefaultLocalizedFields
(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 givenClass
e.g. if you wanna skip all components with the classImageField
-
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 givenClass
es in the List
-