* : the profile qualified name you want to apply.
*/
private void applySysMLProfile(Package p, String profileQualifiedName) {
if (isProfileApplied(p, profileQualifiedName))
return;
Profile parentProfile = null;
if (profileQualifiedName.startsWith("SysML")) {
parentProfile = Activator.getSysMLProfile();
} else if (profileQualifiedName.startsWith("Standard")) {
parentProfile = Activator.getStandardProfile();
}
Package profilePackage = parentProfile;
final String[] profiles = profileQualifiedName.split(":{2}");
// search the profile in the package hierarchy
for (int index = 1; index < profiles.length - 1; index++) {
profilePackage = profilePackage.getNestedPackage(profiles[index]);
}
Profile profile = (Profile)profilePackage;
if (profileQualifiedName.startsWith("SysML")) {
profile = (Profile)profilePackage.getNestedPackage(profiles[profiles.length - 1]);
}