Class PlaceHolder
- java.lang.Object
-
- de.xima.fc.gui.common.placeholder.PlaceHolder
-
- All Implemented Interfaces:
IPlaceholder,Serializable
- Direct Known Subclasses:
GenericTextFragment
public class PlaceHolder extends Object implements IPlaceholder
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPlaceHolder.PlaceHolderBuilderUtility class for creating aPlaceHolder.
-
Field Summary
-
Fields inherited from interface de.xima.fc.gui.common.placeholder.IPlaceholder
LINK_RECOGNITION_PATTERN
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedPlaceHolder(String name, IPlaceholderType type, String kind, String alias, String placeholder, String text, IGuiIcon icon, boolean empty, ISerializableFunction<Locale,String> detailedDescription, ISerializableFunction<Locale,String> displayName)
-
Method Summary
-
-
-
Constructor Detail
-
PlaceHolder
protected PlaceHolder(String name, IPlaceholderType type, String kind, String alias, String placeholder, String text, IGuiIcon icon, boolean empty, ISerializableFunction<Locale,String> detailedDescription, ISerializableFunction<Locale,String> displayName)
-
-
Method Detail
-
comparator
public static Comparator<IPlaceholder> comparator(Locale locale)
-
empty
public static PlaceHolder empty(EPlaceholderType type)
- Parameters:
type- Type of placeholder- Returns:
- A new empty placeholder that cannot be inserted into a text field. Usually this is shown in the list of placeholders when no placeholders are available.
-
formLang
public static PlaceHolder formLang()
-
formXfAction
public static PlaceHolder formXfAction()
-
formXfQualifier
public static PlaceHolder formXfQualifier()
-
getAlias
public String getAlias()
- Specified by:
getAliasin interfaceIPlaceholder- Returns:
- Only for form field placeholders: The alias of the form field.
-
getDetailedDescription
public String getDetailedDescription(Locale locale)
- Specified by:
getDetailedDescriptionin interfaceIPlaceholder- Parameters:
locale- The locale to get the description for.- Returns:
- Detailed description of this placeholder, explaining what it does and how it works.
-
getDisplayName
public String getDisplayName(Locale locale)
- Specified by:
getDisplayNamein interfaceIPlaceholder- Parameters:
locale- The locale to get the display name for.- Returns:
- Display name of the placeholder, e.g.
Client ID. Usually shown in the list of available placeholders
-
getIcon
public IGuiIcon getIcon()
- Specified by:
getIconin interfaceIPlaceholder- Returns:
- Icon for this placeholder. Depending on the placeholder type, may overwrite the default icon of that type.
-
getIconStyleClass
public String getIconStyleClass()
- Returns:
- Style class for displaying the icon
-
getIconValue
public String getIconValue()
- Returns:
- Value for displaying the icon (text content of the span element)
-
getKind
@Deprecated public String getKind()
Deprecated.- Specified by:
getKindin interfaceIPlaceholder- Returns:
- The type or kind of the placeholder. May be used by certain
IPlaceholderTypes for a more detailed description etc.
-
getName
@Deprecated public String getName()
Deprecated.- Specified by:
getNamein interfaceIPlaceholder- Returns:
- Name of the placeholder, e.g.
CLIENT_ID. Usually shown in the list of available placeholders
-
getPlaceholder
public String getPlaceholder()
Description copied from interface:IPlaceholderGets the full placeholder name with the brackets, e.g.[%$CLIENT_ID%]. Used when inserting the placeholder in an input field- Specified by:
getPlaceholderin interfaceIPlaceholder- Returns:
- The full placeholder name including brackets.
-
getShortDescription
@Deprecated public String getShortDescription(Locale locale)
Deprecated.- Specified by:
getShortDescriptionin interfaceIPlaceholder- Parameters:
locale- The locale to get the description for.- Returns:
- Short description of this placeholder, explaining what it does.
-
getSortKey
public Comparable<?> getSortKey()
- Specified by:
getSortKeyin interfaceIPlaceholder- Returns:
- The sort key of this placeholder. Used for sorting placeholders in the list of available placeholders.
-
getText
public String getText()
- Specified by:
getTextin interfaceIPlaceholder- Returns:
- Content of this placeholder, eg. the HTML string for HTML template placeholders.
-
getType
public IPlaceholderType getType()
- Specified by:
getTypein interfaceIPlaceholder- Returns:
- Type of this placeholder (e.g. system, template, form field, etc.)
-
getInsertHint
public EPlaceholderInsertHint getInsertHint()
Description copied from interface:IPlaceholderThe preferred way for this text fragment to be inserted into input elements, although this might not be supported by all target components.The default implementation behaves as follows: If the placeholder starts with "LINK_", ends with "_LINK", or contains "_LINK_" or "_LINK." returns
LINK. Otherwise, returnsTEXT.- Specified by:
getInsertHintin interfaceIPlaceholder- Returns:
- The preferred insert mode for this text fragment.
-
isEmpty
public boolean isEmpty()
-
-