Top Description Inners Fields Constructors Methods
org.codehaus.groovy.antlr

public Class LexerFrame

extends JFrame
implements ActionListener
Class Inheritance
All Implemented Interfaces
java.awt.event.ActionListener, java.util.EventListener
Annotations
@Deprecated
Imports
antlr.Token, org.apache.groovy.parser.antlr4.GroovyLangLexer, org.codehaus.groovy.antlr.java.JavaLexer, .JavaTokenTypes, org.codehaus.groovy.antlr.parser.GroovyLexer, .GroovyTokenTypes, org.codehaus.groovy.control.CompilerConfiguration, org.codehaus.groovy.runtime.IOGroovyMethods, .ResourceGroovyMethods, javax.swing.AbstractAction, .Action, .BorderFactory, .ButtonGroup, .JButton, .JComponent, .JFileChooser, .JFrame, .JLabel, .JPanel, .JPopupMenu, .JScrollPane, .JSplitPane, .JTextArea, .JTextPane, .JToggleButton, .UIManager, .WindowConstants, javax.swing.border.Border, javax.swing.text.BadLocationException, java.awt.BorderLayout, .Dimension, .Insets, java.awt.event.ActionEvent, .ActionListener, .MouseAdapter, .MouseEvent, java.io.File, .FileReader, .Reader, .StringReader, java.lang.reflect.Constructor, .Field, .InvocationTargetException, .Modifier, java.util.HashMap, .Map

Deprecated

org.apache.groovy.antlr.LexerFrame instead

Swing application to graphically display the tokens produced by the lexer.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final JButton
private final JScrollPane
private final JScrollPane
private final JSplitPane
private final Class<T>
private final Action
private final JPanel
private final JTextArea
private static final long
private final JTextPane
private final Map<Integer, String>
Inherited from javax.swing.JFrame:
accessibleContextrootPanerootPaneCheckingEnabled

Constructor Summary

AccessConstructor and Description
public
LexerFrame(Class<T>
the lexer class to use
lexerClass
,
Class<T>
the lexer token types class
tokenTypesClass
)

Constructor used when invoking as a standalone application

public
LexerFrame(Class<T>
the lexer class to use
lexerClass
,
Class<T>
the lexer token types class
tokenTypesClass
,
Reader reader)

Constructor used when invoking for a specific file

Method Summary

Modifier and TypeMethod and Description
public void
actionPerformed(ActionEvent
the event to be processed
ae
)

Implements java.awt.event.ActionListener.actionPerformed.

Invoked when an action occurs.
private Integer
eof()

private Integer
public static LexerFrame

Returns:

the new frame rending the parsed tokens
groovyScriptFactory
(String
the Groovy source file to parse/render
scriptText
)

Deprecated as a consequence of LexerFrame being deprecated.
Creates a Groovy language LexerFrame for the given script text
private void
private Object
invokeMethod(Object obj, String methodName)

private boolean
private void
jbInit(Reader reader)

private void
listTokens(Class<T> tokenTypes)

public static void
main(String[] args)

private void
private void
private void
scanScript(final StringReader reader)

Inherited from javax.swing.JFrame:
addImplcreateRootPaneframeInitgetAccessibleContextgetContentPanegetDefaultCloseOperationgetGlassPanegetGraphicsgetJMenuBargetLayeredPanegetRootPanegetTransferHandlerisDefaultLookAndFeelDecoratedisRootPaneCheckingEnabledparamStringprocessWindowEventremoverepaintsetContentPanesetDefaultCloseOperationsetDefaultLookAndFeelDecoratedsetGlassPanesetIconImagesetJMenuBarsetLayeredPanesetLayoutsetRootPanesetRootPaneCheckingEnabledsetTransferHandlerupdate

Field Detail

jbuttonback to summary
private final JButton jbutton
jScrollPane1back to summary
private final JScrollPane jScrollPane1
jScrollPane2back to summary
private final JScrollPane jScrollPane2
jSplitPane1back to summary
private final JSplitPane jSplitPane1
lexerClassback to summary
private final Class<T> lexerClass
loadFileActionback to summary
private final Action loadFileAction
mainPanelback to summary
private final JPanel mainPanel
scriptPaneback to summary
private final JTextArea scriptPane
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.awt.Frame.serialVersionUID.

