com.sap.tc.cmi.texts

Interface ICMITextProvider


public interface ICMITextProvider

Provides static texts for UI scenarios, like captions, field labels, table columns etc. CMI consumers interested in texts should check the metadata entities ICMIModelClassInfo, ICMIModelClassPropertyInfo, ICMIRelationRoleInfo, whether they implement this interface.

Since:
NY AP5

Method Summary
 CMITextType[] getAvailableTextTypes()
          Returns the set of text types that this provider can provide.
 CMITextType[] getAvailableTextTypes(String[] componentPath)
          Returns the set of text types that this provider can provide.
 String getText(CMITextType type)
          Returns UI text of the given text type, suitable for the given locale and timezone.
 String getText(CMITextType type, Locale locale, TimeZone tz)
          Returns UI text of the given text type, suitable for the given locale and timezone.
 String getText(String[] componentPath, CMITextType type)
          Returns UI text of the given text type, suitable for the given locale and timezone.
 String getText(String[] componentPath, CMITextType type, Locale locale, TimeZone tz)
          Returns UI text of the given text type, suitable for the given locale and timezone.
 

Method Detail

getAvailableTextTypes

CMITextType[] getAvailableTextTypes()
Returns the set of text types that this provider can provide. If it provides no texts, an empty array is returned (eg. CMITextType.NO_TEXT_TYPES ).

Returns:

getText

String getText(CMITextType type,
               Locale locale,
               TimeZone tz)
Returns UI text of the given text type, suitable for the given locale and timezone. If a provider can't provide text of the given type, null must be returned. This allows clients to determine fallback text types on their own.

The locale and timezone parameters are fully optional. If a parameter is null or if a provider can't deal with a given value, then it must be ignored. Instead, the provider can choose a locale or timezone on its own (typically some model instance specific locale/timezone, e.g. the locale of the backen connection). The intention is that - in contrast to an unsupported text type - a missing or unsupported locale or timezone does never lead to a return value of null. This encourages consumers to always specify locale and timezone information without losing functionality.

Returns:
text of the given type or null.

getText

String getText(CMITextType type)
Returns UI text of the given text type, suitable for the given locale and timezone. If a provider can't provide text of the given type, null must be returned. This allows clients to determine fallback text types on their own.

Locale and timezone settings are chosen by the provider implementation. This method should behave exactly as if calling getText(type, null, null).


getAvailableTextTypes

CMITextType[] getAvailableTextTypes(String[] componentPath)
Returns the set of text types that this provider can provide. If it provides no texts, an empty array is returned (eg. CMITextType.NO_TEXT_TYPES ).

Returns:

getText

String getText(String[] componentPath,
               CMITextType type,
               Locale locale,
               TimeZone tz)
Returns UI text of the given text type, suitable for the given locale and timezone. If a provider can't provide text of the given type, null must be returned. This allows clients to determine fallback text types on their own.

The locale and timezone parameters are fully optional. If a parameter is null or if a provider can't deal with a given value, then it must be ignored. Instead, the provider can choose a locale or timezone on its own (typically some model instance specific locale/timezone, e.g. the locale of the backen connection). The intention is that - in contrast to an unsupported text type - a missing or unsupported locale or timezone does never lead to a return value of null. This encourages consumers to always specify locale and timezone information without losing functionality.

Returns:
text of the given type or null.

getText

String getText(String[] componentPath,
               CMITextType type)
Returns UI text of the given text type, suitable for the given locale and timezone. If a provider can't provide text of the given type, null must be returned. This allows clients to determine fallback text types on their own.

Locale and timezone settings are chosen by the provider implementation. This method should behave exactly as if calling getText(type, null, null).

Access Rights

This class can be accessed from:


SC DC
[sap.com] FRAMEWORK [sap.com] tc/cmi
[sap.com] FRAMEWORK [sap.com] tc/cm/ejb/api


Copyright 2010 SAP AG Complete Copyright Notice