diff --git a/src/org/ntlab/pushPullRefactoring/PushPullDescriptor.java b/src/org/ntlab/pushPullRefactoring/PushPullDescriptor.java index 509e2a1..520ab3b 100644 --- a/src/org/ntlab/pushPullRefactoring/PushPullDescriptor.java +++ b/src/org/ntlab/pushPullRefactoring/PushPullDescriptor.java @@ -1,7 +1,10 @@ package org.ntlab.pushPullRefactoring; import org.eclipse.jdt.core.IType; +import org.eclipse.jdt.core.dom.ASTVisitor; import org.eclipse.jdt.core.dom.CompilationUnit; +import org.eclipse.jdt.core.dom.MethodInvocation; +import org.eclipse.jdt.core.dom.TypeDeclaration; import org.eclipse.jdt.core.refactoring.descriptors.JavaRefactoringDescriptor; public class PushPullDescriptor extends JavaRefactoringDescriptor { @@ -12,6 +15,7 @@ private CompilationUnit distinationClass = null; private boolean isPushToPull; + public boolean isPushToPull() { return isPushToPull; @@ -31,6 +35,13 @@ public void setSourceClass(CompilationUnit sourceClass) { this.sourceClass = sourceClass; + sourceClass.accept(new ASTVisitor() { + @Override + public boolean visit(TypeDeclaration node) { + sourceClassName = node.getName().toString(); + return false; + } + }); } public CompilationUnit getDistinationClass() { @@ -39,15 +50,20 @@ public void setDistinationClass(CompilationUnit distinationClass) { this.distinationClass = distinationClass; + distinationClass.accept(new ASTVisitor() { + @Override + public boolean visit(TypeDeclaration node) { + distinationClassName = node.getName().toString(); + return false; + } + }); + } public String getDistinationClassName() { return distinationClassName; } - - public void setDistinationClassName(String distinationClassName) { - this.distinationClassName = distinationClassName; + public String getSourceClassName() { + return sourceClassName; } - - }