public class ActiveLanguageManager
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getActiveLanguage(org.eclipse.emf.ecore.EObject semanticContext,
org.eclipse.emf.ecore.EObject modelContext)
Determines the active language.
|
static java.lang.String |
getPersistedLanguageInRootPackage(org.eclipse.emf.ecore.EObject context)
Utility method to get the persisted language in the model.
|
static void |
setActiveLanguage(java.lang.String languageId)
Set the active language.
|
static void |
setFirstDescriptorActive()
Sets the active language to be the derived language descriptor 'First'.
|
static void |
setModelDescriptorActive()
Sets the active language to be the Model descriptor.
|
static void |
setPersistedLanguageInRootPackage(org.eclipse.emf.ecore.EObject context,
java.lang.String languageID,
boolean loadLanguageData)
Persists the language id of the given descriptor in to the root package that owns the given context.
|
public static java.lang.String getActiveLanguage(org.eclipse.emf.ecore.EObject semanticContext, org.eclipse.emf.ecore.EObject modelContext)
semanticContext
- -
the semantic element that will store the code fragment. Note: This context element will be used by the
'First' language descriptor to determine the 'first' language found.modelContext
- -
The context to determine the persisted model language from (Note: this is needed if the current active language
is set to be Model)String
identifier for the language that is
currently designated as "active" in the tooling environment.public static void setActiveLanguage(java.lang.String languageId)
languageId
- The new language to be set as activepublic static void setModelDescriptorActive()
public static void setFirstDescriptorActive()
public static java.lang.String getPersistedLanguageInRootPackage(org.eclipse.emf.ecore.EObject context)
context
- The context to find the root package frompublic static void setPersistedLanguageInRootPackage(org.eclipse.emf.ecore.EObject context, java.lang.String languageID, boolean loadLanguageData)
context
- The context to find the root package fromlanguageID
- The id of the language to persist. Or null
if the persisted language should be removed from the root package.loadLanguageData
- true
if the given language's libraries, profiles, etc should be applied to the root model
false
if just the language should be persisted