Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2018-01-18 09:54:09 +0000
committerPatrick Tessier2018-02-16 09:37:20 +0000
commit2658888c2d7bafc7cbee50b70918f8dbef29f1c7 (patch)
treec86e6a5566de481d1541d60a02218f9680dae4b7 /plugins/infra
parentcdd8be15a6787f5536a9d462b722152c4fb9aabb (diff)
downloadorg.eclipse.papyrus-2658888c2d7bafc7cbee50b70918f8dbef29f1c7.tar.gz
org.eclipse.papyrus-2658888c2d7bafc7cbee50b70918f8dbef29f1c7.tar.xz
org.eclipse.papyrus-2658888c2d7bafc7cbee50b70918f8dbef29f1c7.zip
Bug 529966: Papyrus fails to export diagrams as images
https://bugs.eclipse.org/bugs/show_bug.cgi?id=529966 - When exporting diagrams from the Project Explorer, make sure that the services registry is started before doing the actual export - Fix some service usages/declarations to avoid errors in the log Change-Id: Ie9a2e550dbd78f98cb055bf7d7303300305a32e3 Signed-off-by: Camille Letavernier <cletavernier@eclipsesource.com>
Diffstat (limited to 'plugins/infra')
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/PapyrusDiagramEditPart.java2
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.export/src/org/eclipse/papyrus/infra/gmfdiag/export/engine/ExportAllDiagramsEngine.java7
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.viewersearch/plugin.xml7
3 files changed, 15 insertions, 1 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/PapyrusDiagramEditPart.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/PapyrusDiagramEditPart.java
index 9810d54c940..cdd6a6aa30f 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/PapyrusDiagramEditPart.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/PapyrusDiagramEditPart.java
@@ -86,7 +86,7 @@ public class PapyrusDiagramEditPart extends DiagramEditPart {
IMultiDiagramEditor multiDiagramEditor = ServiceUtilsForEditPart.getInstance().getService(IMultiDiagramEditor.class, this);
activeEditor = multiDiagramEditor.getActiveEditor();
} catch (ServiceException e) {
- Activator.log.error(e);
+ //Ignore: the IMultiDiagramEditor may not be present in headless mode
}
((IRefreshHandlerPart) SVGPostProcessor.instance).refresh(activeEditor);
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.export/src/org/eclipse/papyrus/infra/gmfdiag/export/engine/ExportAllDiagramsEngine.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.export/src/org/eclipse/papyrus/infra/gmfdiag/export/engine/ExportAllDiagramsEngine.java
index 7f23e1232d3..3b4715bf600 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.export/src/org/eclipse/papyrus/infra/gmfdiag/export/engine/ExportAllDiagramsEngine.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.export/src/org/eclipse/papyrus/infra/gmfdiag/export/engine/ExportAllDiagramsEngine.java
@@ -319,6 +319,13 @@ public class ExportAllDiagramsEngine {
} catch (ModelMultiException e) {
diagnostic = new BasicDiagnostic(Diagnostic.ERROR, Activator.PLUGIN_ID, 0, Messages.ExportAllDiagrams_3, new Object[] { e });
}
+
+ // Start all remaining services
+ try {
+ service.startRegistry();
+ } catch (ServiceException e) {
+ // Ignore errors: in headless mode, UI services may be missing
+ }
// Initialise an editing domain
modelSet.getTransactionalEditingDomain();
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.viewersearch/plugin.xml b/plugins/infra/services/org.eclipse.papyrus.infra.services.viewersearch/plugin.xml
index 844664044bb..11117160930 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.viewersearch/plugin.xml
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.viewersearch/plugin.xml
@@ -4,12 +4,19 @@
<extension-point id="viewerSearcher" name="viewerSearcher" schema="schema/viewerSearcher.exsd"/>
<extension
point="org.eclipse.papyrus.infra.core.service">
+ <!-- Invalid ID; still preserved for backwards compatibility, just in case -->
<service
classname="org.eclipse.papyrus.infra.services.viewersearch.impl.ViewerSearchService"
id="viewerSearchService"
priority="1"
startKind="lazy">
</service>
+ <service
+ classname="org.eclipse.papyrus.infra.services.viewersearch.impl.ViewerSearchService"
+ id="org.eclipse.papyrus.infra.services.viewersearch.impl.ViewerSearchService"
+ priority="1"
+ startKind="lazy">
+ </service>
</extension>
</plugin>

Back to the top