Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2015-05-26 19:25:23 +0000
committerChristian W. Damus2015-05-26 19:25:23 +0000
commit9963c6ef7005b311347e0f04a131b717d716a83c (patch)
tree3aacd600ffe187a7a110c4811acc9311169cfa87
parenta090ede025171a5656559091df500230ebb8fb71 (diff)
downloadorg.eclipse.papyrus-9963c6ef7005b311347e0f04a131b717d716a83c.tar.gz
org.eclipse.papyrus-9963c6ef7005b311347e0f04a131b717d716a83c.tar.xz
org.eclipse.papyrus-9963c6ef7005b311347e0f04a131b717d716a83c.zip
Bug 467920: [Model Explorer] New Trace relationship menu action creates a Refine abstraction
https://bugs.eclipse.org/bugs/show_bug.cgi?id=467920 Fix trace edit-helper that applied the <<refine>> stereotype by copy/paste error. Address nearby deprecation warnings.
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/RefineEditHelperAdvice.java18
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/TraceEditHelperAdvice.java18
2 files changed, 22 insertions, 14 deletions
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/RefineEditHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/RefineEditHelperAdvice.java
index aadd127a98d..2f86612ee0f 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/RefineEditHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/RefineEditHelperAdvice.java
@@ -1,13 +1,17 @@
/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
+ * Copyright (c) 2011, 2015 CEA LIST, 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 v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ * Christian W. Damus - bug 467920
+ *
*****************************************************************************/
+
package org.eclipse.papyrus.uml.service.types.helper.advice;
import org.eclipse.core.commands.ExecutionException;
@@ -17,7 +21,7 @@ import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
+import org.eclipse.papyrus.uml.tools.utils.NamedElementUtil;
import org.eclipse.uml2.uml.NamedElement;
import org.eclipse.uml2.uml.profile.standard.Refine;
import org.eclipse.uml2.uml.profile.standard.StandardPackage;
@@ -39,13 +43,13 @@ public class RefineEditHelperAdvice extends AbstractStereotypedElementEditHelper
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- NamedElement element = (NamedElement)request.getElementToConfigure();
- if(element != null) {
- StereotypeApplicationHelper.INSTANCE.applyStereotype(element, StandardPackage.eINSTANCE.getRefine());
+ NamedElement element = (NamedElement) request.getElementToConfigure();
+ if (element != null) {
+ StereotypeApplicationHelper.getInstance(element).applyStereotype(element, StandardPackage.Literals.REFINE);
// Set default name
// Initialize the element name based on the created IElementType
- String initializedName = NamedElementHelper.getDefaultNameWithIncrementFromBase(StandardPackage.eINSTANCE.getRefine().getName(), element.eContainer().eContents());
+ String initializedName = NamedElementUtil.getDefaultNameWithIncrementFromBase(StandardPackage.Literals.REFINE.getName(), element.eContainer().eContents());
element.setName(initializedName);
}
return CommandResult.newOKCommandResult(element);
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/TraceEditHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/TraceEditHelperAdvice.java
index a4398e55b23..53085b63380 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/TraceEditHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/TraceEditHelperAdvice.java
@@ -1,13 +1,17 @@
/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
+ * Copyright (c) 2011, 2015 CEA LIST, 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 v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ * Christian W. Damus - bug 467920
+ *
*****************************************************************************/
+
package org.eclipse.papyrus.uml.service.types.helper.advice;
import org.eclipse.core.commands.ExecutionException;
@@ -17,7 +21,7 @@ import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
+import org.eclipse.papyrus.uml.tools.utils.NamedElementUtil;
import org.eclipse.uml2.uml.NamedElement;
import org.eclipse.uml2.uml.profile.standard.StandardPackage;
import org.eclipse.uml2.uml.profile.standard.Trace;
@@ -39,13 +43,13 @@ public class TraceEditHelperAdvice extends AbstractStereotypedElementEditHelperA
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- NamedElement element = (NamedElement)request.getElementToConfigure();
- if(element != null) {
- StereotypeApplicationHelper.INSTANCE.applyStereotype(element, StandardPackage.eINSTANCE.getRefine());
+ NamedElement element = (NamedElement) request.getElementToConfigure();
+ if (element != null) {
+ StereotypeApplicationHelper.getInstance(element).applyStereotype(element, StandardPackage.Literals.TRACE);
// Set default name
// Initialize the element name based on the created IElementType
- String initializedName = NamedElementHelper.getDefaultNameWithIncrementFromBase(StandardPackage.eINSTANCE.getTrace().getName(), element.eContainer().eContents());
+ String initializedName = NamedElementUtil.getDefaultNameWithIncrementFromBase(StandardPackage.Literals.TRACE.getName(), element.eContainer().eContents());
element.setName(initializedName);
}
return CommandResult.newOKCommandResult(element);

Back to the top