01: /*
02: * @(#)console.java 1.3 05/01/15
03: *
04: * Copyright (c) 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
05: *
06: * See the file "LICENSE.txt" for information on usage and redistribution of
07: * this file, and for a DISCLAIMER OF ALL WARRANTIES.
08: */
09: package org.pnuts.tools;
10:
11: import pnuts.lang.Context;
12: import pnuts.lang.PnutsFunction;
13: import pnuts.tools.PnutsConsole;
14: import pnuts.tools.PnutsConsoleUI;
15:
16: public class console extends PnutsFunction {
17: transient Thread th;
18:
19: public console() {
20: super ("console");
21: }
22:
23: public boolean defined(int nargs) {
24: return nargs == 0;
25: }
26:
27: protected Object exec(Object[] args, Context context) {
28: if (args.length != 0) {
29: undefined(args, context);
30: return null;
31: }
32: Context ctx = new Context(context);
33: PnutsConsoleUI ui = new PnutsConsoleUI();
34: PnutsConsole console = ui.createConsole(null, ctx, null, null,
35: true, null, Thread.NORM_PRIORITY);
36: ui.getFrame().setVisible(true);
37: console.start();
38: return null;
39: }
40: }
|