Package org.jnode.driver.console

Examples of org.jnode.driver.console.ConsoleManager$CreateOptions


         * @param args
         */
        public static void main(String[] args) {
            try {
                final ShellManager sm = InitialNaming.lookup(ShellManager.NAME);
                final ConsoleManager conMgr = sm.getCurrentShell().getConsole().getManager();
                final PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
                TextConsole console = createConsoleWithShell(conMgr, out);
                System.setIn(new ReaderInputStream(console.getIn()));
                System.setOut(new PrintStream(new WriterOutputStream(console.getOut(), false), true));
                System.setErr(new PrintStream(new WriterOutputStream(console.getErr(), false), true));
View Full Code Here


    @Override
    public void execute() throws NameNotFoundException, IsolateStartupException, ShellException {
        final PrintWriter out = getOutput().getPrintWriter();
        final ShellManager sm = InitialNaming.lookup(ShellManager.NAME);
        final ConsoleManager conMgr = sm.getCurrentShell().getConsole().getManager();

        boolean listConsoles = FLAG_LIST.isSet();
        boolean newConsole = FLAG_NEW.isSet();
        boolean isolateNewConsole = FLAG_ISOLATED.isSet();
        boolean test = FLAG_TEST.isSet();

        if (listConsoles) {
            conMgr.printConsoles(out);
        } else if (newConsole) {
            if (isolateNewConsole) {
                try {
                    Isolate newIsolate = new Isolate(
                            ConsoleCommand.IsolatedConsole.class.getName(),
                            new String[0]);
                    newIsolate.start();
                    out.println("Started new isolated console");
                } catch (IsolateStartupException ex) {
                    out.println("Failed to start new isolated console");
                    throw ex;
                }
            } else {
                createConsoleWithShell(conMgr, out);
            }
        } else if (test) {
            out.println("test RawTextConsole");
            final TextConsole console = (TextConsole) conMgr.createConsole(
                    null, ConsoleManager.CreateOptions.TEXT | ConsoleManager.CreateOptions.NO_LINE_EDITTING);
            conMgr.registerConsole(console);
            conMgr.focus(console);
            console.clear();
        }
    }
View Full Code Here

    }

    private static Toolkit createInstance() {
        try {
            final ShellManager sm = InitialNaming.lookup(ShellManager.NAME);
            final ConsoleManager conMgr = sm.getCurrentShell().getConsole().getManager();
            final TextConsole console = (TextConsole) conMgr.createConsole(
                "charva",
                ConsoleManager.CreateOptions.TEXT |
                            ConsoleManager.CreateOptions.STACKED |
                            ConsoleManager.CreateOptions.NO_LINE_EDITTING);
            console.addKeyboardListener(new KeyboardAdapter() {
View Full Code Here

     */
    protected void startPlugin() throws PluginException {
        final Logger root = Logger.getRootLogger();
        try {
            // Create the appenders
            final ConsoleManager conMgr = InitialNaming.lookup(ConsoleManager.NAME);
            final TextConsole console =
                (TextConsole) conMgr.createConsole(
                    "Log4j",
                    (ConsoleManager.CreateOptions.TEXT |
                        ConsoleManager.CreateOptions.SCROLLABLE |
                        ConsoleManager.CreateOptions.NO_SYSTEM_OUT_ERR |
                        ConsoleManager.CreateOptions.NO_LINE_EDITTING));
            conMgr.registerConsole(console);

            console.setAcceleratorKeyCode(KeyEvent.VK_F7);
            final VirtualConsoleAppender debugApp =
                new VirtualConsoleAppender(new PatternLayout(LAYOUT), console, false);
            debugApp.setThreshold(Level.DEBUG);
View Full Code Here

TOP

Related Classes of org.jnode.driver.console.ConsoleManager$CreateOptions

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.