Package com._1c.g5.v8.dt.dcs.util
Class DcsUtil
java.lang.Object
com._1c.g5.v8.dt.dcs.util.DcsUtil
Вспомогательные функции
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
appendValueList
(TypedValueList to, TypedValueList from) Добавить один список в другойstatic void
clearDuplicatesValueList
(TypedValueList valueList) Удалить дублирующиеся значения в спискеstatic DataCompositionSettings
Creates new instance ofDataCompositionSettings
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 valuestatic Font
createDefaultFont
(Version version) static TypeItem
createType
(String typeName, Version version) Создать тип по имениstatic TypeDescription
createTypeDescription
(String typeName, Version version) Создать тип по имениstatic String
dscPathToSynonym
(String path) Get field synonym by data pathstatic org.eclipse.emf.ecore.EObject
getContextObject
(IV8Project v8project) Gets context object for resolvingstatic String
getDateTimePattern
(boolean isOnlyDate, boolean isOnlyTime) Get date time patternstatic List<DbViewFieldDef>
getFieldsByTypeDescription
(SettingsContext settingsContext, TypeDescription typeDescription) Returns fields provided by type description or empty list.static String
getLangString
(LocalString str, Language lang) Получить строку из многоязыковой строки по языкуstatic String
getLangString
(LocalString str, String langCode) Get current string from local stringstatic String
getLangString
(Presentation presentation, Language lang) Get current string from presentation byLanguage
static String
getLangString
(Presentation presentation, String langCode) Get current string from presentation by lang codestatic String
getNextName
(String template, List<String> names) Сгенерировать следующее имя объектаstatic <T> T
getQlDcsService
(Class<T> type) static QuerySchema
getQuerySchema
(String queryString, IDtProject project) CreateQuerySchema
by query stringstatic Collection<Type>
getResolvedTypes
(TypeDescription typeDescription, org.eclipse.emf.ecore.EObject context) Get collection of resolved types from type descriptionstatic Collection<Type>
getResolvedTypes
(TypeDescriptionSource tdp, SettingsContext settingsContext) Gets the collection of resolved type items, with typesets being taken into the accountstatic TypedValueList
getValueList
(IV8Project v8project, String langCode, List<AvailableValue> eList) Create TypedValueList from list of available valuesstatic TypeDescription
merge
(TypeDescription type1, TypeDescription type2) Check types and mergestatic String
nameToSynonym
(String str) Сформировать синоним по имени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) static String
pathToSynonym
(DcsPath path) Сформировать синоним по путиstatic <T extends org.eclipse.emf.ecore.EObject>
TresolveProxy
(T object, SettingsContext settingsContext)
-
Constructor Details
-
DcsUtil
public DcsUtil()
-
-
Method Details
-
createDefaultFont
-
nameToSynonym
Сформировать синоним по имени- Parameters:
str
- имя- Returns:
- синоним
-
pathToSynonym
Сформировать синоним по пути- Parameters:
path
- путь- Returns:
- синоним
- Throws:
DcsPathException
-
createTypeDescription
Создать тип по имени- Parameters:
typeName
- имя типаversion
- версия- Returns:
- тип
-
getLangString
Get current string from presentation byLanguage
- Parameters:
presentation
-Presentation
object contains localized strings, can benull
lang
-Language
object for getting presentation string by its lang code, cannot benull
- Returns:
- localized string from
Presentation
object corresponding to the specifiedlang
, nevernull
but can be empty string ifpresentation
isnull
orPresentation
object does not have any strings
-
getLangString
Get current string from presentation by lang code- Parameters:
presentation
-Presentation
object contains localized strings, can benull
langCode
- current language code, cannot benull
- Returns:
- localized string from
Presentation
object corresponding to the specifiedlangCode
, nevernull
but can be empty string ifpresentation
isnull
orPresentation
object does not have any strings
-
getLangString
Получить строку из многоязыковой строки по языку- Parameters:
str
- многоязыковая строкаlang
- язык- Returns:
- строка языка
-
getLangString
Get current string from local string- Parameters:
str
- local stringlangCode
- 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 nulllangCode
- current language code, can't be nulleList
- list of available values- Returns:
- TypedValueList list, never null
-
appendValueList
Добавить один список в другой- Parameters:
to
- цельfrom
- добавляемый
-
clearDuplicatesValueList
Удалить дублирующиеся значения в списке- Parameters:
valueList
- список
-
getQuerySchema
public static QuerySchema getQuerySchema(String queryString, IDtProject project) throws DcsDataSetInfoException CreateQuerySchema
by query string- Parameters:
queryString
- text of the queryproject
- actual project containing the query resource- Returns:
- created
QuerySchema
- Throws:
DcsDataSetInfoException
-
getQlDcsService
-
createType
Создать тип по имени- 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 nullcontext
- context object for resolving, can't be null- Returns:
- collection of resolved types, never null
-
merge
Check types and merge- Parameters:
type1
- first type, can't be nulltype2
- second type, can't be null- Returns:
- type or null if both types are null
-
getDateTimePattern
Get date time pattern- Parameters:
isOnlyDate
- - is show only dateisOnlyTime
- - is show only time- Returns:
- date time pattern
-
getContextObject
Gets context object for resolving- Parameters:
v8project
- contextIV8Project
, can't benull
- Returns:
- context object for the
#v8project
, nevernull
-
dscPathToSynonym
Get field synonym by data path- Parameters:
path
- field data path, can't be null- Returns:
- field synonym, never null
-
getNextName
Сгенерировать следующее имя объекта- 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
- TheTypeDescriptionSource
that represent the type. May not benull
settingsContext
- The context object to use for the resolution. May not benull
- 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 benull
typeDescription
- theTypeDescription
(may benull
)- Returns:
- fields from dbviews provided by field types or empty list.
-
createDefaultDataCompositionSettings
Creates new instance ofDataCompositionSettings
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, nevernull
-
resolveProxy
public static <T extends org.eclipse.emf.ecore.EObject> T resolveProxy(T object, SettingsContext settingsContext)
-