Examples of PySelection


Examples of org.python.pydev.core.docutils.PySelection

                return;
            }

            PyEdit pyEdit = getPyEdit();

            PySelection ps = new PySelection(pyEdit);
            String endLineDelim = ps.getEndLineDelim();
            final IDocument doc = ps.getDoc();
            DocumentRewriteSession session = null;

            try {
                if (ps.getStartLineIndex() == ps.getEndLineIndex()) {
                    //let's see if someone wants to make a better implementation in another plugin...
                    List<IOrganizeImports> participants = ExtensionHelper
                            .getParticipants(ExtensionHelper.PYDEV_ORGANIZE_IMPORTS);

                    for (IOrganizeImports organizeImports : participants) {
                        if (!organizeImports.beforePerformArrangeImports(ps, pyEdit)) {
                            return;
                        }
                    }

                    session = startWrite(doc);

                    performArrangeImports(doc, endLineDelim, pyEdit.getIndentPrefs().getIndentationString());

                    for (IOrganizeImports organizeImports : participants) {
                        organizeImports.afterPerformArrangeImports(ps, pyEdit);
                    }
                } else {
                    session = startWrite(doc);
                    performSimpleSort(doc, endLineDelim, ps.getStartLineIndex(), ps.getEndLineIndex());
                }
            } finally {
                if (session != null) {
                    endWrite(doc, session);
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.