Class PlaceholderBean
java.lang.Object
de.xima.fc.gui.common.bean.placeholder.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
IPlaceholderLibrarythat contains the registered placeholders. It contains several groups and a set of placeholders for that group. A group is just anyObject, e.g. 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:
PlaceholderModifyLibraryEventmay be triggered to register or unregister placeholders from theIPlaceholderLibraryPlaceholderModifyActiveGroupsEventmay be triggered to add or remove currently active groups
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassA 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.Methods that can be used from the outside to modify the available placeholders.getModel()All available placeholders, depending on the current context (i.e. whether the user is editing a project etc.).getTooltip(IPlaceholder placeholder) voidload()No-op, but calling this ensures thatPostConstructgets called when this bean is created via CDI.voidregisterProvideContext(ISerializableSupplier<IPlaceholderProvideContext> provideContext) voidregisterProvider(IPlaceholderProvider listener) voidsetSelectedProject(Projekt selectedProject) voidunregisterProvideContext(ISerializableSupplier<IPlaceholderProvideContext> provideContext) voidunregisterProvider(IPlaceholderProvider listener) voidupdatePlaceholders(boolean withLoadingDialog) Action listener to update the available placeholders.void
-
Constructor Details
-
PlaceholderBean
public PlaceholderBean()
-
-
Method Details
-
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.
-
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.
-
getLibrary
- Returns:
- The library with the registered placeholders.
-
getModel
- Returns:
- The placeholder model with the placeholders that are shown in the UI.
-
getPlaceholders
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
- Returns:
- All placeholders applicable for the current context
-
getProjects
-
getSelectedProject
-
setSelectedProject
-
getTooltip
-
load
public void load()No-op, but calling this ensures thatPostConstructgets called when this bean is created via CDI. -
registerProvideContext
public void registerProvideContext(ISerializableSupplier<IPlaceholderProvideContext> provideContext) -
registerProvider
-
unregisterProvideContext
public void unregisterProvideContext(ISerializableSupplier<IPlaceholderProvideContext> provideContext) -
unregisterProvider
-
updatePlaceholderUiComponent
public void updatePlaceholderUiComponent() -
updatePlaceholders
public void updatePlaceholders(boolean withLoadingDialog) Action listener to update the available placeholders.- Parameters:
withLoadingDialog-trueto show a loading dialog,falseto perform the action in the background.
-