bug fixed
diff --git a/org.eclipse.emf.refactor.refactorings.papyrus.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringController$1.class b/org.eclipse.emf.refactor.refactorings.papyrus.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringController$1.class
index aae4b0f..58b1540 100644
--- a/org.eclipse.emf.refactor.refactorings.papyrus.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringController$1.class
+++ b/org.eclipse.emf.refactor.refactorings.papyrus.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringController$1.class
Binary files differ
diff --git a/org.eclipse.emf.refactor.refactorings.papyrus.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringController$InternalRefactoringProcessor.class b/org.eclipse.emf.refactor.refactorings.papyrus.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringController$InternalRefactoringProcessor.class
index 78297d0..88d78a2 100644
--- a/org.eclipse.emf.refactor.refactorings.papyrus.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringController$InternalRefactoringProcessor.class
+++ b/org.eclipse.emf.refactor.refactorings.papyrus.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringController$InternalRefactoringProcessor.class
Binary files differ
diff --git a/org.eclipse.emf.refactor.refactorings.papyrus.uml24/src/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringController.java b/org.eclipse.emf.refactor.refactorings.papyrus.uml24/src/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringController.java
index 2b71f41..1ec13ff 100644
--- a/org.eclipse.emf.refactor.refactorings.papyrus.uml24/src/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringController.java
+++ b/org.eclipse.emf.refactor.refactorings.papyrus.uml24/src/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringController.java
@@ -140,6 +140,28 @@
System.out.println(">>>> hallloooo >>>");
Class owningClass = selectedEObject.getClass_();
ArrayList<Class> subClasses = UmlUtils.getAllSubClasses(owningClass);
+ // ----- new
+ // execute: move selected attribute to specified superclass
+ Class firstSubClass = subClasses.get(0);
+ owningClass.getOwnedAttributes().remove(selectedEObject);
+ firstSubClass.getOwnedAttributes().add(selectedEObject);
+ // if attribute is no association end: move shape to attribute compartment
+ View view = null;
+ if (selectedEObject.getAssociation() == null) {
+ view = getView(selectedEObject);
+ if (view != null) {
+ System.out.println("==> View: " + view);
+ BasicCompartment bcOld = (BasicCompartment) view.eContainer();
+ System.out.println("==> bcOld: " + bcOld);
+ bcOld.removeChild(view);
+ BasicCompartment bcNew = getAttributeCompartment(firstSubClass);
+ System.out.println("==> bcNew: " + bcNew);
+ System.out.println("==> bcNew: " + bcNew.getElement());
+ bcNew.insertChild(view);
+ }
+ }
+ subClasses.remove(0);
+ // ----- end new
for (Class subClass : subClasses) {
// create copy of the selected attribute
Copier attCopier = new Copier();
@@ -149,11 +171,11 @@
subClass.getOwnedAttributes().add(newAttribute);
// if attribute is no association end: add shape copy to attribute compartments of each subclass
if (selectedEObject.getAssociation() == null) {
- View view = getView(selectedEObject);
- if (view != null) {
- System.out.println("--> View: " + view);
+ View v = getView(selectedEObject);
+ if (v != null) {
+ System.out.println("--> View: " + v);
Copier viewCopier = new Copier();
- View newView = (View) viewCopier.copy(view);
+ View newView = (View) viewCopier.copy(v);
newView.setElement(newAttribute);
BasicCompartment bc = getAttributeCompartment(subClass);
bc.insertChild(newView);
@@ -189,14 +211,16 @@
// owningPackage.getPackagedElements().remove(assoc);
// }
// if attribute is no association end: remove shape from attribute compartment
- if (selectedEObject.getAssociation() == null) {
- View view = getView(selectedEObject);
- if (view != null) {
- System.out.println("--> View: " + view);
- BasicCompartment bcOld = (BasicCompartment) view.eContainer();
- bcOld.removeChild(view);
- }
- }
+ // ----- new
+// if (selectedEObject.getAssociation() == null) {
+// View v = getView(selectedEObject);
+// if (v != null) {
+// System.out.println("--> View: " + v);
+// BasicCompartment bcOld = (BasicCompartment) v.eContainer();
+// bcOld.removeChild(v);
+// }
+// }
+ // ----- end new
// execute: remove selected attribute from owning class
owningClass.getOwnedAttributes().remove(selectedEObject);
}