Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: cce7675a9ed190f180ba9dc815ad123b4f441e94 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package org.eclipse.papyrus.example.custo.cyber;

import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.papyrus.infra.architecture.commands.IModelCreationCommand;
import org.eclipse.papyrus.uml.diagram.common.commands.ModelCreationCommandBase;
import org.eclipse.papyrus.uml.tools.utils.PackageUtil;
import org.eclipse.uml2.uml.Package;
import org.eclipse.uml2.uml.Profile;
import org.eclipse.uml2.uml.UMLFactory;
public class SOFTModelCreation extends ModelCreationCommandBase implements IModelCreationCommand {
	@Override
	protected EObject createRootElement() {
		return UMLFactory.eINSTANCE.createModel();
	}
	@Override
	protected void initializeModel(EObject owner) {
		super.initializeModel(owner);
		Profile myProfileTest = (Profile) PackageUtil.loadPackage(URI.createURI("pathmap://PROFILE_CYBER/soft.profile.uml"), owner.eResource().getResourceSet());
		if (myProfileTest != null) {
			PackageUtil.applyProfile((Package) owner, myProfileTest, true);
		}
	}
}

Back to the top