Class DcsUtil

java.lang.Object
com._1c.g5.v8.dt.dcs.util.DcsUtil

public class DcsUtil extends Object
Вспомогательные функции
  • Constructor Details

    • DcsUtil

      public DcsUtil()
  • Method Details

    • createDefaultFont

      public static Font createDefaultFont(Version version)
    • nameToSynonym

      public static String nameToSynonym(String str)
      Сформировать синоним по имени
      Parameters:
      str - имя
      Returns:
      синоним
    • pathToSynonym

      public static String pathToSynonym(DcsPath path) throws DcsPathException
      Сформировать синоним по пути
      Parameters:
      path - путь
      Returns:
      синоним
      Throws:
      DcsPathException
    • createTypeDescription

      public static TypeDescription createTypeDescription(String typeName, Version version)
      Создать тип по имени
      Parameters:
      typeName - имя типа
      version - версия
      Returns:
      тип
    • getLangString

      public static String getLangString(Presentation presentation, Language lang)
      Get current string from presentation by Language
      Parameters:
      presentation - Presentation object contains localized strings, can be null
      lang - Language object for getting presentation string by its lang code, cannot be null
      Returns:
      localized string from Presentation object corresponding to the specified lang, never null but can be empty string if presentation is null or Presentation object does not have any strings
    • getLangString

      public static String getLangString(Presentation presentation, String langCode)
      Get current string from presentation by lang code
      Parameters:
      presentation - Presentation object contains localized strings, can be null
      langCode - current language code, cannot be null
      Returns:
      localized string from Presentation object corresponding to the specified langCode, never null but can be empty string if presentation is null or Presentation object does not have any strings
    • getLangString

      public static String getLangString(LocalString str, Language lang)
      Получить строку из многоязыковой строки по языку
      Parameters:
      str - многоязыковая строка
      lang - язык
      Returns:
      строка языка
    • getLangString

      public static String getLangString(LocalString str, String langCode)
      Get current string from local string
      Parameters:
      str - local string
      langCode - current language code
      Returns:
      current string
    • getValueList

      public static TypedValueList getValueList(IV8Project v8project, String langCode, List<AvailableValue> eList)
      Create TypedValueList from list of available values
      Parameters:
      v8project - the V8 project, can't be null
      langCode - current language code, can't be null
      eList - list of available values
      Returns:
      TypedValueList list, never null
    • appendValueList

      public static void appendValueList(TypedValueList to, TypedValueList from)
      Добавить один список в другой
      Parameters:
      to - цель
      from - добавляемый
    • clearDuplicatesValueList

      public static void clearDuplicatesValueList(TypedValueList valueList)
      Удалить дублирующиеся значения в списке
      Parameters:
      valueList - список
    • getQuerySchema

      public static QuerySchema getQuerySchema(String queryString, IDtProject project) throws DcsDataSetInfoException
      Create QuerySchema by query string
      Parameters:
      queryString - text of the query
      project - actual project containing the query resource
      Returns:
      created QuerySchema
      Throws:
      DcsDataSetInfoException
    • getQlDcsService

      public static <T> T getQlDcsService(Class<T> type)
    • createType

      public static TypeItem createType(String typeName, Version version)
      Создать тип по имени
      Parameters:
      typeName - имя типа
      version - версия
      Returns:
      тип
    • getResolvedTypes

      public static Collection<Type> getResolvedTypes(TypeDescription typeDescription, org.eclipse.emf.ecore.EObject context)
      Get collection of resolved types from type description
      Parameters:
      typeDescription - type description, can't be null
      context - context object for resolving, can't be null
      Returns:
      collection of resolved types, never null
    • merge

      public static TypeDescription merge(TypeDescription type1, TypeDescription type2)
      Check types and merge
      Parameters:
      type1 - first type, can't be null
      type2 - second type, can't be null
      Returns:
      type or null if both types are null
    • getDateTimePattern

      public static String getDateTimePattern(boolean isOnlyDate, boolean isOnlyTime)
      Get date time pattern
      Parameters:
      isOnlyDate - - is show only date
      isOnlyTime - - is show only time
      Returns:
      date time pattern
    • getContextObject

      public static org.eclipse.emf.ecore.EObject getContextObject(IV8Project v8project)
      Gets context object for resolving
      Parameters:
      v8project - context IV8Project, can't be null
      Returns:
      context object for the #v8project, never null
    • dscPathToSynonym

      public static String dscPathToSynonym(String path)
      Get field synonym by data path
      Parameters:
      path - field data path, can't be null
      Returns:
      field synonym, never null
    • getNextName

      public static String getNextName(String template, List<String> names)
      Сгенерировать следующее имя объекта
      Parameters:
      template - шаблонная часть имени (НаборДанных), не может быть null
      names - существующие имена (НаборДанных1, НаборДанных2), не может быть null
      Returns:
      следующее имя (НаборДанных3), никогда не null
    • parse

      public static <T> T parse(String textToParse, org.eclipse.emf.common.util.URI uri, org.eclipse.emf.ecore.resource.ResourceSet resourceSet, IDtProject dtProject, Map<?,?> options, List<org.eclipse.emf.ecore.resource.Resource.Diagnostic> outputErrors)
    • getResolvedTypes

      public static Collection<Type> getResolvedTypes(TypeDescriptionSource tdp, SettingsContext settingsContext)
      Gets the collection of resolved type items, with typesets being taken into the account
      Parameters:
      tdp - The TypeDescriptionSource that represent the type. May not be null
      settingsContext - The context object to use for the resolution. May not be null
      Returns:
      The collection of resolved types. Never null
    • getFieldsByTypeDescription

      public static List<DbViewFieldDef> getFieldsByTypeDescription(SettingsContext settingsContext, TypeDescription typeDescription)
      Returns fields provided by type description or empty list.
      Parameters:
      settingsContext - The context object to use for the resolution. May not be null
      typeDescription - the TypeDescription (may be null)
      Returns:
      fields from dbviews provided by field types or empty list.
    • createDefaultDataCompositionSettings

      public static DataCompositionSettings createDefaultDataCompositionSettings()
      Creates new instance of DataCompositionSettings with filled properties such as:
      • DcsPackage.Literals.DATA_COMPOSITION_SETTINGS__ITEMS_USER_SETTING_ID filled by random uuid
      • DcsPackage.Literals.DATA_COMPOSITION_SETTINGS__VIEW_MODE filled by DataCompositionSettingsItemViewMode.NORMAL value
      • DcsPackage.Literals.DATA_COMPOSITION_SETTINGS__FILTER filled by new object DcsPackage.Literals.DATA_COMPOSITION_FILTER
      • DcsPackage.Literals.DATA_COMPOSITION_FILTER__USER_SETTING_ID filled by random uuid
      • DcsPackage.Literals.DATA_COMPOSITION_FILTER__VIEW_MODE filled by DataCompositionSettingsItemViewMode.NORMAL value
      • DcsPackage.Literals.DATA_COMPOSITION_SETTINGS__ORDER filled by new object DcsPackage.Literals.DATA_COMPOSITION_ORDER
      • DcsPackage.Literals.DATA_COMPOSITION_ORDER__USER_SETTING_ID filled by random uuid
      • DcsPackage.Literals.DATA_COMPOSITION_ORDER__VIEW_MODE filled by DataCompositionSettingsItemViewMode.NORMAL value
      • DcsPackage.Literals.DATA_COMPOSITION_SETTINGS__CONDITIONAL_APPEARANCE filled by new object DcsPackage.Literals.DATA_COMPOSITION_CONDITIONAL_APPEARANCE
      • DcsPackage.Literals.DATA_COMPOSITION_CONDITIONAL_APPEARANCE__USER_SETTING_ID filled by random uuid
      • DcsPackage.Literals.DATA_COMPOSITION_CONDITIONAL_APPEARANCE__VIEW_MODE filled by DataCompositionSettingsItemViewMode.NORMAL value
      Returns:
      new instance of DataCompositionSettings with filled properties, never null
    • resolveProxy

      public static <T extends org.eclipse.emf.ecore.EObject> T resolveProxy(T object, SettingsContext settingsContext)