diff options
Diffstat (limited to 'plugins')
71 files changed, 773 insertions, 312 deletions
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/plugin.xml b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/plugin.xml index 15cdb7fd94d..b8877792bb8 100644 --- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/plugin.xml +++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/plugin.xml @@ -25,7 +25,7 @@ id="org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation.CustomModelWizardID" name="%_UI_CustomModelWizard_label" class="org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation.CustomModelWizard" - category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.addons.category" + category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.custo.category/org.eclipse.papyrus.wizards.custo.modelexplorer.category" icon="icons/full/obj16/CustomModelFile.gif"> <description>%_UI_CustomModelWizard_description</description> <selection class="org.eclipse.core.resources.IResource"/> diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/META-INF/MANIFEST.MF b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/META-INF/MANIFEST.MF index 600476f63e0..0b8cb68f24d 100644 --- a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/META-INF/MANIFEST.MF +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.papyrus.infra.architecture;singleton:=true -Bundle-Version: 3.1.0.qualifier +Bundle-Version: 3.2.0.qualifier Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-11 Export-Package: org.eclipse.papyrus.infra.architecture, diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/pom.xml b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/pom.xml index 4230c8e2785..d0927eedd49 100644 --- a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/pom.xml +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/pom.xml @@ -9,9 +9,9 @@ <version>0.0.1-SNAPSHOT</version> </parent> <artifactId>org.eclipse.papyrus.infra.architecture</artifactId> - <version>3.1.0-SNAPSHOT</version> + <version>3.2.0-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> - + <build> <plugins> <!-- TODO: These first two plug-ins should be replaced by Papyrus standard diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/AbstractArchitectureDescriptionAdapter.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/AbstractArchitectureDescriptionAdapter.java new file mode 100644 index 00000000000..65a03c9c5ba --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/AbstractArchitectureDescriptionAdapter.java @@ -0,0 +1,64 @@ +/***************************************************************************** + * Copyright (c) 2021 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.architecture.listeners; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.util.EContentAdapter; +import org.eclipse.papyrus.infra.core.architecture.ArchitectureDescription; +import org.eclipse.papyrus.infra.core.architecture.ArchitectureDescriptionPreferences; + +/** + * An adapter that is installed in DI models to listen to architecture description changes + * + * @since 3.2 + * + */ +public abstract class AbstractArchitectureDescriptionAdapter extends EContentAdapter { + + /** + * Listens to changes on ArchitectureDescription* objects + */ + @Override + public void notifyChanged(final Notification notification) { + if (notification.getNotifier() instanceof ArchitectureDescription || + notification.getNewValue() instanceof ArchitectureDescription || + notification.getOldValue() instanceof ArchitectureDescription) { + fireArchitectureContextChanged(notification); + } else if (notification.getNotifier() instanceof ArchitectureDescriptionPreferences || + notification.getNewValue() instanceof ArchitectureDescriptionPreferences || + notification.getOldValue() instanceof ArchitectureDescriptionPreferences) { + fireArchitectureViewpointsChanged(notification); + } + } + + /** + * This method notifies that the Architecture context changed + * + * @param notification + * a notification + */ + public abstract void fireArchitectureContextChanged(final Notification notification); + + /** + * This method notifies that the Architecture viewpoint changed + * + * @param notification + * a notification + */ + public abstract void fireArchitectureViewpointsChanged(final Notification notification); + + +}
\ No newline at end of file diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/ArchitectureDescriptionAdapter.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/ArchitectureDescriptionAdapter.java index 7e9efcc70e8..753c5e1dec2 100644 --- a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/ArchitectureDescriptionAdapter.java +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/ArchitectureDescriptionAdapter.java @@ -1,46 +1,47 @@ -/** - * Copyright (c) 2017 CEA LIST. - * +/***************************************************************************** + * Copyright (c) 2017, 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: * Maged Elaasar - Initial API and implementation - * - * - */ + * Vincent Lorenzo (CEA LIST) <vincent.lorenzo@cea.fr> - Bug 576004 + * + *****************************************************************************/ package org.eclipse.papyrus.infra.architecture.listeners; import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.util.EContentAdapter; -import org.eclipse.papyrus.infra.core.architecture.ArchitectureDescription; -import org.eclipse.papyrus.infra.core.architecture.ArchitectureDescriptionPreferences; /** * An adapter that is installed in DI models to listen to architecture description changes * * @since 1.0 */ -public class ArchitectureDescriptionAdapter extends EContentAdapter { +public class ArchitectureDescriptionAdapter extends AbstractArchitectureDescriptionAdapter { + + /** + * @see org.eclipse.papyrus.infra.architecture.listeners.AbstractArchitectureDescriptionAdapter#fireArchitectureContextChanged(org.eclipse.emf.common.notify.Notification) + * + * @param notification + */ + @Override + public void fireArchitectureContextChanged(Notification notification) { + ArchitectureDescriptionNotifier.getInstance().fireArchitectureContextChanged(notification); + } /** - * Listens to changes on ArchitectureDescription* objects + * @see org.eclipse.papyrus.infra.architecture.listeners.AbstractArchitectureDescriptionAdapter#fireArchitectureViewpointsChanged(org.eclipse.emf.common.notify.Notification) + * + * @param notification */ @Override - public void notifyChanged(Notification notification) { - if (notification.getNotifier() instanceof ArchitectureDescription || - notification.getNewValue() instanceof ArchitectureDescription || - notification.getOldValue() instanceof ArchitectureDescription) { - ArchitectureDescriptionNotifier.getInstance().fireArchitectureContextChanged(notification); - } else if (notification.getNotifier() instanceof ArchitectureDescriptionPreferences || - notification.getNewValue() instanceof ArchitectureDescriptionPreferences || - notification.getOldValue() instanceof ArchitectureDescriptionPreferences) { - ArchitectureDescriptionNotifier.getInstance().fireArchitectureViewpointsChanged(notification); - } + public void fireArchitectureViewpointsChanged(Notification notification) { + ArchitectureDescriptionNotifier.getInstance().fireArchitectureViewpointsChanged(notification); } } diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/ArchitectureDescriptionAdapterUtils.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/ArchitectureDescriptionAdapterUtils.java new file mode 100644 index 00000000000..abd87b29b1a --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/ArchitectureDescriptionAdapterUtils.java @@ -0,0 +1,71 @@ +/***************************************************************************** + * Copyright (c) 2021 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.architecture.listeners; + +import org.eclipse.papyrus.infra.core.resource.ModelSet; +import org.eclipse.papyrus.infra.core.resource.sasheditor.DiModel; +import org.eclipse.papyrus.infra.core.resource.sasheditor.SashModel; + +/** + * This class is in charge to register adapter on the architecture, in order to be notified when the Architecture context of the architecture viewpoint changed + * + * @since 3.2 + */ +public final class ArchitectureDescriptionAdapterUtils { + + + private ArchitectureDescriptionAdapterUtils() { + // to prevent instantiation + } + + /** + * + * @param modelSet + * the current modelSet + * @param adapter + * the adapter to register on the architecture context + */ + public static final void registerListener(final ModelSet modelSet, final AbstractArchitectureDescriptionAdapter adapter) { + DiModel diModel = (DiModel) modelSet.getModel(DiModel.DI_MODEL_ID); + if (diModel != null) { + diModel.getResource().eAdapters().add(adapter); + } + SashModel sashModel = (SashModel) modelSet.getModel(SashModel.MODEL_ID); + if (sashModel != null) { + sashModel.getResource().eAdapters().add(adapter); + } + } + + /** + * + * @param modelSet + * the current modelSet + * @param adapter + * the adapter to unregister + */ + public static final void unregisterListener(final ModelSet modelSet, final AbstractArchitectureDescriptionAdapter adapter) { + DiModel diModel = (DiModel) modelSet.getModel(DiModel.DI_MODEL_ID); + if (diModel != null && diModel.getResource() != null) { + diModel.getResource().eAdapters().remove(adapter); + } + SashModel sashModel = (SashModel) modelSet.getModel(SashModel.MODEL_ID); + if (sashModel != null && sashModel.getResource() != null) { + if (sashModel.getResource() != null) { + sashModel.getResource().eAdapters().remove(adapter); + } + } + } +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/ArchitectureDescriptionSnippet.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/ArchitectureDescriptionSnippet.java index 1ad3accb24a..9ea27e7a591 100644 --- a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/ArchitectureDescriptionSnippet.java +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/ArchitectureDescriptionSnippet.java @@ -1,5 +1,5 @@ -/** - * Copyright (c) 2017 CEA LIST. +/***************************************************************************** + * Copyright (c) 2017, 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 @@ -10,15 +10,13 @@ * * Contributors: * Maged Elaasar - Initial API and implementation + * Vincent Lorenzo (CEA LIST) <vincent.lorenzo@cea.fr> - Bug 576004 * - * - */ + *****************************************************************************/ package org.eclipse.papyrus.infra.architecture.listeners; import org.eclipse.papyrus.infra.core.resource.IModelSetSnippet; import org.eclipse.papyrus.infra.core.resource.ModelSet; -import org.eclipse.papyrus.infra.core.resource.sasheditor.DiModel; -import org.eclipse.papyrus.infra.core.resource.sasheditor.SashModel; /** * A model snippet to install the architecture description adapter in the DI model @@ -42,14 +40,7 @@ public class ArchitectureDescriptionSnippet implements IModelSetSnippet { */ @Override public void start(ModelSet modelSet) { - DiModel diModel = (DiModel) modelSet.getModel(DiModel.DI_MODEL_ID); - if (diModel != null) { - diModel.getResource().eAdapters().add(adapter); - } - SashModel sashModel = (SashModel) modelSet.getModel(SashModel.MODEL_ID); - if (sashModel != null) { - sashModel.getResource().eAdapters().add(adapter); - } + ArchitectureDescriptionAdapterUtils.registerListener(modelSet, this.adapter); } /** @@ -62,15 +53,6 @@ public class ArchitectureDescriptionSnippet implements IModelSetSnippet { */ @Override public void dispose(ModelSet modelSet) { - DiModel diModel = (DiModel) modelSet.getModel(DiModel.DI_MODEL_ID); - if (diModel != null) { - diModel.getResource().eAdapters().remove(adapter); - } - SashModel sashModel = (SashModel) modelSet.getModel(SashModel.MODEL_ID); - if (sashModel != null) { - if (sashModel.getResource() != null) { - sashModel.getResource().eAdapters().remove(adapter); - } - } + ArchitectureDescriptionAdapterUtils.unregisterListener(modelSet, this.adapter); } } diff --git a/plugins/infra/constraints/org.eclipse.papyrus.infra.constraints.editor/plugin.xml b/plugins/infra/constraints/org.eclipse.papyrus.infra.constraints.editor/plugin.xml index 5d5a73d154f..41817a0d887 100644 --- a/plugins/infra/constraints/org.eclipse.papyrus.infra.constraints.editor/plugin.xml +++ b/plugins/infra/constraints/org.eclipse.papyrus.infra.constraints.editor/plugin.xml @@ -16,7 +16,7 @@ id="org.eclipse.papyrus.infra.constraints.presentation.ConstraintsModelWizardID" name="%_UI_ConstraintsModelWizard_label" class="org.eclipse.papyrus.infra.constraints.presentation.ConstraintsModelWizard" - category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.addons.category" + category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.dev.category/org.eclipse.papyrus.wizards.dev.framework.category" icon="icons/full/obj16/ConstraintsModelFile.gif"> <description>%_UI_ConstraintsModelWizard_description</description> <selection class="org.eclipse.core.resources.IResource"/> @@ -25,7 +25,7 @@ id="org.eclipse.papyrus.infra.constraints.environment.presentation.EnvironmentModelWizardID" name="%_UI_EnvironmentModelWizard_label" class="org.eclipse.papyrus.infra.constraints.environment.presentation.EnvironmentModelWizard" - category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.addons.category" + category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.dev.category/org.eclipse.papyrus.wizards.dev.framework.category" icon="icons/full/obj16/EnvironmentModelFile.gif"> <description>%_UI_EnvironmentModelWizard_description</description> <selection class="org.eclipse.core.resources.IResource"/> diff --git a/plugins/infra/emf/expressions/org.eclipse.papyrus.infra.emf.expressions.editor/plugin.xml b/plugins/infra/emf/expressions/org.eclipse.papyrus.infra.emf.expressions.editor/plugin.xml index 1095aa6ead7..c13d0f774c1 100755 --- a/plugins/infra/emf/expressions/org.eclipse.papyrus.infra.emf.expressions.editor/plugin.xml +++ b/plugins/infra/emf/expressions/org.eclipse.papyrus.infra.emf.expressions.editor/plugin.xml @@ -26,7 +26,7 @@ id="org.eclipse.papyrus.infra.emf.expressions.presentation.ExpressionsModelWizardID" name="%_UI_ExpressionsModelWizard_label" class="org.eclipse.papyrus.infra.emf.expressions.presentation.ExpressionsModelWizard" - category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.addons.category" + category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.dev.category/org.eclipse.papyrus.wizards.dev.framework.category" icon="icons/full/obj16/ExpressionsModelFile.gif"> <description>%_UI_ExpressionsModelWizard_description</description> <selection class="org.eclipse.core.resources.IResource"/> diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.editor/plugin.xml b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.editor/plugin.xml index cbc38fb5b36..e36c5280144 100644 --- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.editor/plugin.xml +++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.editor/plugin.xml @@ -23,7 +23,7 @@ id="org.eclipse.papyrus.infra.gmfdiag.assistant.presentation.AssistantModelWizardID" name="%_UI_AssistantModelWizard_label" class="org.eclipse.papyrus.infra.gmfdiag.assistant.presentation.AssistantModelWizard" - category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.addons.category" + category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.custo.category/org.eclipse.papyrus.wizards.custo.editors.category" icon="icons/full/obj16/AssistantModelFile.gif"> <description>%_UI_AssistantModelWizard_description</description> <selection class="org.eclipse.core.resources.IResource"/> diff --git a/plugins/infra/gmfdiag/expansion/org.eclipse.papyrus.infra.gmfdiag.expansion.editor/plugin.xml b/plugins/infra/gmfdiag/expansion/org.eclipse.papyrus.infra.gmfdiag.expansion.editor/plugin.xml index 1272c225304..ded3aa9768e 100644 --- a/plugins/infra/gmfdiag/expansion/org.eclipse.papyrus.infra.gmfdiag.expansion.editor/plugin.xml +++ b/plugins/infra/gmfdiag/expansion/org.eclipse.papyrus.infra.gmfdiag.expansion.editor/plugin.xml @@ -11,7 +11,7 @@ id="org.eclipse.papyrus.infra.gmfdiag.expansion.expansionmodel.presentation.ExpansionModelModelWizardID" name="%_UI_ExpansionModelModelWizard_label" class="org.eclipse.papyrus.infra.gmfdiag.expansion.expansionmodel.presentation.ExpansionModelModelWizard" - category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.addons.category" + category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.dev.category/org.eclipse.papyrus.wizards.dev.editors.category" icon="icons/full/obj16/ExpansionModelModelFile.gif"> <description>%_UI_ExpansionModelModelWizard_description</description> <selection class="org.eclipse.core.resources.IResource"/> 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.menu/src/org/eclipse/papyrus/infra/gmfdiag/menu/handlers/PasteInDiagramHandler.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/src/org/eclipse/papyrus/infra/gmfdiag/menu/handlers/PasteInDiagramHandler.java index e4890eda481..e9736af1c26 100644 --- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/src/org/eclipse/papyrus/infra/gmfdiag/menu/handlers/PasteInDiagramHandler.java +++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/src/org/eclipse/papyrus/infra/gmfdiag/menu/handlers/PasteInDiagramHandler.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2014 CEA LIST. + * Copyright (c) 2014, 2021 CEA LIST. * * * All rights reserved. This program and the accompanying materials @@ -11,7 +11,7 @@ * * Contributors: * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation - * + * Ansgar Radermacher (CEA LIST) ansgar.radermacher@cea.fr - bug 573807 *****************************************************************************/ package org.eclipse.papyrus.infra.gmfdiag.menu.handlers; @@ -82,7 +82,7 @@ public class PasteInDiagramHandler extends AbstractGraphicalCommandHandler { Control focusControl = null; if (activeShell instanceof Shell) { Shell shell = (Shell) activeShell; - Display display = shell.getDisplay(); + Display display = !shell.isDisposed() ? shell.getDisplay() : null; if (display != null) { focusControl = display.getFocusControl(); } 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/gmfdiag/paletteconfiguration/org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration.editor/plugin.xml b/plugins/infra/gmfdiag/paletteconfiguration/org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration.editor/plugin.xml index c09267a6413..80b8e2d764e 100644 --- a/plugins/infra/gmfdiag/paletteconfiguration/org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration.editor/plugin.xml +++ b/plugins/infra/gmfdiag/paletteconfiguration/org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration.editor/plugin.xml @@ -16,7 +16,7 @@ id="org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration.presentation.PaletteconfigurationModelWizardID" name="%_UI_PaletteconfigurationModelWizard_label" class="org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration.presentation.CustomPaletteconfigurationModelWizard" - category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.addons.category" + category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.custo.category/org.eclipse.papyrus.wizards.custo.editors.category" icon="icons/full/obj16/PaletteconfigurationModelFile.gif"> <description>%_UI_PaletteconfigurationModelWizard_description</description> <selection class="org.eclipse.core.resources.IResource"/> diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor/plugin.xml b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor/plugin.xml index 99f7146a7b7..6576d9dd712 100644 --- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor/plugin.xml +++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor/plugin.xml @@ -58,7 +58,7 @@ id="org.eclipse.papyrus.infra.nattable.model.nattable.nattableconfiguration.presentation.NattableconfigurationModelWizardID" name="%_UI_NattableconfigurationModelWizard_label" class="org.eclipse.papyrus.infra.nattable.model.nattable.nattableconfiguration.presentation.NattableconfigurationModelWizard" - category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.addons.category" + category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.custo.category/org.eclipse.papyrus.wizards.custo.editors.category" icon="icons/full/obj16/NattableconfigurationModelFile.gif"> <description>%_UI_NattableconfigurationModelWizard_description</description> <selection class="org.eclipse.core.resources.IResource"/> 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/newchild/org.eclipse.papyrus.infra.newchild.editor/plugin.xml b/plugins/infra/newchild/org.eclipse.papyrus.infra.newchild.editor/plugin.xml index d71878018db..3458372c790 100644 --- a/plugins/infra/newchild/org.eclipse.papyrus.infra.newchild.editor/plugin.xml +++ b/plugins/infra/newchild/org.eclipse.papyrus.infra.newchild.editor/plugin.xml @@ -24,7 +24,7 @@ id="org.eclipse.papyrus.infra.newchild.elementcreationmenumodel.presentation.ElementCreationMenuModelModelWizardID" name="%_UI_ElementCreationMenuModelModelWizard_label" class="org.eclipse.papyrus.infra.newchild.elementcreationmenumodel.presentation.ElementCreationMenuModelModelWizard" - category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.addons.category" + category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.custo.category/org.eclipse.papyrus.wizards.custo.modelexplorer.category" icon="icons/full/obj16/ElementCreationMenuModelModelFile.gif"> <description>%_UI_ElementCreationMenuModelModelWizard_description</description> <selection class="org.eclipse.core.resources.IResource"/> 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/properties/org.eclipse.papyrus.infra.properties.editor/plugin.xml b/plugins/infra/properties/org.eclipse.papyrus.infra.properties.editor/plugin.xml index ad301007599..8eeb1e10e21 100644 --- a/plugins/infra/properties/org.eclipse.papyrus.infra.properties.editor/plugin.xml +++ b/plugins/infra/properties/org.eclipse.papyrus.infra.properties.editor/plugin.xml @@ -16,7 +16,7 @@ id="org.eclipse.papyrus.infra.properties.environment.presentation.EnvironmentModelWizardID" name="%_UI_EnvironmentModelWizard_label" class="org.eclipse.papyrus.infra.properties.environment.presentation.EnvironmentModelWizard" - category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.addons.category" + category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.custo.category/org.eclipse.papyrus.wizards.custo.properties.category" icon="icons/full/obj16/EnvironmentModelFile.gif"> <description>%_UI_EnvironmentModelWizard_description</description> <selection class="org.eclipse.core.resources.IResource"/> @@ -40,7 +40,7 @@ id="org.eclipse.papyrus.infra.properties.contexts.presentation.ContextsModelWizardID" name="%_UI_ContextsModelWizard_label" class="org.eclipse.papyrus.infra.properties.contexts.presentation.ContextsModelWizard" - category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.addons.category" + category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.dev.category/org.eclipse.papyrus.wizards.dev.framework.category" icon="icons/full/obj16/ContextsModelFile.gif"> <description>%_UI_ContextsModelWizard_description</description> <selection class="org.eclipse.core.resources.IResource"/> @@ -64,7 +64,7 @@ id="org.eclipse.papyrus.infra.properties.ui.presentation.UiModelWizardID" name="%_UI_UiModelWizard_label" class="org.eclipse.papyrus.infra.properties.ui.presentation.UiModelWizard" - category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.addons.category" + category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.dev.category/org.eclipse.papyrus.wizards.dev.framework.category" icon="icons/full/obj16/UiModelFile.gif"> <description>%_UI_UiModelWizard_description</description> <selection class="org.eclipse.core.resources.IResource"/> 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..1665b4aa5f4 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.0.100.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/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..0414b874411 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 *****************************************************************************/ package org.eclipse.papyrus.infra.textedit.xtext.nested.editor; @@ -26,6 +26,7 @@ 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.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; @@ -351,7 +352,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 +371,12 @@ 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 + } } 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..be0b2b2a1d9 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.0.100-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/types/org.eclipse.papyrus.infra.types.editor/plugin.xml b/plugins/infra/types/org.eclipse.papyrus.infra.types.editor/plugin.xml index 6210d701332..ed43f5a8e8c 100644 --- a/plugins/infra/types/org.eclipse.papyrus.infra.types.editor/plugin.xml +++ b/plugins/infra/types/org.eclipse.papyrus.infra.types.editor/plugin.xml @@ -26,7 +26,7 @@ id="org.eclipse.papyrus.infra.types.presentation.ElementTypesConfigurationsModelWizardID" name="%_UI_ElementTypesConfigurationsModelWizard_label" class="org.eclipse.papyrus.infra.types.presentation.ElementTypesConfigurationsModelWizard" - category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.addons.category" + category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.custo.category/org.eclipse.papyrus.wizards.custo.framework.category" icon="icons/full/obj16/ElementTypesConfigurationsModelFile.gif"> <description>%_UI_ElementTypesConfigurationsModelWizard_description</description> <selection class="org.eclipse.core.resources.IResource"/> 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/infra/ui/org.eclipse.papyrus.infra.ui.architecture/plugin.xml b/plugins/infra/ui/org.eclipse.papyrus.infra.ui.architecture/plugin.xml index a388b4d053e..1faa3af1e47 100644 --- a/plugins/infra/ui/org.eclipse.papyrus.infra.ui.architecture/plugin.xml +++ b/plugins/infra/ui/org.eclipse.papyrus.infra.ui.architecture/plugin.xml @@ -25,7 +25,7 @@ id="org.eclipse.papyrus.infra.ui.architecture.ArchitectureModelWizardID" name="%_UI_ArchitectureModelWizard_label" class="org.eclipse.papyrus.infra.ui.architecture.editor.ArchitectureModelWizard" - category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.addons.category" + category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.custo.category/org.eclipse.papyrus.wizards.custo.framework.category" icon="icons/full/obj16/ArchitectureModelFile.gif"> <description>%_UI_ArchitectureModelWizard_description</description> <selection class="org.eclipse.core.resources.IResource"/> diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.ui/plugin.properties b/plugins/infra/ui/org.eclipse.papyrus.infra.ui/plugin.properties index 5729862d400..1d64d06ede0 100644 --- a/plugins/infra/ui/org.eclipse.papyrus.infra.ui/plugin.properties +++ b/plugins/infra/ui/org.eclipse.papyrus.infra.ui/plugin.properties @@ -17,7 +17,14 @@ viewcategory.name=Papyrus wizardCategoryExportPapyrus=Papyrus wizardCategoryImportPapyrus=Papyrus wizardCategoryPapyrus=Papyrus -wizardCategoryAddons=Papyrus Add-ons +wizardCategoryCustomization=Customization +wizardCategoryCustoFramework=Framework +wizardCategoryCustoModelExplorer=Model Explorer +wizardCategoryCustoEditors=Editors +wizardCategoryCustoPropertyView=Property View +wizardCategoryDeveloppers=Developpers +wizardCategoryDevFramework=Framework +wizardCategoryDevEditors=Editors wizardCategoryComponents=Papyrus Components wizardCategoryTable=Papyrus Table wizardCategoryToolsmiths=Papyrus Toolsmiths diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.ui/plugin.xml b/plugins/infra/ui/org.eclipse.papyrus.infra.ui/plugin.xml index ac48320e7a8..01e9d57d3dc 100644 --- a/plugins/infra/ui/org.eclipse.papyrus.infra.ui/plugin.xml +++ b/plugins/infra/ui/org.eclipse.papyrus.infra.ui/plugin.xml @@ -564,8 +564,37 @@ name="%wizardCategoryPapyrus"> </category> <category - id="org.eclipse.papyrus.wizards.addons.category" - name="%wizardCategoryAddons" parentCategory="org.eclipse.papyrus.wizards.category"> + id="org.eclipse.papyrus.wizards.custo.category" + name="%wizardCategoryCustomization" parentCategory="org.eclipse.papyrus.wizards.category"> + </category> + <category + id="org.eclipse.papyrus.wizards.custo.framework.category" + name="%wizardCategoryCustoFramework" parentCategory="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.custo.category"> + </category> + <category + id="org.eclipse.papyrus.wizards.custo.modelexplorer.category" + name="%wizardCategoryCustoModelExplorer" parentCategory="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.custo.category"> + </category> + <category + id="org.eclipse.papyrus.wizards.custo.editors.category" + name="%wizardCategoryCustoEditors" parentCategory="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.custo.category"> + </category> + <category + id="org.eclipse.papyrus.wizards.custo.properties.category" + name="%wizardCategoryCustoPropertyView" parentCategory="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.custo.category"> + </category> + + <category + id="org.eclipse.papyrus.wizards.dev.category" + name="%wizardCategoryDeveloppers" parentCategory="org.eclipse.papyrus.wizards.category"> + </category> + <category + id="org.eclipse.papyrus.wizards.dev.framework.category" + name="%wizardCategoryDevFramework" parentCategory="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.dev.category"> + </category> + <category + id="org.eclipse.papyrus.wizards.dev.editors.category" + name="%wizardCategoryDevEditors" parentCategory="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.dev.category"> </category> <category id="org.eclipse.papyrus.wizards.components.category" @@ -575,10 +604,6 @@ id="org.eclipse.papyrus.wizards.table.category" name="%wizardCategoryTable" parentCategory="org.eclipse.papyrus.wizards.category"> </category> - <category - id="org.eclipse.papyrus.wizards.toolsmiths.category" - name="%wizardCategoryToolsmiths" parentCategory="org.eclipse.papyrus.wizards.category"> - </category> <category id="org.eclipse.papyrus.examples" parentCategory="org.eclipse.ui.Examples" 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 6af386c87c6..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.0.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 148cead0d3e..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.0.0-SNAPSHOT</version> + <version>6.2.0-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> </project>
\ No newline at end of file diff --git a/plugins/toolsmiths/org.eclipse.papyrus.customization.nattableconfiguration/plugin.xml b/plugins/toolsmiths/org.eclipse.papyrus.customization.nattableconfiguration/plugin.xml index 926e846ebf4..8f34f410bee 100644 --- a/plugins/toolsmiths/org.eclipse.papyrus.customization.nattableconfiguration/plugin.xml +++ b/plugins/toolsmiths/org.eclipse.papyrus.customization.nattableconfiguration/plugin.xml @@ -45,7 +45,7 @@ <extension point="org.eclipse.ui.newWizards"> <wizard - category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.toolsmiths.category" + category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.dev.category/org.eclipse.papyrus.wizards.dev.editors.category" class="org.eclipse.papyrus.customization.nattableconfiguration.wizards.CreateNattableConfigurationProjectWizard" hasPages="true" icon="icons/wizard_icon.png" @@ -55,7 +55,7 @@ project="true"> </wizard> <wizard - category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.toolsmiths.category" + category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.dev.category/org.eclipse.papyrus.wizards.dev.editors.category" class="org.eclipse.papyrus.customization.nattableconfiguration.wizards.CreateAndEditTableConfigurationWizard" hasPages="true" icon="icons/wizard_icon.png" diff --git a/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths/plugin.xml b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths/plugin.xml index 9f1fa64e64a..6e4ac61cfb7 100644 --- a/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths/plugin.xml +++ b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths/plugin.xml @@ -21,7 +21,7 @@ point="org.eclipse.ui.newWizards"> <!-- @generated NOT --> <wizard - category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.toolsmiths.category" + category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.dev.category/org.eclipse.papyrus.wizards.dev.framework.category" class="org.eclipse.papyrus.toolsmiths.wizard.CreateNewCustomizationPluginWizard" icon="icons/16-config.png" id="org.eclipse.papyrus.toolsmiths.wizard" diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/strategy/paste/StereotypePasteStrategy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/strategy/paste/StereotypePasteStrategy.java index bb774f32fd8..df1f675eb6b 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/strategy/paste/StereotypePasteStrategy.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/strategy/paste/StereotypePasteStrategy.java @@ -1,6 +1,6 @@ /***************************************************************************** - * Copyright (c) 2014 CEA LIST. - * + * Copyright (c) 2014, 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 @@ -10,6 +10,7 @@ * * Contributors: * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation + * Ansgar Radermacher (CEA LIST) ansgar.radermacher@cea.fr - bug 573807 *****************************************************************************/ package org.eclipse.papyrus.uml.diagram.common.strategy.paste; @@ -70,7 +71,7 @@ public class StereotypePasteStrategy extends AbstractPasteStrategy implements IP /* * (non-Javadoc) - * + * * @see org.eclipse.papyrus.infra.gmfdiag.common.strategy.paste.IPasteStrategy#getLabel() */ public String getLabel() { @@ -79,7 +80,7 @@ public class StereotypePasteStrategy extends AbstractPasteStrategy implements IP /* * (non-Javadoc) - * + * * @see org.eclipse.papyrus.infra.gmfdiag.common.strategy.paste.IPasteStrategy#getID() */ public String getID() { @@ -88,7 +89,7 @@ public class StereotypePasteStrategy extends AbstractPasteStrategy implements IP /* * (non-Javadoc) - * + * * @see org.eclipse.papyrus.infra.gmfdiag.common.strategy.paste.IPasteStrategy#getDescription() */ public String getDescription() { @@ -97,7 +98,7 @@ public class StereotypePasteStrategy extends AbstractPasteStrategy implements IP /* * (non-Javadoc) - * + * * @see org.eclipse.papyrus.infra.gmfdiag.common.strategy.paste.IPasteStrategy#dependsOn() */ @Override @@ -107,7 +108,7 @@ public class StereotypePasteStrategy extends AbstractPasteStrategy implements IP /* * (non-Javadoc) - * + * * @see org.eclipse.papyrus.infra.gmfdiag.common.strategy.paste.IPasteStrategy#getSemanticCommand(org.eclipse.emf.edit.domain.EditingDomain, * org.eclipse.emf.ecore.EObject, org.eclipse.papyrus.infra.core.clipboard.PapyrusClipboard) */ @@ -122,7 +123,7 @@ public class StereotypePasteStrategy extends AbstractPasteStrategy implements IP // 1. init all ApplyStereotypeCommand for (Iterator<Object> iterator = papyrusClipboard.iterator(); iterator.hasNext();) { - Object object = (Object) iterator.next(); + Object object = iterator.next(); // get target Element EObject target = papyrusClipboard.getTragetCopyFromInternalClipboardCopy(object); if (target != null && target instanceof Element) { @@ -136,19 +137,22 @@ public class StereotypePasteStrategy extends AbstractPasteStrategy implements IP DuplicateStereotypeCommand applyStereotypeCommand = new DuplicateStereotypeCommand((TransactionalEditingDomain) domain, (Element) target, (Element) targetOwner, stereotypeApplication); Stereotype stereotypeInTargetContext = applyStereotypeCommand.getStereotypeInTargetContext(); - Profile profile = stereotypeInTargetContext.getProfile(); - - if (isProfileAppliedRecursive(targetPackage, profile)) { - compoundCommand.append(applyStereotypeCommand); - } else { // Profile is missing - Activator.getDefault().logInfo(profile.getName() + " is missing", null); - List<DuplicateStereotypeCommand> stereotypeListMissingProfiles = missingProfiles.get(profile); - if (stereotypeListMissingProfiles != null && !stereotypeListMissingProfiles.isEmpty()) { - stereotypeListMissingProfiles.add(applyStereotypeCommand); - } else { - stereotypeListMissingProfiles = new ArrayList<DuplicateStereotypeCommand>(); - stereotypeListMissingProfiles.add(applyStereotypeCommand); - missingProfiles.put(profile, stereotypeListMissingProfiles); + // might be null, if copied model element does no longer exist (since editor is closed) + if (stereotypeInTargetContext != null) { + Profile profile = stereotypeInTargetContext.getProfile(); + + if (isProfileAppliedRecursive(targetPackage, profile)) { + compoundCommand.append(applyStereotypeCommand); + } else { // Profile is missing + Activator.getDefault().logInfo(profile.getName() + " is missing", null); + List<DuplicateStereotypeCommand> stereotypeListMissingProfiles = missingProfiles.get(profile); + if (stereotypeListMissingProfiles != null && !stereotypeListMissingProfiles.isEmpty()) { + stereotypeListMissingProfiles.add(applyStereotypeCommand); + } else { + stereotypeListMissingProfiles = new ArrayList<DuplicateStereotypeCommand>(); + stereotypeListMissingProfiles.add(applyStereotypeCommand); + missingProfiles.put(profile, stereotypeListMissingProfiles); + } } } } @@ -255,7 +259,7 @@ public class StereotypePasteStrategy extends AbstractPasteStrategy implements IP /* * (non-Javadoc) - * + * * @see org.eclipse.papyrus.infra.gmfdiag.common.strategy.paste.IPasteStrategy#prepare(org.eclipse.papyrus.infra.core.clipboard.PapyrusClipboard) */ @Override 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="&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.generation/plugin.xml b/plugins/uml/properties/org.eclipse.papyrus.uml.properties.generation/plugin.xml index 44c6954ad45..0603ddee462 100644 --- a/plugins/uml/properties/org.eclipse.papyrus.uml.properties.generation/plugin.xml +++ b/plugins/uml/properties/org.eclipse.papyrus.uml.properties.generation/plugin.xml @@ -7,7 +7,7 @@ point="org.eclipse.ui.newWizards"> <!-- @generated NOT --> <wizard - category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.addons.category" + category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.custo.category/org.eclipse.papyrus.wizards.custo.properties.category" class="org.eclipse.papyrus.customization.properties.generation.wizard.CreateContextWizard" icon="icons/new_customization.png" id="org.eclipse.papyrus.customization.properties.generation.wizard" 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/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/commands/DuplicateStereotypeCommand.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/commands/DuplicateStereotypeCommand.java index fe158f817f2..c2887cb876f 100644 --- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/commands/DuplicateStereotypeCommand.java +++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/commands/DuplicateStereotypeCommand.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2014, 2017, 2019 CEA LIST. + * Copyright (c) 2014, 2017, 2019, 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 @@ -12,7 +12,7 @@ * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation * Gaabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - bug 438511 * Thanh Liem PHAN (ALL4TEC) thanhliem.phan@all4tec.net - bug 511045 - * Ansgar Radermacher (CEA LIST), ansgar.radermacher@cea.fr - bug 521279 (copy/paste between models) + * Ansgar Radermacher (CEA LIST) ansgar.radermacher@cea.fr - bug 521279 (copy/paste between models), bug 573807 * Pauline DEVILLE (CEA LIST) pauline.deville@cea.fr - bug 552410 *****************************************************************************/ package org.eclipse.papyrus.uml.tools.commands; @@ -81,8 +81,11 @@ public class DuplicateStereotypeCommand extends RecordingCommand { // reload the stereotype in the new Context-ResourceSet (Required because in org.eclipse.uml2.uml.internal.operations.PackageOperations // L960 in getProfileApplication the test is using == instead of equals) Stereotype stereotype = UMLUtil.getStereotype(stereotypeApplication); - Stereotype stereotypeInTargetContext = EMFHelper.reloadIntoContext(stereotype, targetContainer); - this.stereotypeInTargetContext = stereotypeInTargetContext; + // might be null, if copied model element does no longer exist (since editor is closed) + if (stereotype != null) { + Stereotype stereotypeInTargetContext = EMFHelper.reloadIntoContext(stereotype, targetContainer); + this.stereotypeInTargetContext = stereotypeInTargetContext; + } } public Stereotype getStereotypeInTargetContext() { 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); + } } } } |