JET

edu.utep.cs.jet.gui.editor
Interface Editor

All Known Implementing Classes:
DefaultEditor, LineNumberedEditor

public interface Editor

An interface to the built-in editor that can edit a single document at a time. This interface provides APIs for:

Author:
Yoonsik Cheon

Method Summary
 void addFileChangeListener(FileChangeListener l)
          Registers the given file change listener.
 void addLineChangeListener(LineChangeListener l)
          Registers the given line change listener.
 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.
 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 column)
          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)
          Associates 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.
 

Method Detail

newDocument

boolean newDocument()
Creates a new empty document and returns true if the creation was successful. The created document is not associated with an external file.


openFile

boolean openFile(File file)
Opens the given 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.


saveFile

boolean saveFile(File file)
Saves the document of this editor to the given file file, and returns true if it was successfully saved.


isDirty

boolean isDirty()
Returns true if there exist any unsaved edits.


highlight

void highlight(int line,
               int column)
Highlights the specified line and column.


highlight

void highlight(int line)
Highlights the specified line.


getView

JComponent getView()
Returns the view of this editor.


getOptionPanel

OptionPanel getOptionPanel()
Returns the option panel of this editor.


setDropTarget

void setDropTarget(DropTarget dropTarget)
Associates a DropTarget with this editor so that the editor receives drops.


setHideViewAction

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.


addFileChangeListener

void addFileChangeListener(FileChangeListener l)
Registers the given file change listener.


addLineChangeListener

void addLineChangeListener(LineChangeListener l)
Registers the given line change listener.


getCopy

Action getCopy()
Returns the copy action of this editor. Initially the action is disabled; it is enabled whenever something is selected in the editor.


getCut

Action getCut()
Returns the cut action of this editor. Initially the action is disabled,; it is enabled whenever something is selected in the editor.


getPaste

Action getPaste()
Returns the action for paste menu item. Initially the action is disabled, and gets enabled whenever something is copied or cut by the editor.


getDelete

Action getDelete()
Returns the action for delete menu item. Initially the action is disabled, and gets enabled whenever something is selected on the editor.


getUndo

Action getUndo()
Returns the undo action of this editor. Initially the action is disabled.


getRedo

Action getRedo()
Returns the redo action of this editor. Initially the action is disabled.


getFind

Action getFind()
Returns the find action of this editor.


getGoto

Action getGoto()
Returns the goto action of this editor.


JET

JET is Copyright (C) 2005-2008 by The University of Texas at El Paso and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.