Class ModelUtil
java.lang.Object
com._1c.g5.v8.dt.internal.platform.ModelUtil
Utility class containing convenient functions for working with model objects.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BooleanValue
createBooleanValue
(boolean value) Creates instance ofBooleanValue
.static Ctor
createCtor
(Type type, int minParams, int maxParams) static Font
createFontProxy
(org.eclipse.emf.common.util.URI uri) CreatesFont
proxy.static Method
createMethod
(ContextDef cntxDef, String name, String nameRu, boolean retVal) CreatesMethod
instance and adds it to the owningContextDef
.static NumberValue
createNumberValue
(long value) Creates instance ofNumberValue
.static NumberValue
createNumberValue
(BigDecimal value) Creates instance ofNumberValue
.static Picture
createPictureProxy
(org.eclipse.emf.common.util.URI uri) CreatesPicture
proxy.static PlatformBorder
createPlatformBorder
(String name, BorderStyle style, int width, CompositeId compositeId) CreatesPlatformBorder
instance.static PlatformColor
createPlatformColor
(String name, int red, int green, int blue, CompositeId compositeId) CreatesPlatformColor
instance.static PlatformFont
createPlatformFont
(String name, int height, String faceName) CreatesPlatformFont
instance.static PlatformFontRef
createPlatformFontRef
(String name, Font font, int height, CompositeId compositeId) CreatesPlatformFontRef
instance.static PlatformFontRef
createPlatformFontRef
(String name, Font font, CompositeId compositeId) CreatesPlatformFontRef
instance.static PlatformPicture
createPlatformPicture
(String name, String nameRu, CompositeId compositeId) CreatesPlatformPicture
instance.static Property
createProperty
(ContextDef cntxDef, String name, String nameRu, boolean readable, boolean writable) CreatesProperty
instance and adds it to the owningContextDef
.static FormStandardCommand
createStandardCommand
(String name, String nameRu) CreatesFormStandardCommand
instance.static StandardCommandGroup
createStandardCommandGroup
(String name, String nameRu, CommandGroupCategory category, int priority) CreatesStandardCommandGroup
instance.static StringValue
createStringValue
(String value) Creates instance ofStringValue
.static SystemColor
createSystemColor
(String name, CompositeId compositeId) CreatesSystemColor
instance.static SystemFont
createSystemFont
(String name, CompositeId compositeId) CreatesSystemFont
instance.static Type
createType
(String name, String nameRu, Environments environments) CreatesType
instance.static TypeSet
createTypeSet
(String name, String nameRu) CreatesTypeSet
instance.static UndefinedValue
Creates instance ofUndefinedValue
.createUserData
(CompositeId compositeId) Creates immutableMap
to be used as user data usingCompositeId
passed in parameter.createUserData
(Environments envs) Creates immutableMap
to be used as user data usingEnvironments
passed in parameter.Creates immutableMap
to be used as user data usingEnvironments
passed in parameter.createUserDataRu
(Environments envs) Creates immutableMap
to be used as user data usingEnvironments
passed in parameter.
-
Constructor Details
-
ModelUtil
public ModelUtil()
-
-
Method Details
-
createPlatformBorder
public static PlatformBorder createPlatformBorder(String name, BorderStyle style, int width, CompositeId compositeId) CreatesPlatformBorder
instance.- Parameters:
name
- value ofname
attribute.style
- value ofstyle
attribute.width
- value ofwidth
attribute.compositeId
- value ofcompositeId
attribute.- Returns:
- created instance.
-
createPlatformColor
public static PlatformColor createPlatformColor(String name, int red, int green, int blue, CompositeId compositeId) CreatesPlatformColor
instance.- Parameters:
name
- value ofname
attribute.red
- value ofred
attribute.green
- value ofgreen
attribute.blue
- value ofblue
attribute.compositeId
- value ofcompositeId
attribute.- Returns:
- created instance.
-
createStandardCommandGroup
public static StandardCommandGroup createStandardCommandGroup(String name, String nameRu, CommandGroupCategory category, int priority) CreatesStandardCommandGroup
instance.- Parameters:
name
- value ofname
attribute.nameRu
- value ofnameRu
attribute.category
- value ofcategory
attribute.priority
- value ofpriority
attribute.- Returns:
- created instance.
-
createStandardCommand
CreatesFormStandardCommand
instance.- Parameters:
name
- value ofname
attribute.nameRu
- value ofnameRu
attribute.- Returns:
- created instance.
-
createSystemColor
CreatesSystemColor
instance.- Parameters:
name
- value ofname
attribute.compositeId
- value ofcompositeId
attribute.- Returns:
- created instance.
-
createPlatformFontRef
public static PlatformFontRef createPlatformFontRef(String name, Font font, CompositeId compositeId) CreatesPlatformFontRef
instance.- Parameters:
name
- value ofname
attribute.font
- value offont
reference.compositeId
- value ofcompositeId
attribute.- Returns:
- created instance.
-
createPlatformFontRef
public static PlatformFontRef createPlatformFontRef(String name, Font font, int height, CompositeId compositeId) CreatesPlatformFontRef
instance.- Parameters:
name
- value ofname
attribute.font
- value offont
reference.height
- value ofheight
attribute.compositeId
- value ofcompositeId
attribute.- Returns:
- created instance.
-
createPlatformFont
CreatesPlatformFont
instance.- Parameters:
name
- value ofname
attribute.height
- value ofheight
attribute.faceName
- face name of creating font, can't benull
- Returns:
- created instance, never
null
-
createSystemFont
CreatesSystemFont
instance.- Parameters:
font
- value offont
reference.compositeId
- value ofcompositeId
attribute.- Returns:
- created instance.
-
createFontProxy
CreatesFont
proxy.- Parameters:
uri
- proxyURI
.- Returns:
- created proxy.
-
createPictureProxy
CreatesPicture
proxy.- Parameters:
uri
- proxyURI
.- Returns:
- created proxy.
-
createPlatformPicture
public static PlatformPicture createPlatformPicture(String name, String nameRu, CompositeId compositeId) CreatesPlatformPicture
instance.- Parameters:
name
- value ofname
attribute.- Returns:
- created instance.
-
createType
CreatesType
instance.- Parameters:
name
- value ofname
attribute.nameRu
- value ofnameRu
attribute.- Returns:
- created instance.
-
createTypeSet
CreatesTypeSet
instance.- Parameters:
name
- value ofname
attribute.nameRu
- value ofnameRu
attribute.- Returns:
- created instance.
-
createCtor
-
createProperty
public static Property createProperty(ContextDef cntxDef, String name, String nameRu, boolean readable, boolean writable) CreatesProperty
instance and adds it to the owningContextDef
.- Parameters:
cntxDef
-ContextDef
owning createdProperty
.name
- value ofname
attribute.nameRu
- value ofnameRu
attribute.readable
- value ofreadable
attribute.writable
- value ofwritable
attribute.- Returns:
- created instance.
-
createMethod
CreatesMethod
instance and adds it to the owningContextDef
.- Parameters:
cntxDef
-ContextDef
owning createdMethod
.name
- value ofname
attribute.nameRu
- value ofnameRu
attribute.retVal
- value ofretVal
attribute.- Returns:
- created instance.
-
createUndefinedValue
Creates instance ofUndefinedValue
.- Returns:
- created instance.
-
createNumberValue
Creates instance ofNumberValue
.- Parameters:
value
- value to be contained if created instance. Shouldn't benull
.- Returns:
- created instance.
-
createNumberValue
Creates instance ofNumberValue
.- Parameters:
value
- value to be contained if created instance. Shouldn't benull
.- Returns:
- created instance.
-
createBooleanValue
Creates instance ofBooleanValue
.- Parameters:
value
- value to be contained in created instance.- Returns:
- created instance.
-
createStringValue
Creates instance ofStringValue
.- Parameters:
value
- value to be contained in created instance. Shouldn't benull
.- Returns:
- created instance.
-
createUserData
Creates immutableMap
to be used as user data usingEnvironments
passed in parameter.- Parameters:
envs
-Environments
to be used as base to create user dataMap
.- Returns:
- created user data
-
createUserData
Creates immutableMap
to be used as user data usingCompositeId
passed in parameter.- Parameters:
compositeId
-CompositeId
to be used as base to create user dataMap
.- Returns:
- created user data
-
createUserDataRu
Creates immutableMap
to be used as user data usingEnvironments
passed in parameter. This user data also has <"script":"ru"> entry.- Parameters:
envs
-Environments
to be used as base to create user dataMap
.- Returns:
- created user data
-
createUserDataIntnl
Creates immutableMap
to be used as user data usingEnvironments
passed in parameter. This user data also has <"script":"intnl"> entry.- Parameters:
envs
-Environments
to be used as base to create user dataMap
.- Returns:
- created user data
-