Class ModelUtil

java.lang.Object
com._1c.g5.v8.dt.internal.platform.ModelUtil

public class ModelUtil extends Object
Utility class containing convenient functions for working with model objects.
  • Constructor Details

    • ModelUtil

      public ModelUtil()
  • Method Details

    • createPlatformBorder

      public static PlatformBorder createPlatformBorder(String name, BorderStyle style, int width, CompositeId compositeId)
      Creates PlatformBorder instance.
      Parameters:
      name - value of name attribute.
      style - value of style attribute.
      width - value of width attribute.
      compositeId - value of compositeId attribute.
      Returns:
      created instance.
    • createPlatformColor

      public static PlatformColor createPlatformColor(String name, int red, int green, int blue, CompositeId compositeId)
      Creates PlatformColor instance.
      Parameters:
      name - value of name attribute.
      red - value of red attribute.
      green - value of green attribute.
      blue - value of blue attribute.
      compositeId - value of compositeId attribute.
      Returns:
      created instance.
    • createStandardCommandGroup

      public static StandardCommandGroup createStandardCommandGroup(String name, String nameRu, CommandGroupCategory category, int priority)
      Creates StandardCommandGroup instance.
      Parameters:
      name - value of name attribute.
      nameRu - value of nameRu attribute.
      category - value of category attribute.
      priority - value of priority attribute.
      Returns:
      created instance.
    • createStandardCommand

      public static FormStandardCommand createStandardCommand(String name, String nameRu)
      Creates FormStandardCommand instance.
      Parameters:
      name - value of name attribute.
      nameRu - value of nameRu attribute.
      Returns:
      created instance.
    • createSystemColor

      public static SystemColor createSystemColor(String name, CompositeId compositeId)
      Creates SystemColor instance.
      Parameters:
      name - value of name attribute.
      compositeId - value of compositeId attribute.
      Returns:
      created instance.
    • createPlatformFontRef

      public static PlatformFontRef createPlatformFontRef(String name, Font font, CompositeId compositeId)
      Creates PlatformFontRef instance.
      Parameters:
      name - value of name attribute.
      font - value of font reference.
      compositeId - value of compositeId attribute.
      Returns:
      created instance.
    • createPlatformFontRef

      public static PlatformFontRef createPlatformFontRef(String name, Font font, int height, CompositeId compositeId)
      Creates PlatformFontRef instance.
      Parameters:
      name - value of name attribute.
      font - value of font reference.
      height - value of height attribute.
      compositeId - value of compositeId attribute.
      Returns:
      created instance.
    • createPlatformFont

      public static PlatformFont createPlatformFont(String name, int height, String faceName)
      Creates PlatformFont instance.
      Parameters:
      name - value of name attribute.
      height - value of height attribute.
      faceName - face name of creating font, can't be null
      Returns:
      created instance, never null
    • createSystemFont

      public static SystemFont createSystemFont(String name, CompositeId compositeId)
      Creates SystemFont instance.
      Parameters:
      font - value of font reference.
      compositeId - value of compositeId attribute.
      Returns:
      created instance.
    • createFontProxy

      public static Font createFontProxy(org.eclipse.emf.common.util.URI uri)
      Creates Font proxy.
      Parameters:
      uri - proxy URI.
      Returns:
      created proxy.
    • createPictureProxy

      public static Picture createPictureProxy(org.eclipse.emf.common.util.URI uri)
      Creates Picture proxy.
      Parameters:
      uri - proxy URI.
      Returns:
      created proxy.
    • createPlatformPicture

      public static PlatformPicture createPlatformPicture(String name, String nameRu, CompositeId compositeId)
      Creates PlatformPicture instance.
      Parameters:
      name - value of name attribute.
      Returns:
      created instance.
    • createType

      public static Type createType(String name, String nameRu, Environments environments)
      Creates Type instance.
      Parameters:
      name - value of name attribute.
      nameRu - value of nameRu attribute.
      Returns:
      created instance.
    • createTypeSet

      public static TypeSet createTypeSet(String name, String nameRu)
      Creates TypeSet instance.
      Parameters:
      name - value of name attribute.
      nameRu - value of nameRu attribute.
      Returns:
      created instance.
    • createCtor

      public static Ctor createCtor(Type type, int minParams, int maxParams)
      Creates Ctor instance and adds it to the owning Type.
      Parameters:
      type - Type owning created Ctor.
      minParams - value of minParams attribute.
      maxParams - value of maxParams attribute.
      Returns:
      created instance.
    • createProperty

      public static Property createProperty(ContextDef cntxDef, String name, String nameRu, boolean readable, boolean writable)
      Creates Property instance and adds it to the owning ContextDef.
      Parameters:
      cntxDef - ContextDef owning created Property.
      name - value of name attribute.
      nameRu - value of nameRu attribute.
      readable - value of readable attribute.
      writable - value of writable attribute.
      Returns:
      created instance.
    • createMethod

      public static Method createMethod(ContextDef cntxDef, String name, String nameRu, boolean retVal)
      Creates Method instance and adds it to the owning ContextDef.
      Parameters:
      cntxDef - ContextDef owning created Method.
      name - value of name attribute.
      nameRu - value of nameRu attribute.
      retVal - value of retVal attribute.
      Returns:
      created instance.
    • createUndefinedValue

      public static UndefinedValue createUndefinedValue()
      Creates instance of UndefinedValue.
      Returns:
      created instance.
    • createNumberValue

      public static NumberValue createNumberValue(BigDecimal value)
      Creates instance of NumberValue.
      Parameters:
      value - value to be contained if created instance. Shouldn't be null.
      Returns:
      created instance.
    • createNumberValue

      public static NumberValue createNumberValue(long value)
      Creates instance of NumberValue.
      Parameters:
      value - value to be contained if created instance. Shouldn't be null.
      Returns:
      created instance.
    • createBooleanValue

      public static BooleanValue createBooleanValue(boolean value)
      Creates instance of BooleanValue.
      Parameters:
      value - value to be contained in created instance.
      Returns:
      created instance.
    • createStringValue

      public static StringValue createStringValue(String value)
      Creates instance of StringValue.
      Parameters:
      value - value to be contained in created instance. Shouldn't be null.
      Returns:
      created instance.
    • createUserData

      public static Map<String,String> createUserData(Environments envs)
      Creates immutable Map to be used as user data using Environments passed in parameter.
      Parameters:
      envs - Environments to be used as base to create user data Map.
      Returns:
      created user data
    • createUserData

      public static Map<String,String> createUserData(CompositeId compositeId)
      Creates immutable Map to be used as user data using CompositeId passed in parameter.
      Parameters:
      compositeId - CompositeId to be used as base to create user data Map.
      Returns:
      created user data
    • createUserDataRu

      public static Map<String,String> createUserDataRu(Environments envs)
      Creates immutable Map to be used as user data using Environments passed in parameter. This user data also has <"script":"ru"> entry.
      Parameters:
      envs - Environments to be used as base to create user data Map.
      Returns:
      created user data
    • createUserDataIntnl

      public static Map<String,String> createUserDataIntnl(Environments envs)
      Creates immutable Map to be used as user data using Environments passed in parameter. This user data also has <"script":"intnl"> entry.
      Parameters:
      envs - Environments to be used as base to create user data Map.
      Returns:
      created user data