Package org.python.pydev.editor.actions

Examples of org.python.pydev.editor.actions.PyFormatStd$FormatStd


            boolean showSpacesAndNewLines) {
        //When new preferences are set, the cache is reset (the background color doesn't need to be
        //cleared because the colors are gotten from the rgb and not from the names).
        this.colorCache.setPreferences(prefs);

        PyFormatStd formatter = new PyFormatStd();
        try {
            Document doc = new Document(str);
            formatter.formatAll(doc, null, false, formatStd, false);
            str = doc.get();
        } catch (SyntaxErrorException e) {
        }
        FastStringBuffer buf = new FastStringBuffer();
        for (String line : StringUtils.splitInLines(str)) {
View Full Code Here


                ITextSelection selection = (ITextSelection) this.getSelectionProvider().getSelection();
                PySelection ps = new PySelection(document, selection);

                if (!hasSyntaxError(ps.getDoc())) {
                    PyFormatStd std = new PyFormatStd();
                    boolean throwSyntaxError = true;
                    try {
                        std.applyFormatAction(this, ps, regionsForSave, throwSyntaxError);
                        statusLineManager.setErrorMessage(null);
                    } catch (SyntaxErrorException e) {
                        statusLineManager.setErrorMessage(e.getMessage());
                    }
                }
View Full Code Here

     * Initialize the open files and the formatter to be used.
     */
    @Override
    protected void beforeRun() {
        openFiles = PyAction.getOpenFiles();
        PyFormatStd std = new PyFormatStd();
        formatter = std.getFormatter();
    }
View Full Code Here

TOP

Related Classes of org.python.pydev.editor.actions.PyFormatStd$FormatStd

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.