use of org.eclipse.sirius.viewpoint.description.JavaExtension in project InformationSystem by ObeoNetwork.
the class ClassDiagramGenerator method addJavaExtensions.
private void addJavaExtensions(Configuration configuration, Viewpoint viewpointFromTemplate) {
Collection<String> javaExtensions = new LinkedHashSet<String>(configuration.getJavaExtensions());
for (JavaExtension javaExtensionFromTemplate : viewpointFromTemplate.getOwnedJavaExtensions()) {
javaExtensions.add(javaExtensionFromTemplate.getQualifiedClassName());
}
if (javaExtensions.isEmpty() == false) {
for (String javaExtension : javaExtensions) {
if (containsJavaExtension(configuration.getViewpoint().getOwnedJavaExtensions(), javaExtension) == false) {
JavaExtension extension = DescriptionFactory.eINSTANCE.createJavaExtension();
extension.setQualifiedClassName(javaExtension);
AddCommand addCommand = new AddCommand(editingDomain, configuration.getViewpoint(), DescriptionPackage.Literals.VIEWPOINT__OWNED_JAVA_EXTENSIONS, extension);
editingDomain.getCommandStack().execute(addCommand);
}
}
}
}
Aggregations