Package com._1c.g5.v8.dt.md
Class PredefinedItemUtil
java.lang.Object
com._1c.g5.v8.dt.md.PredefinedItemUtil
PredefinedItem util.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumGeneral enumerator for presentation fields (for example,CatalogMainPresentationand others) -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanCodeEdit(org.eclipse.emf.ecore.EObject eObject) Checks code edit ability.static booleancanDescriptionEdit(org.eclipse.emf.ecore.EObject eObject) Checks description edit ability.static booleancanTypeDescriptionEdit(org.eclipse.emf.ecore.EObject eObject) Checks type description edit ability.static PredefinedItemfindPredefinedItemByName(org.eclipse.emf.ecore.EObject parent, String name) Find predefined item in specified parent object by given namestatic StringGenerates unique code for new predefined item in the given parent object.static StringgeneratePredefinedItemUniqueName(BasicDbObject parent, boolean isFolder) Generates unique name for new predefined item in the given parent object.static AllowedLengthGets code allowed length.static org.eclipse.emf.ecore.EAttributegetCodeAllowedLengthFeature(org.eclipse.emf.ecore.EObject eObject) Returns e-object code allowed length feature if present.static intGets code length.static org.eclipse.emf.ecore.EAttributegetCodeLengthFeature(org.eclipse.emf.ecore.EObject eObject) Returns e-object code length feature if present.static org.eclipse.emf.common.util.EnumeratorgetCodeType(BasicDbObject obj) Gets code type if supports.static org.eclipse.emf.ecore.EAttributegetCodeTypeFeature(org.eclipse.emf.ecore.EObject eObject) Returns e-object code type feature if present.static List<? extends PredefinedItem>getContent(org.eclipse.emf.ecore.EObject item) Get predefined item content.static intGets description length.static org.eclipse.emf.ecore.EAttributegetDescriptionLengthFeature(org.eclipse.emf.ecore.EObject eObject) Returns e-object description length feature if present.static List<? extends PredefinedItem>getItems(org.eclipse.emf.ecore.EObject obj) Gets model orPredefinedpredefined items.static org.eclipse.emf.ecore.EObjectgetItemsContainer(org.eclipse.emf.ecore.EObject predefinedContainer) Returns predefined item container.static org.eclipse.emf.ecore.EReferencegetItemsFeature(org.eclipse.emf.ecore.EObject eObject) Returns predefined data items feature if object supports one.static intgetLevelCount(org.eclipse.emf.ecore.EObject obj) Gets level count if supports.static PredefinedgetPredefined(org.eclipse.emf.ecore.EObject obj) Gets model predefined if supports.static List<? extends PredefinedItem>getPredefinedChildItems(org.eclipse.emf.ecore.EObject parent) Gets model predefined child items if supports.static org.eclipse.emf.ecore.EReferencegetPredefinedFeature(org.eclipse.emf.ecore.EObject eObject) Returns predefined data feature if object supports one.static ObjectGets predefined item code.static org.eclipse.emf.ecore.EStructuralFeatureGets predefined item code.getPresentationField(BasicDbObject object) Gets presentation field byBasicDbObjectornullstatic booleanhasOwners(BasicDbObject obj) Returnstrueif the object has owners.static booleanisAddEnabledForSelectedPredefinedItem(BasicDbObject basicDbObject, Object selectedObject, boolean isFolder) Checks is element adding enabled for selected object for predefined container hierarchy type.static booleanReturntrueif autonumbering used.static booleanReturntrueif check unique used.static booleanChecks if object code type is fixed.static booleanisHierarchical(org.eclipse.emf.ecore.EObject obj) Returnstrueif hierarchical model.static booleanReturnstrueif folders and items hierarchy.static booleanReturnstrueif items hierarchy.static booleanCheks if object has number type code.static booleanisNumberCodeType(org.eclipse.emf.common.util.Enumerator codeType) Cheks if code type is number.static booleanChecks if object has zero length code.static booleanisPredefinedItemFolder(Object item) Returnstrueif predefined item is folder.static booleanChecks if object supports predefined data.static booleanCheks if object has string type code.static booleanisStringCodeType(org.eclipse.emf.common.util.Enumerator codeType) Cheks if code type is string.static booleanReturnstrueif model has whole object code series selected.static ObjectmapStringToValue(String stringCodeVaule, BasicDbObject basicDbObject) Maps string code value to metadata model type value by hisBasicDbObjectcode type.static StringnormalizeCode(boolean fixedStringCodeType, boolean numberCodeType, int codeLength, String code) Normalizes code for fixed string code or empty number code or null code.
-
Method Details
-
getPresentationField
Gets presentation field byBasicDbObjectornull- Parameters:
object-BasicDbObject, can benull- Returns:
PredefinedItemUtil.PresentationField, cannot benull
-
getCodeAllowedLength
Gets code allowed length.- Parameters:
obj- the object, cannot benull- Returns:
- the allowed length
-
getCodeLength
Gets code length.- Parameters:
obj- the object, cannot benull- Returns:
- the code length
-
getCodeType
Gets code type if supports.- Parameters:
obj- the object, cannot benull- Returns:
- the code type, if not supported returns
null
-
getContent
Get predefined item content.- Parameters:
item- the predefined item, cannot benull- Returns:
- the content
-
getItems
Gets model orPredefinedpredefined items.- Parameters:
obj- the object or predefined, cannot benull- Returns:
- the items
-
getLevelCount
public static int getLevelCount(org.eclipse.emf.ecore.EObject obj) Gets level count if supports.- Parameters:
obj- the object, cannot benull- Returns:
- the level count or -1 if not supported
-
getPredefined
Gets model predefined if supports.- Parameters:
obj- the object, cannot benull- Returns:
- the predefined,
nullif not supported
-
getPredefinedItemCode
Gets predefined item code.- Parameters:
item- the item, cannot benull- Returns:
- the code,
nullif not supported
-
getPredefinedItemCodeFeature
public static org.eclipse.emf.ecore.EStructuralFeature getPredefinedItemCodeFeature(PredefinedItem item) Gets predefined item code.- Parameters:
item- the item, cannot benull- Returns:
- the code,
nullif not supported
-
findPredefinedItemByName
public static PredefinedItem findPredefinedItemByName(org.eclipse.emf.ecore.EObject parent, String name) Find predefined item in specified parent object by given name- Parameters:
parent- the parent of predefained items, cannot benullname- the name of searched predefained item, cannot benull- Returns:
- instance of
PredefinedItemfinded in parent object predefined items ornull
-
getItemsContainer
public static org.eclipse.emf.ecore.EObject getItemsContainer(org.eclipse.emf.ecore.EObject predefinedContainer) Returns predefined item container.- Parameters:
predefinedContainer- the predefined data container, cannot benull- Returns:
- the predefined item container (predefined or predefined item), otherwise
null
-
getItemsFeature
public static org.eclipse.emf.ecore.EReference getItemsFeature(org.eclipse.emf.ecore.EObject eObject) Returns predefined data items feature if object supports one.- Parameters:
eObject- the e-object, cannot benull- Returns:
- the feature or
nullif not supports
-
getPredefinedFeature
public static org.eclipse.emf.ecore.EReference getPredefinedFeature(org.eclipse.emf.ecore.EObject eObject) Returns predefined data feature if object supports one.- Parameters:
eObject- the model, cannot benull- Returns:
- the feature or
nullif not supports
-
getPredefinedChildItems
public static List<? extends PredefinedItem> getPredefinedChildItems(org.eclipse.emf.ecore.EObject parent) Gets model predefined child items if supports.- Parameters:
obj- the object, cannot benull- Returns:
- the child predefined items, empty list if not supported
-
hasOwners
Returnstrueif the object has owners.- Parameters:
obj- the object, cannot benull- Returns:
- true if has owners
-
getDescriptionLength
Gets description length.- Parameters:
obj- the object, cannot benull- Returns:
- the description length
-
isAutonumbering
Returntrueif autonumbering used.- Parameters:
obj- the object, cannot benull- Returns:
trueif autonumbering
-
isFixedStringCode
Checks if object code type is fixed.- Parameters:
obj- the object, cannot benull- Returns:
trueif fixed
-
isHierarchical
public static boolean isHierarchical(org.eclipse.emf.ecore.EObject obj) Returnstrueif hierarchical model.- Parameters:
obj- the object, cannot benull- Returns:
trueif is
-
isHierarchyFoldersAndItems
Returnstrueif folders and items hierarchy.- Parameters:
obj- the object, cannot benull- Returns:
trueif is
-
isHierarchyOfItems
Returnstrueif items hierarchy.- Parameters:
obj- the object, cannot benull- Returns:
trueif is
-
isNumberCode
Cheks if object has number type code.- Parameters:
obj- the object, cannot benull- Returns:
trueis number type code
-
isNumberCodeType
public static boolean isNumberCodeType(org.eclipse.emf.common.util.Enumerator codeType) Cheks if code type is number.- Parameters:
codeType- the code type, can benull- Returns:
trueis number
-
isNumberZeroLengthCode
Checks if object has zero length code.- Parameters:
obj- the object, can benull- Returns:
trueis zero
-
isPredefinedItemFolder
Returnstrueif predefined item is folder.- Parameters:
item- the predefined item, cannot benull- Returns:
trueif is folder
-
isStringCode
Cheks if object has string type code.- Parameters:
obj- the object, cannot benull- Returns:
trueis string type code
-
isStringCodeType
public static boolean isStringCodeType(org.eclipse.emf.common.util.Enumerator codeType) Cheks if code type is string.- Parameters:
codeType- the code type, can benull- Returns:
trueis string
-
isWholeObjectCodeSeries
Returnstrueif model has whole object code series selected.- Parameters:
obj- the object, cannot benull- Returns:
trueis whole object code series
-
isAddEnabledForSelectedPredefinedItem
public static boolean isAddEnabledForSelectedPredefinedItem(BasicDbObject basicDbObject, Object selectedObject, boolean isFolder) Checks is element adding enabled for selected object for predefined container hierarchy type.- Parameters:
basicDbObject- the predefined container, cannot benullselectedObject- the selected object, cannot benullisFolder- is selected object is predefined item folder.- Returns:
trueis adding enable
-
isPredefinedSupports
Checks if object supports predefined data.- Parameters:
obj- the object-candidate, cannot benull- Returns:
trueif supports
-
mapStringToValue
Maps string code value to metadata model type value by hisBasicDbObjectcode type.- Parameters:
stringCodeVaule- the string code value, can benullbasicDbObject- theBasicDbObject- predefined elements owner, cannot benull- Returns:
- the metadata model type value for code or
String} if codeType isnull
-
generatePredefinedItemUniqueCode
Generates unique code for new predefined item in the given parent object.- Parameters:
parent- the object in which predefined item will be stored- Returns:
- generated unique code, never
null
-
generatePredefinedItemUniqueName
Generates unique name for new predefined item in the given parent object.- Parameters:
parent- the object in which predefined item will be storedisFolder- flag indicating that new predefined item will be a folder- Returns:
- generated unique name, never
null
-
isCheckUnique
Returntrueif check unique used.- Parameters:
obj- the object, cannot benull- Returns:
trueif object checks code uniqueness,falseotherwise
-
getCodeAllowedLengthFeature
public static org.eclipse.emf.ecore.EAttribute getCodeAllowedLengthFeature(org.eclipse.emf.ecore.EObject eObject) Returns e-object code allowed length feature if present.- Parameters:
eObject- the e-object, cannot benull- Returns:
- the feature or
nullif not present
-
getCodeLengthFeature
public static org.eclipse.emf.ecore.EAttribute getCodeLengthFeature(org.eclipse.emf.ecore.EObject eObject) Returns e-object code length feature if present.- Parameters:
eObject- the e-object, cannot benull- Returns:
- the feature or
nullif not present
-
getCodeTypeFeature
public static org.eclipse.emf.ecore.EAttribute getCodeTypeFeature(org.eclipse.emf.ecore.EObject eObject) Returns e-object code type feature if present.- Parameters:
eObject- the e-object, cannot benull- Returns:
- the feature or
nullif not present
-
getDescriptionLengthFeature
public static org.eclipse.emf.ecore.EAttribute getDescriptionLengthFeature(org.eclipse.emf.ecore.EObject eObject) Returns e-object description length feature if present.- Parameters:
eObject- the e-object, cannot benull- Returns:
- the feature or
nullif not present
-
canCodeEdit
public static boolean canCodeEdit(org.eclipse.emf.ecore.EObject eObject) Checks code edit ability.- Parameters:
eObject- the e-object, cannot benull- Returns:
trueif can,falseotherwise
-
canDescriptionEdit
public static boolean canDescriptionEdit(org.eclipse.emf.ecore.EObject eObject) Checks description edit ability.- Parameters:
eObject- the e-object, cannot benull- Returns:
trueif can,falseotherwise
-
canTypeDescriptionEdit
public static boolean canTypeDescriptionEdit(org.eclipse.emf.ecore.EObject eObject) Checks type description edit ability.- Parameters:
eObject- the e-object, cannot benull- Returns:
trueif can,falseotherwise
-
normalizeCode
public static String normalizeCode(boolean fixedStringCodeType, boolean numberCodeType, int codeLength, String code) Normalizes code for fixed string code or empty number code or null code.- Parameters:
fixedStringCodeType- the fixed string code typenumberCodeType- the fixed string code typecodeLength- the code lengthcode- the initial code, can benull- Returns:
- normalized code, cannot be
null
-