tokenPaneback to summary
private final JTextPane tokenPane
tokensback to summary
private final Map<Integer, String> tokens

Constructor Detail

LexerFrameback to summary
public LexerFrame(Class<T> lexerClass, Class<T> tokenTypesClass)

Constructor used when invoking as a standalone application

Parameters
lexerClass:Class<T>

the lexer class to use

tokenTypesClass:Class<T>

the lexer token types class

LexerFrameback to summary
public LexerFrame(Class<T> lexerClass, Class<T> tokenTypesClass, Reader reader)

Constructor used when invoking for a specific file

Parameters
lexerClass:Class<T>

the lexer class to use

tokenTypesClass:Class<T>

the lexer token types class

Method Detail

actionPerformedback to summary
public void actionPerformed(ActionEvent ae)

Implements java.awt.event.ActionListener.actionPerformed.

Doc from java.awt.event.ActionListener.actionPerformed.

Invoked when an action occurs.

Parameters
ae:ActionEvent

the event to be processed

eofback to summary
private Integer eof()
getColumnback to summary
private Integer getColumn(Object token) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException
groovyScriptFactoryback to summary
public static LexerFrame groovyScriptFactory(String scriptText)

Deprecated

as a consequence of LexerFrame being deprecated. See corresponding docs for further information.

Creates a Groovy language LexerFrame for the given script text

Parameters
scriptText:String

the Groovy source file to parse/render

Returns:LexerFrame

the new frame rending the parsed tokens

insertComponentback to summary
private void insertComponent(JComponent comp)
invokeMethodback to summary
private Object invokeMethod(Object obj, String methodName) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException
isParrotLexerback to summary
private boolean isParrotLexer()
jbInitback to summary
private void jbInit(Reader reader) throws Exception
listTokensback to summary
private void listTokens(Class<T> tokenTypes) throws Exception
mainback to summary
public static void main(String[] args) throws Exception
safeScanScriptback to summary
private void safeScanScript(File file)
safeScanScriptback to summary
private void safeScanScript(Reader reader)
scanScriptback to summary
private void scanScript(final StringReader reader) throws Exception
org.codehaus.groovy.antlr back to summary

private Class LexerFrame.HScrollableTextPane

extends JTextPane
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public boolean
getScrollableTracksViewportWidth()

Overrides javax.swing.JEditorPane.getScrollableTracksViewportWidth.

Implements javax.swing.Scrollable.getScrollableTracksViewportWidth.

Returns true if a viewport should always force the width of this Scrollable to match the width of the viewport.
public void
setSize(final Dimension
the dimension specifying the new size of this component
d
)

Overrides java.awt.Component.setSize.

Resizes this component so that it has width d.width and height d.height.
Inherited from javax.swing.JTextPane:
addStylecreateDefaultEditorKitgetCharacterAttributesgetInputAttributesgetLogicalStylegetParagraphAttributesgetStylegetStyledDocumentgetStyledEditorKitgetUIClassIDinsertComponentinsertIconparamStringremoveStylereplaceSelectionsetCharacterAttributessetDocumentsetEditorKitsetLogicalStylesetParagraphAttributessetStyledDocument

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.awt.Container.serialVersionUID.

Constructor Detail

HScrollableTextPaneback to summary
private HScrollableTextPane()

Method Detail

getScrollableTracksViewportWidthback to summary
public boolean getScrollableTracksViewportWidth()

Overrides javax.swing.JEditorPane.getScrollableTracksViewportWidth.

Implements javax.swing.Scrollable.getScrollableTracksViewportWidth.

Doc from javax.swing.JEditorPane.getScrollableTracksViewportWidth.

Returns true if a viewport should always force the width of this Scrollable to match the width of the viewport.

Returns:boolean

true if a viewport should force the Scrollables width to match its own, false otherwise

Annotations
@Override
setSizeback to summary
public void setSize(final Dimension d)

Overrides java.awt.Component.setSize.

Doc from java.awt.Component.setSize.

Resizes this component so that it has width d.width and height d.height.

This method changes layout-related information, and therefore, invalidates the component hierarchy.

Parameters
d:Dimension

the dimension specifying the new size of this component

Annotations
@Override