com.sap.ip.collaboration.core.api.util.text

Interface IText

All Known Implementing Classes:
FixText

public interface IText

Representation of an internationalizable text. Text objects are retrieved from TextBundles.

The Text interface supports internationalization and retrieving texts with different lengths for different GUI purposes.

There is no fix definition of the text lengths. The three text length types are only a hint. The idea is of cause that short <= medium <= long is true.

There is an optional fallback onto a technical constructed name if there is no resource bundle at all. The normal behavior is to throw a MissingResourceException.

Copyright: Copyright (c) 2002 Company: SAP Portals


Field Summary
static boolean FALLBACK
          flag for fallback
static boolean NO_FALLBACK
          flag for no fallback
 
Method Summary
 String getLongText(Locale aLocale)
          returns a locale specific long version of the text.
 String getLongText(Locale aLocale, boolean fallback)
          returns a locale specific long version of the text.
 String getMediumText(Locale aLocale)
          returns a locale specific medium version of the text.
 String getMediumText(Locale aLocale, boolean fallback)
          returns a locale specific medium version of the text.
 String getShortText(Locale aLocale)
          returns a locale specific short version of the text.
 String getShortText(Locale aLocale, boolean fallback)
          returns a locale specific short version of the text.
 String getText(Locale aLocale, int aLengthType, boolean fallback)
          returns a locale specific version of the text.
 

Field Detail

FALLBACK

static final boolean FALLBACK
flag for fallback

See Also:
Constant Field Values

NO_FALLBACK

static final boolean NO_FALLBACK
flag for no fallback

See Also:
Constant Field Values
Method Detail

getText

String getText(Locale aLocale,
               int aLengthType,
               boolean fallback)
returns a locale specific version of the text. The text length is an argument of the method

Parameters:
aLocale - the locale for the text
aLengthType - one of the length types defined in TextBundle
fallback - true, if a technical name should be contructed when
Returns:
formatted text
Throws:
MissingResourceException - if the text key is missing and fallback is disabled

getShortText

String getShortText(Locale aLocale)
returns a locale specific short version of the text. If there is no short version, an artifical string containing the text key and the parameters will be constructed.

Parameters:
aLocale - the locale for the text
Returns:
formatted text
Throws:
MissingResourceException - if the text key is missing

getShortText

String getShortText(Locale aLocale,
                    boolean fallback)
returns a locale specific short version of the text. If there is no short version, an artifical string containing the text key and the parameters will be constructed.

Parameters:
aLocale - the locale for the text
fallback - true, if a technical name should be contructed when
Returns:
formatted text
Throws:
MissingResourceException - if the text key is missing and fallback is disabled

getMediumText

String getMediumText(Locale aLocale)
returns a locale specific medium version of the text. If there is no medium version, the short version will be returned

Parameters:
aLocale - the locale for the text
Returns:
formatted text
Throws:
MissingResourceException - if the text key is missing

getMediumText

String getMediumText(Locale aLocale,
                     boolean fallback)
returns a locale specific medium version of the text. If there is no medium version, the short version will be returned

Parameters:
aLocale - the locale for the text
fallback - true, if a technical name should be contructed when
Returns:
formatted text
Throws:
MissingResourceException - if the text key is missing and fallback is disabled

getLongText

String getLongText(Locale aLocale)
returns a locale specific long version of the text. If there is no long version, the medium version will be returned.

Parameters:
aLocale - the locale for the text
Returns:
formatted text
Throws:
MissingResourceException - if the text key is missing

getLongText

String getLongText(Locale aLocale,
                   boolean fallback)
returns a locale specific long version of the text. If there is no long version, the medium version will be returned.

Parameters:
aLocale - the locale for the text
fallback - true, if a technical name should be contructed when
Returns:
formatted text
Throws:
MissingResourceException - if the text key is missing and fallback is disabled
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] KMC-CM [sap.com] tc/km/frwk api EP-KM-CM
[sap.com] KMC-COLL [sap.com] tc/kmc/coll/util api EP-KM-COL
[sap.com] KMC-WPC [sap.com] tc/kmc/wpc/wpcfacade api EP-PIN-WPC-WCM


Copyright 2011 SAP AG Complete Copyright Notice