diff options
author | khussey | 2006-04-10 21:04:11 +0000 |
---|---|---|
committer | khussey | 2006-04-10 21:04:11 +0000 |
commit | e70dc264ab1f8a6b9fea9c9de13a6f8c29708c76 (patch) | |
tree | ae2b08ebd4656f1910c1d4db04ab615543ca61b1 /plugins/org.eclipse.uml2.uml.ecore.exporter | |
parent | 223ac4c609e4a8188f4485a194aa36c8566306d6 (diff) | |
download | org.eclipse.uml2-e70dc264ab1f8a6b9fea9c9de13a6f8c29708c76.tar.gz org.eclipse.uml2-e70dc264ab1f8a6b9fea9c9de13a6f8c29708c76.tar.xz org.eclipse.uml2-e70dc264ab1f8a6b9fea9c9de13a6f8c29708c76.zip |
[87260] Adding diagnostic support to UML exporter.
Diffstat (limited to 'plugins/org.eclipse.uml2.uml.ecore.exporter')
4 files changed, 30 insertions, 16 deletions
diff --git a/plugins/org.eclipse.uml2.uml.ecore.exporter/META-INF/MANIFEST.MF b/plugins/org.eclipse.uml2.uml.ecore.exporter/META-INF/MANIFEST.MF index e96fbf28d..8f3d8af43 100644 --- a/plugins/org.eclipse.uml2.uml.ecore.exporter/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.uml2.uml.ecore.exporter/META-INF/MANIFEST.MF @@ -12,6 +12,7 @@ Export-Package: org.eclipse.uml2.uml.ecore.exporter, Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.1.0,4.0.0)", org.eclipse.core.resources;bundle-version="[3.1.0,4.0.0)", org.eclipse.uml2.uml.editor;bundle-version="[2.0.0,3.0.0)", + org.eclipse.uml2.uml.ecore.importer;bundle-version="[2.0.0,3.0.0)", org.eclipse.emf.exporter;bundle-version="[2.2.0,2.3.0)", org.eclipse.emf.codegen.ecore.ui;bundle-version="[2.2.0,2.3.0)";resolution:=optional Eclipse-LazyStart: true diff --git a/plugins/org.eclipse.uml2.uml.ecore.exporter/plugin.properties b/plugins/org.eclipse.uml2.uml.ecore.exporter/plugin.properties index b6a4ab399..0a3c6a0c0 100644 --- a/plugins/org.eclipse.uml2.uml.ecore.exporter/plugin.properties +++ b/plugins/org.eclipse.uml2.uml.ecore.exporter/plugin.properties @@ -7,7 +7,7 @@ # Contributors: # IBM - initial API and implementation # -# $Id: plugin.properties,v 1.2 2006/04/06 12:56:52 khussey Exp $ +# $Id: plugin.properties,v 1.3 2006/04/10 21:04:15 khussey Exp $ # NLS_MESSAGEFORMAT_VAR @@ -33,18 +33,8 @@ _UI_UMLExport_title = UML Export _UI_Exporting_message = Exporting package to ''{0}''... -_UI_Options_label = Options - -_UI_Discard_label = Discard -_UI_Ignore_label = Ignore -_UI_Process_label = Process -_UI_Report_label = Report - _UI_EcoreTaggedValues_label = Ecore Tagged Values _UI_RedefinesAnnotations_label = Redefines Annotations _UI_SubsetsAnnotations_label = Subsets Annotations _UI_UnionAnnotations_label = Union Annotations _UI_AnnotationDetails_label = Annotation Details - -_UI_IgnoreAll_label = Ignore All -_UI_ProcessAll_label = Process All diff --git a/plugins/org.eclipse.uml2.uml.ecore.exporter/src/org/eclipse/uml2/uml/ecore/exporter/UMLExporter.java b/plugins/org.eclipse.uml2.uml.ecore.exporter/src/org/eclipse/uml2/uml/ecore/exporter/UMLExporter.java index ae8c93474..29dcf3d13 100644 --- a/plugins/org.eclipse.uml2.uml.ecore.exporter/src/org/eclipse/uml2/uml/ecore/exporter/UMLExporter.java +++ b/plugins/org.eclipse.uml2.uml.ecore.exporter/src/org/eclipse/uml2/uml/ecore/exporter/UMLExporter.java @@ -8,7 +8,7 @@ * Contributors: * IBM - initial API and implementation * - * $Id: UMLExporter.java,v 1.2 2006/04/06 12:56:52 khussey Exp $ + * $Id: UMLExporter.java,v 1.3 2006/04/10 21:04:15 khussey Exp $ */ package org.eclipse.uml2.uml.ecore.exporter; @@ -20,11 +20,15 @@ import java.util.Map; import org.eclipse.emf.codegen.ecore.genmodel.GenAnnotation; import org.eclipse.emf.codegen.ecore.genmodel.GenModel; import org.eclipse.emf.codegen.ecore.genmodel.GenPackage; +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.common.util.Diagnostic; import org.eclipse.emf.common.util.DiagnosticException; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.common.util.EMap; import org.eclipse.emf.common.util.Monitor; import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.converter.ConverterPlugin; +import org.eclipse.emf.converter.util.ConverterUtil; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.resource.Resource; @@ -66,11 +70,23 @@ public class UMLExporter return super.doCheckEPackageArtifactLocation(location, packageName); } - protected void doExport(Monitor monitor, ExportData exportData) + protected Diagnostic doExport(Monitor monitor, ExportData exportData) throws Exception { + Diagnostic diagnostic = Diagnostic.OK_INSTANCE; + ResourceSet resourceSet = new ResourceSetImpl(); UMLUtil.Ecore2UMLConverter ecore2umlConverter = new UMLUtil.Ecore2UMLConverter(); + BasicDiagnostic diagnostics = new BasicDiagnostic(ConverterPlugin.ID, + ConverterUtil.ACTION_DEFAULT, UMLExporterPlugin.INSTANCE + .getString("_UI_ProblemsEncounteredProcessing_message"), //$NON-NLS-1$ + null); + + Map context = new HashMap(); + context.put( + org.eclipse.uml2.common.util.UML2Util.QualifiedTextProvider.class, + UMLUtil.QualifiedTextProvider.DEFAULT); + monitor.beginTask(UML2Util.EMPTY_STRING, exportData.genPackageToArtifactURI.size()); @@ -86,7 +102,7 @@ public class UMLExporter "_UI_Exporting_message", new Object[]{artifactURI.toString()})); //$NON-NLS-1$ ecore2umlConverter.convert(Collections.singleton(ePackage), - getOptions(), null, null); + getOptions(), diagnostics, context); org.eclipse.uml2.uml.Package package_ = (org.eclipse.uml2.uml.Package) ecore2umlConverter .doSwitch(ePackage); @@ -114,6 +130,12 @@ public class UMLExporter } monitor.done(); + + if (Diagnostic.INFO < diagnostics.getSeverity()) { + diagnostic = diagnostics; + } + + return diagnostic; } public void setGenModel(GenModel genModel) diff --git a/plugins/org.eclipse.uml2.uml.ecore.exporter/src/org/eclipse/uml2/uml/ecore/exporter/UMLExporterPlugin.java b/plugins/org.eclipse.uml2.uml.ecore.exporter/src/org/eclipse/uml2/uml/ecore/exporter/UMLExporterPlugin.java index 30e670515..2b64bd7d9 100644 --- a/plugins/org.eclipse.uml2.uml.ecore.exporter/src/org/eclipse/uml2/uml/ecore/exporter/UMLExporterPlugin.java +++ b/plugins/org.eclipse.uml2.uml.ecore.exporter/src/org/eclipse/uml2/uml/ecore/exporter/UMLExporterPlugin.java @@ -8,13 +8,14 @@ * Contributors: * IBM - initial API and implementation * - * $Id: UMLExporterPlugin.java,v 1.1 2006/04/06 04:21:53 khussey Exp $ + * $Id: UMLExporterPlugin.java,v 1.2 2006/04/10 21:04:15 khussey Exp $ */ package org.eclipse.uml2.uml.ecore.exporter; import org.eclipse.emf.common.EMFPlugin; import org.eclipse.emf.common.util.ResourceLocator; import org.eclipse.emf.exporter.ExporterPlugin; +import org.eclipse.uml2.uml.ecore.importer.UMLImporterPlugin; /** * The <b>Plugin</b> for the UML2.UML.Ecore.Exporter library. @@ -36,7 +37,7 @@ public final class UMLExporterPlugin * Creates the singleton instance. */ private UMLExporterPlugin() { - super(new ResourceLocator[]{ExporterPlugin.INSTANCE}); + super(new ResourceLocator[]{ExporterPlugin.INSTANCE, UMLImporterPlugin.INSTANCE}); } /* |