Package com.aptana.interactive_console.console.ui

Examples of com.aptana.interactive_console.console.ui.IConsoleStyleProvider


*
*/
public class PydevConsoleTest extends TestCase {

    public void testPydevConsoleColors() throws Exception {
        IConsoleStyleProvider provider = new ConsoleStyleProvider();

        //foo start yellow bar endyellow xxx
        Tuple<List<ScriptStyleRange>, String> tup = provider.createInterpreterErrorStyle(
                "foo\u001B[0;33mbar\u001B[0mxxx", 0);
        List<ScriptStyleRange> ranges = tup.o1;
        assertEquals(3, ranges.size());
        assertEquals(null, ranges.get(0).foreground);
        assertEquals(ColorManager.dimYellow, ranges.get(1).foreground.getRGB());
View Full Code Here


        if (out.length() == 0) {
            return; //nothing to add!
        }
        int start = doc.getLength();

        IConsoleStyleProvider styleProvider = viewer.getStyleProvider();
        Tuple<List<ScriptStyleRange>, String> style = null;
        if (styleProvider != null) {
            if (stdout) {
                style = styleProvider.createInterpreterOutputStyle(out, start);
            } else { //stderr
                style = styleProvider.createInterpreterErrorStyle(out, start);
            }
            if (style != null) {
                for (ScriptStyleRange s : style.o1) {
                    addToPartitioner(s);
                }
View Full Code Here

     *
     * @param cmd
     * @param offset2
     */
    private void applyStyleToUserAddedText(String cmd, int offset2) {
        IConsoleStyleProvider styleProvider = viewer.getStyleProvider();
        if (styleProvider != null) {
            ScriptStyleRange style = styleProvider.createUserInputStyle(cmd, offset2);
            if (style != null) {
                addToPartitioner(style);
            }
        }
    }
View Full Code Here

     * Shows the prompt for the user (e.g.: >>>)
     */
    protected void appendInvitation(boolean async) {
        int start = doc.getLength();
        String promptStr = prompt.toString();
        IConsoleStyleProvider styleProvider = viewer.getStyleProvider();
        if (styleProvider != null) {
            ScriptStyleRange style = styleProvider.createPromptStyle(promptStr, start);
            if (style != null) {
                addToPartitioner(style);
            }
        }
        appendText(promptStr); //caret already updated
View Full Code Here

TOP

Related Classes of com.aptana.interactive_console.console.ui.IConsoleStyleProvider

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.