Class SynonymAwarePresentationProvider
java.lang.Object
com._1c.g5.v8.dt.md.resource.presentation.SynonymAwarePresentationProvider
- All Implemented Interfaces:
IPresentationAdapter
- Direct Known Subclasses:
PeriodFieldPresentationProvider
Default
IPresentationAdapter
implementation for DbView fields based on object with synonym.
This implementation uses synonym of given object.
This object should be instance of MdObject
or StandardAttribute
.
If given object has no synonym or wrong type this provider will return field name according
configuration script variant.
This implementation can be used only with DbViewFieldFieldDef
.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSynonymAwarePresentationProvider
(IBmModelManager bmModelManager) Constructs the instance of the provider. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addAdapter
(IBmObject target, org.eclipse.emf.ecore.EObject objectWithSynonym) Adds adapter data for the given context.static void
addAdapter
(IBmObject target, org.eclipse.emf.ecore.EObject objectWithSynonym, String separator, String suffix) Adds adapter data for the given context.protected IBmModelManager
Gets theIBmModelManager
reference for descendant's use.protected String
getFieldName
(DbViewFieldDef field) Gets the field display name.protected String
getFromSynonym
(IBmObject synonymSource, String languageCode) Gets the name information from the synonym.protected String
getLocalizedSuffix
(String suffix) Gets the UI-localized representation of the suffix.getPresentation
(IBmObject target, String languageCode) Returns object presentation for given languageCode
-
Field Details
-
BM_PERSISTENT_ADAPTER_ID
- See Also:
-
BM_PERSISTENT_ADAPTER_CONTEXT_KEY_SUFFIX
- See Also:
-
BM_PERSISTENT_ADAPTER_CONTEXT_KEY_SEPARATOR
- See Also:
-
-
Constructor Details
-
SynonymAwarePresentationProvider
Constructs the instance of the provider.- Parameters:
bmModelManager
- TheIBmModelManager
reference.
-
-
Method Details
-
addAdapter
Adds adapter data for the given context.- Parameters:
target
- The target object to store context in (notnull
)objectWithSynonym
- - the object with synonym (notnull
)
-
addAdapter
public static void addAdapter(IBmObject target, org.eclipse.emf.ecore.EObject objectWithSynonym, String separator, String suffix) Adds adapter data for the given context.- Parameters:
target
- The target object to store context in (notnull
)objectWithSynonym
- The object with synonym (notnull
)separator
- The separator (notnull
)suffix
- - the suffix (notnull
)
-
getPresentation
Description copied from interface:IPresentationAdapter
Returns object presentation for given languageCode- Specified by:
getPresentation
in interfaceIPresentationAdapter
languageCode
- - the language code (notnull
)- Returns:
- object presentation for given languageCode (never
null
)
-
getBmModelManager
Gets theIBmModelManager
reference for descendant's use.- Returns:
- The instance of the
IBmModelManager
.
-
getFieldName
Gets the field display name.- Parameters:
field
- The field.- Returns:
- The display name of the field.
-
getFromSynonym
Gets the name information from the synonym.- Parameters:
synonymSource
- The source of the synonym data.languageCode
- The code of the language to get synonym data for.- Returns:
- The synonym data that corresponds the given language code.
-
getLocalizedSuffix
Gets the UI-localized representation of the suffix.- Parameters:
suffix
- The suffix.- Returns:
- The localized representation of the suffix, never
null
-