class AstBrowser
extends Object
This object is a GUI for looking at the AST that Groovy generates. Usage: java groovy.console.ui.AstBrowser [filename] where [filename] is an existing Groovy script.
| Type | Name and description |
|---|---|
GeneratedBytecodeAwareGroovyClassLoader |
classLoaderClass loader used to capture generated bytecode for the selected phase. |
Object |
frameTop-level browser window. |
Object |
prefsPersisted UI preferences for the browser window. |
Action |
refreshActionRefresh action shared by toolbar and menu items. |
boolean |
showClosureClassesDisplay flags that control which script representations are shown. |
boolean |
showScriptClassDisplay flags that control which script representations are shown. |
boolean |
showScriptFreeFormDisplay flags that control which script representations are shown. |
boolean |
showTreeViewDisplay flags that control which script representations are shown. |
SwingBuilder |
swingSwing builder used to create and update the browser UI. |
| Constructor and description |
|---|
AstBrowser(Object inputArea, Object rootElement, Object classLoader, Object config)Creates a browser for the supplied editor state. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
void |
aboutAction(EventObject evt)Displays the browser about dialog. |
|
void |
compile(Object jTree, String script, int compilePhase)Rebuilds the AST tree for the selected compile phase. |
|
void |
copyAction(Object table, MouseEvent me, EventObject evt)Copies the current tooltip value to the system clipboard. |
|
void |
decompile(Object phaseId, Object source)Rebuilds the decompiled source view for the selected compile phase. |
|
void |
initAuxViews()Resets the auxiliary source views to their default placeholder text. |
|
void |
largerFont(EventObject evt)Increases the font size used by the browser views. |
|
void |
launch(Object table, Object valueCol, Object pathClosure)Opens the selected value in the object browser. |
|
void |
launchAction(Object table, Object valueCol, Object pathClosure, EventObject evt)Action handler that delegates to launch(Object, Object, Object). |
|
static void |
main(Object args)Launches the AST browser for the supplied script file. |
|
Object |
mouseListener(int valueCol, Closure pathClosure)Creates the table mouse listener used for copy and browse actions. |
|
void |
run(Closure script)Opens the browser for the supplied script producer. |
|
void |
run(Closure script, String name)Opens the browser for the supplied script producer. |
|
void |
showClosureClasses(EventObject evt)Toggles display of generated closure and lambda classes. |
|
void |
showScriptClass(EventObject evt)Toggles display of the generated script class. |
|
void |
showScriptFreeForm(EventObject evt)Toggles display of the free-form script body. |
|
void |
showTreeView(EventObject evt)Toggles visibility of the tree pane. |
|
void |
smallerFont(EventObject evt)Decreases the font size used by the browser views. |
Class loader used to capture generated bytecode for the selected phase.
Top-level browser window.
Persisted UI preferences for the browser window.
Refresh action shared by toolbar and menu items.
Display flags that control which script representations are shown.
Display flags that control which script representations are shown.
Display flags that control which script representations are shown.
Display flags that control which script representations are shown.
Swing builder used to create and update the browser UI.
Creates a browser for the supplied editor state.
inputArea - input component whose selection should track the treerootElement - root document element for the input componentclassLoader - parent class loader used for compilationconfig - optional compiler configurationDisplays the browser about dialog.
Rebuilds the AST tree for the selected compile phase.
jTree - tree component to updatescript - current source textcompilePhase - compile phase identifierCopies the current tooltip value to the system clipboard.
Rebuilds the decompiled source view for the selected compile phase.
phaseId - compile phase identifiersource - current source textResets the auxiliary source views to their default placeholder text.
Increases the font size used by the browser views.
evt - triggering event, if anyOpens the selected value in the object browser.
table - source tablevalueCol - column containing the browsable valuepathClosure - closure used to build the browser pathAction handler that delegates to launch(Object, Object, Object).
Launches the AST browser for the supplied script file.
args - command-line arguments containing the script file pathCreates the table mouse listener used for copy and browse actions.
valueCol - column index containing the browsable valuepathClosure - closure used to build the browser path for a selected rowOpens the browser for the supplied script producer.
script - closure that supplies the current script textOpens the browser for the supplied script producer.
script - closure that supplies the current script textname - optional source name displayed in the window titleToggles display of generated closure and lambda classes.
Toggles display of the generated script class.
Toggles display of the free-form script body.
Toggles visibility of the tree pane.
evt - triggering event, if anyDecreases the font size used by the browser views.
evt - triggering event, if anyCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.