Package ch.tocco.nice2.model.form.impl
Class FormModelImpl
java.lang.Object
ch.tocco.nice2.model.base.spi.base.AbstractModel<FormModelReceiver>
ch.tocco.nice2.model.form.impl.FormModelImpl
- All Implemented Interfaces:
ReloadAction
,FormModel
@Component("legacyFormModelImpl")
public final class FormModelImpl
extends AbstractModel<FormModelReceiver>
implements FormModel
-
Field Summary
Fields inherited from class ch.tocco.nice2.model.base.spi.base.AbstractModel
log, modelProviders
-
Constructor Summary
ConstructorDescriptionFormModelImpl
(org.slf4j.Logger log, ReloadEventEmitter reloadEvent, ThreadHandlerManager threadHandlerManager, FormModelDiff formModelDiff, NiceDataModel dataModel, L10N l10n) -
Method Summary
Modifier and TypeMethodDescription@Nullable Form
Returns the loaded form by name with user adjustments.@Nullable Form
Returns the loaded form by name and scope with user adjustments.getForms()
Returns all loaded forms.@Nullable Form
getFormWithoutUsersettings
(String fullFormName) Returns the loaded form by name without user adjustments.@Nullable Form
getFormWithoutUsersettings
(String formOrEntityName, String scope) Returns the loaded form by name and scope without user adjustments.void
void
onReload()
void
setValidators
(List<ComponentValidator> validator) static void
void
Sorts all children lists of the components in the given form.Methods inherited from class ch.tocco.nice2.model.base.spi.base.AbstractModel
addListener, fireFinished, removeListener, setModelProviders
-
Constructor Details
-
FormModelImpl
public FormModelImpl(org.slf4j.Logger log, ReloadEventEmitter reloadEvent, ThreadHandlerManager threadHandlerManager, FormModelDiff formModelDiff, NiceDataModel dataModel, L10N l10n)
-
-
Method Details
-
initializeService
@PostConstruct public void initializeService() -
sort
Sorts all children lists of the components in the given form. If the form is backed by an entity model, it is used to resolve positions relative to virtual localized fields. -
setValidators
-
onReload
public void onReload()- Specified by:
onReload
in interfaceFormModel
- Specified by:
onReload
in interfaceReloadAction
- Specified by:
onReload
in classAbstractModel<FormModelReceiver>
-
getForm
Description copied from interface:FormModel
Returns the loaded form by name with user adjustments. -
getFormWithoutUsersettings
Description copied from interface:FormModel
Returns the loaded form by name without user adjustments.- Specified by:
getFormWithoutUsersettings
in interfaceFormModel
- Parameters:
fullFormName
- For example "Address_list", so it's the combination of entity type and view (aka scope).- Returns:
- Null if no such form.
-
getForm
Description copied from interface:FormModel
Returns the loaded form by name and scope with user adjustments.Note: The scope may be a specific or default one. For example there might be a specialized form "Address_create", or just the generic one named "Address_detail" which handles all crud scopes if there are no specific ones (for create, update, delete, read).
-
getFormWithoutUsersettings
Description copied from interface:FormModel
Returns the loaded form by name and scope without user adjustments.Note: The scope may be a specific or default one. For example there might be a specialized form "Address_create", or just the generic one named "Address_detail" which handles all crud scopes if there are no specific ones (for create, update, delete, read).
- Specified by:
getFormWithoutUsersettings
in interfaceFormModel
- Parameters:
formOrEntityName
- For example "Address".scope
- For example "detail" or "create", in lower case.- Returns:
- Null if no form in that scope or fallback default scope.
-
getForms
Description copied from interface:FormModel
Returns all loaded forms. The entries provide the getName() method. -
sort
- Throws:
TopoSort.CircularGraphException
-