当前位置: 首页>>代码示例>>Java>>正文


Java UmlUtils类代码示例

本文整理汇总了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
			}
		}
	});

}
 
开发者ID:bmaggi,项目名称:library-training,代码行数:32,代码来源:ImportLibraryTemplateInModel.java

示例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);
}
 
开发者ID:info-sharing-environment,项目名称:NIEM-Modeling-Tool,代码行数:9,代码来源:SetModelValuesCommand.java

示例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);
}
 
开发者ID:info-sharing-environment,项目名称:NIEM-Modeling-Tool,代码行数:7,代码来源:InitFromTemplateCommand.java


注:本文中的org.eclipse.papyrus.uml.tools.model.UmlUtils类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。