Search in sources :

Example 1 with ConsoleTab

use of org.phoenicis.javafx.views.mainwindow.console.ConsoleTab in project POL-POM-5 by PhoenicisOrg.

the class ConsoleController method createConsole.

public ConsoleTab createConsole() {
    final ConsoleTab consoleTab = consoleTabFactory.createInstance();
    final InteractiveScriptSession interactiveScriptSession = scriptInterpreter.createInteractiveSession();
    consoleTab.setOnSendCommand(command -> {
        consoleTab.appendTextToConsole("> " + command + "\n", ConsoleTextType.NORMAL);
        consoleTab.disableCommand();
        interactiveScriptSession.eval(command, result -> {
            consoleTab.appendTextToConsole(result == null ? "null\n" : result.toString() + "\n");
            consoleTab.enableCommand();
        }, error -> {
            consoleTab.appendTextToConsole(ExceptionUtils.getFullStackTrace(error), ConsoleTextType.ERROR);
            consoleTab.enableCommand();
        });
    });
    return consoleTab;
}
Also used : ConsoleTab(org.phoenicis.javafx.views.mainwindow.console.ConsoleTab) InteractiveScriptSession(org.phoenicis.scripts.interpreter.InteractiveScriptSession)

Example 2 with ConsoleTab

use of org.phoenicis.javafx.views.mainwindow.console.ConsoleTab in project POL-POM-5 by PlayOnLinux.

the class LibraryFeaturePanel method openConsole.

/**
 * Opens a new console tab
 */
public void openConsole() {
    final ConsoleTab console = getConsoleController().createConsole();
    getTabs().add(console);
    setSelectedTab(console);
}
Also used : ConsoleTab(org.phoenicis.javafx.views.mainwindow.console.ConsoleTab)

Example 3 with ConsoleTab

use of org.phoenicis.javafx.views.mainwindow.console.ConsoleTab in project phoenicis by PhoenicisOrg.

the class ConsoleController method createConsole.

public ConsoleTab createConsole() {
    final ConsoleTab consoleTab = consoleTabFactory.createInstance();
    final InteractiveScriptSession interactiveScriptSession = scriptInterpreter.createInteractiveSession();
    consoleTab.setOnSendCommand(command -> {
        consoleTab.appendTextToConsole("> " + command + "\n", ConsoleTextType.NORMAL);
        consoleTab.disableCommand();
        interactiveScriptSession.eval(command, result -> {
            consoleTab.appendTextToConsole(result == null ? "null\n" : result.toString() + "\n");
            consoleTab.enableCommand();
        }, error -> {
            consoleTab.appendTextToConsole(ExceptionUtils.getFullStackTrace(error), ConsoleTextType.ERROR);
            consoleTab.enableCommand();
        });
    });
    return consoleTab;
}
Also used : ConsoleTab(org.phoenicis.javafx.views.mainwindow.console.ConsoleTab) InteractiveScriptSession(org.phoenicis.scripts.interpreter.InteractiveScriptSession)

Example 4 with ConsoleTab

use of org.phoenicis.javafx.views.mainwindow.console.ConsoleTab in project POL-POM-5 by PlayOnLinux.

the class ConsoleController method createConsole.

public ConsoleTab createConsole() {
    final ConsoleTab consoleTab = consoleTabFactory.createInstance();
    final InteractiveScriptSession interactiveScriptSession = scriptInterpreter.createInteractiveSession();
    consoleTab.setOnSendCommand(command -> {
        consoleTab.appendTextToConsole("> " + command + "\n", ConsoleTextType.NORMAL);
        consoleTab.disableCommand();
        interactiveScriptSession.eval(command, result -> {
            consoleTab.appendTextToConsole(result == null ? "null\n" : result.toString() + "\n");
            consoleTab.enableCommand();
        }, error -> {
            consoleTab.appendTextToConsole(ExceptionUtils.getFullStackTrace(error), ConsoleTextType.ERROR);
            consoleTab.enableCommand();
        });
    });
    return consoleTab;
}
Also used : ConsoleTab(org.phoenicis.javafx.views.mainwindow.console.ConsoleTab) InteractiveScriptSession(org.phoenicis.scripts.session.InteractiveScriptSession)

Aggregations

ConsoleTab (org.phoenicis.javafx.views.mainwindow.console.ConsoleTab)4 InteractiveScriptSession (org.phoenicis.scripts.interpreter.InteractiveScriptSession)2 InteractiveScriptSession (org.phoenicis.scripts.session.InteractiveScriptSession)1