Package com._1c.g5.v8.dt.form.service
Class FormUtil
- java.lang.Object
-
- com._1c.g5.v8.dt.form.service.FormUtil
-
public class FormUtil extends Object
Utility class
-
-
Field Summary
Fields Modifier and Type Field Description static com.google.common.base.Function<org.eclipse.emf.ecore.EObject,Form>
EOBJECT_TO_FORM
-
Constructor Summary
Constructors Constructor Description FormUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static boolean
arePropertyInfosEqual(Object a, Object b)
Test whether two potential property infos are equal or not.static Set<Command>
getCommandsByTypes(CommandInterfaceRoot cmiRoot, Collection<TypeItem> types)
Returns commands by selected types.static TypeItem
getExactAttributeType(FormAttribute attribute)
Extracts exact type information of a given form attribute.static FormAttribute
getFormAttribute(PropertyInfo prop)
Returns attribute of the rootPropertyInfo
.static FormAttributeService
getFormAttributeService()
Gets FormAttributeService.static AbstractFormAttribute
getItemAttribute(DataItem dataItem)
static PropertyInfo
getItemOwnPropertyInfo(DataItem dataItem)
Gets the item own property info.static PropertyInfo
getItemPropertyInfo(DataItem dataItem)
Deprecated.UsegetItemOwnPropertyInfo(DataItem)
instead.static TypeItem
getItemType(DataItem dataItem)
static TypeDescription
getItemTypeDescription(DataItem dataItem)
static String
getItemTypeName(DataItem dataItem)
static FormAttribute
getMainAttribute(Form form)
Finds main form attribute for a given form.static ElementDataSourceInfo
getParentTableElements(PropertyInfo columnPropertyInfo)
The method find relative paretn elmentstatic AbstractFormDataSourceInfo
getRelativeElementDataSourceInfo(PropertyInfo propertyInfo, PropertyInfo base)
The method get relative element data source info.static FormAttribute
getTopFormAttribute(PropertyInfo prop)
Returns top attributestatic boolean
isChoiceForm(Form form, FormAttribute mainAttribute)
Determines whether a given form is a choice form.static boolean
isColumn(PropertyInfo propertyInfo)
static boolean
isListForm(Form form, FormAttribute mainAttribute)
Determines whether a given form is a list form.static boolean
isSystemLanguageIsRussian()
Checks whether system language is Russian or not.
-
-
-
Field Detail
-
EOBJECT_TO_FORM
public static final com.google.common.base.Function<org.eclipse.emf.ecore.EObject,Form> EOBJECT_TO_FORM
-
-
Method Detail
-
getFormAttribute
public static FormAttribute getFormAttribute(PropertyInfo prop)
Returns attribute of the rootPropertyInfo
.- Parameters:
prop
- - a form property info- Returns:
- - a attribute of the root
PropertyInfo
.
-
getTopFormAttribute
public static FormAttribute getTopFormAttribute(PropertyInfo prop)
Returns top attribute- Parameters:
prop
- - a form property info- Returns:
- - a top attribute of the root
PropertyInfo
.
-
getFormAttributeService
public static FormAttributeService getFormAttributeService()
Gets FormAttributeService. The service turns out through IoCFormPlugin#getInjector()
.This method is created for support of an old code. Don't use this method when writing a new code.
- Returns:
- the FormAttributeService.
-
getRelativeElementDataSourceInfo
public static AbstractFormDataSourceInfo getRelativeElementDataSourceInfo(PropertyInfo propertyInfo, PropertyInfo base)
The method get relative element data source info.- Parameters:
propertyInfo
- the property info.base
- the base of property info.- Returns:
- the relative element data source info.
-
getParentTableElements
public static ElementDataSourceInfo getParentTableElements(PropertyInfo columnPropertyInfo)
The method find relative paretn elment- Parameters:
columnPropertyInfo
- the property info- Returns:
- return relative
ElementDataSourceInfo
element. Can returnnull
if parent table do not found
-
isColumn
public static boolean isColumn(PropertyInfo propertyInfo)
-
arePropertyInfosEqual
public static boolean arePropertyInfosEqual(Object a, Object b)
Test whether two potential property infos are equal or not.- Parameters:
a
- property info Ab
- property info B- Returns:
true
if they are both property infos and their data paths are not empty and equal,false
otherwise.
-
getItemTypeDescription
public static TypeDescription getItemTypeDescription(DataItem dataItem)
- Returns:
TypeDescription
for a givendataItem
ornull
, if no information found.
-
getItemType
public static TypeItem getItemType(DataItem dataItem)
- Returns:
TypeItem
for a givendataItem
ornull
, if no information found.
-
getItemTypeName
public static String getItemTypeName(DataItem dataItem)
- Returns:
- type name for a given
dataItem
ornull
, if no information found.
-
getItemAttribute
public static AbstractFormAttribute getItemAttribute(DataItem dataItem)
- Returns:
AbstractFormAttribute
for a givendataItem
ornull
, if no information found.
-
getItemOwnPropertyInfo
public static PropertyInfo getItemOwnPropertyInfo(DataItem dataItem)
Gets the item own property info.- Parameters:
dataItem
- the data item.- Returns:
- the item property info
-
getItemPropertyInfo
@Deprecated public static PropertyInfo getItemPropertyInfo(DataItem dataItem)
Deprecated.UsegetItemOwnPropertyInfo(DataItem)
instead.Gets the item property info.- Parameters:
dataItem
- the data item.- Returns:
- the item property info
-
isSystemLanguageIsRussian
public static boolean isSystemLanguageIsRussian()
Checks whether system language is Russian or not.- Returns:
true
if system language is Russian,false
otherwise.
-
getMainAttribute
public static FormAttribute getMainAttribute(Form form)
Finds main form attribute for a given form.- Parameters:
form
- form to find main attribute of.- Returns:
- found main attribute or
null
if form has no main attribute.
-
getExactAttributeType
public static TypeItem getExactAttributeType(FormAttribute attribute)
Extracts exact type information of a given form attribute.- Parameters:
attribute
- attribute to extract exact type of.- Returns:
- extracted type or
null
if attribute has no type or type is composite.
-
isListForm
public static boolean isListForm(Form form, FormAttribute mainAttribute)
Determines whether a given form is a list form.- Parameters:
form
- form to check.mainAttribute
- main form attribute.- Returns:
true
if it's a list form,false
otherwise.
-
isChoiceForm
public static boolean isChoiceForm(Form form, FormAttribute mainAttribute)
Determines whether a given form is a choice form.- Parameters:
form
- form to check.mainAttribute
- main form attribute.- Returns:
true
if it's a choice form,false
otherwise.
-
getCommandsByTypes
public static Set<Command> getCommandsByTypes(CommandInterfaceRoot cmiRoot, Collection<TypeItem> types)
Returns commands by selected types.- Parameters:
cmiRoot
- the CMI root model, cannot benull
types
- the types, cannot benull
- Returns:
- the commands
-
-