All Packages Class Hierarchy This Package Previous Next Index
Class edu.mit.ai.psg.jevaESUI.JevaESUI
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----java.applet.Applet
|
+----edu.mit.ai.psg.jevaESUI.JevaESUI
- public class JevaESUI
- extends Applet
- implements ActionListener
JevaESUI is the user interface for the JevaES Java Expression & Statement
evaluator. JevaESUI can be used as
- an application: main starts a top read-eval-print-loop (repl) window.
Good for quickly trying out some class in the classpath.
- an applet: provides a button which starts a repl window when pressed.
(AWT panes haven't worked well nested in browsers.)
- a breakpoint/stub: an application may call JevaESUI.repl(..)
providing an environment of current names, and a repl window
appears in which the user can evaluate Java expression and
statements in that environment, including calling other stubs
(which create new windows), returning values, and throwing exceptions.
In any situation, results can be explored in an outline tree using Jexa,
and objects found in Jexa can become parameters of statements and
expressions.
- Author:
- CarlManning, caroma@ai.mit.edu
Copyright (c) 1997, 1998 Massachusetts Institute of Technology
- See Also:
- JevaES, Jexa
-
DontRedirectSystemOutAndErr
- option bits fit into a 32 bit int.
-
err
- PrintWriter stream for printing errors to result pane.
-
NoThrowDeclarations
- default empty array argument for repl(...
-
out
- PrintWriter stream for printing to result pane.
-
results
- Vector of result values from expressions typed at the window
-
systemErr
- Saved system.err present when loaded
-
systemOut
- Saved system.out present when loaded
-
JevaESUI()
-
-
actionPerformed(ActionEvent)
- Start up window frame when applet button is pushed.
-
awaitResult(Container)
-
-
dontRedirectSystemOutAndErr(int)
-
-
getHerald()
-
-
init()
- Applet startup:
Starts a window at which users can type top level expressions.
-
main(String[])
- Application Startup:
Starts a window at which users can type top level expressions.
-
repl()
- Read-Eval-Print-Loop: creates a new window in which user may type java
expressions and statements, including return to return a value.
-
repl(int, String, Class, Class[], IEnv)
- Read-Eval-Print-Loop: creates a new window in which user may type java
expressions and statements, including return to return a value.
-
replTop()
- Top read-eval-print-loop: creates a new window in which user
may type java expressions and statements.
out
public static PrintWriter out
- PrintWriter stream for printing to result pane.
err
public static PrintWriter err
- PrintWriter stream for printing errors to result pane.
systemOut
public static PrintStream systemOut
- Saved system.out present when loaded
systemErr
public static PrintStream systemErr
- Saved system.err present when loaded
results
public static Vector results
- Vector of result values from expressions typed at the window
DontRedirectSystemOutAndErr
public static final int DontRedirectSystemOutAndErr
- option bits fit into a 32 bit int. 0 is default for each option.
For applets in security sandbox, use DontRedirectSystemOutAndErr
NoThrowDeclarations
public static final Class NoThrowDeclarations[]
- default empty array argument for repl(... throwClasses)
JevaESUI
public JevaESUI()
main
public static void main(String ignore[])
- Application Startup:
Starts a window at which users can type top level expressions.
init
public void init()
- Applet startup:
Starts a window at which users can type top level expressions.
- Overrides:
- init in class Applet
actionPerformed
public void actionPerformed(ActionEvent e)
- Start up window frame when applet button is pushed.
dontRedirectSystemOutAndErr
public static boolean dontRedirectSystemOutAndErr(int options)
replTop
public static void replTop()
- Top read-eval-print-loop: creates a new window in which user
may type java expressions and statements.
Returns when window is closed.
repl
public static Object repl() throws Throwable, AWTException
- Read-Eval-Print-Loop: creates a new window in which user may type java
expressions and statements, including return to return a value.
- Throws: Throwable
- --- throws anything user throws.
- Throws: AWTException
- if window is closed.
repl
public static Object repl(int options,
String initialMessage,
Class returnClass,
Class throwClasses[],
IEnv env) throws Throwable, AWTException
- Read-Eval-Print-Loop: creates a new window in which user may type java
expressions and statements, including return to return a value.
- Parameters:
- options - Option flag bits or'ed together; 0 is default. Applets:
require DontRedirectSystemOutAndErr due to security sandbox.
- initialMessage - Non-null text replaces herald; if called from a
breakpoint, a good practice is to show user contents of env.
- returnClass - user may only return a value of this class
(like method return type); Object.class is default.
Use void.class for void result.
If null, never returns (like a top level loop).
- throwClasses - user may only throw Throwables which are instances
of these classes, or instances of Error or RuntimeException
(like method throw declarations).
If null, defaults to no delcarations.
- env - initial environment created with JevaES.makeDefaultEnv,
JevaES.extendEnv(), or JevaES.parseEval..Statement
If null, defaults to JevaES.makeDefaultEnv()
Applet sandbox requires JevaES.checkPackageNames==false .
- Throws: Throwable
- --- throws anything user throws compatibile
with throwClasses
- Throws: AWTException
- if window is closed.
awaitResult
public static Object awaitResult(Container container) throws Throwable, AWTException
getHerald
public static String getHerald()
All Packages Class Hierarchy This Package Previous Next Index