Package org.python.pydev.editor

Examples of org.python.pydev.editor.PyEdit$MyResources


        TddCodeGenerationQuickFixParticipant quickFix;
        PySelection ps;
        List<ICompletionProposal> props;
        IFile mod2 = initFile.getParent().getFile(new Path("other_module.py"));
        mod2.create(new ByteArrayInputStream("".getBytes()), true, null);
        PyEdit editor2 = (PyEdit) PyOpenEditor.doOpenEditor(mod2);
        try {
            goToManual(AnalysisRequestsTestWorkbench.TIME_FOR_ANALYSIS); //give it a bit more time...
            mod1Contents = "" +
                    "import other_module\n" +
                    "other_module.Foo";
            setContentsAndWaitReparseAndError(mod1Contents);

            quickFix = new TddCodeGenerationQuickFixParticipant();
            int offset = mod1Contents.length() - 1;
            ps = new PySelection(editor.getDocument(), offset);
            assertTrue(quickFix.isValid(ps, "", editor, offset));
            props = waitForQuickFixProps(quickFix, ps, offset);

            findCompletion(props, "Create Foo class at other_module.py").apply(editor.getISourceViewer(), '\n', 0,
                    offset);
            assertContentsEqual("" +
                    "class Foo(object):\n" +
                    "    pass\n" +
                    "\n" +
                    "\n" +
                    "", editor2.getDocument()
                    .get());

        } finally {
            editor2.close(false);
            mod2.delete(true, null);
        }
    }
View Full Code Here


public class PyShowOutline extends PyAction {

    public void run(IAction action) {

        PyEdit pyEdit = getPyEdit();

        TreeSelectionDialog dialog = new PyOutlineSelectionDialog(PyAction.getShell(), pyEdit);

        dialog.open(); //The dialog will take care of everything.
    }
View Full Code Here

    public PydevConsoleLaunchInfo createInteractiveLaunch() throws UserCanceledException, Exception {

        IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
        IWorkbenchPage activePage = workbenchWindow.getActivePage();
        IEditorPart activeEditor = activePage.getActiveEditor();
        PyEdit edit = null;

        if (activeEditor instanceof PyEdit) {
            edit = (PyEdit) activeEditor;
        }
View Full Code Here

TOP

Related Classes of org.python.pydev.editor.PyEdit$MyResources

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.