Defining Active Language

In UML models, multiple languages can be specified for elements such as Opaque Behavior, Opaque Expression, and Opaque Action. Model RealTime provides you the ability to designate a language as the active language. The active language will be the one that is displayed on the diagram or other user interfaces where language specific information is displayed.

You can programmatically create your own language descriptor by extending AbstractLanguageDescriptor. A language descriptor provides the following functionalities:

You can add your language descriptor by extending the com.ibm.xtools.uml.msl.UMLLanguageDescriptor extension point, as the following example shows:
     <extension
           id="com.ibm.xtools.uml.msl.MyLanguageDescriptor"
           name="My Language"
           point="com.ibm.xtools.uml.msl.UMLLanguageDescriptor">
        <language>
           <id
                 id="com.ibm.xtools.uml.msl.MyLanguage">
           </id>
           <descriptor
                 descriptorClass="com.ibm.xtools.uml.msl.MyLanguageDescriptor">
           </descriptor>
        </language>
     </extension>

ActiveLanguageManager provides APIs that enable you to work with the active language programmatically. You can set the active language by using setActiveLanguage(String languageId). You can also persist the active language in the root package of a given context by using setPersistedLanguageInRootPackage(EObject context, String languageID, boolean loadLanguageData). The loadLangData flag allows you to specify whether the language's associated libraries should be loaded and profiles applied to the model.

Legal notices