Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF15
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/plugin.xml26
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/pom.xml2
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/service/ProviderServiceUtil.java52
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/service/shape/AbstractShapeProvider.java2
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/DiagramUtils.java18
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/internal/common/expressions/PapyrusGMFDiagramTester.java66
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.gmfmenu.filter/plugin.xml20
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/META-INF/MANIFEST.MF2
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/pom.xml2
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/GetContainedDiagrams.java10
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/IsDiagramContainer.java8
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/META-INF/MANIFEST.MF2
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/pom.xml2
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/wizard/ConfigureTableCategoriesWizard.java8
-rw-r--r--plugins/infra/onefile/org.eclipse.papyrus.infra.onefile/META-INF/MANIFEST.MF2
-rw-r--r--plugins/infra/onefile/org.eclipse.papyrus.infra.onefile/pom.xml2
-rw-r--r--plugins/infra/onefile/org.eclipse.papyrus.infra.onefile/src/org/eclipse/papyrus/infra/onefile/utils/OneFileUtils.java29
-rwxr-xr-xplugins/infra/textedit/org.eclipse.papyrus.infra.textedit.edit/.project6
-rwxr-xr-xplugins/infra/textedit/org.eclipse.papyrus.infra.textedit.modelexplorer/.project6
-rwxr-xr-xplugins/infra/textedit/org.eclipse.papyrus.infra.textedit.properties/.project6
-rwxr-xr-xplugins/infra/textedit/org.eclipse.papyrus.infra.textedit.representation.architecture/.project6
-rwxr-xr-xplugins/infra/textedit/org.eclipse.papyrus.infra.textedit.representation.edit/.project6
-rwxr-xr-xplugins/infra/textedit/org.eclipse.papyrus.infra.textedit.representation/.project6
-rwxr-xr-xplugins/infra/textedit/org.eclipse.papyrus.infra.textedit.types/.project6
-rwxr-xr-xplugins/infra/textedit/org.eclipse.papyrus.infra.textedit.ui/.project6
-rwxr-xr-xplugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/.project6
-rwxr-xr-xplugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/META-INF/MANIFEST.MF2
-rwxr-xr-xplugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/api/org/eclipse/papyrus/infra/textedit/xtext/custom/PapyrusXTextDocumentProvider.java35
-rwxr-xr-xplugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/api/org/eclipse/papyrus/infra/textedit/xtext/custom/PapyrusXTextMarker.java2
-rwxr-xr-xplugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/api/org/eclipse/papyrus/infra/textedit/xtext/nested/editor/PapyrusXTextEditor.java186
-rwxr-xr-xplugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/plugin.xml2
-rwxr-xr-xplugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/pom.xml2
-rwxr-xr-xplugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/src/org/eclipse/papyrus/infra/textedit/xtext/Activator.java6
-rwxr-xr-xplugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/src/org/eclipse/papyrus/infra/textedit/xtext/internal/actions/CustomXtextActionBarContributor.java61
-rwxr-xr-xplugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/src/org/eclipse/papyrus/infra/textedit/xtext/internal/command/TextUndoRedoCommandWrapper.java130
-rwxr-xr-xplugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/src/org/eclipse/papyrus/infra/textedit/xtext/internal/listeners/UndoableTextChangeListener.java135
-rwxr-xr-xplugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/usecase.md15
-rwxr-xr-xplugins/infra/textedit/org.eclipse.papyrus.infra.textedit/.project6
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui/META-INF/MANIFEST.MF4
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui/pom.xml2
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui/src/org/eclipse/papyrus/infra/onefile/internal/ui/providers/PapyrusModelActionProvider.java26
-rw-r--r--plugins/sdk/org.eclipse.papyrus.sdk/META-INF/MANIFEST.MF2
-rw-r--r--plugins/sdk/org.eclipse.papyrus.sdk/plugin.properties6
-rw-r--r--plugins/sdk/org.eclipse.papyrus.sdk/pom.xml2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/META-INF/MANIFEST.MF2
-rwxr-xr-xplugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/plugin.xml195
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/pom.xml2
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.clazz.config/configs/class_synchronized_tree.nattableconfiguration1
-rwxr-xr-xplugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.config/configs/generic.nattableconfiguration1
-rwxr-xr-xplugins/uml/nattable/org.eclipse.papyrus.uml.nattable/configs/genericTreeTable.nattableconfiguration1
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/META-INF/MANIFEST.MF5
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/pom.xml2
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/contribution/CommentAnnotateSVG.java4
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/svgextension/PapyrusDiagramSVGGenerator.java74
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties/META-INF/MANIFEST.MF2
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties/pom.xml2
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/StereotypeExplorerDialog.java12
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/META-INF/MANIFEST.MF2
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/pom.xml2
-rwxr-xr-xplugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/provider/IsIOpenablePropertyTester.java14
61 files changed, 1012 insertions, 255 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF
index 3a5765238fb..d4d5d5ced97 100755
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF
@@ -1,9 +1,10 @@
Manifest-Version: 1.0
Require-Bundle: com.ibm.icu,
- org.apache.batik.dom;bundle-version="[1.6.0,1.7.0)",
- org.apache.batik.dom.svg;bundle-version="[1.6.0,1.7.0)",
- org.apache.batik.util;bundle-version="[1.6.0,1.7.0)",
- org.apache.batik.xml;bundle-version="[1.6.0,1.7.0)",
+ org.apache.batik.dom;bundle-version="[1.14.0,1.15.0)",
+ org.apache.batik.dom.svg;bundle-version="[1.14.0,1.15.0)",
+ org.apache.batik.util;bundle-version="[1.14.0,1.15.0)",
+ org.apache.batik.xml;bundle-version="[1.14.0,1.15.0)",
+ org.apache.batik.anim;bundle-version="[1.14.0,1.15.0)",
org.eclipse.core.databinding.property;bundle-version="[1.8.0,2.0.0)",
org.eclipse.core.expressions;bundle-version="[3.6.0,4.0.0)",
org.eclipse.emf.databinding;bundle-version="[1.5.0,2.0.0)",
@@ -99,7 +100,7 @@ Bundle-Activator: org.eclipse.papyrus.infra.gmfdiag.common.Activator
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
-Bundle-Version: 4.2.0.qualifier
+Bundle-Version: 4.3.0.qualifier
Bundle-Localization: plugin
Bundle-Name: %pluginName
Bundle-ManifestVersion: 2
@@ -109,5 +110,5 @@ Import-Package: com.google.common.base;version="[30.1.0, 31.0.0)",
com.google.common.util.concurrent;version="[30.1.0, 31.0.0)",
org.osgi.service.component.annotations;version="1.3.0";resolution:=optional
Automatic-Module-Name: org.eclipse.papyrus.infra.gmfdiag.common
-Service-Component: OSGI-INF/org.eclipse.papyrus.infra.gmfdiag.common.internal.service.ViewProviderServiceImpl.xml,
- OSGI-INF/org.eclipse.papyrus.infra.gmfdiag.common.internal.service.EditPolicyProviderServiceImpl.xml
+Service-Component: OSGI-INF/org.eclipse.papyrus.infra.gmfdiag.common.internal.service.EditPolicyProviderServiceImpl.xml,
+ OSGI-INF/org.eclipse.papyrus.infra.gmfdiag.common.internal.service.ViewProviderServiceImpl.xml
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/plugin.xml b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/plugin.xml
index fd848859279..84919191723 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/plugin.xml
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/plugin.xml
@@ -43,14 +43,17 @@
label="Refresh"
style="push"
tooltip="Refresh the current diagram">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.infra.core.papyrusEditor">
- </equals>
- </with>
+ <visibleWhen>
+ <and>
+ <with
+ variable="selection">
+ <test
+ forcePluginActivation="false"
+ property="org.eclipse.papyrus.infra.gmfdiag.internal.common.expressions.PapyrusGMFDiagramTester.isPapyrusGMFDiagramActive"
+ value="true">
+ </test>
+ </with>
+ </and>
</visibleWhen>
</command>
</menuContribution>
@@ -220,6 +223,13 @@
properties="canDelete,isSemanticDeletion"
type="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
</propertyTester>
+ <propertyTester
+ class="org.eclipse.papyrus.infra.gmfdiag.internal.common.expressions.PapyrusGMFDiagramTester"
+ id="org.eclipse.papyrus.infra.gmfdiag.internal.common.expressions.PapyrusGMFDiagramTester"
+ namespace="org.eclipse.papyrus.infra.gmfdiag.internal.common.expressions.PapyrusGMFDiagramTester"
+ properties="isPapyrusGMFDiagramActive"
+ type="org.eclipse.jface.viewers.IStructuredSelection">
+ </propertyTester>
</extension>
<extension
point="org.eclipse.ui.menus">
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/pom.xml b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/pom.xml
index 5a748174bbb..76eff12ab77 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/pom.xml
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/pom.xml
@@ -9,6 +9,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.infra.gmfdiag.common</artifactId>
- <version>4.2.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/service/ProviderServiceUtil.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/service/ProviderServiceUtil.java
index c7dadd06b19..a9d2887378f 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/service/ProviderServiceUtil.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/service/ProviderServiceUtil.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2018 EclipseSource and others.
+ * Copyright (c) 2018, 2022 EclipseSource and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,16 +10,18 @@
*
* Contributors:
* EclipseSource - Initial API and implementation (Bug 533701)
- *
+ * Vincent Lorenzo (CEA LIST) - vincent.lorenzo@cea.fr - Bug 577845
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.common.service;
import org.eclipse.gef.EditPart;
import org.eclipse.gmf.runtime.diagram.core.providers.IViewProvider;
import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.IEditPolicyProvider;
+import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
import org.eclipse.papyrus.infra.gmfdiag.common.utils.ServiceUtilsForEditPart;
/**
@@ -32,6 +34,46 @@ import org.eclipse.papyrus.infra.gmfdiag.common.utils.ServiceUtilsForEditPart;
public class ProviderServiceUtil {
/**
+ * this method allows to identify if the editpart is associated to a Papyrus GMF Diagram (diagram.eContainer()==null)
+ *
+ * @param editPart
+ * an edit part
+ * @return
+ * <code>true</code> if the editPart probably concerns the Papyrus GMF Diagram
+ * <code>false</code> otherwise (editPart is <code>null</code> or diagram.eContainer()!=null in case of a Papyrus Sirius Diagram)
+ *
+ */
+ private static final boolean isPapyrusGMFPart(final EditPart editPart) {
+ if (editPart != null) {
+ final Object model = editPart.getModel();
+ if (model instanceof View) {
+ return isPapyrusGMFView((View) model);
+ }
+ }
+ return false;
+ }
+
+ /**
+ * this method allows to identify if the view is associated to a Papyrus GMF Diagram (diagram.eContainer()==null)
+ *
+ * @param view
+ * a view
+ * @return
+ * <code>true</code> if the view probably concerns the Papyrus GMF Diagram
+ * <code>false</code> otherwise (view is <code>null</code> or diagram.eContainer()!=null in case of a Papyrus Sirius Diagram)
+ *
+ */
+ private static final boolean isPapyrusGMFView(final View view) {
+ if (view != null) {
+ final Diagram d = view.getDiagram();
+ if (d != null) {
+ return DiagramUtils.isPapyrusGMFDiagram(d);
+ }
+ }
+ return false;
+ }
+
+ /**
* <p>
* Tests if the given edit part is a Papyrus Edit Part, by testing if a Papyrus {@link ServicesRegistry}
* is present.
@@ -43,6 +85,9 @@ public class ProviderServiceUtil {
* <code>true</code> if this edit part is part of a Papyrus environment (Using a Papyrus {@link ServicesRegistry}), <code>false</code> otherwise
*/
public static boolean isPapyrusPart(EditPart editPart) {
+ if (!isPapyrusGMFPart(editPart)) {
+ return false;
+ }
try {
return ServiceUtilsForEditPart.getInstance().getServiceRegistry(editPart) != null;
} catch (Exception ex) {
@@ -63,6 +108,9 @@ public class ProviderServiceUtil {
* <code>true</code> if this view is part of a Papyrus environment (Using a Papyrus {@link ServicesRegistry}), <code>false</code> otherwise
*/
public static boolean isPapyrusView(View view) {
+ if (!isPapyrusGMFView(view)) {
+ return false;
+ }
try {
return ServiceUtilsForEObject.getInstance().getServiceRegistry(view) != null;
} catch (Exception ex) {
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/service/shape/AbstractShapeProvider.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/service/shape/AbstractShapeProvider.java
index c2f15ec90db..29593dc9533 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/service/shape/AbstractShapeProvider.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/service/shape/AbstractShapeProvider.java
@@ -22,7 +22,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.WeakHashMap;
-import org.apache.batik.dom.svg.SAXSVGDocumentFactory;
+import org.apache.batik.anim.dom.SAXSVGDocumentFactory;
import org.apache.batik.dom.util.DOMUtilities;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.draw2d.PositionConstants;
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/DiagramUtils.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/DiagramUtils.java
index 2c7fed7f86b..5ab212de21a 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/DiagramUtils.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/DiagramUtils.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2013, 2017, 2019, 2020 CEA LIST and others.
+ * Copyright (c) 2013, 2017, 2019, 2020, 2022 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -15,8 +15,7 @@
* Christian W. Damus - bug 527580
* Ansgar Radermacher - bug 539754
* Nicolas FAUVERGUE (CEA LIST) nicolas.fauvergue@cea.fr - Bug 550568
- * Vincent LORENZO (CEA LIST) vincent.lorenzo@cea.fr - Bug 560644
- *
+ * Vincent LORENZO (CEA LIST) vincent.lorenzo@cea.fr - Bug 560644, 577845
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.common.utils;
@@ -412,4 +411,17 @@ public class DiagramUtils {
return null;
}
+ /**
+ *
+ * @param diagram
+ * a diagram, can't be <code>null</code>
+ * @return
+ * <code>true</code> if the view probably concerns the Papyrus GMF Diagram (diagram.eContainer()==null)
+ * <code>false</code> the view probably concerns a Papyrus Sirius Diagram (diagram.eContainer()!=null)
+ * @since 4.3
+ */
+ public static final boolean isPapyrusGMFDiagram(final Diagram diagram) {
+ return diagram.eContainer() == null; // diagram.eContainer()!=null for papyrus sirius diagram
+ }
+
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/internal/common/expressions/PapyrusGMFDiagramTester.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/internal/common/expressions/PapyrusGMFDiagramTester.java
new file mode 100644
index 00000000000..776ba74e5b6
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/internal/common/expressions/PapyrusGMFDiagramTester.java
@@ -0,0 +1,66 @@
+/*****************************************************************************
+ * Copyright (c) 2021 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.internal.common.expressions;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.papyrus.infra.gmfdiag.common.SynchronizableGmfDiagramEditor;
+import org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor;
+import org.eclipse.papyrus.infra.ui.util.EditorHelper;
+import org.eclipse.ui.IEditorPart;
+
+/**
+ * This tester is used to check if the current Editor is a Papyrus GMF diagram (and not a papyrus Sirius Diagram) (see bug 577822)
+ */
+public class PapyrusGMFDiagramTester extends PropertyTester {
+
+ /**
+ * this property is used to know is the current Editor is a Papyrus GMF diagram (and not a papyrus Sirius Diagram)
+ */
+ private static final String IS_PAPYRUS_GMF_DIAGRAM_ACTIVE = "isPapyrusGMFDiagramActive";//$NON-NLS-1$
+
+
+ /**
+ *
+ * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
+ *
+ * @param receiver
+ * @param property
+ * @param args
+ * @param expectedValue
+ * @return
+ */
+ @Override
+ public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+ if (IS_PAPYRUS_GMF_DIAGRAM_ACTIVE.equals(property) && receiver instanceof IStructuredSelection && expectedValue instanceof Boolean) {
+ return expectedValue.equals(isPapyrusGMFDiagramActive());
+ }
+ return false;
+ }
+
+
+ /**
+ *
+ * @return
+ * <code>true</code> if the current active editor represents a Papyrus GMF Editor
+ */
+ private final boolean isPapyrusGMFDiagramActive() {
+ IEditorPart editorPart = EditorHelper.getCurrentEditor();
+ // this code also should work when the SynchronizableGmfDiagramEditor is not embedded in the IMultiDiagramEditor
+ if (editorPart instanceof IMultiDiagramEditor) {
+ editorPart = ((IMultiDiagramEditor) editorPart).getActiveEditor();
+ }
+ return editorPart instanceof SynchronizableGmfDiagramEditor;
+ }
+}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.gmfmenu.filter/plugin.xml b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.gmfmenu.filter/plugin.xml
index 6d9f5811181..a5ecc441667 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.gmfmenu.filter/plugin.xml
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.gmfmenu.filter/plugin.xml
@@ -478,6 +478,26 @@
removeFromMenubar="false"
removeFromToolbar="true">
</partPredefinedItem>
+ <partPredefinedItem
+ id="toolbarFontGroup"
+ removeFromMenubar="false"
+ removeFromToolbar="true">
+ </partPredefinedItem>
+ <partPredefinedItem
+ id="fontColorContributionItem"
+ removeFromMenubar="false"
+ removeFromToolbar="true">
+ </partPredefinedItem>
+ <partPredefinedItem
+ id="fillColorContributionItem"
+ removeFromMenubar="false"
+ removeFromToolbar="true">
+ </partPredefinedItem>
+ <partPredefinedItem
+ id="lineColorContributionItem"
+ removeFromMenubar="false"
+ removeFromToolbar="true">
+ </partPredefinedItem>
</partContribution>
<popupContribution
class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/META-INF/MANIFEST.MF b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/META-INF/MANIFEST.MF
index c8f72e5c3d9..2b24b7f73e4 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/META-INF/MANIFEST.MF
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/META-INF/MANIFEST.MF
@@ -24,7 +24,7 @@ Require-Bundle: org.eclipse.core.expressions;bundle-version="[3.6.0,4.0.0)",
org.eclipse.uml2.types;bundle-version="[2.5.0,3.0.0)"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
-Bundle-Version: 2.0.0.qualifier
+Bundle-Version: 2.0.100.qualifier
Bundle-Name: %pluginName
Bundle-Localization: plugin
Bundle-ManifestVersion: 2
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/pom.xml b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/pom.xml
index c20a10b90dd..1ce8ff3cc15 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/pom.xml
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/pom.xml
@@ -9,7 +9,7 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.infra.gmfdiag.modelexplorer</artifactId>
- <version>2.0.0-SNAPSHOT</version>
+ <version>2.0.100-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<description>This plugin provides : - the facets and the customization to display the GMF Diagrams in the ModelExplorer</description>
</project> \ No newline at end of file
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/GetContainedDiagrams.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/GetContainedDiagrams.java
index 0c7f563759e..522b0210ea3 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/GetContainedDiagrams.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/GetContainedDiagrams.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2011 Atos, Christian W. Damus, and others.
+ * Copyright (c) 2011, 2022 Atos, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -11,7 +11,7 @@
* Contributors:
* Atos - Initial API and implementation
* Christian W. Damus - bug 485220
- *
+ * Vincent Lorenzo (CEA LIST) - vincent.lorenzo@cea.fr - Bug 577843
*/
package org.eclipse.papyrus.infra.gmfdiag.modelexplorer.queries;
@@ -28,19 +28,21 @@ import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2;
import org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationUtils;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
/** Get the collection of all contained diagrams */
public class GetContainedDiagrams implements IJavaQuery2<EObject, Collection<org.eclipse.gmf.runtime.notation.Diagram>> {
+ @Override
public Collection<Diagram> evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
- List<Diagram> result = new ArrayList<Diagram>();
+ List<Diagram> result = new ArrayList<>();
Collection<Setting> settings = EMFHelper.getUsages(source);
if (settings != null) {
for (Setting setting : settings) {
Diagram diagram = NotationUtils.getOwnedDiagram(setting.getEObject(), source);
- if (diagram != null) {
+ if (diagram != null && DiagramUtils.isPapyrusGMFDiagram(diagram)) {
result.add(diagram);
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/IsDiagramContainer.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/IsDiagramContainer.java
index ae9c064a156..9a4e8e66d97 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/IsDiagramContainer.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/IsDiagramContainer.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2011 Atos, Christian W. Damus, and others.
+ * Copyright (c) 2011, 2022 Atos, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -11,7 +11,7 @@
* Contributors:
* Atos - Initial API and implementation
* Christian W. Damus - bug 485220
- *
+ * Vincent Lorenzo (CEA LIST) - vincent.lorenzo@cea.fr - Bug 577843
*/
package org.eclipse.papyrus.infra.gmfdiag.modelexplorer.queries;
@@ -26,18 +26,20 @@ import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2;
import org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationUtils;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
public class IsDiagramContainer implements IJavaQuery2<EObject, Boolean> {
/**
* Return true if the element is a Diagram Container
*/
+ @Override
public Boolean evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
Collection<Setting> settings = EMFHelper.getUsages(source);
if (settings != null) {
for (Setting setting : settings) {
Diagram diagram = NotationUtils.getOwnedDiagram(setting.getEObject(), source);
- if (diagram != null) {
+ if (diagram != null && DiagramUtils.isPapyrusGMFDiagram(diagram)) {
return true;
}
}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/META-INF/MANIFEST.MF b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/META-INF/MANIFEST.MF
index c628a45b285..87408fb79cb 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/META-INF/MANIFEST.MF
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/META-INF/MANIFEST.MF
@@ -92,7 +92,7 @@ Require-Bundle: ca.odell.glazedlists;bundle-version="[1.9.0,2.0.0)",
org.eclipse.uml2.types;bundle-version="[2.5.0,3.0.0)"
Bundle-Vendor: %Bundle-Vendor
Bundle-ActivationPolicy: lazy
-Bundle-Version: 7.1.0.qualifier
+Bundle-Version: 7.1.100.qualifier
Bundle-Name: %Bundle-Name
Bundle-Activator: org.eclipse.papyrus.infra.nattable.Activator
Bundle-ManifestVersion: 2
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/pom.xml b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/pom.xml
index 731eab8f9d9..3663c176e91 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/pom.xml
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/pom.xml
@@ -9,6 +9,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.infra.nattable</artifactId>
- <version>7.1.0-SNAPSHOT</version>
+ <version>7.1.100-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/wizard/ConfigureTableCategoriesWizard.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/wizard/ConfigureTableCategoriesWizard.java
index c0a08fb9d2b..244d41a9676 100755
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/wizard/ConfigureTableCategoriesWizard.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/wizard/ConfigureTableCategoriesWizard.java
@@ -1,6 +1,6 @@
/*****************************************************************************
- * Copyright (c) 2014 CEA LIST and others.
- *
+ * Copyright (c) 2014, 2022 CEA LIST and others.
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -11,7 +11,7 @@
* Contributors:
* CEA LIST - Initial API and implementation
* Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.ne - Bug 455060
- *
+ * Vincent LORENZO (CEA LIST) vincent.lorenzo@cea.fr - Bug 579399
*****************************************************************************/
package org.eclipse.papyrus.infra.nattable.wizard;
@@ -142,7 +142,7 @@ public class ConfigureTableCategoriesWizard extends AbstractTableWizard implemen
@Override
public boolean isValidValue(Object element) {
// EMF dependency, must not be done here, it should be better with a new content provider service
- return element instanceof EReference && ((EReference) element).isMany() && element != EcorePackage.eINSTANCE.getEModelElement_EAnnotations();
+ return element instanceof EReference && element != EcorePackage.eINSTANCE.getEModelElement_EAnnotations();
}
};
diff --git a/plugins/infra/onefile/org.eclipse.papyrus.infra.onefile/META-INF/MANIFEST.MF b/plugins/infra/onefile/org.eclipse.papyrus.infra.onefile/META-INF/MANIFEST.MF
index 93887eadd92..6cfa26e36d7 100644
--- a/plugins/infra/onefile/org.eclipse.papyrus.infra.onefile/META-INF/MANIFEST.MF
+++ b/plugins/infra/onefile/org.eclipse.papyrus.infra.onefile/META-INF/MANIFEST.MF
@@ -8,7 +8,7 @@ Require-Bundle: org.eclipse.emf.transaction;bundle-version="[1.9.0,2.0.0)",
org.eclipse.papyrus.infra.internationalization;bundle-version="[2.0.0,3.0.0)"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
-Bundle-Version: 3.0.0.qualifier
+Bundle-Version: 3.1.0.qualifier
Bundle-Localization: plugin
Bundle-Name: %pluginName
Bundle-Activator: org.eclipse.papyrus.infra.onefile.Activator
diff --git a/plugins/infra/onefile/org.eclipse.papyrus.infra.onefile/pom.xml b/plugins/infra/onefile/org.eclipse.papyrus.infra.onefile/pom.xml
index e0a755aee0c..e752ddc3ec0 100644
--- a/plugins/infra/onefile/org.eclipse.papyrus.infra.onefile/pom.xml
+++ b/plugins/infra/onefile/org.eclipse.papyrus.infra.onefile/pom.xml
@@ -9,6 +9,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.infra.onefile</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/plugins/infra/onefile/org.eclipse.papyrus.infra.onefile/src/org/eclipse/papyrus/infra/onefile/utils/OneFileUtils.java b/plugins/infra/onefile/org.eclipse.papyrus.infra.onefile/src/org/eclipse/papyrus/infra/onefile/utils/OneFileUtils.java
index bbffed52975..a3541907725 100644
--- a/plugins/infra/onefile/org.eclipse.papyrus.infra.onefile/src/org/eclipse/papyrus/infra/onefile/utils/OneFileUtils.java
+++ b/plugins/infra/onefile/org.eclipse.papyrus.infra.onefile/src/org/eclipse/papyrus/infra/onefile/utils/OneFileUtils.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2011, 2016 Atos Origin Integration, Christian W. Damus, and others.
+ * Copyright (c) 2011, 2016, 2022 Atos Origin Integration, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -12,11 +12,14 @@
* Tristan Faure (Atos Origin Integration) tristan.faure@atosorigin.com - Initial API and implementation
* Christian W. Damus - bug 485220
* Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 496905
- *
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Bug 578434
*****************************************************************************/
package org.eclipse.papyrus.infra.onefile.utils;
import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
@@ -59,7 +62,7 @@ public class OneFileUtils {
return null;
}
final String substring = getFileNameForDi(fileName, parent);
- IFile file = parent.getFile(new Path(substring + "." + DiModel.DI_FILE_EXTENSION));
+ IFile file = parent.getFile(new Path(substring + "." + DiModel.DI_FILE_EXTENSION)); //$NON-NLS-1$
if (file.exists()) {
return file;
}
@@ -138,6 +141,24 @@ public class OneFileUtils {
}
/**
+ * @param resources
+ * a list of {@link IResource}
+ * @return <code>true</code> if the list contains a di file
+ * @since 3.1
+ */
+ public static boolean containsDi(final Collection<IResource> resources) {
+ final Iterator<IResource> iter = resources.iterator();
+ while (iter.hasNext()) {
+ final IResource current = iter.next();
+ if (isDi(current)) {
+ return true;
+ }
+ }
+ return false;
+
+ }
+
+ /**
* Returns the name without the extension of the file
*
* @param res
@@ -180,7 +201,7 @@ public class OneFileUtils {
}
public static IFile[] getAssociatedFiles(IPapyrusFile papyrusFile) {
- ArrayList<IFile> files = new ArrayList<IFile>();
+ List<IFile> files = new ArrayList<>();
for (IResource res : papyrusFile.getAssociatedResources()) {
if (res instanceof IFile) {
files.add((IFile) res);
diff --git a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.edit/.project b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.edit/.project
index fedc1c56b8b..2667d7019b4 100755
--- a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.edit/.project
+++ b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.edit/.project
@@ -20,9 +20,15 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
</natures>
</projectDescription>
diff --git a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.modelexplorer/.project b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.modelexplorer/.project
index fbb6ed37938..f208e0971e1 100755
--- a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.modelexplorer/.project
+++ b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.modelexplorer/.project
@@ -20,9 +20,15 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
</natures>
</projectDescription>
diff --git a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.properties/.project b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.properties/.project
index 89484cab4dc..c7d5debb6fd 100755
--- a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.properties/.project
+++ b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.properties/.project
@@ -20,9 +20,15 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
</natures>
</projectDescription>
diff --git a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.representation.architecture/.project b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.representation.architecture/.project
index 9405bab1a09..8689400abb7 100755
--- a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.representation.architecture/.project
+++ b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.representation.architecture/.project
@@ -20,9 +20,15 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
</natures>
</projectDescription>
diff --git a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.representation.edit/.project b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.representation.edit/.project
index ea21b3a5147..f10c3607e79 100755
--- a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.representation.edit/.project
+++ b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.representation.edit/.project
@@ -20,9 +20,15 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
</natures>
</projectDescription>
diff --git a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.representation/.project b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.representation/.project
index 04a0d4a1d50..fc648c70308 100755
--- a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.representation/.project
+++ b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.representation/.project
@@ -20,9 +20,15 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
</natures>
</projectDescription>
diff --git a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.types/.project b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.types/.project
index bef472e20db..9d6aa71e306 100755
--- a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.types/.project
+++ b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.types/.project
@@ -20,9 +20,15 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
</natures>
</projectDescription>
diff --git a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.ui/.project b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.ui/.project
index 367ae42f8c5..9c9ff0b79ce 100755
--- a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.ui/.project
+++ b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.ui/.project
@@ -20,9 +20,15 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
</natures>
</projectDescription>
diff --git a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/.project b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/.project
index 62eae2fe130..eaef2ca8fad 100755
--- a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/.project
+++ b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/.project
@@ -20,9 +20,15 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
</natures>
</projectDescription>
diff --git a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/META-INF/MANIFEST.MF b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/META-INF/MANIFEST.MF
index 0432942da5b..e8c19ec5089 100755
--- a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/META-INF/MANIFEST.MF
+++ b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.eclipse.papyrus.infra.textedit.xtext;singleton:=true
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 1.1.0.qualifier
Bundle-Activator: org.eclipse.papyrus.infra.textedit.xtext.Activator
Bundle-Vendor: %Bundle-Vendor
Require-Bundle: org.eclipse.ui;bundle-version="[3.119.0,4.0.0)",
diff --git a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/api/org/eclipse/papyrus/infra/textedit/xtext/custom/PapyrusXTextDocumentProvider.java b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/api/org/eclipse/papyrus/infra/textedit/xtext/custom/PapyrusXTextDocumentProvider.java
index 4648efd3fa3..379598c2fbb 100755
--- a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/api/org/eclipse/papyrus/infra/textedit/xtext/custom/PapyrusXTextDocumentProvider.java
+++ b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/api/org/eclipse/papyrus/infra/textedit/xtext/custom/PapyrusXTextDocumentProvider.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2021 CEA LIST and others.
+ * Copyright (c) 2021-2022 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,7 +10,7 @@
*
* Contributors:
* Vincent Lorenzo (CEA LIST) <vincent.lorenzo@cea.fr> - Initial API and implementation
- *
+ * Vincent Lorenzo (CEA LIST) <vincent.lorenzo@cea.fr> - Bug 580115
*****************************************************************************/
package org.eclipse.papyrus.infra.textedit.xtext.custom;
@@ -30,6 +30,7 @@ import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
import org.eclipse.papyrus.infra.gmfdiag.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration;
import org.eclipse.papyrus.infra.textedit.xtext.Activator;
import org.eclipse.papyrus.infra.textedit.xtext.nested.editor.NestedXTextEditorInput;
+import org.eclipse.xtext.ui.editor.model.IXtextDocument;
import org.eclipse.xtext.ui.editor.model.XtextDocumentProvider;
/**
@@ -38,6 +39,18 @@ import org.eclipse.xtext.ui.editor.model.XtextDocumentProvider;
public class PapyrusXTextDocumentProvider extends XtextDocumentProvider {
/**
+ * @see org.eclipse.ui.texteditor.AbstractDocumentProvider#getDocument(java.lang.Object)
+ *
+ * @param element
+ * @return
+ * @since 1.1
+ */
+ @Override
+ public IXtextDocument getDocument(Object element) {
+ return (IXtextDocument) super.getDocument(element);
+ }
+
+ /**
* @see org.eclipse.xtext.ui.editor.model.XtextDocumentProvider#doSaveDocument(org.eclipse.core.runtime.IProgressMonitor, java.lang.Object, org.eclipse.jface.text.IDocument, boolean)
*
* @param monitor
@@ -72,13 +85,29 @@ public class PapyrusXTextDocumentProvider extends XtextDocumentProvider {
if (newText.equals(initialText)) {
return;
}
-
ICommand cmd = getParseCommand(input.getDirectEditorConfiguration(), semanticElement, newText);
final TransactionalEditingDomain domain = getEditingDomain(semanticElement);
domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(cmd));
}
/**
+ * This method is used to update the editor content when the value has been edited outside of the current editor
+ *
+ * @param editorInput
+ * the editor input
+ * @param document
+ * the edited document
+ * @since 1.1
+ */
+ public void updateTextEditorContent(final NestedXTextEditorInput editorInput, final IDocument document) {
+ final String oldText = document.get();
+ final String newText = editorInput.getTextToEdit();
+ if (!oldText.equals(newText)) {
+ document.set(newText);
+ }
+ }
+
+ /**
*
* @param configuration
* the editor configuration
diff --git a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/api/org/eclipse/papyrus/infra/textedit/xtext/custom/PapyrusXTextMarker.java b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/api/org/eclipse/papyrus/infra/textedit/xtext/custom/PapyrusXTextMarker.java
index 7cdf4ae4fae..bb7e40a132d 100755
--- a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/api/org/eclipse/papyrus/infra/textedit/xtext/custom/PapyrusXTextMarker.java
+++ b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/api/org/eclipse/papyrus/infra/textedit/xtext/custom/PapyrusXTextMarker.java
@@ -21,7 +21,7 @@ import org.eclipse.papyrus.infra.textedit.xtext.nested.editor.PapyrusXTextEditor
/**
* This class allows to get error markers in the {@link PapyrusXTextEditor}.
- * Strangely it seems work find doing nothing
+ * Strangely it seems work fine doing nothing
*/
public class PapyrusXTextMarker extends org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel {
diff --git a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/api/org/eclipse/papyrus/infra/textedit/xtext/nested/editor/PapyrusXTextEditor.java b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/api/org/eclipse/papyrus/infra/textedit/xtext/nested/editor/PapyrusXTextEditor.java
index f014c31f7dc..2775269b9b0 100755
--- a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/api/org/eclipse/papyrus/infra/textedit/xtext/nested/editor/PapyrusXTextEditor.java
+++ b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/api/org/eclipse/papyrus/infra/textedit/xtext/nested/editor/PapyrusXTextEditor.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2021 CEA LIST and others.
+ * Copyright (c) 2021-2022 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,7 +10,7 @@
*
* Contributors:
* Vincent Lorenzo (CEA LIST) <vincent.lorenzo@cea.fr> - Initial API and implementation
- *
+ * Vincent Lorenzo (CEA LIST) <vincent.lorenzo@cea.fr> - Bug 578648, 579033, 580115, 580042
*****************************************************************************/
package org.eclipse.papyrus.infra.textedit.xtext.nested.editor;
@@ -18,32 +18,47 @@ package org.eclipse.papyrus.infra.textedit.xtext.nested.editor;
import java.io.IOException;
import java.util.EventObject;
+import org.eclipse.core.commands.operations.IOperationHistory;
+import org.eclipse.core.commands.operations.OperationHistoryFactory;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CommandStack;
import org.eclipse.emf.common.command.CommandStackListener;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.impl.AdapterImpl;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.papyrus.infra.core.resource.ModelSet;
import org.eclipse.papyrus.infra.core.sasheditor.editor.ISashWindowsContainer;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
+import org.eclipse.papyrus.infra.emf.gmf.command.NotifyingWorkspaceCommandStack;
import org.eclipse.papyrus.infra.gmfdiag.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration;
import org.eclipse.papyrus.infra.textedit.textdocument.TextDocument;
import org.eclipse.papyrus.infra.textedit.textdocument.TextDocumentPackage;
import org.eclipse.papyrus.infra.textedit.xtext.Activator;
+import org.eclipse.papyrus.infra.textedit.xtext.custom.PapyrusXTextDocumentProvider;
+import org.eclipse.papyrus.infra.textedit.xtext.internal.command.TextUndoRedoCommandWrapper;
import org.eclipse.papyrus.infra.textedit.xtext.internal.listeners.SaveTextOnFocusLostPageLifeCycleEventsListener;
import org.eclipse.papyrus.infra.textedit.xtext.internal.listeners.SaveTextOnFocusLostPartListener;
+import org.eclipse.papyrus.infra.textedit.xtext.internal.listeners.UndoableTextChangeListener;
import org.eclipse.papyrus.infra.ui.lifecycleevents.ISaveAndDirtyService;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.IPartListener2;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.texteditor.IDocumentProvider;
import org.eclipse.xtext.ui.editor.XtextEditor;
+import org.eclipse.xtext.ui.editor.model.IXtextDocument;
+import org.eclipse.xtext.ui.editor.model.XtextDocument;
+import org.eclipse.xtext.ui.editor.model.XtextDocumentProvider;
+
/**
* This Customization of the {@link XtextEditor} allows us to open an XtextEditor in the Papyrus sash editor
@@ -53,27 +68,12 @@ public class PapyrusXTextEditor extends XtextEditor {
/**
* the listener on the command stack
*/
- private final CommandStackListener listener = new CommandStackListener() {
-
- @Override
- public void commandStackChanged(EventObject event) {
- resetInput();
- }
- };
+ private CommandStackListener commandStackListener;
/**
* a listener on the semanticContext of the {@link TextDocument}
*/
- private final Adapter textDocumentListener = new AdapterImpl() {
-
- @Override
- public void notifyChanged(org.eclipse.emf.common.notify.Notification msg) {
- if (TextDocumentPackage.eINSTANCE.getTextDocument_SemanticContext().equals(msg.getFeature())) {
- resetInput();
- }
- };
-
- };
+ private Adapter textDocumentListener;
/**
* the part listener. This listener is used to be able to save the editor contents on the focus lost
@@ -130,6 +130,11 @@ public class PapyrusXTextEditor extends XtextEditor {
private SaveTextOnFocusLostPageLifeCycleEventsListener sashWindowsContainerListener = null;
/**
+ * listener on the IOperationHistory
+ */
+ private UndoableTextChangeListener historyListener;
+
+ /**
*
* Constructor.
*
@@ -221,27 +226,16 @@ public class PapyrusXTextEditor extends XtextEditor {
/**
* This method is called to re-set the editor input
*/
- private void resetInput() {
- int currentCaretOffset = -1;
- if (getSourceViewer() != null
- && getSourceViewer().getTextWidget() != null
- && !getSourceViewer().getTextWidget().isDisposed()) {
- currentCaretOffset = getSourceViewer().getTextWidget().getCaretOffset();
- }
- try {
- // TODO maybe better to call setInput directly!
- // setInput(null);
- doSetInput(null);
- } catch (CoreException e) {
- Activator.log.error(e);
- }
- if (currentCaretOffset != -1 && getSourceViewer() != null
- && getSourceViewer().getTextWidget() != null
- && !getSourceViewer().getTextWidget().isDisposed()) {
- getSourceViewer().getTextWidget().setCaretOffset(currentCaretOffset);
- }
- }
+ private void updateEditorContent() {
+ final PapyrusXTextDocumentProvider provider = getDocumentProvider();
+ final IXtextDocument document = provider.getDocument(this.input);
+
+ // we need to disable the listener in order to not add a new command into the commandstack!
+ this.historyListener.disable();
+ provider.updateTextEditorContent(this.input, document);
+ this.historyListener.enable();
+ }
/**
* This method allows to save the typed text in the edited model
@@ -254,13 +248,21 @@ public class PapyrusXTextEditor extends XtextEditor {
* this method registers the listeners
*/
protected void registerListeners() {
- this.domain.getCommandStack().addCommandStackListener(this.listener);
- this.textDocument.eAdapters().add(this.textDocumentListener);
+ this.commandStackListener = createCommandStackListener();
+ if (this.commandStackListener != null) {
+ this.domain.getCommandStack().addCommandStackListener(this.commandStackListener);
+ }
+ this.textDocumentListener = createTextDocumentListener();
+ if (this.textDocumentListener != null) {
+ this.textDocument.eAdapters().add(this.textDocumentListener);
+ }
if (this.saveAndDirtyService != null) {
this.saveAndDirtyService.registerIsaveablePart(this);
}
final IWorkbenchPage page = getEditorSite().getPage();
page.addPartListener(this.partListener);
+ this.historyListener = new UndoableTextChangeListener(this.domain, getDocumentProvider().getDocument(this.input));
+ getOperationHistory().addOperationHistoryListener(this.historyListener);
}
@@ -269,10 +271,15 @@ public class PapyrusXTextEditor extends XtextEditor {
*/
protected void unregisterListeners() {
unregisterSashWindowsContainerListener();
+ getOperationHistory().removeOperationHistoryListener(this.historyListener);
final IWorkbenchPage page = getEditorSite().getPage();
page.removePartListener(this.partListener);
- this.domain.getCommandStack().removeCommandStackListener(this.listener);
- this.textDocument.eAdapters().remove(this.textDocumentListener);
+ if (this.commandStackListener != null) {
+ this.domain.getCommandStack().removeCommandStackListener(this.commandStackListener);
+ }
+ if (this.textDocumentListener != null) {
+ this.textDocument.eAdapters().remove(this.textDocumentListener);
+ }
if (this.saveAndDirtyService != null) {
this.saveAndDirtyService.removeIsaveablePart(this);
}
@@ -324,6 +331,22 @@ public class PapyrusXTextEditor extends XtextEditor {
if (this.textDocument != null
&& this.textDocument.eResource() != null) {// resource can be null when we are destroying the TextDocument
super.doSetInput(this.input);
+ if (this.historyListener != null) {
+ this.historyListener.updateXTextDocument(getDocumentProvider().getDocument(this.input));
+ }
+
+ final IDocumentProvider provider = getDocumentProvider();
+ if (provider instanceof XtextDocumentProvider) {
+ final XtextDocumentProvider xtextDocumentProvider = (XtextDocumentProvider) provider;
+ final IDocument tmp = xtextDocumentProvider.getDocument(this.input);
+
+ if (tmp instanceof XtextDocument) {
+ final XtextDocument xtextDoc = (XtextDocument) tmp;
+ // here to create and display validation marker just after the opening of the editor
+ // bug 580042
+ xtextDoc.checkAndUpdateAnnotations();
+ }
+ }
}
}
@@ -351,7 +374,10 @@ public class PapyrusXTextEditor extends XtextEditor {
this.sashWindowsContainerListener = new SaveTextOnFocusLostPageLifeCycleEventsListener(this);
this.sashWindowsContainer.addPageChangedListener(this.sashWindowsContainerListener);
} catch (ServiceException e) {
- Activator.log.error(e);
+ // we get an exception when we reopen a Papyrus model with an XtextEditor already open.
+ // This method is called at least 3 times during the loading and at the end we succeed to register the listen
+ // see bug 578648
+ Activator.log.warn(NLS.bind("The service {0} is not yet initialized. We will retry at the next focus change.", ISashWindowsContainer.class)); //$NON-NLS-1$
}
}
}
@@ -367,4 +393,76 @@ public class PapyrusXTextEditor extends XtextEditor {
this.sashWindowsContainerListener = null;
}
+ /**
+ * this method do nothing to avoid to break Undo/Redo Papyrus nested editor (diagram/table/...)
+ * see Bug 579033: [Diagram][KeyBinding] Undo/Redo actions are broken in diagram and it seems comes form the keybinding
+ */
+ @Override
+ protected void createUndoRedoActions() {
+ // do nothing to preserve Papyrus Undo/Redo feature/keybinding
+ }
+
+ /**
+ *
+ * @return
+ * the {@link IOperationHistory}
+ */
+ private IOperationHistory getOperationHistory() {
+ return OperationHistoryFactory.getOperationHistory();
+ }
+
+ /**
+ * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#getDocumentProvider()
+ *
+ * @return
+ * @since 1.1
+ */
+ @Override
+ public PapyrusXTextDocumentProvider getDocumentProvider() {
+ return (PapyrusXTextDocumentProvider) super.getDocumentProvider();
+ }
+
+ /**
+ *
+ * @return
+ * the listener for the {@link CommandStack}, can be <code>null</code>
+ * @since 1.1
+ */
+ protected CommandStackListener createCommandStackListener() {
+ return new CommandStackListener() {
+
+ @Override
+ public void commandStackChanged(EventObject event) {
+ final Object source = event.getSource();
+ if (source instanceof NotifyingWorkspaceCommandStack) {
+ NotifyingWorkspaceCommandStack stack = (NotifyingWorkspaceCommandStack) source;
+ final Command cmd = stack.getMostRecentCommand();
+
+ if (cmd instanceof TextUndoRedoCommandWrapper) {
+ // there is nothing to do in this case, because this notification has been sent by ourself!
+ return;
+ }
+ }
+ updateEditorContent();
+ }
+ };
+ }
+
+ /**
+ *
+ * @return
+ * the listener for {@link TextDocument}, can be <code>null</code>
+ * @since 1.1
+ */
+ protected Adapter createTextDocumentListener() {
+ return new AdapterImpl() {
+
+ @Override
+ public void notifyChanged(org.eclipse.emf.common.notify.Notification msg) {
+ if (TextDocumentPackage.eINSTANCE.getTextDocument_SemanticContext().equals(msg.getFeature())) {
+ updateEditorContent();
+ }
+ };
+ };
+ }
}
diff --git a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/plugin.xml b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/plugin.xml
index 87cb9b4cc67..44bf59a3c28 100755
--- a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/plugin.xml
+++ b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/plugin.xml
@@ -5,7 +5,7 @@
point="org.eclipse.papyrus.infra.ui.papyrusDiagram">
<actionBarContributor
id="org.eclipse.papyrus.infra.textedit.xtext.PapyrusXTextActionBarContributor"
- implementingClass="org.eclipse.ui.editors.text.TextEditorActionContributor">
+ implementingClass="org.eclipse.papyrus.infra.textedit.xtext.internal.actions.CustomXtextActionBarContributor">
</actionBarContributor>
</extension>
diff --git a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/pom.xml b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/pom.xml
index 1b4c022948d..49e3b773d1b 100755
--- a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/pom.xml
+++ b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/pom.xml
@@ -9,6 +9,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.infra.textedit.xtext</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/src/org/eclipse/papyrus/infra/textedit/xtext/Activator.java b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/src/org/eclipse/papyrus/infra/textedit/xtext/Activator.java
index 2a96764f342..de442928fa6 100755
--- a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/src/org/eclipse/papyrus/infra/textedit/xtext/Activator.java
+++ b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/src/org/eclipse/papyrus/infra/textedit/xtext/Activator.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2021 CEA LIST and others.
+ * Copyright (c) 2021 - 2022 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,7 +10,7 @@
*
* Contributors:
* Vincent Lorenzo (CEA LIST) <vincent.lorenzo@cea.fr> - Initial API and implementation
- *
+ * Vincent Lorenzo (CEA LIST) <vincent.lorenzo@cea.fr> - Bug 578648
*****************************************************************************/
package org.eclipse.papyrus.infra.textedit.xtext;
@@ -41,12 +41,14 @@ public class Activator extends AbstractUIPlugin {
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
+ log = new LogHelper(this);
}
@Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
+ log = null;
}
/**
diff --git a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/src/org/eclipse/papyrus/infra/textedit/xtext/internal/actions/CustomXtextActionBarContributor.java b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/src/org/eclipse/papyrus/infra/textedit/xtext/internal/actions/CustomXtextActionBarContributor.java
new file mode 100755
index 00000000000..8dd9b80bfe6
--- /dev/null
+++ b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/src/org/eclipse/papyrus/infra/textedit/xtext/internal/actions/CustomXtextActionBarContributor.java
@@ -0,0 +1,61 @@
+/*****************************************************************************
+ * Copyright (c) 2022 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) <vincent.lorenzo@cea.fr> - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.textedit.xtext.internal.actions;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.actions.ActionFactory;
+
+/**
+ * A custom version of the Text actionbar contributor for org.eclipse.papyrus.infra.textedit.xtext.nested.editor.PapyrusXTextEditor.
+ * This action bar contributor allows to preserve the Undo/Redo actions inside Papyrus
+ */
+public class CustomXtextActionBarContributor extends org.eclipse.ui.editors.text.TextEditorActionContributor {
+
+
+ /**
+ * Constructor.
+ *
+ */
+ public CustomXtextActionBarContributor() {
+ // nothing to do
+ }
+
+
+ /**
+ * @see org.eclipse.ui.editors.text.TextEditorActionContributor#setActiveEditor(org.eclipse.ui.IEditorPart)
+ *
+ * @param part
+ */
+ @Override
+ public void setActiveEditor(IEditorPart part) {
+ final IActionBars actionBars = getActionBars();
+
+ final IAction undo = actionBars.getGlobalActionHandler(ActionFactory.UNDO.getId());
+ final IAction redo = actionBars.getGlobalActionHandler(ActionFactory.REDO.getId());
+
+ super.setActiveEditor(part);// this super seems erase undo/redo actions
+
+ // see bug Bug 579033: [Diagram][KeyBinding] Undo/Redo actions are broken in diagram and it seems comes form the keybinding
+ if (undo != null) {
+ actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), undo);
+ }
+ if (redo != null) {
+ actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), redo);
+ }
+ }
+}
diff --git a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/src/org/eclipse/papyrus/infra/textedit/xtext/internal/command/TextUndoRedoCommandWrapper.java b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/src/org/eclipse/papyrus/infra/textedit/xtext/internal/command/TextUndoRedoCommandWrapper.java
new file mode 100755
index 00000000000..ba1a4d995c2
--- /dev/null
+++ b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/src/org/eclipse/papyrus/infra/textedit/xtext/internal/command/TextUndoRedoCommandWrapper.java
@@ -0,0 +1,130 @@
+/*****************************************************************************
+ * Copyright (c) 2022 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) <vincent.lorenzo@cea.fr> - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.textedit.xtext.internal.command;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.operations.IOperationHistory;
+import org.eclipse.core.commands.operations.IUndoableOperation;
+import org.eclipse.core.commands.operations.OperationHistoryFactory;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.common.command.AbstractCommand;
+import org.eclipse.papyrus.infra.textedit.xtext.Activator;
+import org.eclipse.ui.editors.text.TextEditor;
+
+/**
+ * This command is used to wrap an already executed {@link IUndoableOperation} used in the context of a {@link TextEditor}
+ */
+public class TextUndoRedoCommandWrapper extends AbstractCommand {
+
+ /**
+ * the wrapped operation
+ */
+ private IUndoableOperation operation;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param operation
+ * the wrapped operation
+ */
+ public TextUndoRedoCommandWrapper(final IUndoableOperation operation) {
+ super("Wrapped Papyrus Text Edit Operation"); //$NON-NLS-1$
+ this.operation = operation;
+
+ }
+
+ /**
+ * @see org.eclipse.emf.common.command.Command#execute()
+ *
+ */
+ @Override
+ public void execute() {
+ // do nothing, already executed by XText
+ }
+
+ /**
+ *
+ * @see org.eclipse.emf.common.command.AbstractCommand#canExecute()
+ *
+ * @return
+ */
+ @Override
+ public boolean canExecute() {
+ return true;
+ };
+
+ /**
+ *
+ * @see org.eclipse.emf.common.command.AbstractCommand#prepare()
+ *
+ * @return
+ */
+ @Override
+ protected boolean prepare() {
+ return true;
+ };
+
+ /**
+ * @see org.eclipse.emf.common.command.AbstractCommand#undo()
+ *
+ */
+ @Override
+ public void undo() {
+ try {
+ if (operation != null) {
+ getOperationHistory().undoOperation(this.operation, new NullProgressMonitor(), null);
+ }
+ } catch (ExecutionException e) {
+ Activator.log.error(e);
+ }
+ }
+
+ /**
+ * @see org.eclipse.emf.common.command.AbstractCommand#canUndo()
+ *
+ * @return
+ */
+ @Override
+ public boolean canUndo() {
+ return true;
+ }
+
+
+ /**
+ * @see org.eclipse.emf.common.command.Command#redo()
+ *
+ */
+ @Override
+ public void redo() {
+ try {
+ if (this.operation != null) {
+ getOperationHistory().redoOperation(operation, new NullProgressMonitor(), null);
+ }
+ } catch (ExecutionException e) {
+ Activator.log.error(e);
+ }
+ }
+
+ /**
+ *
+ * @return
+ * the {@link IOperationHistory}
+ */
+ private IOperationHistory getOperationHistory() {
+ return OperationHistoryFactory.getOperationHistory();
+ }
+}
diff --git a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/src/org/eclipse/papyrus/infra/textedit/xtext/internal/listeners/UndoableTextChangeListener.java b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/src/org/eclipse/papyrus/infra/textedit/xtext/internal/listeners/UndoableTextChangeListener.java
new file mode 100755
index 00000000000..7b1ce8f245d
--- /dev/null
+++ b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/src/org/eclipse/papyrus/infra/textedit/xtext/internal/listeners/UndoableTextChangeListener.java
@@ -0,0 +1,135 @@
+/*****************************************************************************
+ * Copyright (c) 2022 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) <vincent.lorenzo@cea.fr> - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.textedit.xtext.internal.listeners;
+
+import org.eclipse.core.commands.operations.IOperationHistoryListener;
+import org.eclipse.core.commands.operations.IUndoContext;
+import org.eclipse.core.commands.operations.IUndoableOperation;
+import org.eclipse.core.commands.operations.ObjectUndoContext;
+import org.eclipse.core.commands.operations.OperationHistoryEvent;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.papyrus.infra.textedit.xtext.internal.command.TextUndoRedoCommandWrapper;
+import org.eclipse.xtext.ui.editor.model.IXtextDocument;
+
+/**
+ * This class is in charge of listening the change of the Eclipse OperationHistory and to propagate the changes concerning a text edition from Papyrus
+ * inside the Papyrus CommandStack
+ */
+public class UndoableTextChangeListener implements IOperationHistoryListener {
+
+ private static final String UNDOABLE_TEXT_CHANGE_CLASS = "org.eclipse.text.undo.DocumentUndoManager.UndoableTextChange"; //$NON-NLS-1$
+
+ private static final String UNDOABLE_COMPOUND_TEXT_CHANGE_CLASS = "org.eclipse.text.undo.DocumentUndoManager.UndoableCompoundTextChange"; //$NON-NLS-1$
+
+ /**
+ * the editing domain to use
+ */
+ private TransactionalEditingDomain domain;
+
+ /**
+ * the edited {@link IXtextDocument}
+ */
+ private IXtextDocument xTextDocument;
+
+ /**
+ * boolean indicating if we must listen or not the changes
+ */
+ private boolean active = true;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param domain
+ * the editing domain used to by the Papyrus editor
+ * @param xTextDocument
+ * the edited {@link IXtextDocument}
+ */
+ public UndoableTextChangeListener(final TransactionalEditingDomain domain, final IXtextDocument xTextDocument) {
+ this.domain = domain;
+ this.xTextDocument = xTextDocument;
+ }
+
+ /**
+ * This method allows to update the concerned XtextDocument because we create a new one after each new setInput
+ *
+ * @param xTextDocument
+ */
+ public void updateXTextDocument(final IXtextDocument xTextDocument) {
+ this.xTextDocument = xTextDocument;
+ }
+
+ /**
+ * enable the listener
+ */
+ public void enable() {
+ this.active = true;
+ }
+
+ /**
+ * disable the listener
+ */
+ public void disable() {
+ this.active = false;
+ }
+
+ /**
+ * @see org.eclipse.core.commands.operations.IOperationHistoryListener#historyNotification(org.eclipse.core.commands.operations.OperationHistoryEvent)
+ *
+ * @param event
+ */
+ @Override
+ public void historyNotification(final OperationHistoryEvent event) {
+
+ final int eventType = event.getEventType();
+ final IUndoableOperation operation = event.getOperation();
+ final String operationClassName = operation.getClass().getCanonicalName();
+ if (UNDOABLE_TEXT_CHANGE_CLASS.equals(operationClassName)
+ || UNDOABLE_COMPOUND_TEXT_CHANGE_CLASS.equals(operationClassName)) {
+
+ if (eventType == OperationHistoryEvent.OPERATION_ADDED) {
+ if (!active) {
+ return;
+ }
+ // we check the notification concerns the document for which we installed this listener
+ if (this.xTextDocument == extractCurrentXTextDocument(operation)) {
+ // we wrap the action and we add it to the papyrus command stack
+ final TextUndoRedoCommandWrapper lastCreatedWrapper = new TextUndoRedoCommandWrapper(operation);
+ this.domain.getCommandStack().execute(lastCreatedWrapper);
+ }
+ }
+ }
+ }
+
+ /**
+ *
+ * @param operation
+ * an operation
+ * @return
+ * the xtext document or <code>null</code> for the current operation
+ */
+ private IXtextDocument extractCurrentXTextDocument(final IUndoableOperation operation) {
+ for (final IUndoContext ctx : operation.getContexts()) {
+ if (ctx instanceof ObjectUndoContext) {
+ final ObjectUndoContext undoContext = (ObjectUndoContext) ctx;
+ if (undoContext.getObject() instanceof IXtextDocument) {
+ return (IXtextDocument) undoContext.getObject();
+ }
+ }
+ }
+ return null;
+ }
+}
diff --git a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/usecase.md b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/usecase.md
index 986801fa7e3..3e4bb8fa874 100755
--- a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/usecase.md
+++ b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit.xtext/usecase.md
@@ -11,4 +11,17 @@ For the "focus lost", we must consider several case:
Custom implementation of the dispose method (close method is never called by Papyrus)
5. We have several PapyrusXtextEditor open side by side, we must save the first one each time the user click in another one
- we use the SaveTextOnFocusLostPageLifeCycleEventsListener \ No newline at end of file
+ we use the SaveTextOnFocusLostPageLifeCycleEventsListener
+
+##Undo/Redo
+bug 580115 : the Undo/Redo of the text editor must be accessible to the user.
+Undo/Redo of TextEditor is not compliant with the Papyrus Undo/Redo mechanism which uses an EMF Command Stack. Nevertheless we find a way to propagate Text changes inside the Papyrus Undo/Redo command stack.
+We listen the Eclipse Operation History (class org.eclipse.papyrus.infra.textedit.xtext.internal.listeners.UndoableTextChangeListener) to detect TextEdition action from a Papyrus nested TextEditor,
+then we wrap the UndoableTextChange/UndoableCompoundTextChange (already executed) into an EMF Command (class TextUndoRedoCommandWrapper) and we add this command into the Papyrus CommandStack.
+
+The CommandStack listener is used to update the editor contents when a new command is executed inside the Command Stack:
+- TextUndoRedoCommandWrapper can be ignored, because the editor is already up to date
+- the CommandStackListener calls org.eclipse.papyrus.infra.textedit.xtext.nested.editor.PapyrusXTextEditor.updateEditorContent()
+- updateEditorContent disables the UndoableTextChangeListener before updating the contents. this steps is required. If we don't disable the listener, the update will add a new TextUndoRedoCommandWrapper inside the Papyrus CommandStack and it should not!
+
+ \ No newline at end of file
diff --git a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit/.project b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit/.project
index ad4bb1562aa..ca6d97a1307 100755
--- a/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit/.project
+++ b/plugins/infra/textedit/org.eclipse.papyrus.infra.textedit/.project
@@ -20,9 +20,15 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
</natures>
</projectDescription>
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui/META-INF/MANIFEST.MF b/plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui/META-INF/MANIFEST.MF
index 2d0f4023a5c..a9ccaba3d3b 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui/META-INF/MANIFEST.MF
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui/META-INF/MANIFEST.MF
@@ -16,7 +16,7 @@ Require-Bundle: org.eclipse.core.expressions;bundle-version="[3.6.0,4.0.0)",
org.eclipse.papyrus.infra.core.log;bundle-version="[2.0.0,3.0.0)",
org.eclipse.papyrus.infra.emf;bundle-version="[4.0.0,5.0.0)",
org.eclipse.papyrus.infra.internationalization;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.papyrus.infra.onefile;bundle-version="[3.0.0,4.0.0)",
+ org.eclipse.papyrus.infra.onefile;bundle-version="[3.1.0,4.0.0)",
org.eclipse.papyrus.infra.ui;bundle-version="[3.0.0,4.0.0)",
org.eclipse.ui.ide;bundle-version="[3.17.0,4.0.0)",
org.eclipse.ui.navigator;bundle-version="[3.9.0,4.0.0)",
@@ -25,7 +25,7 @@ Require-Bundle: org.eclipse.core.expressions;bundle-version="[3.6.0,4.0.0)",
org.eclipse.uml2.types;bundle-version="[2.5.0,3.0.0)"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
-Bundle-Version: 2.0.0.qualifier
+Bundle-Version: 2.0.100.qualifier
Bundle-Localization: plugin
Bundle-Name: %pluginName
Bundle-Activator: org.eclipse.papyrus.infra.onefile.internal.ui.Activator
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui/pom.xml b/plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui/pom.xml
index ef52c3f380d..15abab788e3 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui/pom.xml
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui/pom.xml
@@ -9,6 +9,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.infra.onefile.ui</artifactId>
- <version>2.0.0-SNAPSHOT</version>
+ <version>2.0.100-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui/src/org/eclipse/papyrus/infra/onefile/internal/ui/providers/PapyrusModelActionProvider.java b/plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui/src/org/eclipse/papyrus/infra/onefile/internal/ui/providers/PapyrusModelActionProvider.java
index fdddf7197bc..e6fcf4b4857 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui/src/org/eclipse/papyrus/infra/onefile/internal/ui/providers/PapyrusModelActionProvider.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui/src/org/eclipse/papyrus/infra/onefile/internal/ui/providers/PapyrusModelActionProvider.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2011 Atos Origin Integration - CEA LIST.
+ * Copyright (c) 2011, 2022 Atos Origin Integration - CEA LIST.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -12,6 +12,7 @@
* Tristan Faure (Atos Origin Integration) tristan.faure@atosorigin.com - Initial API and implementation
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr
* Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Add copy Action
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Bug 578434
*****************************************************************************/
package org.eclipse.papyrus.infra.onefile.internal.ui.providers;
@@ -157,7 +158,7 @@ public class PapyrusModelActionProvider extends CommonActionProvider {
if (getIFile() != null) {
try {
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- page.openEditor(new FileEditorInput(getIFile()), "org.eclipse.papyrus.infra.core.papyrusEditor", true, IWorkbenchPage.MATCH_ID | IWorkbenchPage.MATCH_INPUT);
+ page.openEditor(new FileEditorInput(getIFile()), "org.eclipse.papyrus.infra.core.papyrusEditor", true, IWorkbenchPage.MATCH_ID | IWorkbenchPage.MATCH_INPUT); //$NON-NLS-1$
} catch (WorkbenchException e) {
Activator.log.error(e);
}
@@ -183,8 +184,7 @@ public class PapyrusModelActionProvider extends CommonActionProvider {
@Override
public boolean isEnabled() {
- return getSelectedResources() != null && getSelectedResources().size() > 0 && OneFileUtils.isDi((IResource) getSelectedResources().get(0));
-
+ return getSelectedResources() != null && getSelectedResources().size() > 0 && OneFileUtils.containsDi(getSelectedResources());
}
@Override
@@ -193,7 +193,7 @@ public class PapyrusModelActionProvider extends CommonActionProvider {
}
@Override
- protected List getSelectedResources() {
+ protected List<IResource> getSelectedResources() {
return helper.getSelectedResources(getContext());
}
};
@@ -206,7 +206,7 @@ public class PapyrusModelActionProvider extends CommonActionProvider {
}
@Override
- protected List getSelectedResources() {
+ protected List<IResource> getSelectedResources() {
return helper.getSelectedResources(getContext());
}
};
@@ -219,7 +219,7 @@ public class PapyrusModelActionProvider extends CommonActionProvider {
}
@Override
- protected List getSelectedResources() {
+ protected List<IResource> getSelectedResources() {
return helper.getSelectedResources(getContext());
}
@@ -326,6 +326,7 @@ public class PapyrusModelActionProvider extends CommonActionProvider {
*
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout(2, false));
@@ -342,6 +343,7 @@ public class PapyrusModelActionProvider extends CommonActionProvider {
fNameField.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false));
fNameField.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
validatePage();
}
@@ -361,7 +363,7 @@ public class PapyrusModelActionProvider extends CommonActionProvider {
}
protected final void validatePage() {
- String text = fNameField.getText() + ".di";
+ String text = fNameField.getText() + ".di"; //$NON-NLS-1$
RefactoringStatus status = fRefactoringProcessor.validateNewElementName(text);
setPageComplete(status);
}
@@ -394,7 +396,7 @@ public class PapyrusModelActionProvider extends CommonActionProvider {
}
private void initializeRefactoring() {
- fRefactoringProcessor.setNewResourceName(fNameField.getText() + ".di");
+ fRefactoringProcessor.setNewResourceName(fNameField.getText() + ".di"); //$NON-NLS-1$
}
}
}
@@ -446,12 +448,12 @@ public class PapyrusModelActionProvider extends CommonActionProvider {
return null;
}
- protected List getSelectedResources(ActionContext context) {
+ protected List<IResource> getSelectedResources(ActionContext context) {
ISelection selec = context.getSelection();
- List<IResource> resources = new ArrayList<IResource>();
+ List<IResource> resources = new ArrayList<>();
if (selec instanceof IStructuredSelection) {
IStructuredSelection struc = (IStructuredSelection) selec;
- for (Iterator<Object> i = struc.iterator(); i.hasNext();) {
+ for (Iterator<?> i = struc.iterator(); i.hasNext();) {
Object o = i.next();
if (o instanceof IPapyrusFile) {
IPapyrusFile papy = (IPapyrusFile) o;
diff --git a/plugins/sdk/org.eclipse.papyrus.sdk/META-INF/MANIFEST.MF b/plugins/sdk/org.eclipse.papyrus.sdk/META-INF/MANIFEST.MF
index a28b9597df3..51b1fda3d04 100644
--- a/plugins/sdk/org.eclipse.papyrus.sdk/META-INF/MANIFEST.MF
+++ b/plugins/sdk/org.eclipse.papyrus.sdk/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
-Bundle-Version: 6.1.0.qualifier
+Bundle-Version: 6.2.0.qualifier
Bundle-Name: %pluginName
Bundle-Localization: plugin
Bundle-ManifestVersion: 2
diff --git a/plugins/sdk/org.eclipse.papyrus.sdk/plugin.properties b/plugins/sdk/org.eclipse.papyrus.sdk/plugin.properties
index c68b097147c..86d93a098f2 100644
--- a/plugins/sdk/org.eclipse.papyrus.sdk/plugin.properties
+++ b/plugins/sdk/org.eclipse.papyrus.sdk/plugin.properties
@@ -1,5 +1,5 @@
-#
-# Copyright (c) 2016 Christian W. Damus and others.
+################################################################################
+# Copyright (c) 2016-2022 Christian W. Damus and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License 2.0
@@ -10,7 +10,7 @@
#
# Contributors:
# Christian W. Damus - Initial API and implementation
-#
+################################################################################
pluginName=Papyrus UML Modeller
providerName=Eclipse Modeling Project
diff --git a/plugins/sdk/org.eclipse.papyrus.sdk/pom.xml b/plugins/sdk/org.eclipse.papyrus.sdk/pom.xml
index 6861a50f788..48013784f50 100644
--- a/plugins/sdk/org.eclipse.papyrus.sdk/pom.xml
+++ b/plugins/sdk/org.eclipse.papyrus.sdk/pom.xml
@@ -9,6 +9,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.sdk</artifactId>
- <version>6.1.0-SNAPSHOT</version>
+ <version>6.2.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/META-INF/MANIFEST.MF b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/META-INF/MANIFEST.MF
index b566df1ad9f..c1f7c2bda2c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/META-INF/MANIFEST.MF
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/META-INF/MANIFEST.MF
@@ -25,7 +25,7 @@ Require-Bundle: org.eclipse.core.expressions;bundle-version="[3.6.0,4.0.0)",
org.eclipse.uml2.uml.editor;bundle-version="[5.5.0,6.0.0)"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
-Bundle-Version: 3.0.0.qualifier
+Bundle-Version: 3.0.100.qualifier
Bundle-Localization: plugin
Bundle-Name: %pluginName
Bundle-Activator: org.eclipse.papyrus.uml.diagram.menu.Activator
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/plugin.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/plugin.xml
index f5322b31ed9..e82ea048453 100755
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/plugin.xml
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/plugin.xml
@@ -32,12 +32,16 @@
label="&amp;Diagram"
tooltip="Diagram Menu">
<visibleWhen>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.infra.core.papyrusEditor">
- </equals>
- </with>
+ <and>
+ <with
+ variable="selection">
+ <test
+ forcePluginActivation="false"
+ property="org.eclipse.papyrus.infra.gmfdiag.internal.common.expressions.PapyrusGMFDiagramTester.isPapyrusGMFDiagramActive"
+ value="true">
+ </test>
+ </with>
+ </and>
</visibleWhen>
</menu>
</menuContribution>
@@ -207,12 +211,14 @@
tooltip="Line Style Action">
<visibleWhen>
<and>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.infra.core.papyrusEditor">
- </equals>
- </with>
+ <with
+ variable="selection">
+ <test
+ forcePluginActivation="false"
+ property="org.eclipse.papyrus.infra.gmfdiag.internal.common.expressions.PapyrusGMFDiagramTester.isPapyrusGMFDiagramActive"
+ value="true">
+ </test>
+ </with>
</and>
</visibleWhen>
</command>
@@ -229,11 +235,13 @@
<visibleWhen>
<and>
<with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.infra.core.papyrusEditor">
- </equals>
- </with>
+ variable="selection">
+ <test
+ forcePluginActivation="false"
+ property="org.eclipse.papyrus.infra.gmfdiag.internal.common.expressions.PapyrusGMFDiagramTester.isPapyrusGMFDiagramActive"
+ value="true">
+ </test>
+ </with>
</and>
</visibleWhen>
</command>
@@ -250,11 +258,13 @@
<visibleWhen>
<and>
<with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.infra.core.papyrusEditor">
- </equals>
- </with>
+ variable="selection">
+ <test
+ forcePluginActivation="false"
+ property="org.eclipse.papyrus.infra.gmfdiag.internal.common.expressions.PapyrusGMFDiagramTester.isPapyrusGMFDiagramActive"
+ value="true">
+ </test>
+ </with>
</and>
</visibleWhen>
</command>
@@ -267,11 +277,13 @@
<visibleWhen>
<and>
<with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.infra.core.papyrusEditor">
- </equals>
- </with>
+ variable="selection">
+ <test
+ forcePluginActivation="false"
+ property="org.eclipse.papyrus.infra.gmfdiag.internal.common.expressions.PapyrusGMFDiagramTester.isPapyrusGMFDiagramActive"
+ value="true">
+ </test>
+ </with>
</and>
</visibleWhen>
</command>
@@ -284,11 +296,13 @@
<visibleWhen>
<and>
<with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.infra.core.papyrusEditor">
- </equals>
- </with>
+ variable="selection">
+ <test
+ forcePluginActivation="false"
+ property="org.eclipse.papyrus.infra.gmfdiag.internal.common.expressions.PapyrusGMFDiagramTester.isPapyrusGMFDiagramActive"
+ value="true">
+ </test>
+ </with>
</and>
</visibleWhen>
</command>
@@ -301,11 +315,13 @@
<visibleWhen>
<and>
<with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.infra.core.papyrusEditor">
- </equals>
- </with>
+ variable="selection">
+ <test
+ forcePluginActivation="false"
+ property="org.eclipse.papyrus.infra.gmfdiag.internal.common.expressions.PapyrusGMFDiagramTester.isPapyrusGMFDiagramActive"
+ value="true">
+ </test>
+ </with>
</and>
</visibleWhen>
</command>
@@ -318,11 +334,13 @@
<visibleWhen>
<and>
<with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.infra.core.papyrusEditor">
- </equals>
- </with>
+ variable="selection">
+ <test
+ forcePluginActivation="false"
+ property="org.eclipse.papyrus.infra.gmfdiag.internal.common.expressions.PapyrusGMFDiagramTester.isPapyrusGMFDiagramActive"
+ value="true">
+ </test>
+ </with>
</and>
</visibleWhen>
</command>
@@ -335,11 +353,13 @@
<visibleWhen>
<and>
<with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.infra.core.papyrusEditor">
- </equals>
- </with>
+ variable="selection">
+ <test
+ forcePluginActivation="false"
+ property="org.eclipse.papyrus.infra.gmfdiag.internal.common.expressions.PapyrusGMFDiagramTester.isPapyrusGMFDiagramActive"
+ value="true">
+ </test>
+ </with>
</and>
</visibleWhen>
</command>
@@ -352,11 +372,13 @@
<visibleWhen>
<and>
<with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.infra.core.papyrusEditor">
- </equals>
- </with>
+ variable="selection">
+ <test
+ forcePluginActivation="false"
+ property="org.eclipse.papyrus.infra.gmfdiag.internal.common.expressions.PapyrusGMFDiagramTester.isPapyrusGMFDiagramActive"
+ value="true">
+ </test>
+ </with>
</and>
</visibleWhen>
</command>
@@ -373,10 +395,12 @@
<visibleWhen
checkEnabled="false">
<with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.infra.core.papyrusEditor">
- </equals>
+ variable="selection">
+ <test
+ forcePluginActivation="false"
+ property="org.eclipse.papyrus.infra.gmfdiag.internal.common.expressions.PapyrusGMFDiagramTester.isPapyrusGMFDiagramActive"
+ value="true">
+ </test>
</with>
</visibleWhen>
</command>
@@ -387,12 +411,14 @@
tooltip="Auto Size">
<visibleWhen>
<and>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.infra.core.papyrusEditor">
- </equals>
- </with>
+ <with
+ variable="selection">
+ <test
+ forcePluginActivation="false"
+ property="org.eclipse.papyrus.infra.gmfdiag.internal.common.expressions.PapyrusGMFDiagramTester.isPapyrusGMFDiagramActive"
+ value="true">
+ </test>
+ </with>
</and>
</visibleWhen>
</command>
@@ -405,11 +431,13 @@
<visibleWhen>
<and>
<with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.infra.core.papyrusEditor">
- </equals>
- </with>
+ variable="selection">
+ <test
+ forcePluginActivation="false"
+ property="org.eclipse.papyrus.infra.gmfdiag.internal.common.expressions.PapyrusGMFDiagramTester.isPapyrusGMFDiagramActive"
+ value="true">
+ </test>
+ </with>
</and>
</visibleWhen>
</command>
@@ -419,22 +447,29 @@
<visibleWhen
checkEnabled="false">
<and>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.infra.core.papyrusEditor">
- </equals>
- </with>
+ <with
+ variable="selection">
+ <test
+ forcePluginActivation="false"
+ property="org.eclipse.papyrus.infra.gmfdiag.internal.common.expressions.PapyrusGMFDiagramTester.isPapyrusGMFDiagramActive"
+ value="true">
+ </test>
+ </with>
</and>
</visibleWhen>
</dynamic>
- <visibleWhen>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.infra.core.papyrusEditor">
- </equals>
- </with>
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <with
+ variable="selection">
+ <test
+ forcePluginActivation="false"
+ property="org.eclipse.papyrus.infra.gmfdiag.internal.common.expressions.PapyrusGMFDiagramTester.isPapyrusGMFDiagramActive"
+ value="true">
+ </test>
+ </with>
+ </and>
</visibleWhen>
</toolbar>
</menuContribution>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/pom.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/pom.xml
index d2ca70dad93..287d17915b8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/pom.xml
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/pom.xml
@@ -7,6 +7,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.uml.diagram.menu</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.100-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.clazz.config/configs/class_synchronized_tree.nattableconfiguration b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.clazz.config/configs/class_synchronized_tree.nattableconfiguration
index 1a82cd3ca38..a0c1e6b5ff8 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.clazz.config/configs/class_synchronized_tree.nattableconfiguration
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.clazz.config/configs/class_synchronized_tree.nattableconfiguration
@@ -63,6 +63,7 @@
<axisManagers xmi:type="nattableaxisconfiguration:AxisManagerRepresentation" xmi:id="_UJa7yDzQEei_1txcmoHe_A" axisManagerId="org.eclipse.papyrus.uml.nattable.feature.axis.manager" labelProviderContext="org.eclipse.papyrus.infra.nattable.header.feature.labelprovider" headerLabelConfiguration="_UJa7xjzQEei_1txcmoHe_A"/>
<axisManagers xmi:type="nattableaxisconfiguration:AxisManagerRepresentation" xmi:id="_UJa7yTzQEei_1txcmoHe_A" axisManagerId="org.eclipse.papyrus.uml.nattable.stereotype.property.axis.manager" labelProviderContext="org.eclipse.papyrus.infra.nattable.header.feature.labelprovider" headerLabelConfiguration="_UJa7xjzQEei_1txcmoHe_A"/>
<axisManagers xmi:type="nattableaxisconfiguration:AxisManagerRepresentation" xmi:id="_UJa7yjzQEei_1txcmoHe_A" axisManagerId="org.eclipse.papyrus.uml.nattable.operation.axis.manager" labelProviderContext="org.eclipse.papyrus.infra.nattable.header.operation.labelprovider" headerLabelConfiguration="_UJa7xzzQEei_1txcmoHe_A"/>
+ <axisManagers xmi:type="nattableaxisconfiguration:AxisManagerRepresentation" xmi:id="_rcyucGneEeqTUc47pzPrfw" axisManagerId="org.eclipse.papyrus.uml.nattable.stereotype.operation.axis.manager" labelProviderContext="org.eclipse.papyrus.infra.nattable.header.operation.labelprovider" headerLabelConfiguration="_UJa7xzzQEei_1txcmoHe_A"/>
</columnHeaderAxisConfiguration>
<columnAxisProviders xmi:type="nattableaxisprovider:SlaveObjectAxisProvider" xmi:id="_UJa7yzzQEei_1txcmoHe_A" description="This axis provider provides available columns according to the rows of the table (features of the object displayed on the other axis)" name="UML Feature axis provider">
<axis xmi:type="nattableaxis:EStructuralFeatureAxis" xmi:id="_UJbi0DzQEei_1txcmoHe_A" manager="_UJa7yDzQEei_1txcmoHe_A">
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.config/configs/generic.nattableconfiguration b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.config/configs/generic.nattableconfiguration
index f22d9e9c0bd..72914811036 100755
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.config/configs/generic.nattableconfiguration
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.config/configs/generic.nattableconfiguration
@@ -14,6 +14,7 @@
<axisManagers xmi:type="nattableaxisconfiguration:AxisManagerRepresentation" xmi:id="_P0EFFDzQEei_1txcmoHe_A" axisManagerId="org.eclipse.papyrus.uml.nattable.feature.axis.manager" labelProviderContext="org.eclipse.papyrus.infra.nattable.header.feature.labelprovider" headerLabelConfiguration="_P0EFEjzQEei_1txcmoHe_A"/>
<axisManagers xmi:type="nattableaxisconfiguration:AxisManagerRepresentation" xmi:id="_P0EFFTzQEei_1txcmoHe_A" axisManagerId="org.eclipse.papyrus.uml.nattable.stereotype.property.axis.manager" labelProviderContext="org.eclipse.papyrus.infra.nattable.header.feature.labelprovider" headerLabelConfiguration="_P0EFEjzQEei_1txcmoHe_A"/>
<axisManagers xmi:type="nattableaxisconfiguration:AxisManagerRepresentation" xmi:id="_P0EFFjzQEei_1txcmoHe_A" axisManagerId="org.eclipse.papyrus.uml.nattable.operation.axis.manager" labelProviderContext="org.eclipse.papyrus.infra.nattable.header.operation.labelprovider" headerLabelConfiguration="_P0EFEzzQEei_1txcmoHe_A"/>
+ <axisManagers xmi:type="nattableaxisconfiguration:AxisManagerRepresentation" xmi:id="_e6RCAGneEeqTUc47pzPrfw" axisManagerId="org.eclipse.papyrus.uml.nattable.stereotype.operation.axis.manager" labelProviderContext="org.eclipse.papyrus.infra.nattable.header.operation.labelprovider" headerLabelConfiguration="_P0EFEzzQEei_1txcmoHe_A"/>
</columnHeaderAxisConfiguration>
<columnAxisProviders xmi:type="nattableaxisprovider:SlaveObjectAxisProvider" xmi:id="_P0EFFzzQEei_1txcmoHe_A" description="This axis provider provides available columns according to the rows of the table (features of the object displayed on the other axis)" name="UML Feature axis provider"/>
<rowAxisProviders xmi:type="nattableaxisprovider:MasterObjectAxisProvider" xmi:id="_P0EFGDzQEei_1txcmoHe_A" description="This axis provider contains the object dropped by the user into the table" name="DroppedElementAxisProvider"/>
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/configs/genericTreeTable.nattableconfiguration b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/configs/genericTreeTable.nattableconfiguration
index fad615ca8e2..2c09a0f69af 100755
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/configs/genericTreeTable.nattableconfiguration
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/configs/genericTreeTable.nattableconfiguration
@@ -32,6 +32,7 @@
<axisManagers xmi:type="nattableaxisconfiguration:AxisManagerRepresentation" xmi:id="_Wa4BBDzQEei_1txcmoHe_A" axisManagerId="org.eclipse.papyrus.uml.nattable.feature.axis.manager" labelProviderContext="org.eclipse.papyrus.infra.nattable.header.feature.labelprovider" headerLabelConfiguration="_Wa4BAjzQEei_1txcmoHe_A"/>
<axisManagers xmi:type="nattableaxisconfiguration:AxisManagerRepresentation" xmi:id="_Wa4BBTzQEei_1txcmoHe_A" axisManagerId="org.eclipse.papyrus.uml.nattable.stereotype.property.axis.manager" labelProviderContext="org.eclipse.papyrus.infra.nattable.header.feature.labelprovider" headerLabelConfiguration="_Wa4BAjzQEei_1txcmoHe_A"/>
<axisManagers xmi:type="nattableaxisconfiguration:AxisManagerRepresentation" xmi:id="_Wa4BBjzQEei_1txcmoHe_A" axisManagerId="org.eclipse.papyrus.uml.nattable.operation.axis.manager" labelProviderContext="org.eclipse.papyrus.infra.nattable.header.operation.labelprovider" headerLabelConfiguration="_Wa4BAzzQEei_1txcmoHe_A"/>
+ <axisManagers xmi:type="nattableaxisconfiguration:AxisManagerRepresentation" xmi:id="_8HDsUGneEeqTUc47pzPrfw" axisManagerId="org.eclipse.papyrus.uml.nattable.stereotype.operation.axis.manager" labelProviderContext="org.eclipse.papyrus.infra.nattable.header.operation.labelprovider" headerLabelConfiguration="_Wa4BAzzQEei_1txcmoHe_A"/>
</columnHeaderAxisConfiguration>
<columnAxisProviders xmi:type="nattableaxisprovider:SlaveObjectAxisProvider" xmi:id="_Wa4BBzzQEei_1txcmoHe_A" description="This axis provider provides available columns according to the rows of the table (features of the object displayed on the other axis)" name="UML Feature axis provider">
<axis xmi:type="nattableaxis:EStructuralFeatureAxis" xmi:id="_Wa4BCDzQEei_1txcmoHe_A" manager="_Wa4BBDzQEei_1txcmoHe_A">
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/META-INF/MANIFEST.MF b/plugins/uml/org.eclipse.papyrus.uml.export/META-INF/MANIFEST.MF
index 489707c13ba..2d8f0eb7929 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.export/META-INF/MANIFEST.MF
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/META-INF/MANIFEST.MF
@@ -2,10 +2,11 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.papyrus.uml.export;singleton:=true
-Bundle-Version: 2.0.0.qualifier
+Bundle-Version: 2.1.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-11
Require-Bundle: com.google.gson;bundle-version="[2.7.0,2.8.0)",
- org.apache.batik.dom.svg;bundle-version="[1.6.0,1.7.0)",
+ org.apache.batik.dom.svg;bundle-version="[1.14.0,1.15.0)",
+ org.apache.batik.anim;bundle-version="[1.14.0,1.15.0)",
org.eclipse.emf.databinding;bundle-version="[1.5.0,2.0.0)",
org.eclipse.emf.edit.ui;bundle-version="[2.18.0,3.0.0)",
org.eclipse.gmf.runtime.diagram.ui;bundle-version="[1.9.0,2.0.0)",
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/pom.xml b/plugins/uml/org.eclipse.papyrus.uml.export/pom.xml
index cd561feaaab..cb7735c2d55 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.export/pom.xml
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/pom.xml
@@ -9,6 +9,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.uml.export</artifactId>
- <version>2.0.0-SNAPSHOT</version>
+ <version>2.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/contribution/CommentAnnotateSVG.java b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/contribution/CommentAnnotateSVG.java
index 245ce8a0488..0ec8035fca4 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/contribution/CommentAnnotateSVG.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/contribution/CommentAnnotateSVG.java
@@ -13,7 +13,7 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.export.extension.contribution;
-import org.apache.batik.dom.svg.SVGDOMImplementation;
+import org.apache.batik.anim.dom.SVGDOMImplementation;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.draw2d.ui.render.awt.internal.svg.export.GraphicsSVG;
@@ -48,7 +48,7 @@ public class CommentAnnotateSVG implements AnnotateSVG {
EObject eObject = view.getElement();
if (eObject instanceof NamedElement) {
NamedElement namedElement = (NamedElement) eObject;
- EList<Comment> ownedComments = namedElement.getOwnedComments();
+ EList<Comment> ownedComments = namedElement.getOwnedComments();
if (!ownedComments.isEmpty()) {
rectangle.setAttributeNS(null, ATTRIBUTE_TITLE, ownedComments.get(0).getBody());
Element title = svgG.getDocument().createElementNS(SVGDOMImplementation.SVG_NAMESPACE_URI, ATTRIBUTE_TITLE);
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/svgextension/PapyrusDiagramSVGGenerator.java b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/svgextension/PapyrusDiagramSVGGenerator.java
index 3459e842a85..8c34357f9e6 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/svgextension/PapyrusDiagramSVGGenerator.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/svgextension/PapyrusDiagramSVGGenerator.java
@@ -28,7 +28,7 @@ import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
-import org.apache.batik.dom.svg.SVGDOMImplementation;
+import org.apache.batik.anim.dom.SVGDOMImplementation;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.geometry.Rectangle;
@@ -59,15 +59,17 @@ import org.w3c.dom.Element;
public class PapyrusDiagramSVGGenerator extends OpenAPIDiagramSVGGenerator {
/** The annotations. */
- private List<AnnotateSVG> annotations = new ArrayList<>();
-
+ private List<AnnotateSVG> annotations = new ArrayList<>();
+
/**
* Instantiates a new papyrus diagram SVG generator.
*
- * @param diagramEditPart the diagram edit part
- * @param annotations the annotations
+ * @param diagramEditPart
+ * the diagram edit part
+ * @param annotations
+ * the annotations
*/
- public PapyrusDiagramSVGGenerator(DiagramEditPart diagramEditPart, List<AnnotateSVG> annotations ) {
+ public PapyrusDiagramSVGGenerator(DiagramEditPart diagramEditPart, List<AnnotateSVG> annotations) {
super(diagramEditPart);
this.annotations = annotations;
}
@@ -90,7 +92,7 @@ public class PapyrusDiagramSVGGenerator extends OpenAPIDiagramSVGGenerator {
*/
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.gmf.runtime.diagram.ui.render.clipboard.DiagramGenerator#
* setUpGraphics(int, int)
*/
@@ -108,7 +110,7 @@ public class PapyrusDiagramSVGGenerator extends OpenAPIDiagramSVGGenerator {
*/
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.gmf.runtime.diagram.ui.render.clipboard.DiagramGenerator#
* getImageDescriptor(org.eclipse.draw2d.Graphics)
*/
@@ -118,11 +120,11 @@ public class PapyrusDiagramSVGGenerator extends OpenAPIDiagramSVGGenerator {
Activator.log(IStatus.INFO, "Start transformation from Graphics to image descriptor");
GraphicsSVG svgG = (GraphicsSVG) g;
- svgRoot = svgG.getRoot();
-
+ svgRoot = svgG.getRoot();
+
//////// Papyrus Specific code //////////
List<PartPositionInfo> allPartPositionInfo = this.getDiagramPartInfo();
-
+
Collections.reverse(allPartPositionInfo);// Required to have property after class
for (PartPositionInfo partPositionInfo : allPartPositionInfo) {
Element rectangle = svgG.getDocument().createElementNS(SVGDOMImplementation.SVG_NAMESPACE_URI, "rect");
@@ -130,27 +132,27 @@ public class PapyrusDiagramSVGGenerator extends OpenAPIDiagramSVGGenerator {
NamedElement nameElement = (NamedElement) partPositionInfo.getSemanticElement();
rectangle.setAttributeNS(null, "id", nameElement.getName());// useful for svg debug
}
-
+
rectangle.setAttributeNS(null, "x", String.valueOf(partPositionInfo.getPartX()));
rectangle.setAttributeNS(null, "y", String.valueOf(partPositionInfo.getPartY()));
rectangle.setAttributeNS(null, "width", String.valueOf(partPositionInfo.getPartWidth()));
rectangle.setAttributeNS(null, "height", String.valueOf(partPositionInfo.getPartHeight()));
- rectangle.setAttributeNS(null, "fill-opacity", "0"); //transparent
+ rectangle.setAttributeNS(null, "fill-opacity", "0"); // transparent
rectangle.setAttributeNS(null, "stroke-opacity", "0"); // no border
- View view = partPositionInfo.getView();
+ View view = partPositionInfo.getView();
if (view instanceof Shape) { // filter on shape only to avoid duplication
boolean hasAnnotation = applyAll(view, svgG, rectangle);
if (hasAnnotation) {
- svgRoot.appendChild(rectangle);
- }
+ svgRoot.appendChild(rectangle);
+ }
}
}
-
+
/////////////////////////
-
-
+
+
ByteArrayOutputStream os = new ByteArrayOutputStream(5000); // 5K
// buffer
stream(os);
@@ -159,22 +161,25 @@ public class PapyrusDiagramSVGGenerator extends OpenAPIDiagramSVGGenerator {
setRenderedImage(RenderedImageFactory.getInstance(os.toByteArray()));
return RenderedImageDescriptor
- .createFromRenderedImage(getRenderedImage());
+ .createFromRenderedImage(getRenderedImage());
} catch (IOException ex) {
Log.error(DiagramUIRenderPlugin.getInstance(), IStatus.ERROR, ex
- .getMessage(), ex);
+ .getMessage(), ex);
}
return null;
}
-
+
/**
* Apply all.
*
- * @param view the view
- * @param svgG the svg G
- * @param rectangle the rectangle
+ * @param view
+ * the view
+ * @param svgG
+ * the svg G
+ * @param rectangle
+ * the rectangle
* @return true, if successful
*/
public boolean applyAll(View view, GraphicsSVG svgG, Element rectangle) {
@@ -183,14 +188,15 @@ public class PapyrusDiagramSVGGenerator extends OpenAPIDiagramSVGGenerator {
res = res || annotateSVG.addAnnotation(view, svgG, rectangle);
}
return true;
- }
-
+ }
+
/**
* Writes the SVG Model out to a file.
- *
+ *
* @param outputStream
* output stream to store the SVG Model
*/
+ @Override
public void stream(OutputStream outputStream) {
try {
// Define the view box
@@ -222,17 +228,19 @@ public class PapyrusDiagramSVGGenerator extends OpenAPIDiagramSVGGenerator {
*/
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.gmf.runtime.diagram.ui.internal.clipboard.DiagramGenerator#
* createAWTImageForParts(java.util.List)
*/
+ @Override
public Image createAWTImageForParts(List editparts, org.eclipse.swt.graphics.Rectangle sourceRect) {
createSWTImageDescriptorForParts(editparts, sourceRect);
if (getRenderedImage() != null) {
try {
- BufferedImage bufImg = (BufferedImage) getRenderedImage().getAdapter(BufferedImage.class);
- if (bufImg == null)
+ BufferedImage bufImg = getRenderedImage().getAdapter(BufferedImage.class);
+ if (bufImg == null) {
bufImg = ImageConverter.convert(getRenderedImage().getSWTImage());
+ }
return bufImg;
} catch (Error e) {
// log the Error but allow execution to continue
@@ -259,6 +267,7 @@ public class PapyrusDiagramSVGGenerator extends OpenAPIDiagramSVGGenerator {
* @return Returns the rendered image created by previous call to
* createSWTImageDescriptorForParts
*/
+ @Override
public RenderedImage getRenderedImage() {
return renderedImage;
}
@@ -266,7 +275,8 @@ public class PapyrusDiagramSVGGenerator extends OpenAPIDiagramSVGGenerator {
/**
* Sets the rendered image.
*
- * @param renderedImage the new rendered image
+ * @param renderedImage
+ * the new rendered image
*/
private void setRenderedImage(RenderedImage renderedImage) {
this.renderedImage = renderedImage;
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/META-INF/MANIFEST.MF b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/META-INF/MANIFEST.MF
index 4dbfec6ec0e..913bcc780f6 100644
--- a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/META-INF/MANIFEST.MF
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/META-INF/MANIFEST.MF
@@ -62,7 +62,7 @@ Require-Bundle: org.eclipse.core.databinding.property;bundle-version="[1.8.0,2.0
org.eclipse.papyrus.infra.gmfdiag.properties;bundle-version="5.0.0"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy;exclude:=org.eclipse.papyrus.uml.properties.constraints
-Bundle-Version: 4.1.0.qualifier
+Bundle-Version: 4.1.100.qualifier
Bundle-ClassPath: .
Bundle-Name: %pluginName
Bundle-Localization: plugin
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/pom.xml b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/pom.xml
index 9e15e10cd3e..29e55786f50 100644
--- a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/pom.xml
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/pom.xml
@@ -9,6 +9,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.uml.properties</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.100-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/StereotypeExplorerDialog.java b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/StereotypeExplorerDialog.java
index ced746e8592..f5283b615b1 100644
--- a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/StereotypeExplorerDialog.java
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/StereotypeExplorerDialog.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2016 CEA LIST.
+ * Copyright (c) 2016, 2022 CEA LIST.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,6 +10,7 @@
*
* Contributors:
* Mickael ADAM (ALL4TEC) mickael.adam@all4tec.net - Initial API and Implementation
+ * Vincent LORENZO (CEA-LIST) vincent.lorenzo@cea.fr - Bug 579917
*****************************************************************************/
package org.eclipse.papyrus.uml.properties.widgets;
@@ -251,14 +252,7 @@ public class StereotypeExplorerDialog extends SelectionStatusDialog {
if (element instanceof String) {
styledString.setStyle(0, text.length(),
StyledString.COUNTER_STYLER);
- } else if (element instanceof IRegisteredProfile) {
- URI uri = resourceSet.getURIConverter().normalize(((IRegisteredProfile) element).getUri()).trimFragment();
- String path = new StringBuilder(" - ")//$NON-NLS-1$
- .append(uri.toPlatformString(true).substring(1))
- .toString();
- styledString.append(path, StyledString.QUALIFIER_STYLER);
-
- } else if (element instanceof Profile) {
+ }else if (element instanceof Profile) {
URI uri = EcoreUtil.getURI((EObject) element).trimFragment();
String path = new StringBuilder(" - ")//$NON-NLS-1$
.append(uri.toPlatformString(true).substring(1)).toString();
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/META-INF/MANIFEST.MF b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/META-INF/MANIFEST.MF
index 0e3ed866073..cdd44d71c20 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/META-INF/MANIFEST.MF
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/META-INF/MANIFEST.MF
@@ -51,7 +51,7 @@ Require-Bundle: org.eclipse.core.expressions;bundle-version="[3.6.0,4.0.0)",
org.eclipse.uml2.types;bundle-version="[2.5.0,3.0.0)"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
-Bundle-Version: 5.0.0.qualifier
+Bundle-Version: 5.0.100.qualifier
Bundle-Localization: plugin
Bundle-Name: %pluginName
Bundle-Activator: org.eclipse.papyrus.views.modelexplorer.Activator
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/pom.xml b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/pom.xml
index b425b5a7ca5..a1d940c69a9 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/pom.xml
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/pom.xml
@@ -9,6 +9,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.views.modelexplorer</artifactId>
- <version>5.0.0-SNAPSHOT</version>
+ <version>5.0.100-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/provider/IsIOpenablePropertyTester.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/provider/IsIOpenablePropertyTester.java
index e5fc47b4246..7b2c4932b11 100755
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/provider/IsIOpenablePropertyTester.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/provider/IsIOpenablePropertyTester.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2021 CEA LIST and others.
+ * Copyright (c) 2021, 2022 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,7 +10,7 @@
*
* Contributors:
* Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Bug 578357
*****************************************************************************/
package org.eclipse.papyrus.views.modelexplorer.provider;
@@ -56,11 +56,13 @@ public class IsIOpenablePropertyTester extends org.eclipse.core.expressions.Prop
// /!\ Here we don't use the "selection" variable because it is updated too late to be used by enablement of org.eclipse.ui.navigator.navigatorContent#actionProvider
final ISelectionProvider selectionProvider = wp.getSite().getSelectionProvider();
final ISelection selection = selectionProvider.getSelection();
- if (selection instanceof IStructuredSelection) {
+ if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
final EObject current = EMFHelper.getEObject(((IStructuredSelection) selection).getFirstElement());
- IAdapterManager adapterManager = Platform.getAdapterManager();
- IOpenable adapter = adapterManager.getAdapter(current, IOpenable.class);
- return Boolean.valueOf(adapter != null).equals(expectedValue);
+ if (current != null) {
+ IAdapterManager adapterManager = Platform.getAdapterManager();
+ IOpenable adapter = adapterManager.getAdapter(current, IOpenable.class);
+ return Boolean.valueOf(adapter != null).equals(expectedValue);
+ }
}
}
}

Back to the top