本文整理汇总了Java中org.eclipse.papyrus.uml.tools.model.UmlUtils类的典型用法代码示例。如果您正苦于以下问题:Java UmlUtils类的具体用法?Java UmlUtils怎么用?Java UmlUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UmlUtils类属于org.eclipse.papyrus.uml.tools.model包,在下文中一共展示了UmlUtils类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.eclipse.papyrus.uml.tools.model.UmlUtils; //导入依赖的package包/类
@Override
public void execute() {
// Get its resource
Resource umlResource = UmlUtils.getUmlModel(modelSet).getResource();
// Select the root element to add the wanted imports
root = (org.eclipse.uml2.uml.Package) umlResource.getContents().get(0);
URI templatelibraryURI = URI.createURI(EXAMPLE_PATH).appendFragment(EXAMPLE_ROOT_ID);
libraryPackage = (org.eclipse.uml2.uml.Package) modelSet.getEObject(templatelibraryURI, true);
// Creates the import packages at the root of the model (elements of type packageImport)
this.getCommandStack(modelSet).execute(new RecordingCommand(modelSet.getTransactionalEditingDomain()) {
@Override
protected void doExecute() {
PackageImport importPrimitivePack = root.createPackageImport(libraryPackage);
if (!root.getPackageImports().contains(importPrimitivePack)) {
root.getPackageImports().add(importPrimitivePack);
}
try {
root.eResource().save(Collections.emptyMap());
} catch (IOException e) {
//TODO : log error
}
}
});
}
示例2: SetModelValuesCommand
import org.eclipse.papyrus.uml.tools.model.UmlUtils; //导入依赖的package包/类
public SetModelValuesCommand(final ModelSet modelSet, final BasicValues modelValues, final MPDValues modelMultiValues,
final List<PointOfContact> pointsOfContact) {
super(modelSet.getTransactionalEditingDomain());
this.modelValues = modelValues;
this.modelMultiValues = modelMultiValues;
this.pointsOfContact = pointsOfContact;
root = (Model) UmlUtils.getUmlResource(modelSet).getContents().get(0);
}
示例3: InitFromTemplateCommand
import org.eclipse.papyrus.uml.tools.model.UmlUtils; //导入依赖的package包/类
public InitFromTemplateCommand(final ModelSet modelSet) {
super(modelSet.getTransactionalEditingDomain());
uml = UmlUtils.getUmlResource(modelSet);
diagram = DiModelUtils.getDiResource(modelSet);
notation = NotationUtils.getNotationResource(modelSet);
}