Package org.python.pydev.refactoring.core.base

Examples of org.python.pydev.refactoring.core.base.RefactoringInfo


        boolean allFilesSaved = saveAll();
        if (!allFilesSaved) {
            return;
        }

        RefactoringInfo info;
        try {
            info = new RefactoringInfo(this.targetEditor);
            PythonRefactoringWizard wizard = new PythonRefactoringWizard(this.createRefactoring(info),
                    this.targetEditor, this.createPage(info), this.getWizardFlags());

            wizard.run();
View Full Code Here


    @Override
    public void runTest() throws Throwable {
        MockupSelectionConfig config = initConfig();

        RefactoringInfo info = setupInfo(config);
        runSelectionExtension(info);

        assertEquals(getExpected(), getGenerated());
    }
View Full Code Here

    private RefactoringInfo setupInfo(MockupSelectionConfig config) throws Throwable {
        IDocument doc = new Document(data.source);

        ITextSelection selection = new TextSelection(doc, data.sourceSelection.getOffset(),
                data.sourceSelection.getLength());
        RefactoringInfo info = new RefactoringInfo(doc, selection, new IGrammarVersionProvider() {

            public int getGrammarVersion() throws MisconfigurationException {
                return IGrammarVersionProvider.GRAMMAR_PYTHON_VERSION_2_7;
            }
        });
View Full Code Here

            System.out.println("here");
        }
        ITextSelection selection = new TextSelection(doc, data.sourceSelection.getOffset(),
                data.sourceSelection.getLength());

        RefactoringInfo info = new RefactoringInfo(doc, selection, new IGrammarVersionProvider() {

            public int getGrammarVersion() throws MisconfigurationException {
                return IGrammarVersionProvider.GRAMMAR_PYTHON_VERSION_2_7;
            }
        });
View Full Code Here

        FileUtilsFileBuffer.IN_TESTS = true;

        IDocument document = new Document(data.source);
        ITextSelection selection = new TextSelection(document, data.sourceSelection.getOffset(),
                data.sourceSelection.getLength());
        RefactoringInfo info = new RefactoringInfo(document, selection, new IGrammarVersionProvider() {

            public int getGrammarVersion() throws MisconfigurationException {
                return IGrammarVersionProvider.GRAMMAR_PYTHON_VERSION_2_7;
            }
        });
View Full Code Here

                    "Target editor is null (not PyEdit).", status);
            return;
        }

        try {
            RefactoringInfo refactoringInfo = new RefactoringInfo(targetEditor);
            execute(refactoringInfo, LOCATION_STRATEGY_BEFORE_CURRENT);
        } catch (Throwable e) {
            Log.log(e);
            Throwable initial = e;
            while (e.getCause() != null) {
View Full Code Here

    private TemplateProposal getExecuted() {
        if (executed == null) {
            pyCreateAction.setActiveEditor(null, edit);
            try {
                RefactoringInfo refactoringInfo = new RefactoringInfo(edit, ps.getTextSelection());
                executed = (TemplateProposal) pyCreateAction.createProposal(refactoringInfo, this.fReplacementString,
                        this.locationStrategy, parametersAfterCall);
            } catch (MisconfigurationException e) {
                Log.log(e);
            }
View Full Code Here

        IDocument document = new Document(data.source);
        ITextSelection selection = new TextSelection(document, data.sourceSelection.getOffset(),
                data.sourceSelection.getLength());
        IGrammarVersionProvider versionProvider = createVersionProvider();
        RefactoringInfo info = new RefactoringInfo(document, selection, versionProvider);
        ExtractLocalRefactoring refactoring = new ExtractLocalRefactoring(info);

        ExtractLocalRequestProcessor requestProcessor = refactoring.getRequestProcessor();
        requestProcessor.setVariableName("extracted_variable");
        requestProcessor.setReplaceDuplicates(true);
View Full Code Here

        PyCreateMethodOrField pyCreateMethod = new PyCreateMethodOrField();

        String source = "MyMethod()";
        IDocument document = new Document(source);
        ITextSelection selection = new TextSelection(document, 0, 0);
        RefactoringInfo info = new RefactoringInfo(document, selection, new IGrammarVersionProvider() {

            public int getGrammarVersion() throws MisconfigurationException {
                return IGrammarVersionProvider.GRAMMAR_PYTHON_VERSION_2_7;
            }
        });
View Full Code Here

        PyCreateMethodOrField pyCreateMethod = new PyCreateMethodOrField();

        String source = "MyMethod(a, b())";
        IDocument document = new Document(source);
        ITextSelection selection = new TextSelection(document, 0, 0);
        RefactoringInfo info = new RefactoringInfo(document, selection, new IGrammarVersionProvider() {

            public int getGrammarVersion() throws MisconfigurationException {
                return IGrammarVersionProvider.GRAMMAR_PYTHON_VERSION_2_7;
            }
        });
View Full Code Here

TOP

Related Classes of org.python.pydev.refactoring.core.base.RefactoringInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.