|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JScrollPane visad.util.TextEditor visad.util.CodeEditor
public abstract class CodeEditor
An editor for writing and executing source code in Java runtime.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JScrollPane |
---|
JScrollPane.AccessibleJScrollPane, JScrollPane.ScrollBar |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected JTextArea |
lineNumbers
text pane containing line numbers |
protected int |
numDigits
number of digits in lines of code in the document |
protected int |
numLines
number of lines of code in the document |
Fields inherited from class visad.util.TextEditor |
---|
changed, currentFile, DEBUG, MONO, text, undo |
Fields inherited from class javax.swing.JScrollPane |
---|
columnHeader, horizontalScrollBar, horizontalScrollBarPolicy, lowerLeft, lowerRight, rowHeader, upperLeft, upperRight, verticalScrollBar, verticalScrollBarPolicy, viewport |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
CodeEditor()
constructs a CodeEditor |
|
CodeEditor(String filename)
constructs a CodeEditor containing text from the given filename |
Method Summary | |
---|---|
abstract void |
compile()
compiles the source code to a Java class |
abstract void |
exec(String line)
executes the given line of code immediately in Java runtime |
void |
highlightLine(int line)
highlights the given line of code in the document |
void |
redo()
redoes the last undone edit |
abstract void |
run()
executes the source code in Java runtime |
void |
undo()
undoes the last edit |
void |
undoableEditHappened(UndoableEditEvent e)
updates line numbers when undoable action occurs |
protected void |
updateLineNumbers()
updates line numbers to match document text |
Methods inherited from class visad.util.TextEditor |
---|
addUndoableEditListener, canRedo, canUndo, copy, cut, doMakeFileChooser, getFile, getFileChooser, getFilename, getRedoName, getText, getTextComponent, getUndoName, hasChanged, insertText, newFile, openDialog, openFile, openFile, paste, removeUndoableEditListener, saveDialog, saveFile, saveFile, saveFile, setText |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected JTextArea lineNumbers
protected int numLines
protected int numDigits
Constructor Detail |
---|
public CodeEditor()
public CodeEditor(String filename)
Method Detail |
---|
public void highlightLine(int line)
public abstract void run() throws VisADException
VisADException
public abstract void compile() throws VisADException
VisADException
public abstract void exec(String line) throws VisADException
VisADException
protected void updateLineNumbers()
public void undo() throws CannotUndoException
undo
in class TextEditor
CannotUndoException
public void redo() throws CannotRedoException
redo
in class TextEditor
CannotRedoException
public void undoableEditHappened(UndoableEditEvent e)
undoableEditHappened
in interface UndoableEditListener
undoableEditHappened
in class TextEditor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |