Package de.xima.fc.gui.bean.form_theme
Class FormThemeBean
- java.lang.Object
-
- de.xima.fc.gui.bean.form_theme.FormThemeBean
-
- All Implemented Interfaces:
Serializable
@Named @ViewScoped public class FormThemeBean extends Object implements Serializable
Bean for the backend, when editingclient form theme
entities.- Since:
- 8.3.0
- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FormThemeBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EFormThemeEditMode
getEditMode()
Gets the UI mode for editing client form themes.FormThemeEditModeAdvancedModel
getEditModeAdvancedModel()
Gets the view model foradvanced
edit mode.FormThemeEditModeSimpleModel
getEditModeSimpleModel()
Get the view model forsimple
edit mode.String
getElfinderConnectorUrl()
Gets the URL to the elFinder connector, i.e.String
getElFinderExtensions()
Gets a list of file extensions that are allowed for files in the elFinder file explorer.String
getElFinderMessages()
Returns additional localized messages for the elFinder file explorer.boolean
isEditModeAdvanced()
boolean
isEditModeSimple()
boolean
isWasEditModeSet()
Gets whether the user already has a stored preference for the edit mode.void
onConfirmChangeToAdvancedEditMode()
When there are unsaved changes and the user wishes to change to advanced edit mode, they are asked to confirm whether they want to discard their changes.void
onCreateNewTheme()
Command button callback that is invoked when the user wishes to create a new theme, either whenvoid
onGetThemeDetails()
void
onToggleEditMode()
When the user clicks on the button to toggle the edit mode, either from simple to advanced or vice versa.void
onUpdateThemeDetail()
Remote command invoked when the edit mode is advanced and the user change a detail of a client form theme via the file explorer.
-
-
-
Method Detail
-
getEditMode
public EFormThemeEditMode getEditMode()
Gets the UI mode for editing client form themes. This is used to determine which parts of the UI are shown to the user. Simple mode only shows two simple CSS editors for the form and HTML template CSS, advanced mode shows a full-fledged file explorer.- Returns:
- The UI mode for editing client form themes.
-
getEditModeAdvancedModel
public FormThemeEditModeAdvancedModel getEditModeAdvancedModel()
- Returns:
- Additional data for the currently selected client form theme, null if no theme is selected.
-
getEditModeSimpleModel
public FormThemeEditModeSimpleModel getEditModeSimpleModel()
- Returns:
- The list model.
-
getElFinderExtensions
public String getElFinderExtensions()
Gets a list of file extensions that are allowed for files in the elFinder file explorer. This is a comma separated list of file extensions, each file extensions without the leading dot. E.g. "jpg,png,gif".- Returns:
- The allowed file extensions.
-
getElFinderMessages
public String getElFinderMessages()
Returns additional localized messages for the elFinder file explorer. This is a stringified JSON object with string keys and values. The keys are the messages keys, the values the localized messages.- Returns:
- The additional messages.
-
getElfinderConnectorUrl
public String getElfinderConnectorUrl()
Gets the URL to the elFinder connector, i.e. the URL to the file manager can call to communicate with the backend.- Returns:
- The URL to the elFinder connector.
-
isEditModeAdvanced
public boolean isEditModeAdvanced()
- Returns:
- True if the edit mode is advanced, false otherwise.
-
isEditModeSimple
public boolean isEditModeSimple()
- Returns:
- True if the edit mode is simple, false otherwise.
-
isWasEditModeSet
public boolean isWasEditModeSet()
Gets whether the user already has a stored preference for the edit mode. When false, the user gets shown a help dialog the first time they switch to advanced edit mode.- Returns:
- True if the user already set the edit mode, false otherwise.
-
onConfirmChangeToAdvancedEditMode
public void onConfirmChangeToAdvancedEditMode()
When there are unsaved changes and the user wishes to change to advanced edit mode, they are asked to confirm whether they want to discard their changes. This method is called when the user confirms that they want to discard their changes.
-
onCreateNewTheme
public void onCreateNewTheme()
-
onGetThemeDetails
public void onGetThemeDetails()
Remote command invoked when theedit mode
is set toADVANCED
and the user clicks on the edit icon of a client form theme in the file explorer. Loads the additional details to show to the user, i.e. the name, description and parent theme of the selected client form theme; as well as the list of available options for the parent theme dropdown.
-
onToggleEditMode
public void onToggleEditMode()
When the user clicks on the button to toggle the edit mode, either from simple to advanced or vice versa. Checks whether there are unsaved changes and shows a confirmation dialog if necessary. Otherwise, switches directly to the requested mode.
-
onUpdateThemeDetail
public void onUpdateThemeDetail()
Remote command invoked when the edit mode is advanced and the user change a detail of a client form theme via the file explorer. Updates the client form theme with the provided data.
-
-