Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsgar Radermacher2013-10-08 11:42:25 +0000
committerAnsgar Radermacher2013-10-08 12:37:30 +0000
commit817f6a0ff03f4945565e05ad799dd612595fd9c0 (patch)
treeacc5a81aba294bb50ac4a5765b31ba57b2357b4a /extraplugins
parent3a0a9b2cb98fed0858c9324249d43f505b62b55a (diff)
downloadorg.eclipse.papyrus-817f6a0ff03f4945565e05ad799dd612595fd9c0.tar.gz
org.eclipse.papyrus-817f6a0ff03f4945565e05ad799dd612595fd9c0.tar.xz
org.eclipse.papyrus-817f6a0ff03f4945565e05ad799dd612595fd9c0.zip
Changes related to supression of StUtils
Diffstat (limited to 'extraplugins')
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.views.cpp/META-INF/MANIFEST.MF3
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppClassPanel.java11
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppGeneralizationPanel.java10
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppOperationPanel.java75
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPackagePanel.java11
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppParameterPanel.java38
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPrimitiveTypePanel.java11
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPropertyPanel.java34
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppTemplateBindingPanel.java11
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppTemplateParameterPanel.java11
10 files changed, 111 insertions, 104 deletions
diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/META-INF/MANIFEST.MF b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/META-INF/MANIFEST.MF
index ffb9752e901..25c05c3e98b 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/META-INF/MANIFEST.MF
+++ b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/META-INF/MANIFEST.MF
@@ -24,7 +24,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.emf.transaction;bundle-version="1.4.0",
org.eclipse.gmf.runtime.common.core;bundle-version="1.4.1",
org.eclipse.gmf.runtime.emf.commands.core;bundle-version="1.4.0",
- org.eclipse.papyrus.acceleo;bundle-version="0.10.1"
+ org.eclipse.papyrus.acceleo;bundle-version="0.10.1",
+ org.eclipse.papyrus.uml.tools.utils;bundle-version="0.10.1"
Bundle-Vendor: %providerName
Eclipse-LazyStart: true
Bundle-Version: 0.10.1.qualifier
diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppClassPanel.java b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppClassPanel.java
index 8ba7a277c44..32bc80d953a 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppClassPanel.java
+++ b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppClassPanel.java
@@ -14,13 +14,14 @@ package org.eclipse.papyrus.views.panels;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.source.SourceViewer;
import org.eclipse.papyrus.C_Cpp.Include;
-import org.eclipse.papyrus.cpp.profile.StUtils;
+import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil;
import org.eclipse.papyrus.views.cpp.CommandSupport;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group;
import org.eclipse.uml2.uml.Class;
import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.util.UMLUtil;
@@ -136,9 +137,9 @@ public class CppClassPanel extends CppAbstractPanel {
public void run() {
if(headerDocument.get().equals("")
&& bodyDocument.get().equals("")) {
- StUtils.unapply(selectedClass, Include.class);
+ StereotypeUtil.unapply(selectedClass, Include.class);
} else {
- Include cppInclude = StUtils.applyApp(selectedClass, Include.class);
+ Include cppInclude = StereotypeUtil.applyApp(selectedClass, Include.class);
cppInclude.setHeader(headerDocument.get());
cppInclude.setBody(bodyDocument.get());
}
@@ -167,7 +168,7 @@ public class CppClassPanel extends CppAbstractPanel {
String headerInModel = "";
String bodyInModel = "";
- Include cppInclude = StUtils.getApplication(selectedClass, Include.class);
+ Include cppInclude = UMLUtil.getStereotypeApplication(selectedClass, Include.class);
if(cppInclude != null) {
headerInModel = cppInclude.getHeader();
bodyInModel = cppInclude.getBody();
@@ -189,7 +190,7 @@ public class CppClassPanel extends CppAbstractPanel {
if(selectedClass == null) {
}
else {
- Include cppInclude = StUtils.getApplication(selectedClass, Include.class);
+ Include cppInclude = UMLUtil.getStereotypeApplication(selectedClass, Include.class);
if(cppInclude != null) {
// get the text in the tagged value
String currentHI = cppInclude.getHeader();
diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppGeneralizationPanel.java b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppGeneralizationPanel.java
index 9a7cb1a9133..0e6248c5b99 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppGeneralizationPanel.java
+++ b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppGeneralizationPanel.java
@@ -12,7 +12,6 @@
package org.eclipse.papyrus.views.panels;
import org.eclipse.papyrus.C_Cpp.Visibility;
-import org.eclipse.papyrus.cpp.profile.StUtils;
import org.eclipse.papyrus.views.cpp.Activator;
import org.eclipse.papyrus.views.cpp.CommandSupport;
import org.eclipse.swt.SWT;
@@ -26,6 +25,7 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Generalization;
+import org.eclipse.uml2.uml.util.UMLUtil;
@@ -124,7 +124,7 @@ public class CppGeneralizationPanel extends CppAbstractPanel {
visibilityVal = "public";
break;
}
- final Visibility visibility = StUtils.getApplication(selectedGeneralization, Visibility.class);
+ final Visibility visibility = UMLUtil.getStereotypeApplication(selectedGeneralization, Visibility.class);
if(visibility != null) {
String vis = visibility.getValue();
if(!vis.equals(visibilityVal)) {
@@ -172,7 +172,7 @@ public class CppGeneralizationPanel extends CppAbstractPanel {
protected void refreshPanel()
{
if(selectedGeneralization != null) {
- final Visibility visibility = StUtils.getApplication(selectedGeneralization, Visibility.class);
+ final Visibility visibility = UMLUtil.getStereotypeApplication(selectedGeneralization, Visibility.class);
if(visibility != null) {
String vis = visibility.getValue();
@@ -205,7 +205,7 @@ public class CppGeneralizationPanel extends CppAbstractPanel {
return true;
}
- final Visibility visibility = StUtils.getApplication(selectedGeneralization, Visibility.class);
+ final Visibility visibility = UMLUtil.getStereotypeApplication(selectedGeneralization, Visibility.class);
if(visibility != null) {
String vis = visibility.getValue();
@@ -233,7 +233,7 @@ public class CppGeneralizationPanel extends CppAbstractPanel {
return;
}
- final Visibility visibility = StUtils.getApplication(selectedGeneralization, Visibility.class);
+ final Visibility visibility = UMLUtil.getStereotypeApplication(selectedGeneralization, Visibility.class);
if(visibility != null) {
String vis = visibility.getValue();
if(!(vis.equals("public")) || !(vis.equals("protected")) || !(vis.equals("private"))) {
diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppOperationPanel.java b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppOperationPanel.java
index b14a0fe17c6..85c4ddf57c8 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppOperationPanel.java
+++ b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppOperationPanel.java
@@ -21,8 +21,8 @@ import org.eclipse.papyrus.C_Cpp.Inline;
import org.eclipse.papyrus.C_Cpp.Virtual;
import org.eclipse.papyrus.acceleo.AcceleoDriver;
import org.eclipse.papyrus.acceleo.AcceleoException;
-import org.eclipse.papyrus.cpp.profile.StUtils;
import org.eclipse.papyrus.cpp.profile.StdStereo;
+import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil;
import org.eclipse.papyrus.views.cpp.CommandSupport;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
@@ -42,6 +42,7 @@ import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.OpaqueBehavior;
import org.eclipse.uml2.uml.Operation;
import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.util.UMLUtil;
/**
@@ -262,11 +263,11 @@ public class CppOperationPanel extends CppAbstractPanel {
public void run() {
String newConstInit = docConstInit.get();
- if(newConstInit.equals("")) {
- StUtils.unapply(selectedOperation, ConstInit.class);
+ if(newConstInit.equals("")) { //$NON-NLS-1$
+ StereotypeUtil.unapply(selectedOperation, ConstInit.class);
} else {
ConstInit cppConstInit =
- StUtils.applyApp(selectedOperation, ConstInit.class);
+ StereotypeUtil.applyApp(selectedOperation, ConstInit.class);
cppConstInit.setInitialisation(newConstInit);
}
@@ -299,7 +300,7 @@ public class CppOperationPanel extends CppAbstractPanel {
}
}
}
- return "";
+ return ""; //$NON-NLS-1$
}
public static void setCppBody(Operation operation, String body)
@@ -349,12 +350,12 @@ public class CppOperationPanel extends CppAbstractPanel {
// get the text in the activity
boolean boxState = isInline.getSelection();
- if(boxState != StUtils.isApplied(selectedOperation, Inline.class)) {
+ if(boxState != StereotypeUtil.isApplied(selectedOperation, Inline.class)) {
if(boxState) {
- StUtils.apply(selectedOperation, Inline.class);
+ StereotypeUtil.apply(selectedOperation, Inline.class);
}
else {
- StUtils.unapply(selectedOperation, Inline.class);
+ StereotypeUtil.unapply(selectedOperation, Inline.class);
}
}
}
@@ -366,12 +367,12 @@ public class CppOperationPanel extends CppAbstractPanel {
boolean boxState = isConst.getSelection();
- if(boxState != StUtils.isApplied(selectedOperation, Const.class)) {
+ if(boxState != StereotypeUtil.isApplied(selectedOperation, Const.class)) {
if(boxState) {
- StUtils.apply(selectedOperation, Const.class);
+ StereotypeUtil.apply(selectedOperation, Const.class);
}
else {
- StUtils.unapply(selectedOperation, Const.class);
+ StereotypeUtil.unapply(selectedOperation, Const.class);
}
}
}
@@ -383,12 +384,12 @@ public class CppOperationPanel extends CppAbstractPanel {
boolean boxState = isFriend.getSelection();
- if(boxState != StUtils.isApplied(selectedOperation, Friend.class)) {
+ if(boxState != StereotypeUtil.isApplied(selectedOperation, Friend.class)) {
if(boxState) {
- StUtils.apply(selectedOperation, Friend.class);
+ StereotypeUtil.apply(selectedOperation, Friend.class);
}
else {
- StUtils.unapply(selectedOperation, Friend.class);
+ StereotypeUtil.unapply(selectedOperation, Friend.class);
}
}
}
@@ -401,11 +402,11 @@ public class CppOperationPanel extends CppAbstractPanel {
boolean boxState = isCreate.getSelection();
if(boxState) {
- StUtils.apply(selectedOperation, "Standard::Create");
+ StereotypeUtil.apply(selectedOperation, StdStereo.create);
}
else {
- StUtils.unapply(selectedOperation, ConstInit.class);
- StUtils.unapply(selectedOperation, "Standard::Create");
+ StereotypeUtil.unapply(selectedOperation, ConstInit.class);
+ StereotypeUtil.unapply(selectedOperation, StdStereo.create);
}
groupCInit.setEnabled(boxState);
@@ -419,10 +420,10 @@ public class CppOperationPanel extends CppAbstractPanel {
boolean boxState = isDestroy.getSelection();
if(boxState) {
- StUtils.apply(selectedOperation, "Standard::Destroy");
+ StereotypeUtil.apply(selectedOperation, StdStereo.destroy);
}
else {
- StUtils.unapply(selectedOperation, "Standard::Destroy");
+ StereotypeUtil.unapply(selectedOperation, StdStereo.destroy);
}
}
@@ -445,17 +446,17 @@ public class CppOperationPanel extends CppAbstractPanel {
if(comboSelected == 0 /* not virtual */) {
selectedOperation.setIsAbstract(false);
- StUtils.unapply(selectedOperation, Virtual.class);
+ StereotypeUtil.unapply(selectedOperation, Virtual.class);
}
else if(comboSelected == 1 /* virtual */) {
selectedOperation.setIsAbstract(false);
- StUtils.apply(selectedOperation, Virtual.class);
+ StereotypeUtil.apply(selectedOperation, Virtual.class);
}
else if(comboSelected == 2 /* pure virtual */) {
selectedOperation.setIsAbstract(true);
- StUtils.apply(selectedOperation, Virtual.class);
+ StereotypeUtil.apply(selectedOperation, Virtual.class);
}
// Treat the owner class
@@ -491,8 +492,8 @@ public class CppOperationPanel extends CppAbstractPanel {
@Override
public boolean checkModifications() {
// check if ConstInit has changed
- String valueConstInit = "";
- ConstInit constInit = StUtils.getApplication(selectedOperation, ConstInit.class);
+ String valueConstInit = ""; //$NON-NLS-1$
+ ConstInit constInit = UMLUtil.getStereotypeApplication(selectedOperation, ConstInit.class);
if(constInit != null) {
valueConstInit = constInit.getInitialisation();
}
@@ -519,7 +520,7 @@ public class CppOperationPanel extends CppAbstractPanel {
if(selectedEOwner instanceof Class) {
// This part is done for a class only
- ConstInit constInit = StUtils.getApplication(selectedOperation, ConstInit.class);
+ ConstInit constInit = UMLUtil.getStereotypeApplication(selectedOperation, ConstInit.class);
if(constInit != null) {
docConstInit.set(constInit.getInitialisation());
}
@@ -528,7 +529,7 @@ public class CppOperationPanel extends CppAbstractPanel {
if(isCreate.getSelection()) {
groupCInit.setEnabled(true);
} else {
- docConstInit.set("");
+ docConstInit.set(""); //$NON-NLS-1$
groupCInit.setEnabled(false);
}
@@ -539,11 +540,11 @@ public class CppOperationPanel extends CppAbstractPanel {
if(selectedOperation.isAbstract()) {
vPropCombo.select(2);
// Nothing in body and body unavailable
- docBody.set("");
+ docBody.set(""); //$NON-NLS-1$
groupBody.setEnabled(false);
}
else {
- if(StUtils.isApplied(selectedOperation, Virtual.class)) {
+ if(StereotypeUtil.isApplied(selectedOperation, Virtual.class)) {
vPropCombo.select(1);
groupBody.setEnabled(true);
}
@@ -554,7 +555,7 @@ public class CppOperationPanel extends CppAbstractPanel {
}
// Inline
- if(StUtils.isApplied(selectedOperation, Inline.class)) {
+ if(StereotypeUtil.isApplied(selectedOperation, Inline.class)) {
isInline.setSelection(true);
}
@@ -574,10 +575,10 @@ public class CppOperationPanel extends CppAbstractPanel {
}
isStatic.setSelection(selectedOperation.isStatic());
- isConst.setSelection(StUtils.isApplied(selectedOperation, Const.class));
- isFriend.setSelection(StUtils.isApplied(selectedOperation, Friend.class));
- isCreate.setSelection(StUtils.isApplied(selectedOperation, StdStereo.create));
- isDestroy.setSelection(StUtils.isApplied(selectedOperation, StdStereo.destroy));
+ isConst.setSelection(StereotypeUtil.isApplied(selectedOperation, Const.class));
+ isFriend.setSelection(StereotypeUtil.isApplied(selectedOperation, Friend.class));
+ isCreate.setSelection(StereotypeUtil.isApplied(selectedOperation, StdStereo.create));
+ isDestroy.setSelection(StereotypeUtil.isApplied(selectedOperation, StdStereo.destroy));
}
}
@@ -589,7 +590,7 @@ public class CppOperationPanel extends CppAbstractPanel {
if(selectedEOwner instanceof Class) {
if(selectedOperation.isAbstract()) {
- if(!StUtils.isApplied(selectedOperation, Virtual.class)) {
+ if(!StereotypeUtil.isApplied(selectedOperation, Virtual.class)) {
return false;
}
}
@@ -598,7 +599,7 @@ public class CppOperationPanel extends CppAbstractPanel {
if(!selectedOperation.isAbstract()) {
return false;
}
- if(StUtils.isApplied(selectedOperation, Virtual.class)) {
+ if(StereotypeUtil.isApplied(selectedOperation, Virtual.class)) {
return false;
}
}
@@ -627,7 +628,7 @@ public class CppOperationPanel extends CppAbstractPanel {
if(selectedEOwner instanceof Class) {
// toggle Stereotypes pure virtual if element is abstract
if(selectedOperation.isAbstract()) {
- if(!StUtils.isApplied(selectedOperation, Virtual.class)) {
+ if(!StereotypeUtil.isApplied(selectedOperation, Virtual.class)) {
// selectedOperation.toggleStereotype("VirtualPure", true);
// selectedOperation.toggleStereotype("Virtual", false);
} else {
@@ -637,7 +638,7 @@ public class CppOperationPanel extends CppAbstractPanel {
// if element is abstract and has VirtualPure, set to Virtual only
if(!selectedOperation.isAbstract()) {
- if(StUtils.isApplied(selectedOperation, Virtual.class)) {
+ if(StereotypeUtil.isApplied(selectedOperation, Virtual.class)) {
// selectedOperation.toggleStereotype("VirtualPure", false);
// selectedOperation.toggleStereotype("Virtual", true);
} else {
diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPackagePanel.java b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPackagePanel.java
index b0bd5886d13..98ed1983614 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPackagePanel.java
+++ b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPackagePanel.java
@@ -13,13 +13,14 @@ package org.eclipse.papyrus.views.panels;
import org.eclipse.jface.text.IDocument;
import org.eclipse.papyrus.C_Cpp.Include;
-import org.eclipse.papyrus.cpp.profile.StUtils;
+import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil;
import org.eclipse.papyrus.views.cpp.CommandSupport;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.util.UMLUtil;
/**
@@ -121,9 +122,9 @@ public class CppPackagePanel extends CppAbstractPanel {
public void run()
{
if(headerDocument.get().equals("")) {
- StUtils.unapply(selectedPackage, Include.class);
+ StereotypeUtil.unapply(selectedPackage, Include.class);
} else {
- Include cppInclude = StUtils.applyApp(selectedPackage, Include.class);
+ Include cppInclude = StereotypeUtil.applyApp(selectedPackage, Include.class);
cppInclude.setHeader(headerDocument.get());
}
}
@@ -139,7 +140,7 @@ public class CppPackagePanel extends CppAbstractPanel {
@Override
protected void refreshPanel() {
if(selectedPackage != null) {
- Include cppInclude = StUtils.getApplication(selectedPackage, Include.class);
+ Include cppInclude = UMLUtil.getStereotypeApplication(selectedPackage, Include.class);
if(cppInclude != null) {
headerDocument.set(cppInclude.getHeader());
}
@@ -167,7 +168,7 @@ public class CppPackagePanel extends CppAbstractPanel {
@Override
public boolean checkModifications() {
String headerInModel = "";
- Include cppInclude = StUtils.getApplication(selectedPackage, Include.class);
+ Include cppInclude = UMLUtil.getStereotypeApplication(selectedPackage, Include.class);
if(cppInclude != null) {
headerInModel = cppInclude.getHeader();
}
diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppParameterPanel.java b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppParameterPanel.java
index 8accc2cc415..2602eae6d0f 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppParameterPanel.java
+++ b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppParameterPanel.java
@@ -17,7 +17,7 @@ import org.eclipse.papyrus.C_Cpp.Array;
import org.eclipse.papyrus.C_Cpp.Const;
import org.eclipse.papyrus.C_Cpp.Ptr;
import org.eclipse.papyrus.C_Cpp.Ref;
-import org.eclipse.papyrus.cpp.profile.StUtils;
+import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil;
import org.eclipse.papyrus.views.cpp.CommandSupport;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
@@ -207,19 +207,19 @@ public class CppParameterPanel extends CppAbstractPanel {
// Treat Pointer
String newPtr = docPtr.get();
if(newPtr.equals("")) {
- StUtils.unapply(selectedParameter, Ptr.class);
+ StereotypeUtil.unapply(selectedParameter, Ptr.class);
}
else {
- StUtils.apply(selectedParameter, Ptr.class);
+ StereotypeUtil.apply(selectedParameter, Ptr.class);
}
// Treat Reference
String newRef = docRef.get();
if(newRef.equals("")) {
- StUtils.unapply(selectedParameter, Ref.class);
+ StereotypeUtil.unapply(selectedParameter, Ref.class);
}
else {
- StUtils.apply(selectedParameter, Ref.class);
+ StereotypeUtil.apply(selectedParameter, Ref.class);
}
// Treat DefaultValue
@@ -229,11 +229,11 @@ public class CppParameterPanel extends CppAbstractPanel {
// Treat Array
String newArray = docArray.get();
if(newArray.equals("")) {
- StUtils.unapply(selectedParameter, Array.class);
+ StereotypeUtil.unapply(selectedParameter, Array.class);
}
else {
- StUtils.apply(selectedParameter, Array.class);
- // StUtils.setTaggedValue(selectedParameter, Array.class, "definition", newArray);
+ StereotypeUtil.apply(selectedParameter, Array.class);
+ // StereotypeUtil.setTaggedValue(selectedParameter, Array.class, "definition", newArray);
}
}
});
@@ -250,14 +250,14 @@ public class CppParameterPanel extends CppAbstractPanel {
if(selectedParameter != null) {
// Const
- isConst.setSelection(StUtils.isApplied(selectedParameter, Const.class));
+ isConst.setSelection(StereotypeUtil.isApplied(selectedParameter, Const.class));
// TODO: examine effect;
// isConst.setSelection(selectedParameter.getEffect?);
- docPtr.set(StUtils.isApplied(selectedParameter, Ptr.class) ? "*" : "");
- docRef.set(StUtils.isApplied(selectedParameter, Ref.class) ? "&" : "");
+ docPtr.set(StereotypeUtil.isApplied(selectedParameter, Ptr.class) ? "*" : "");
+ docRef.set(StereotypeUtil.isApplied(selectedParameter, Ref.class) ? "&" : "");
docDefault.set(selectedParameter.getDefault());
- docArray.set(StUtils.isApplied(selectedParameter, Array.class) ? "[]" : "");
+ docArray.set(StereotypeUtil.isApplied(selectedParameter, Array.class) ? "[]" : "");
// need definition?
}
}
@@ -270,12 +270,12 @@ public class CppParameterPanel extends CppAbstractPanel {
boolean boxState = isConst.getSelection();
if(boxState) {
- if(!StUtils.isApplied(selectedParameter, Const.class)) {
- StUtils.apply(selectedParameter, Const.class);
+ if(!StereotypeUtil.isApplied(selectedParameter, Const.class)) {
+ StereotypeUtil.apply(selectedParameter, Const.class);
}
} else {
- if(StUtils.isApplied(selectedParameter, Const.class)) {
- StUtils.unapply(selectedParameter, Const.class);
+ if(StereotypeUtil.isApplied(selectedParameter, Const.class)) {
+ StereotypeUtil.unapply(selectedParameter, Const.class);
}
}
}
@@ -297,12 +297,12 @@ public class CppParameterPanel extends CppAbstractPanel {
*/
@Override
public boolean checkModifications() {
- String ptrValue = StUtils.isApplied(selectedParameter, Ptr.class) ? "*" : "";
+ String ptrValue = StereotypeUtil.isApplied(selectedParameter, Ptr.class) ? "*" : "";
if(!docPtr.get().equals(ptrValue)) {
return true;
}
- String refValue = StUtils.isApplied(selectedParameter, Ref.class) ? "&" : "";
+ String refValue = StereotypeUtil.isApplied(selectedParameter, Ref.class) ? "&" : "";
if(!docRef.get().equals(refValue)) {
return true;
}
@@ -317,7 +317,7 @@ public class CppParameterPanel extends CppAbstractPanel {
return true;
}
- String arrayValue = StUtils.isApplied(selectedParameter, Array.class) ? "[]" : "";
+ String arrayValue = StereotypeUtil.isApplied(selectedParameter, Array.class) ? "[]" : "";
if(!docArray.get().equals(arrayValue)) {
return true;
}
diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPrimitiveTypePanel.java b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPrimitiveTypePanel.java
index 51c3795622f..f7ad72c968e 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPrimitiveTypePanel.java
+++ b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPrimitiveTypePanel.java
@@ -14,13 +14,14 @@ package org.eclipse.papyrus.views.panels;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.source.SourceViewer;
import org.eclipse.papyrus.C_Cpp.Typedef;
-import org.eclipse.papyrus.cpp.profile.StUtils;
+import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil;
import org.eclipse.papyrus.views.cpp.CommandSupport;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.PrimitiveType;
+import org.eclipse.uml2.uml.util.UMLUtil;
/**
@@ -108,10 +109,10 @@ public class CppPrimitiveTypePanel extends CppAbstractPanel {
public void run()
{
if(typeDocument.get().equals("")) {
- StUtils.unapply(selectedPType, Typedef.class);
+ StereotypeUtil.unapply(selectedPType, Typedef.class);
}
else {
- Typedef cppType = StUtils.applyApp(selectedPType, Typedef.class);
+ Typedef cppType = StereotypeUtil.applyApp(selectedPType, Typedef.class);
cppType.setDefinition(typeDocument.get());
}
}
@@ -128,7 +129,7 @@ public class CppPrimitiveTypePanel extends CppAbstractPanel {
@Override
protected void refreshPanel() {
if(selectedPType != null) {
- Typedef cppType = StUtils.getApplication(selectedPType, Typedef.class);
+ Typedef cppType = UMLUtil.getStereotypeApplication(selectedPType, Typedef.class);
typeDocument.set(cppType != null ? cppType.getDefinition() : "");
}
}
@@ -150,7 +151,7 @@ public class CppPrimitiveTypePanel extends CppAbstractPanel {
*/
@Override
public boolean checkModifications() {
- Typedef cppType = StUtils.getApplication(selectedPType, Typedef.class);
+ Typedef cppType = UMLUtil.getStereotypeApplication(selectedPType, Typedef.class);
String typeInModel = cppType != null ? cppType.getDefinition() : "";
if(!typeDocument.get().equals(typeInModel)) {
return true;
diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPropertyPanel.java b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPropertyPanel.java
index 84495ee1c30..2aa61571479 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPropertyPanel.java
+++ b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPropertyPanel.java
@@ -16,7 +16,7 @@ import org.eclipse.papyrus.C_Cpp.Array;
import org.eclipse.papyrus.C_Cpp.Const;
import org.eclipse.papyrus.C_Cpp.Ptr;
import org.eclipse.papyrus.C_Cpp.Ref;
-import org.eclipse.papyrus.cpp.profile.StUtils;
+import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil;
import org.eclipse.papyrus.views.cpp.CommandSupport;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
@@ -221,19 +221,19 @@ public class CppPropertyPanel extends CppAbstractPanel {
// Treat Pointer
String newPtr = docPtr.get();
if(newPtr.equals("")) {
- StUtils.unapply(selectedProperty, Ptr.class);
+ StereotypeUtil.unapply(selectedProperty, Ptr.class);
}
else {
- StUtils.apply(selectedProperty, Ptr.class);
+ StereotypeUtil.apply(selectedProperty, Ptr.class);
}
// Treat Reference
String newRef = docRef.get();
if(newRef.equals("")) {
- StUtils.unapply(selectedProperty, Ref.class);
+ StereotypeUtil.unapply(selectedProperty, Ref.class);
}
else {
- StUtils.apply(selectedProperty, Ref.class);
+ StereotypeUtil.apply(selectedProperty, Ref.class);
}
// Treat DefaultValue
@@ -243,10 +243,10 @@ public class CppPropertyPanel extends CppAbstractPanel {
// Treat Array
String newArray = docArray.get();
if(newArray.equals("")) {
- StUtils.unapply(selectedProperty, Array.class);
+ StereotypeUtil.unapply(selectedProperty, Array.class);
}
else {
- StUtils.apply(selectedProperty, Array.class);
+ StereotypeUtil.apply(selectedProperty, Array.class);
}
}
});
@@ -266,11 +266,11 @@ public class CppPropertyPanel extends CppAbstractPanel {
}
else {
isStatic.setSelection(selectedProperty.isStatic());
- isConst.setSelection(StUtils.isApplied(selectedProperty, Const.class));
- docPtr.set(StUtils.isApplied(selectedProperty, Ptr.class) ? "*" : "");
- docRef.set(StUtils.isApplied(selectedProperty, Ref.class) ? "&" : "");
+ isConst.setSelection(StereotypeUtil.isApplied(selectedProperty, Const.class));
+ docPtr.set(StereotypeUtil.isApplied(selectedProperty, Ptr.class) ? "*" : "");
+ docRef.set(StereotypeUtil.isApplied(selectedProperty, Ref.class) ? "&" : "");
docDefault.set(selectedProperty.getDefault());
- docArray.set(StUtils.isApplied(selectedProperty, Array.class) ? "[]" : "");
+ docArray.set(StereotypeUtil.isApplied(selectedProperty, Array.class) ? "[]" : "");
}
}
@@ -290,12 +290,12 @@ public class CppPropertyPanel extends CppAbstractPanel {
protected void checkConst() {
boolean boxState = isConst.getSelection();
- if(StUtils.isApplied(selectedProperty, Const.class) != boxState) {
+ if(StereotypeUtil.isApplied(selectedProperty, Const.class) != boxState) {
if(boxState) {
- StUtils.apply(selectedProperty, Const.class);
+ StereotypeUtil.apply(selectedProperty, Const.class);
}
else {
- StUtils.unapply(selectedProperty, Const.class);
+ StereotypeUtil.unapply(selectedProperty, Const.class);
}
}
}
@@ -328,12 +328,12 @@ public class CppPropertyPanel extends CppAbstractPanel {
* with the content of the panel
*/
public boolean checkModifications() {
- String ptrValue = StUtils.isApplied(selectedProperty, Ptr.class) ? "*" : "";
+ String ptrValue = StereotypeUtil.isApplied(selectedProperty, Ptr.class) ? "*" : "";
if(!docPtr.get().equals(ptrValue)) {
return true;
}
- String refValue = StUtils.isApplied(selectedProperty, Ref.class) ? "&" : "";
+ String refValue = StereotypeUtil.isApplied(selectedProperty, Ref.class) ? "&" : "";
if(!docRef.get().equals(refValue)) {
return true;
}
@@ -348,7 +348,7 @@ public class CppPropertyPanel extends CppAbstractPanel {
return true;
}
- String arrayValue = StUtils.isApplied(selectedProperty, Array.class) ? "[]" : "";
+ String arrayValue = StereotypeUtil.isApplied(selectedProperty, Array.class) ? "[]" : "";
if(!docArray.get().equals(arrayValue)) {
return true;
}
diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppTemplateBindingPanel.java b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppTemplateBindingPanel.java
index b075257945c..2447e6a0791 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppTemplateBindingPanel.java
+++ b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppTemplateBindingPanel.java
@@ -13,13 +13,14 @@ package org.eclipse.papyrus.views.panels;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.source.SourceViewer;
-import org.eclipse.papyrus.cpp.profile.StUtils;
+import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil;
import org.eclipse.papyrus.views.cpp.CommandSupport;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.TemplateBinding;
+import org.eclipse.uml2.uml.util.UMLUtil;
/**
@@ -117,9 +118,9 @@ public class CppTemplateBindingPanel extends CppAbstractPanel {
// Treat Pointer
String newB = docBinding.get();
if(newB.equals("")) {
- StUtils.unapply(selectedTB, TemplateBinding.class);
+ StereotypeUtil.unapply(selectedTB, TemplateBinding.class);
} else {
- org.eclipse.papyrus.C_Cpp.TemplateBinding templateBinding = StUtils.applyApp(selectedTB, org.eclipse.papyrus.C_Cpp.TemplateBinding.class);
+ org.eclipse.papyrus.C_Cpp.TemplateBinding templateBinding = StereotypeUtil.applyApp(selectedTB, org.eclipse.papyrus.C_Cpp.TemplateBinding.class);
// TODO: use UML template bindings?
templateBinding.setBinding(newB);
}
@@ -136,7 +137,7 @@ public class CppTemplateBindingPanel extends CppAbstractPanel {
@Override
protected void refreshPanel() {
if(selectedTB != null) {
- org.eclipse.papyrus.C_Cpp.TemplateBinding templateBinding = StUtils.getApplication(selectedTB, org.eclipse.papyrus.C_Cpp.TemplateBinding.class);
+ org.eclipse.papyrus.C_Cpp.TemplateBinding templateBinding = UMLUtil.getStereotypeApplication(selectedTB, org.eclipse.papyrus.C_Cpp.TemplateBinding.class);
// TODO: use UML template bindings?
docBinding.set(templateBinding != null ? templateBinding.getBinding() : "");
}
@@ -160,7 +161,7 @@ public class CppTemplateBindingPanel extends CppAbstractPanel {
*/
@Override
public boolean checkModifications() {
- org.eclipse.papyrus.C_Cpp.TemplateBinding templateBinding = StUtils.getApplication(selectedTB, org.eclipse.papyrus.C_Cpp.TemplateBinding.class);
+ org.eclipse.papyrus.C_Cpp.TemplateBinding templateBinding = UMLUtil.getStereotypeApplication(selectedTB, org.eclipse.papyrus.C_Cpp.TemplateBinding.class);
// TODO: use UML template bindings?
String bindingValue = templateBinding != null ? templateBinding.getBinding() : "";
if(!docBinding.get().equals(bindingValue)) {
diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppTemplateParameterPanel.java b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppTemplateParameterPanel.java
index c413d9a3163..f8ec4ec9f86 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppTemplateParameterPanel.java
+++ b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppTemplateParameterPanel.java
@@ -13,13 +13,14 @@ package org.eclipse.papyrus.views.panels;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.source.SourceViewer;
-import org.eclipse.papyrus.cpp.profile.StUtils;
+import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil;
import org.eclipse.papyrus.views.cpp.CommandSupport;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.TemplateParameter;
+import org.eclipse.uml2.uml.util.UMLUtil;
/**
@@ -118,10 +119,10 @@ public class CppTemplateParameterPanel extends CppAbstractPanel {
// Treat Parameter name
String newB = docParameter.get();
if(newB.equals("")) {
- StUtils.unapply(selectedTP, org.eclipse.papyrus.C_Cpp.TemplateParameter.class);
+ StereotypeUtil.unapply(selectedTP, org.eclipse.papyrus.C_Cpp.TemplateParameter.class);
}
else {
- org.eclipse.papyrus.C_Cpp.TemplateParameter templateParameter = StUtils.applyApp(selectedTP, org.eclipse.papyrus.C_Cpp.TemplateParameter.class);
+ org.eclipse.papyrus.C_Cpp.TemplateParameter templateParameter = StereotypeUtil.applyApp(selectedTP, org.eclipse.papyrus.C_Cpp.TemplateParameter.class);
templateParameter.setName(newB);
}
}
@@ -140,7 +141,7 @@ public class CppTemplateParameterPanel extends CppAbstractPanel {
/* Log.debug("resetBody : selectedProperty is null"); */
} else {
- org.eclipse.papyrus.C_Cpp.TemplateParameter templateParameter = StUtils.getApplication(selectedTP, org.eclipse.papyrus.C_Cpp.TemplateParameter.class);
+ org.eclipse.papyrus.C_Cpp.TemplateParameter templateParameter = UMLUtil.getStereotypeApplication(selectedTP, org.eclipse.papyrus.C_Cpp.TemplateParameter.class);
String parameterName = templateParameter != null ? templateParameter.getName() : "";
docParameter.set(parameterName);
}
@@ -163,7 +164,7 @@ public class CppTemplateParameterPanel extends CppAbstractPanel {
*/
@Override
public boolean checkModifications() {
- org.eclipse.papyrus.C_Cpp.TemplateParameter templateParameter = StUtils.getApplication(selectedTP, org.eclipse.papyrus.C_Cpp.TemplateParameter.class);
+ org.eclipse.papyrus.C_Cpp.TemplateParameter templateParameter = UMLUtil.getStereotypeApplication(selectedTP, org.eclipse.papyrus.C_Cpp.TemplateParameter.class);
// TODO: use UML template bindings?
String parameterName = templateParameter != null ? templateParameter.getName() : "";
if(!docParameter.get().equals(parameterName)) {

Back to the top