refactoring PUSH DOWN ATTRIBUTE added
diff --git a/org.eclipse.emf.refactor.refactorings.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringController$1.class b/org.eclipse.emf.refactor.refactorings.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringController$1.class
new file mode 100644
index 0000000..18f402f
--- /dev/null
+++ b/org.eclipse.emf.refactor.refactorings.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringController$1.class
Binary files differ
diff --git a/org.eclipse.emf.refactor.refactorings.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringController$InternalRefactoringProcessor.class b/org.eclipse.emf.refactor.refactorings.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringController$InternalRefactoringProcessor.class
new file mode 100644
index 0000000..ef722a5
--- /dev/null
+++ b/org.eclipse.emf.refactor.refactorings.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringController$InternalRefactoringProcessor.class
Binary files differ
diff --git a/org.eclipse.emf.refactor.refactorings.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringController.class b/org.eclipse.emf.refactor.refactorings.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringController.class
new file mode 100644
index 0000000..2866d2a
--- /dev/null
+++ b/org.eclipse.emf.refactor.refactorings.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringController.class
Binary files differ
diff --git a/org.eclipse.emf.refactor.refactorings.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringDataManagement.class b/org.eclipse.emf.refactor.refactorings.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringDataManagement.class
new file mode 100644
index 0000000..b7b789a
--- /dev/null
+++ b/org.eclipse.emf.refactor.refactorings.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringDataManagement.class
Binary files differ
diff --git a/org.eclipse.emf.refactor.refactorings.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringGuiHandler.class b/org.eclipse.emf.refactor.refactorings.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringGuiHandler.class
new file mode 100644
index 0000000..54caeb0
--- /dev/null
+++ b/org.eclipse.emf.refactor.refactorings.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringGuiHandler.class
Binary files differ
diff --git a/org.eclipse.emf.refactor.refactorings.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringTest$1.class b/org.eclipse.emf.refactor.refactorings.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringTest$1.class
new file mode 100644
index 0000000..456b04a
--- /dev/null
+++ b/org.eclipse.emf.refactor.refactorings.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringTest$1.class
Binary files differ
diff --git a/org.eclipse.emf.refactor.refactorings.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringTest.class b/org.eclipse.emf.refactor.refactorings.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringTest.class
new file mode 100644
index 0000000..25aa92b
--- /dev/null
+++ b/org.eclipse.emf.refactor.refactorings.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringTest.class
Binary files differ
diff --git a/org.eclipse.emf.refactor.refactorings.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringWizard.class b/org.eclipse.emf.refactor.refactorings.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringWizard.class
new file mode 100644
index 0000000..9ebd519
--- /dev/null
+++ b/org.eclipse.emf.refactor.refactorings.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringWizard.class
Binary files differ
diff --git a/org.eclipse.emf.refactor.refactorings.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringWizardPage.class b/org.eclipse.emf.refactor.refactorings.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringWizardPage.class
new file mode 100644
index 0000000..c09efad
--- /dev/null
+++ b/org.eclipse.emf.refactor.refactorings.uml24/bin/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringWizardPage.class
Binary files differ
diff --git a/org.eclipse.emf.refactor.refactorings.uml24/plugin.xml b/org.eclipse.emf.refactor.refactorings.uml24/plugin.xml
index 2b9897c..a029606 100644
--- a/org.eclipse.emf.refactor.refactorings.uml24/plugin.xml
+++ b/org.eclipse.emf.refactor.refactorings.uml24/plugin.xml
@@ -19,5 +19,11 @@
id="org.eclipse.emf.refactor.refactorings.uml24.pullupoperation"
menulabel="Pull Up Operation"
namespaceUri="http://www.eclipse.org/uml2/4.0.0/UML"/>
+<refactoring
+ controller="org.eclipse.emf.refactor.refactorings.uml24.pushdownattribute.RefactoringController"
+ gui="org.eclipse.emf.refactor.refactorings.uml24.pushdownattribute.RefactoringGuiHandler"
+ id="org.eclipse.emf.refactor.refactorings.uml24.pushdownattribute"
+ menulabel="Push Down Attribute"
+ namespaceUri="http://www.eclipse.org/uml2/4.0.0/UML"/>
</extension>
</plugin>
diff --git a/org.eclipse.emf.refactor.refactorings.uml24/src/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringController.java b/org.eclipse.emf.refactor.refactorings.uml24/src/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringController.java
new file mode 100644
index 0000000..e7cf405
--- /dev/null
+++ b/org.eclipse.emf.refactor.refactorings.uml24/src/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringController.java
@@ -0,0 +1,250 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: RefactoringController.javajet,v 1.3 2011/01/21 13:08:06 tarendt Exp $
+ */
+package org.eclipse.emf.refactor.refactorings.uml24.pushdownattribute;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil.Copier;
+import org.eclipse.emf.refactor.refactoring.core.Refactoring;
+import org.eclipse.emf.refactor.refactoring.interfaces.IController;
+import org.eclipse.emf.refactor.refactoring.interfaces.IDataManagement;
+import org.eclipse.emf.refactor.refactoring.runtime.ltk.LtkEmfRefactoringProcessorAdapter;
+import org.eclipse.emf.refactor.refactorings.uml24.UmlUtils;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor;
+import org.eclipse.uml2.uml.Association;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.VisibilityKind;
+
+
+public final class RefactoringController implements IController{
+
+ /**
+ * Refactoring supported by the controller.
+ * @generated
+ */
+ private Refactoring parent;
+
+ /**
+ * DataManagement object of the model refactoring.
+ * @generated
+ */
+ private RefactoringDataManagement dataManagement =
+ new RefactoringDataManagement();
+
+ /**
+ * Invocation context of the model refactoring.
+ * @generated
+ */
+ private List<EObject> selection = new ArrayList<EObject>();
+
+ /**
+ * Ltk RefactoringProcessor of the model refactoring.
+ * @generated
+ */
+ private InternalRefactoringProcessor refactoringProcessor = null;
+
+ /**
+ * Gets the Refactoring supported by the controller.
+ * @return Refactoring supported by the controller.
+ * @see org.eclipse.emf.refactor.common.core.IController#getParent()
+ * @generated
+ */
+ @Override
+ public Refactoring getParent() {
+ return this.parent;
+ }
+
+ /**
+ * Sets the Refactoring supported by the controller.
+ * @param Refactoring Refactoring supported by the controller.
+ * @see org.eclipse.emf.refactor.common.core.IController#
+ * setParent(org.eclipse.emf.refactor.common.core.Refactoring)
+ * @generated
+ */
+ @Override
+ public void setParent(Refactoring Refactoring) {
+ this.parent = Refactoring;
+ }
+
+ /**
+ * Returns the DataManagement object of the model refactoring.
+ * @return DataManagement object of the model refactoring.
+ * @see org.eclipse.emf.refactor.common.core.IController#
+ * getDataManagementObject()
+ * @generated
+ */
+ @Override
+ public IDataManagement getDataManagementObject() {
+ return this.dataManagement;
+ }
+
+ /**
+ * Returns the ltk RefactoringProcessor of the model refactoring.
+ * @return Ltk RefactoringProcessor of the model refactoring.
+ * @see org.eclipse.emf.refactor.common.core.IController#
+ * getLtkRefactoringProcessor()
+ * @generated
+ */
+ @Override
+ public RefactoringProcessor getLtkRefactoringProcessor() {
+ return this.refactoringProcessor;
+ }
+
+ /**
+ * Sets the selected EObject (invocation context of the model refactoring).
+ * @param selection Invocation context of the model refactoring.
+ * @see org.eclipse.emf.refactor.common.core.IController#
+ * setSelection(java.util.List)
+ * @generated
+ */
+ @Override
+ public void setSelection(List<EObject> selection) {
+ this.selection = selection;
+ this.refactoringProcessor =
+ new InternalRefactoringProcessor(this.selection);
+ }
+
+ /**
+ * Returns a Runnable object that executes the model refactoring.
+ * @return Runnable object that executes the model refactoring.
+ * @generated
+ */
+ private Runnable applyRefactoring() {
+ return new Runnable() {
+ /**
+ * @see java.lang.Runnable#run()
+ * @generated
+ */
+ @Override
+ public void run() {
+ org.eclipse.uml2.uml.Property selectedEObject =
+ (org.eclipse.uml2.uml.Property) dataManagement.
+ getInPortByName(dataManagement.SELECTEDEOBJECT).getValue();
+ // execute: copy selected attribute to each subclass
+ Class owningClass = selectedEObject.getClass_();
+ ArrayList<Class> subClasses = UmlUtils.getAllSubClasses(owningClass);
+ for (Class subClass : subClasses) {
+ // create copy of the selected attribute
+ Copier attCopier = new Copier();
+ Property newAttribute = (Property) attCopier.copy(selectedEObject);
+ attCopier.copyReferences();
+ // add copied attribute to subclass
+ subClass.getOwnedAttributes().add(newAttribute);
+ if (selectedEObject.getAssociation() != null) {
+ // selected attribute is member end of an association
+ Association assoc = selectedEObject.getAssociation();
+ Property oldOppositeEnd = assoc.getOwnedEnds().get(0);
+ // create copy of the opposite association end
+ Copier aeCopier = new Copier();
+ Property newAssocEnd = (Property) aeCopier.copy(oldOppositeEnd);
+ aeCopier.copyReferences();
+ newAssocEnd.setType(subClass);
+ // create new association and add association ends
+ Package owningPackage = assoc.getPackage();
+ Association newAssociation = UMLFactory.eINSTANCE.createAssociation();
+ String assocName = "a_" + subClass.getName().toLowerCase() + "_" +
+ newAttribute.getType().getName().toLowerCase();
+ newAssociation.setName(assocName);
+ owningPackage.getPackagedElements().add(newAssociation);
+ newAssociation.getOwnedEnds().add(newAssocEnd);
+ newAssociation.getMemberEnds().add(newAttribute);
+ }
+ }
+ // execute: remove selected attribute from owning class
+ if (selectedEObject.getAssociation() != null) {
+ // selected attribute is member end of an association
+ // delete association from owning package
+ Association assoc = selectedEObject.getAssociation();
+ Package owningPackage = assoc.getPackage();
+ owningPackage.getPackagedElements().remove(assoc);
+ }
+ owningClass.getOwnedAttributes().remove(selectedEObject);
+ }
+ };
+ }
+
+ /**
+ * Internal class for providing an instance of a LTK RefactoringProcessor
+ * used for EMF model refactorings.
+ * @generated
+ */
+ public final class InternalRefactoringProcessor extends
+ LtkEmfRefactoringProcessorAdapter {
+
+ /**
+ * Constructor using the invocation context of the model refactoring.
+ * @param selection Invocation context of the model refactoring.
+ * @generated
+ */
+ private InternalRefactoringProcessor(List<EObject> selection){
+ super(getParent(), selection, applyRefactoring());
+ }
+
+ /**
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#
+ * checkInitialConditions(org.eclipse.core.runtime.IProgressMonitor)
+ * @generated
+ */
+ @Override
+ public RefactoringStatus checkInitialConditions(){
+ RefactoringStatus result = new RefactoringStatus();
+ org.eclipse.uml2.uml.Property selectedEObject =
+ (org.eclipse.uml2.uml.Property) dataManagement.
+ getInPortByName(dataManagement.SELECTEDEOBJECT).getValue();
+ // test: the selected property must be an attribute (owned by a class)
+ String msg = "This refactoring can only be applied" +
+ " on properties which are owned attributes of a class!";
+ if (selectedEObject.getClass_() == null) {
+ result.addFatalError(msg);
+ } else {
+ // test: the selected attribute must be public
+ msg = "This refactoring can only be applied on public class attributes!";
+ if (! selectedEObject.getVisibility().equals(VisibilityKind.PUBLIC_LITERAL))
+ result.addFatalError(msg);
+ // test: the owning class must have at least one subclass
+ msg = "This refactoring can not be applied because the owning class " +
+ "of the selected attribute does not have any subclasses!";
+ if (! UmlUtils.hasSubclasses(selectedEObject.getClass_()))
+ result.addFatalError(msg);
+ // test: the owning class must not have any subclasses which own
+ // attributes with the same name as the selected attribute
+ msg = "This refactoring can not be applied because at least one subclass " +
+ "already owns an attribute named '" + selectedEObject.getName() +"'!";
+ if (UmlUtils.oneSubClassHasEquallyNamedAttribute
+ (selectedEObject.getClass_(), selectedEObject)) result.addFatalError(msg);
+ // test: the owning class must not have any subclasses which inherit
+ // elements with the same name as the selected attribute
+ msg = "This refactoring can not be applied because at least one subclass " +
+ "already inherits an element named '" + selectedEObject.getName() +"'!";
+ if (UmlUtils.oneSubClassInheritsEquallyNamedAttribute
+ (selectedEObject.getClass_(), selectedEObject)) result.addFatalError(msg);
+ }
+ return result;
+ }
+
+ /**
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#
+ * checkFinalConditions(org.eclipse.core.runtime.IProgressMonitor,
+ * org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
+ * @generated
+ */
+ @Override
+ public RefactoringStatus checkFinalConditions(){
+ RefactoringStatus result = new RefactoringStatus();
+ // the refactoring has no final checks
+ return result;
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/org.eclipse.emf.refactor.refactorings.uml24/src/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringDataManagement.java b/org.eclipse.emf.refactor.refactorings.uml24/src/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringDataManagement.java
new file mode 100644
index 0000000..110313c
--- /dev/null
+++ b/org.eclipse.emf.refactor.refactorings.uml24/src/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringDataManagement.java
@@ -0,0 +1,54 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: RefactoringDataManagement.javajet,v 1.2 2011/01/21 13:08:06 tarendt Exp $
+ */
+ package org.eclipse.emf.refactor.refactorings.uml24.pushdownattribute;
+
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.refactor.refactoring.core.Port;
+import org.eclipse.emf.refactor.refactoring.runtime.DataManagementAdapter;
+
+/**
+ * Class for specific data concerning a model refactoring.
+ * @generated
+ */
+public class RefactoringDataManagement extends DataManagementAdapter {
+
+ protected final String SELECTEDEOBJECT = "selectedEObject";
+
+ /**
+ * Default constructor.
+ * @generated
+ */
+ public RefactoringDataManagement() {
+ this.addPorts();
+ }
+
+ /**
+ * Adds the ports to the data management used for parameter passing.
+ * @generated
+ */
+ private void addPorts(){
+ this.inPorts.add
+ (new Port<org.eclipse.uml2.uml.Property>
+ (SELECTEDEOBJECT, org.eclipse.uml2.uml.Property.class));
+ }
+
+ /**
+ * @see org.eclipse.emf.refactor.common.core.IDataManagement#
+ * preselect(java.util.List)
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void preselect(List<EObject> selection) {
+ getInPortByName(SELECTEDEOBJECT).
+ setValue((org.eclipse.uml2.uml.Property) selection.get(0));
+ }
+
+}
+
\ No newline at end of file
diff --git a/org.eclipse.emf.refactor.refactorings.uml24/src/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringGuiHandler.java b/org.eclipse.emf.refactor.refactorings.uml24/src/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringGuiHandler.java
new file mode 100644
index 0000000..1af1698
--- /dev/null
+++ b/org.eclipse.emf.refactor.refactorings.uml24/src/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringGuiHandler.java
@@ -0,0 +1,76 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: RefactoringGuiHandler.javajet,v 1.1 2010/07/15 13:08:44 tarendt Exp $
+ */
+ package org.eclipse.emf.refactor.refactorings.uml24.pushdownattribute;
+
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.refactor.refactoring.core.Refactoring;
+import org.eclipse.emf.refactor.refactoring.interfaces.IGuiHandler;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
+
+/**
+ * Class used for specifying gui topics of a specific model refactoring.
+ * @generated
+ */
+public class RefactoringGuiHandler implements IGuiHandler {
+
+ /**
+ * Refactoring supported by the GuiHandler.
+ * @generated
+ */
+ Refactoring parent;
+
+ /**
+ * @see org.eclipse.emf.refactor.common.core.ui.IGuiHandler#getParent()
+ * @generated
+ */
+ @Override
+ public Refactoring getParent() {
+ return parent;
+ }
+
+ /**
+ * @see org.eclipse.emf.refactor.common.core.ui.IGuiHandler#
+ * setParent(org.eclipse.emf.refactor.common.core.Refactoring)
+ * @generated
+ */
+ @Override
+ public void setParent(Refactoring Refactoring) {
+ this.parent = Refactoring;
+ }
+
+ /**
+ * @see org.eclipse.emf.refactor.common.core.ui.IGuiHandler#show()
+ * @generated
+ */
+ @Override
+ public RefactoringWizard show() {
+ return new org.eclipse.emf.refactor.refactorings.uml24.pushdownattribute.RefactoringWizard
+ ((RefactoringController)this.parent.getController());
+ }
+
+ /**
+ * @see org.eclipse.emf.refactor.common.core.ui.IGuiHandler#
+ * showInMenu(java.util.List)
+ * @generated
+ */
+ @Override
+ public boolean showInMenu(List<EObject> selection) {
+ if (selection.size() > 1) return false;
+ for(EObject o:selection){
+ if(null != o){
+ if (o instanceof org.eclipse.uml2.uml.Property) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+}
+
\ No newline at end of file
diff --git a/org.eclipse.emf.refactor.refactorings.uml24/src/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringTest.java b/org.eclipse.emf.refactor.refactorings.uml24/src/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringTest.java
new file mode 100644
index 0000000..3517e95
--- /dev/null
+++ b/org.eclipse.emf.refactor.refactorings.uml24/src/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringTest.java
@@ -0,0 +1,97 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: RefactoringTest.javajet,v 1.2 2011/03/16 16:14:21 tarendt Exp $
+ */
+
+package org.eclipse.emf.refactor.refactorings.uml24.pushdownattribute;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.refactor.refactoring.core.Refactoring;
+import org.eclipse.emf.refactor.refactoring.runtime.test.JUnitTestCaseAdapter;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+/**
+ * Class used for running individual JUnit test cases
+ * of the specific model refactoring.
+ * @generated
+ */
+@RunWith(value = Parameterized.class)
+public class RefactoringTest extends JUnitTestCaseAdapter {
+
+ /**
+ * Number of test cases.
+ * @generated
+ */
+ private String number;
+
+ /**
+ * Constructor implementation.
+ * @param number Number of test cases.
+ * @generated
+ */
+ public RefactoringTest(String number) throws IOException {
+ super("de.unimarburg.swt.refactorings.uml.pushdownattribute",
+ "uml",
+ new File(".").getCanonicalPath(),
+ new Refactoring(null, "", "http://www.eclipse.org/uml2/3.0.0/UML", new RefactoringGuiHandler(), new RefactoringController()));
+ register(UMLPackage.eINSTANCE);
+ this.number = number;
+ }
+
+ @Parameters
+ public static Collection<Object[]> data() {
+ List<String> testNumbers = getTestNumbers();
+ Object[][] data = new Object[testNumbers.size()][1];
+ for (int i = 0; i < testNumbers.size(); i++) {
+ data[i][0] = testNumbers.get(i);
+ }
+ return Arrays.asList(data);
+ }
+
+ private static List<String> getTestNumbers() {
+ List<String> numbers = new ArrayList<String>();
+ try {
+ String pathPrefix = new File(".").getCanonicalPath() + "/tests/" + "de.unimarburg.swt.refactorings.uml.pushdownattribute";
+ File testCaseDir = new File(pathPrefix,"/");
+ FilenameFilter filter = new FilenameFilter() {
+ public boolean accept(File dir, String name) {
+ return name.startsWith("test_");
+ }
+ };
+ String[] children = testCaseDir.list(filter);
+ if (children != null) {
+ for (String child : children) {
+ numbers.add(
+ child.substring(
+ child.indexOf('_') + 1));
+ }
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return numbers;
+ }
+
+ /**
+ * Runs the test.
+ */
+ @Test
+ public void test() {
+ System.out.println("running test test_" + number);
+ executeTestCase(number);
+ }
+
+}
\ No newline at end of file
diff --git a/org.eclipse.emf.refactor.refactorings.uml24/src/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringWizard.java b/org.eclipse.emf.refactor.refactorings.uml24/src/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringWizard.java
new file mode 100644
index 0000000..26a982b
--- /dev/null
+++ b/org.eclipse.emf.refactor.refactorings.uml24/src/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringWizard.java
@@ -0,0 +1,40 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: RefactoringWizard.javajet,v 1.1 2010/07/15 13:08:44 tarendt Exp $
+ */
+ package org.eclipse.emf.refactor.refactorings.uml24.pushdownattribute;
+
+import org.eclipse.emf.refactor.refactoring.interfaces.IController;
+import org.eclipse.emf.refactor.refactoring.runtime.ltk.ui.AbstractRefactoringWizard;
+
+/**
+ * Class used for providing an implementation of an LTK
+ * RefactoringWizard in EMF Refactor.
+ * @generated
+ */
+public class RefactoringWizard
+ extends AbstractRefactoringWizard {
+
+ /**
+ * Default constructor implementation.
+ * @param controller Controller of the EMF model refactoring.
+ * @generated
+ */
+ public RefactoringWizard(IController controller) {
+ super(controller);
+ }
+
+ /**
+ * @see org.eclipse.ltk.ui.refactoring.RefactoringWizard#
+ * addUserInputPages()
+ * @generated
+ */
+ @Override
+ protected void addUserInputPages() {
+ addPage(new RefactoringWizardPage
+ (controller.getParent().getName(), (RefactoringController)controller));
+ }
+
+}
diff --git a/org.eclipse.emf.refactor.refactorings.uml24/src/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringWizardPage.java b/org.eclipse.emf.refactor.refactorings.uml24/src/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringWizardPage.java
new file mode 100644
index 0000000..b41fd16
--- /dev/null
+++ b/org.eclipse.emf.refactor.refactorings.uml24/src/org/eclipse/emf/refactor/refactorings/uml24/pushdownattribute/RefactoringWizardPage.java
@@ -0,0 +1,80 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: RefactoringWizardPage.javajet,v 1.1 2010/07/15 13:08:44 tarendt Exp $
+ */
+ package org.eclipse.emf.refactor.refactorings.uml24.pushdownattribute;
+
+import java.util.List;
+
+import org.eclipse.emf.refactor.refactoring.runtime.ltk.ui.AbstractRefactoringWizard;
+import org.eclipse.emf.refactor.refactoring.runtime.ui.IInputPageButtonCreator;
+import org.eclipse.emf.refactor.refactoring.runtime.ui.InputPageButtonLoader;
+import org.eclipse.ltk.ui.refactoring.UserInputWizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+
+/**
+ * Class for setting model refactoring specific parameters
+ * by the user.
+ * @generated
+ */
+public class RefactoringWizardPage extends
+ UserInputWizardPage implements Listener {
+
+ /**
+ * Controller of the EMF model refactoring.
+ * @generated
+ */
+ private final RefactoringController controller;
+
+
+ /**
+ * Default constructor using a name and the controller of the
+ * EMF model refactoring.
+ * @param name Name of the WizardPage.
+ * @param controller Controller of the EMF model refactoring.
+ * @generated
+ */
+ public RefactoringWizardPage
+ (String name, RefactoringController controller) {
+ super(name);
+ this.controller = controller;
+ }
+
+ /**
+ * @see org.eclipse.swt.widgets.Listener#
+ * handleEvent(org.eclipse.swt.widgets.Event)
+ * @generated
+ */
+ @Override
+ public void handleEvent(Event event) {
+ getWizard().getContainer().updateButtons();
+ }
+
+ /**
+ * @see org.eclipse.jface.dialogs.IDialogPage#
+ * createControl(org.eclipse.swt.widgets.Composite)
+ * @generated
+ */
+ @Override
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout gl = new GridLayout();
+ gl.numColumns = 2;
+ composite.setLayout(gl);
+
+ List<IInputPageButtonCreator> buttonCreators = InputPageButtonLoader.iNSTANCE.getInputPageButtonCreatorClasses();
+ for(IInputPageButtonCreator creator : buttonCreators){
+ creator.createButton(composite, controller, (AbstractRefactoringWizard)this.getWizard());
+ }
+
+ setControl(composite);
+ }
+
+}
+
\ No newline at end of file