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