|
JET | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.utep.cs.jet.gui.editor.DefaultEditor
public class DefaultEditor
A simple source code editor that support single document editing and primitive syntax hightligting.
| Constructor Summary | |
|---|---|
DefaultEditor()
Create a new JML editor. |
|
| Method Summary | |
|---|---|
void |
addFileChangeListener(FileChangeListener l)
Registers the given file change listener. |
void |
addLineChangeListener(LineChangeListener l)
Registers the given line change listener. |
protected JTextPane |
createTextPane(DefaultStyledDocument doc)
Creates a new text pane. |
SyntaxDocument |
document()
Returns the document being edited. |
Action |
getCopy()
Returns the copy action of this editor. |
Action |
getCut()
Returns the cut action of this editor. |
Action |
getDelete()
Returns the action for delete menu item. |
Action |
getFind()
Returns the find action of this editor. |
Action |
getGoto()
Returns the goto action of this editor. |
protected ImageIcon |
getIcon(String name)
Returns an image icon whose image is read from the file named name. |
OptionPanel |
getOptionPanel()
Returns the option panel of this editor. |
Action |
getPaste()
Returns the action for paste menu item. |
Action |
getRedo()
Returns the redo action of this editor. |
Action |
getUndo()
Returns the undo action of this editor. |
JComponent |
getView()
Returns the view of this editor. |
void |
highlight(int line)
Highlights the specified line. |
void |
highlight(int line,
int col)
Highlights the specified line and column. |
boolean |
isDirty()
Returns true if there exist any unsaved edits. |
boolean |
newDocument()
Creates a new empty document and returns true if the creation was successful. |
boolean |
openFile(File file)
Opens the given file file using this editor, and
returns true if the file was successfully opened. |
boolean |
saveFile(File file)
Saves the document of this editor to the given file file, and returns true if it was successfully
saved. |
void |
setDropTarget(DropTarget dropTarget)
Associate a DropTarget with this editor so that the editor receives drops. |
void |
setHideViewAction(AbstractAction action)
Given the action that hides this editor's view, provides an appropriate user interface for it, such as a popup menu. |
void |
setPopupOptions()
Set right click pop-up options. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultEditor()
| Method Detail |
|---|
public void setPopupOptions()
public void setDropTarget(DropTarget dropTarget)
setDropTarget in interface Editorpublic JComponent getView()
getView in interface Editorpublic OptionPanel getOptionPanel()
getOptionPanel in interface Editorpublic void setHideViewAction(AbstractAction action)
setHideViewAction in interface Editorpublic boolean isDirty()
isDirty in interface Editorpublic boolean newDocument()
newDocument in interface Editorpublic boolean openFile(File file)
file using this editor, and
returns true if the file was successfully opened. The contents
of the file are read into the editing buffer (i.e., document)
of this editor.
openFile in interface Editorpublic boolean saveFile(File file)
file, and returns true if it was successfully
saved.
saveFile in interface Editor
public void highlight(int line,
int col)
highlight in interface Editorpublic void highlight(int line)
highlight in interface Editorpublic void addFileChangeListener(FileChangeListener l)
addFileChangeListener in interface Editorpublic void addLineChangeListener(LineChangeListener l)
addLineChangeListener in interface Editorpublic Action getCopy()
getCopy in interface EditorgetCaretListener()public Action getCut()
getCut in interface EditorgetCaretListener()public Action getPaste()
getPaste in interface Editorpublic Action getDelete()
getDelete in interface EditorgetCaretListener()public Action getUndo()
getUndo in interface Editorpublic Action getRedo()
getRedo in interface Editorpublic Action getFind()
getFind in interface Editorpublic Action getGoto()
getGoto in interface Editorpublic SyntaxDocument document()
protected JTextPane createTextPane(DefaultStyledDocument doc)
protected ImageIcon getIcon(String name)
name. A null is returned if reading the file fails.
|
JET | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||