|
UTJML | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.utep.cs.utjml.gui.JmlEditor
public class JmlEditor
A simple JML/Java source code editor that supports syntax
hightligting. The class is adapted from the demo programs of the
package com.Ostermiller.Syntax written by
Stephen Ostermiller (http://ostermiller.org).
| Field Summary | |
|---|---|
protected edu.utep.cs.utjml.gui.JmlEditor.Colorer |
colorer
A thread that handles the actual coloring. |
protected edu.utep.cs.utjml.gui.JmlEditor.HighLightedDocument |
document
The styled document that is the model for the textPane |
protected edu.utep.cs.utjml.gui.JmlEditor.DocumentReader |
documentReader
A reader wrapped around the document so that the document can be fed into the lexer. |
protected Lexer |
syntaxLexer
The lexer that tells us what colors different words should be. |
protected JTextPane |
textPane
The place where the text is drawn. |
| Constructor Summary | |
|---|---|
JmlEditor(Mainable utjml,
edu.utep.cs.utjml.gui.ActionFactory af)
Create a new JML editor. |
|
| Method Summary | |
|---|---|
void |
color(int position,
int adjustment)
Color a section of the document. |
void |
colorAll()
Color or recolor the entire document |
void |
highlight(String filename,
int line)
Highlights the specified line of the given file. |
void |
highlight(String filename,
int line,
int col)
Highlights the specified column of the given file. |
boolean |
isDirty()
Returns true if there exist unsaved edits. |
boolean |
newDocument()
Creates a new empty document. |
boolean |
openFile(File file)
Opens the given file file for editing. |
boolean |
saveFile(File file)
Saves the contents of the editor buffer to the given file file. |
JTextPane |
textPane()
Returns the text pane of this editor. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected JTextPane textPane
protected edu.utep.cs.utjml.gui.JmlEditor.HighLightedDocument document
protected edu.utep.cs.utjml.gui.JmlEditor.DocumentReader documentReader
protected Lexer syntaxLexer
protected edu.utep.cs.utjml.gui.JmlEditor.Colorer colorer
| Constructor Detail |
|---|
public JmlEditor(Mainable utjml,
edu.utep.cs.utjml.gui.ActionFactory af)
| Method Detail |
|---|
public JTextPane textPane()
public boolean isDirty()
isDirty in interface Editorablepublic boolean newDocument()
newDocument in interface Editorablepublic boolean openFile(File file)
file for editing. The
contents of the file are read into the editing buffer by
creating a new document for that.
openFile in interface Editorablepublic boolean saveFile(File file)
file.
saveFile in interface Editorable
public void highlight(String filename,
int line,
int col)
highlight in interface Editorable
public void highlight(String filename,
int line)
highlight in interface Editorablepublic void colorAll()
public void color(int position,
int adjustment)
position - the starting point for the coloring.adjustment - amount of text inserted or removed
at the starting point.
|
UTJML | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||