Class SynonymAwarePresentationProvider

java.lang.Object
com._1c.g5.v8.dt.md.resource.presentation.SynonymAwarePresentationProvider
All Implemented Interfaces:
IPresentationAdapter
Direct Known Subclasses:
PeriodFieldPresentationProvider

public class SynonymAwarePresentationProvider extends Object implements IPresentationAdapter
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 Details

  • Constructor Details

    • SynonymAwarePresentationProvider

      public SynonymAwarePresentationProvider(IBmModelManager bmModelManager)
      Constructs the instance of the provider.
      Parameters:
      bmModelManager - The IBmModelManager reference.
  • Method Details

    • addAdapter

      public static void addAdapter(IBmObject target, org.eclipse.emf.ecore.EObject objectWithSynonym)
      Adds adapter data for the given context.
      Parameters:
      target - The target object to store context in (not null)
      objectWithSynonym - - the object with synonym (not null)
    • 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 (not null)
      objectWithSynonym - The object with synonym (not null)
      separator - The separator (not null)
      suffix - - the suffix (not null)
    • getPresentation

      public String getPresentation(IBmObject target, String languageCode)
      Description copied from interface: IPresentationAdapter
      Returns object presentation for given languageCode
      Specified by:
      getPresentation in interface IPresentationAdapter
      languageCode - - the language code (not null)
      Returns:
      object presentation for given languageCode (never null)
    • getBmModelManager

      protected IBmModelManager getBmModelManager()
      Gets the IBmModelManager reference for descendant's use.
      Returns:
      The instance of the IBmModelManager.
    • getFieldName

      protected String getFieldName(DbViewFieldDef field)
      Gets the field display name.
      Parameters:
      field - The field.
      Returns:
      The display name of the field.
    • getFromSynonym

      protected String getFromSynonym(IBmObject synonymSource, String languageCode)
      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

      protected String getLocalizedSuffix(String suffix)
      Gets the UI-localized representation of the suffix.
      Parameters:
      suffix - The suffix.
      Returns:
      The localized representation of the suffix, never null