Package com.luciad.datamodel
Class TLcdResourceBundleDataModelDisplayNameProvider
java.lang.Object
com.luciad.datamodel.TLcdResourceBundleDataModelDisplayNameProvider
- All Implemented Interfaces:
ILcdDataModelDisplayNameProvider
public class TLcdResourceBundleDataModelDisplayNameProvider
extends Object
implements ILcdDataModelDisplayNameProvider
Implementation of an
ILcdDataModelDisplayNameProvider
based on a resource bundle. The resource bundle should contain display names as values.
The keys are as follows:
- <data model name>
- <type name>
- <type name>.<property name>
- Since:
- 10.0
-
Constructor Summary
ConstructorDescriptionCreates a new provider based on the resource bundle that is found usingResourceBundle.getBundle(String)
.TLcdResourceBundleDataModelDisplayNameProvider
(ResourceBundle aResourceBundle) Creates a new provider based on the given resource bundle. -
Method Summary
Modifier and TypeMethodDescriptiongetDisplayName
(TLcdDataModel aDataModel) Returns the display name for the given data model.getDisplayName
(TLcdDataProperty aProperty) Returns the display name for the given data property.getDisplayName
(TLcdDataType aType) Returns the display name for the given data type.getDisplayName
(TLcdDataType aType, Object aValue) Returns the display name for the given value, part of the value domain of the given data type.
-
Constructor Details
-
TLcdResourceBundleDataModelDisplayNameProvider
Creates a new provider based on the resource bundle that is found usingResourceBundle.getBundle(String)
.- Parameters:
aBaseName
- the base name of the resource
-
TLcdResourceBundleDataModelDisplayNameProvider
Creates a new provider based on the given resource bundle.- Parameters:
aResourceBundle
- the resource bundle to use for looking up the display names
-
-
Method Details
-
getDisplayName
Returns the display name for the given data model. In case the resource bundle can't provide a name, the name of the data model is returned.- Specified by:
getDisplayName
in interfaceILcdDataModelDisplayNameProvider
- Parameters:
aDataModel
- the data model for which the display name is to be returned- Returns:
- the display name for the given data model
-
getDisplayName
Returns the display name for the given data type. The key that is used to search in the resource bundle is the name of the type. In case the resource bundle can't provide a name, the name of the data type is returned.- Specified by:
getDisplayName
in interfaceILcdDataModelDisplayNameProvider
- Parameters:
aType
- the data type for which the display name is to be returned- Returns:
- the display name for the given data type
-
getDisplayName
Returns the display name for the given data property. The key that is used to search in the resource bundle is the result from evaluatingaProperty.getDeclaringType().getName() + "." + aProperty.getName()
. In case the resource bundle can't provide a name, the name of the property is returned.- Specified by:
getDisplayName
in interfaceILcdDataModelDisplayNameProvider
- Parameters:
aProperty
- the property for which the display name is to be returned- Returns:
- the display name for the given property
-
getDisplayName
Returns the display name for the given value, part of the value domain of the given data type. The key that is used to search in the resource bundle is the result from evaluatingaType.getName() + "." + aValue.toString()
. In case the resource bundle can't provide a name, the toString() of the value is returned.- Specified by:
getDisplayName
in interfaceILcdDataModelDisplayNameProvider
- Parameters:
aType
- the data typeaValue
- the value- Returns:
- the display name for the given value
-