Package com.aptana.shared_core.utils

Examples of com.aptana.shared_core.utils.DocCmd


                +
                "    image_area_right_area_and_quote_area = '\\n'.join(lines)\n" +
                "    else" +
                "";
        int initialOffset = strDoc.length();
        DocCmd docCmd = new DocCmd(initialOffset, 0, ":");
        Document doc = new Document(strDoc);
        strategy.customizeDocumentCommand(doc, docCmd);
        String expected = ":";
        assertEquals("" +
                "if foo:\n" +
View Full Code Here


                "    image_area_right_area_and_quote_area = (a,\n" +
                "b)\n" +
                "    else" +
                "";
        int initialOffset = strDoc.length();
        DocCmd docCmd = new DocCmd(initialOffset, 0, ":");
        Document doc = new Document(strDoc);
        strategy.customizeDocumentCommand(doc, docCmd);
        String expected = ":";
        assertEquals("" +
                "if foo:\n" +
View Full Code Here

        String str = "" +
                "def m1(self):\n" +
                "    return ('foo',";

        final Document doc = new Document(str);
        DocCmd docCmd = new DocCmd(doc.getLength(), 0, "\n");
        strategy.customizeDocumentCommand(doc, docCmd);
        assertEquals("\n            ", docCmd.text);

    }
View Full Code Here

                "        print 'foo'\n" +
                "    print 'bla'" +
                "";

        final Document doc = new Document(str);
        DocCmd docCmd = new DocCmd(doc.getLength() - "print 'bla'".length(), 0, "\n");
        strategy.customizeDocumentCommand(doc, docCmd);
        assertEquals("\n    ", docCmd.text);

    }
View Full Code Here

                "    print 'bla'" +
                "";

        final Document doc = new Document(str);
        int offset = doc.getLength() - "  print 'bla'".length();
        DocCmd docCmd = new DocCmd(offset, 0, "\n");
        strategy.customizeDocumentCommand(doc, docCmd);
        assertEquals("\n  ", docCmd.text);
        assertEquals(offset + 2, docCmd.caretOffset);

    }
View Full Code Here

                "        print    'foo'" +
                "";

        final Document doc = new Document(str);
        int offset = doc.getLength() - "    'foo'".length();
        DocCmd docCmd = new DocCmd(offset, 0, "\n");
        strategy.customizeDocumentCommand(doc, docCmd);
        assertEquals("\n        ", docCmd.text);
        assertEquals(-1, docCmd.caretOffset); //don't change it

    }
View Full Code Here

                ")" +
                "";

        final Document doc = new Document(str);
        int offset = doc.getLength() - "\n                  b,\n)".length();
        DocCmd docCmd = new DocCmd(offset, 0, "\t");
        strategy.customizeDocumentCommand(doc, docCmd);
        assertEquals("                  ", docCmd.text);

    }
View Full Code Here

                "" + //we're here (indent to the first level)
                "";

        final Document doc = new Document(str);
        int offset = doc.getLength();
        DocCmd docCmd = new DocCmd(offset, 0, "\t");
        strategy.customizeDocumentCommand(doc, docCmd);
        assertEquals("    ", docCmd.text);

    }
View Full Code Here

                "    " + //now that we're already in the first level, indent to the current level
                "";

        final Document doc = new Document(str);
        int offset = doc.getLength();
        DocCmd docCmd = new DocCmd(offset, 0, "\t");
        strategy.customizeDocumentCommand(doc, docCmd);
        assertEquals("                      ", docCmd.text);

    }
View Full Code Here

                "";

        final Document doc = new Document(str);
        String s = "\n" +
                "            )\n";
        DocCmd docCmd = new DocCmd(doc.getLength() - s.length(), 0, "\n");
        strategy.customizeDocumentCommand(doc, docCmd);
        assertEquals("\n              ", docCmd.text);

    }
View Full Code Here

TOP

Related Classes of com.aptana.shared_core.utils.DocCmd

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.