diff --git a/plugins/com.python.pydev.analysis/META-INF/MANIFEST.MF b/plugins/com.python.pydev.analysis/META-INF/MANIFEST.MF index 2965cdfffc..c48297d354 100644 --- a/plugins/com.python.pydev.analysis/META-INF/MANIFEST.MF +++ b/plugins/com.python.pydev.analysis/META-INF/MANIFEST.MF @@ -30,6 +30,7 @@ Export-Package: com.python.pydev.analysis, com.python.pydev.analysis.refactoring.changes, com.python.pydev.analysis.refactoring.quick_fixes, com.python.pydev.analysis.refactoring.refactorer, + com.python.pydev.analysis.refactoring.tdd, com.python.pydev.analysis.refactoring.wizards, com.python.pydev.analysis.refactoring.wizards.rename, com.python.pydev.analysis.refactoring.wizards.rename.visitors, diff --git a/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/AbstractPyCreateAction.java b/plugins/com.python.pydev.analysis/src/com/python/pydev/analysis/refactoring/tdd/AbstractPyCreateAction.java similarity index 88% rename from plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/AbstractPyCreateAction.java rename to plugins/com.python.pydev.analysis/src/com/python/pydev/analysis/refactoring/tdd/AbstractPyCreateAction.java index 081b370027..d781e89f09 100644 --- a/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/AbstractPyCreateAction.java +++ b/plugins/com.python.pydev.analysis/src/com/python/pydev/analysis/refactoring/tdd/AbstractPyCreateAction.java @@ -4,11 +4,10 @@ * Please see the license.txt included with this distribution for details. * Any modifications to this file must keep this entire header intact. */ -package com.python.pydev.refactoring.tdd; +package com.python.pydev.analysis.refactoring.tdd; import java.util.List; -import org.eclipse.jface.action.IAction; import org.python.pydev.ast.refactoring.RefactoringInfo; import org.python.pydev.core.IPyEdit; import org.python.pydev.shared_core.code_completion.ICompletionProposalHandle; @@ -21,7 +20,7 @@ public abstract class AbstractPyCreateAction { protected IPyEdit targetEditor; - public void setActiveEditor(IAction action, IPyEdit edit) { + public void setActiveEditor(IPyEdit edit) { this.targetEditor = edit; } diff --git a/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/AbstractPyCreateClassOrMethodOrField.java b/plugins/com.python.pydev.analysis/src/com/python/pydev/analysis/refactoring/tdd/AbstractPyCreateClassOrMethodOrField.java similarity index 99% rename from plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/AbstractPyCreateClassOrMethodOrField.java rename to plugins/com.python.pydev.analysis/src/com/python/pydev/analysis/refactoring/tdd/AbstractPyCreateClassOrMethodOrField.java index 8a71b7b309..ed275c527f 100644 --- a/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/AbstractPyCreateClassOrMethodOrField.java +++ b/plugins/com.python.pydev.analysis/src/com/python/pydev/analysis/refactoring/tdd/AbstractPyCreateClassOrMethodOrField.java @@ -4,7 +4,7 @@ * Please see the license.txt included with this distribution for details. * Any modifications to this file must keep this entire header intact. */ -package com.python.pydev.refactoring.tdd; +package com.python.pydev.analysis.refactoring.tdd; import java.util.List; @@ -36,7 +36,7 @@ public abstract class AbstractPyCreateClassOrMethodOrField extends AbstractPyCre public abstract String getCreationStr(); - protected abstract String getDefaultActTok(); + public abstract String getDefaultActTok(); protected ICompletionProposalHandle createProposal(PySelection pySelection, String source, Tuple offsetAndIndent) { diff --git a/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/NullPyCreateAction.java b/plugins/com.python.pydev.analysis/src/com/python/pydev/analysis/refactoring/tdd/NullPyCreateAction.java similarity index 93% rename from plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/NullPyCreateAction.java rename to plugins/com.python.pydev.analysis/src/com/python/pydev/analysis/refactoring/tdd/NullPyCreateAction.java index b34cabf63e..138140de81 100644 --- a/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/NullPyCreateAction.java +++ b/plugins/com.python.pydev.analysis/src/com/python/pydev/analysis/refactoring/tdd/NullPyCreateAction.java @@ -4,7 +4,7 @@ * Please see the license.txt included with this distribution for details. * Any modifications to this file must keep this entire header intact. */ -package com.python.pydev.refactoring.tdd; +package com.python.pydev.analysis.refactoring.tdd; import java.util.List; diff --git a/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/PyCreateClass.java b/plugins/com.python.pydev.analysis/src/com/python/pydev/analysis/refactoring/tdd/PyCreateClass.java similarity index 96% rename from plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/PyCreateClass.java rename to plugins/com.python.pydev.analysis/src/com/python/pydev/analysis/refactoring/tdd/PyCreateClass.java index a2c49144e7..25307d1b05 100644 --- a/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/PyCreateClass.java +++ b/plugins/com.python.pydev.analysis/src/com/python/pydev/analysis/refactoring/tdd/PyCreateClass.java @@ -4,7 +4,7 @@ * Please see the license.txt included with this distribution for details. * Any modifications to this file must keep this entire header intact. */ -package com.python.pydev.refactoring.tdd; +package com.python.pydev.analysis.refactoring.tdd; import java.util.List; @@ -44,7 +44,7 @@ public String getCreationStr() { } @Override - protected String getDefaultActTok() { + public String getDefaultActTok() { return "MyClass"; } diff --git a/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/PyCreateMethodOrField.java b/plugins/com.python.pydev.analysis/src/com/python/pydev/analysis/refactoring/tdd/PyCreateMethodOrField.java similarity index 98% rename from plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/PyCreateMethodOrField.java rename to plugins/com.python.pydev.analysis/src/com/python/pydev/analysis/refactoring/tdd/PyCreateMethodOrField.java index c85b4b4a98..781fbf862a 100644 --- a/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/PyCreateMethodOrField.java +++ b/plugins/com.python.pydev.analysis/src/com/python/pydev/analysis/refactoring/tdd/PyCreateMethodOrField.java @@ -4,7 +4,7 @@ * Please see the license.txt included with this distribution for details. * Any modifications to this file must keep this entire header intact. */ -package com.python.pydev.refactoring.tdd; +package com.python.pydev.analysis.refactoring.tdd; import java.util.ArrayList; import java.util.List; @@ -49,7 +49,7 @@ public String getCreationStr() { } @Override - protected String getDefaultActTok() { + public String getDefaultActTok() { if (createAs == FIELD) { return "my_field"; } diff --git a/plugins/com.python.pydev.refactoring/plugin_install.py b/plugins/com.python.pydev.refactoring/plugin_install.py index f06e022999..3ab497c2ba 100644 --- a/plugins/com.python.pydev.refactoring/plugin_install.py +++ b/plugins/com.python.pydev.refactoring/plugin_install.py @@ -13,7 +13,7 @@ def __init__(self, class_, key, desc, group): ACTIONS_AND_BINDING = [ #The actions below are now available through the Ctrl+1 quick fixes! - #Action('com.python.pydev.refactoring.tdd.PyCreateClass', 'Alt+Shift+S C', 'CreateClass', 'tddGroup'), - #Action('com.python.pydev.refactoring.tdd.PyCreateMethodOrField', 'Alt+Shift+S M', 'CreateMethod', 'tddGroup'), + #Action('com.python.pydev.analysis.refactoring.tdd.PyCreateClass', 'Alt+Shift+S C', 'CreateClass', 'tddGroup'), + #Action('com.python.pydev.analysis.refactoring.tdd.PyCreateMethodOrField', 'Alt+Shift+S M', 'CreateMethod', 'tddGroup'), Action('org.python.pydev.refactoring.ui.actions.ExtractMethodAction', ('M2+M3+M', 'M3+M2+T E'), 'ExtractMethod', 'pepticRefactoringGroup'), ] \ No newline at end of file diff --git a/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/TddCodeGenerationQuickFixParticipant.java b/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/TddCodeGenerationQuickFixParticipant.java index a477151f39..c56f8ba859 100644 --- a/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/TddCodeGenerationQuickFixParticipant.java +++ b/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/TddCodeGenerationQuickFixParticipant.java @@ -53,6 +53,9 @@ import com.python.pydev.analysis.additionalinfo.builders.AnalysisRunner; import com.python.pydev.analysis.ctrl_1.AbstractAnalysisMarkersParticipants; +import com.python.pydev.analysis.refactoring.tdd.AbstractPyCreateAction; +import com.python.pydev.analysis.refactoring.tdd.PyCreateClass; +import com.python.pydev.analysis.refactoring.tdd.PyCreateMethodOrField; public class TddCodeGenerationQuickFixParticipant extends AbstractAnalysisMarkersParticipants { diff --git a/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/TddQuickFixParticipant.java b/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/TddQuickFixParticipant.java index 6d19c1731c..7fbb366194 100644 --- a/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/TddQuickFixParticipant.java +++ b/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/TddQuickFixParticipant.java @@ -56,6 +56,9 @@ import com.python.pydev.analysis.additionalinfo.builders.AnalysisRunner; import com.python.pydev.analysis.ctrl_1.IAnalysisMarkersParticipant; +import com.python.pydev.analysis.refactoring.tdd.NullPyCreateAction; +import com.python.pydev.analysis.refactoring.tdd.PyCreateClass; +import com.python.pydev.analysis.refactoring.tdd.PyCreateMethodOrField; /** * This participant will add a suggestion to create class/methods/attributes when an undefined variable error is found. diff --git a/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/TddRefactorCompletion.java b/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/TddRefactorCompletion.java index 8adf0d2baa..e1afff1a7d 100644 --- a/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/TddRefactorCompletion.java +++ b/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/TddRefactorCompletion.java @@ -22,6 +22,8 @@ import org.python.pydev.parser.PyParser; import org.python.pydev.shared_core.image.IImageHandle; +import com.python.pydev.analysis.refactoring.tdd.AbstractPyCreateAction; + /** * This is the proposal that goes outside. It only creates the proposal that'll actually do something later, as * creating that proposal may be slower. @@ -81,7 +83,7 @@ public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) { public TemplateProposal getAsTemplateProposal() { if (executed == null) { - pyCreateAction.setActiveEditor(null, edit); + pyCreateAction.setActiveEditor(edit); try { RefactoringInfo refactoringInfo = new RefactoringInfo(edit, ps.getTextSelection()); executed = (TemplateProposal) pyCreateAction.createProposal(refactoringInfo, this.fReplacementString, diff --git a/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/TddRefactorCompletionInInexistentModule.java b/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/TddRefactorCompletionInInexistentModule.java index 8f2c50dfbd..067b49eaa3 100644 --- a/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/TddRefactorCompletionInInexistentModule.java +++ b/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/TddRefactorCompletionInInexistentModule.java @@ -33,6 +33,9 @@ import org.python.pydev.editor.actions.PyOpenAction; import org.python.pydev.shared_core.image.IImageHandle; +import com.python.pydev.analysis.refactoring.tdd.AbstractPyCreateAction; +import com.python.pydev.analysis.refactoring.tdd.PyCreateClass; + /** * This is the proposal that goes outside. It only creates the proposal that'll actually do something later, as * creating that proposal may be slower. diff --git a/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/TddRefactorCompletionInModule.java b/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/TddRefactorCompletionInModule.java index 31c7fbf183..fb1a43a8a3 100644 --- a/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/TddRefactorCompletionInModule.java +++ b/plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/tdd/TddRefactorCompletionInModule.java @@ -22,6 +22,8 @@ import org.python.pydev.editor.actions.PyOpenAction; import org.python.pydev.shared_core.image.IImageHandle; +import com.python.pydev.analysis.refactoring.tdd.AbstractPyCreateAction; + /** * This is the proposal that goes outside. It only creates the proposal that'll actually do something later, as * creating that proposal may be slower. diff --git a/plugins/com.python.pydev.refactoring/tests/com/python/pydev/refactoring/tdd/ExecutePyCreate.java b/plugins/com.python.pydev.refactoring/tests/com/python/pydev/refactoring/tdd/ExecutePyCreate.java index c5b15d12cf..ad8de6e023 100644 --- a/plugins/com.python.pydev.refactoring/tests/com/python/pydev/refactoring/tdd/ExecutePyCreate.java +++ b/plugins/com.python.pydev.refactoring/tests/com/python/pydev/refactoring/tdd/ExecutePyCreate.java @@ -10,6 +10,8 @@ import org.python.pydev.shared_core.code_completion.ICompletionProposalHandle; import org.python.pydev.shared_core.structure.Tuple; +import com.python.pydev.analysis.refactoring.tdd.AbstractPyCreateClassOrMethodOrField; + public class ExecutePyCreate { public static void execute(AbstractPyCreateClassOrMethodOrField action, RefactoringInfo refactoringInfo, diff --git a/plugins/com.python.pydev.refactoring/tests/com/python/pydev/refactoring/tdd/PyCreateClassTest.java b/plugins/com.python.pydev.refactoring/tests/com/python/pydev/refactoring/tdd/PyCreateClassTest.java index f4b20e79e6..82fbbfd9b1 100644 --- a/plugins/com.python.pydev.refactoring/tests/com/python/pydev/refactoring/tdd/PyCreateClassTest.java +++ b/plugins/com.python.pydev.refactoring/tests/com/python/pydev/refactoring/tdd/PyCreateClassTest.java @@ -19,6 +19,8 @@ import org.python.pydev.shared_core.string.CoreTextSelection; import org.python.pydev.shared_core.string.ICoreTextSelection; +import com.python.pydev.analysis.refactoring.tdd.PyCreateClass; + public class PyCreateClassTest extends TestCaseUtils { public static void main(String[] args) { diff --git a/plugins/com.python.pydev.refactoring/tests/com/python/pydev/refactoring/tdd/PyCreateMethodTest.java b/plugins/com.python.pydev.refactoring/tests/com/python/pydev/refactoring/tdd/PyCreateMethodTest.java index c1ed56c2c5..6175de1561 100644 --- a/plugins/com.python.pydev.refactoring/tests/com/python/pydev/refactoring/tdd/PyCreateMethodTest.java +++ b/plugins/com.python.pydev.refactoring/tests/com/python/pydev/refactoring/tdd/PyCreateMethodTest.java @@ -19,6 +19,9 @@ import org.python.pydev.shared_core.string.CoreTextSelection; import org.python.pydev.shared_core.string.ICoreTextSelection; +import com.python.pydev.analysis.refactoring.tdd.AbstractPyCreateAction; +import com.python.pydev.analysis.refactoring.tdd.PyCreateMethodOrField; + public class PyCreateMethodTest extends TestCaseUtils { public static void main(String[] args) { diff --git a/plugins/com.python.pydev.refactoring/tests/com/python/pydev/refactoring/tdd/TddCodeGenerationQuickFixParticipantTest.java b/plugins/com.python.pydev.refactoring/tests/com/python/pydev/refactoring/tdd/TddCodeGenerationQuickFixParticipantTest.java index 434e3c06e7..63c22eace6 100644 --- a/plugins/com.python.pydev.refactoring/tests/com/python/pydev/refactoring/tdd/TddCodeGenerationQuickFixParticipantTest.java +++ b/plugins/com.python.pydev.refactoring/tests/com/python/pydev/refactoring/tdd/TddCodeGenerationQuickFixParticipantTest.java @@ -22,6 +22,7 @@ import org.python.pydev.shared_core.string.FastStringBuffer; import com.python.pydev.analysis.refactoring.refactorer.Refactorer; +import com.python.pydev.analysis.refactoring.tdd.AbstractPyCreateClassOrMethodOrField; /** * @author Fabio