Package de.xima.fc.gui.bean.application
Class PlaceholderBean
java.lang.Object
de.xima.fc.gui.bean.application.PlaceholderBean
- All Implemented Interfaces:
Serializable
This bean provides a list of available placeholders for an input field. Different placeholders may be available,
depending on the current context. For example, when the user is editing a project, placeholders for form elements of
that project are available.
Each placeholder belongs to a IPlaceholderType
. In the dialog, placeholders are grouped according to this
type.
To control which placeholders are available, there exists:
- a
IPlaceholderLibrary
that contains the registered placeholders. It contains several groups and a set of placeholders for that group. A group is just anyObject
, eg. SYSTEM placeholders, FORM placeholders or custom placeholders. This lets you change the placeholders for a certain group without affecting other groups. - a set of groups which are currently active. Only the placeholders for those groups are shown in the dialog. This makes it possible to deactivate a group of placeholders and activate it again later without having to recreate the placeholders.
There are also a few events available that can be triggered from another bean to update the placeholders:
PlaceholderModifyLibraryEvent
may be triggered to register or unregister placeholders from theIPlaceholderLibrary
PlaceholderModifyActiveGroupsEvent
may be triggered to add or remove currently active groups
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
A set of methods for modifying the available placeholders, such as changing which placeholders groups are shown or adding new placeholder groups. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionactions()
Methods that can be used from the outside to modify the available placeholders.int
Compares two given placeholder types.All available placeholders, depending on the current context (i.e. whether the user is editing a project etc.).Methods that can be used from the outside to modify the available placeholders.Deprecated.Deprecated.UseLocaleBean.getLocale()
directly.getModel()
void
load()
No-op, but calling this ensures thatPostConstruct
gets called when this bean is created via CDI.void
updatePlaceholders
(boolean withLoadingDialog) Action listener to update the available placeholders.
-
Constructor Details
-
PlaceholderBean
public PlaceholderBean()
-
-
Method Details
-
comparePlaceholderType
Compares two given placeholder types.- Parameters:
lhs
- First placeholder typerhs
- Second placeholder type- Returns:
- -1 if lhs < rhs, 1 if lhs > rhs, 0 if lhs == rhs.
-
createPlaceholdersForCurrentContext
All available placeholders, depending on the current context (i.e. whether the user is editing a project etc.). This includes, but is not limited to:- System placeholders
- Template placeholders (HTML, TEXT, URL, MAIL)
- Form element placeholders for a certain project
- Placeholders from the currently active designer tab (e.g. workflow action results)
- Returns:
- All placeholders applicable for the current context
-
getActions
Methods that can be used from the outside to modify the available placeholders. All other methods of this bean should not be called directly and are for internal use by the placeholder view only.- Returns:
- A set of methods for modifying the available placeholders, such as changing which placeholders groups are shown or adding new placeholder groups.
-
getClient
Deprecated.UseViewContextBean.getClient()
directly.- Returns:
- The current client.
-
getLibrary
- Returns:
- The library with the registered placeholders.
-
getLocale
Deprecated.UseLocaleBean.getLocale()
directly.- Returns:
- The current locale.
-
getModel
- Returns:
- The placeholder model with the placeholders that are shown in the UI.
-
getProjects
- Returns:
- A list of projects that the user may select to change which form placeholders are displayed.
-
load
public void load()No-op, but calling this ensures thatPostConstruct
gets called when this bean is created via CDI. -
updatePlaceholders
public void updatePlaceholders(boolean withLoadingDialog) Action listener to update the available placeholders.- Parameters:
withLoadingDialog
-true
to show a loading dialog,false
to perform the action in the background.
-
actions
Methods that can be used from the outside to modify the available placeholders. All other methods of this bean should not be called directly and are for internal use by the placeholder view only.- Returns:
- A set of methods for modifying the available placeholders, such as changing which placeholders groups are shown or adding new placeholder groups.
-
ViewContextBean.getClient()
directly.