Package org.jnode.driver.console

Examples of org.jnode.driver.console.Console


     * Gets the console that "hosts" the current thread.
     *
     * @return Console
     */
    public Console getContextConsole() {
        Console c = contextConsole.get();
        if (c == null) {
            c = getFocus();
            contextConsole.set(c);
        }
        return c;
View Full Code Here


        for (Integer key : list) {
            pw.println("Screen of " + KeyEvent.getKeyText(key) + ':');
            Stack<Console> stack = stackMap.get(key);
            int t_ind = stack.size();
            for (int i = t_ind; i-- > 0;) {
                Console console = stack.get(i);
                String prefix = console == current ? " > " :
                    i == t_ind - 1 ? " * " : "   ";
                pw.println(prefix + console.getConsoleName());
            }
        }
    }
View Full Code Here

    private void handleFocus() {
        if (consoles.isEmpty()) {
            if (parent != null)
                parent.handleFocus();
        } else {
            Console c = getFocus();
            if (c == null)
                c = consoles.values().iterator().next();

            focus(c);
        }
View Full Code Here

    /**
     * Close all consoles.
     */
    public void closeAll() {
        for (Iterator<Console> i = consoles.values().iterator(); i.hasNext();) {
            Console console = (Console) i.next();
            i.remove(); // remove from iterator before closing to avoid
            // concurrent modification
            console.close();
        }
    }
View Full Code Here

     * @see org.jnode.driver.input.KeyboardListener#keyPressed(org.jnode.driver.input.KeyboardEvent)
     */
    public void keyPressed(KeyboardEvent event) {
        if ((event.getModifiers() & InputEvent.ALT_DOWN_MASK) != 0) {
            final int keyCode = event.getKeyCode();
            final Console c = getConsoleByAccelerator(keyCode);
            if (c != null) {
                focus(c);
                event.consume();
            }
        }
View Full Code Here

   
    @Override
    public void execute() throws Exception {
        out = getOutput().getPrintWriter();
        err = getError().getPrintWriter();
        Console console = ShellUtils.getCurrentShell().getConsole();
        if (!(console instanceof TextConsole)) {
            err.println(err_not_text);
        }
        TextConsole textConsole = (TextConsole) console;
        if (argReset.isSet()) {
View Full Code Here

TOP

Related Classes of org.jnode.driver.console.Console

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.