Class JtvEditWindow
public class JtvEditWindow
extends JtvWindow
A window containing a JtvFileEditor together with horizontal and vertical scroll bars and a JtvIndicator.
JtvEditWindow constructs all required subviews in its constructor and associates
them with the editor. The window title is derived from the editor's file name, or
"Untitled" when no file name has been set.
When the file name changes (because of a cmSaveAs operation) the editor
broadcasts cmUpdateTitle; this window's handleEvent refreshes the
window frame title in response.
org.viktor44.jtvision.editors.JtvEditWindow
Summary
Constructors
| Visibility | Signature |
|---|---|
| public | JtvEditWindow(JtvRect bounds, String fileName, int number) |
Fields
| Modifiers | Field name | Type |
|---|---|---|
| private static final | clipboardTitle | String |
| private static final | untitled | String |
| private | editor | org.viktor44.jtvision.editors.JtvFileEditor |
Methods
| Modifiers | Method signature | Return type |
|---|---|---|
| public | close() | void |
| public | getTitle(int maxSize) | String |
| public | handleEvent(JtvEvent event) | void |
| public | getMinimumSize() | org.viktor44.jtvision.core.JtvPoint |
| public | getEditor() | org.viktor44.jtvision.editors.JtvFileEditor |
Constructors
JtvEditWindow(JtvRect bounds, String fileName, int number)
Constructs an editor window, creating and inserting horizontal and vertical scroll bars,
a position indicator, and a JtvFileEditor that covers the interior of the window
frame. If fileName is non-empty the editor immediately loads that file.
Parameters
bounds- the bounding rectangle for the windowfileName- path of the file to edit, or empty/null for a new untitled filenumber- window number (displayed in the title bar and used by Alt+nswitching)
Fields
String clipboardTitle
Window title used when the editor is acting as the clipboard (not used by default).
String untitled
Window title shown when no file name has been assigned.
org.viktor44.jtvision.editors.JtvFileEditor editor
The embedded file editor view. All text editing is performed by this object.
Methods
close()
Overrides:
close() in org.viktor44.jtvision.views.JtvWindow
Closes the window only if the editor allows it (i.e. JtvFileEditor.valid(int)
returns true, which may prompt the user to save unsaved changes).
getTitle(int maxSize)
Overrides:
getTitle(int maxSize) in org.viktor44.jtvision.views.JtvWindow
Returns the window title derived from the editor's file name, or "Untitled"
if no file name has been set. The returned string is truncated to maxSize
characters if necessary.
Parameters
maxSize- maximum length of the returned title string
Returns
the window title
handleEvent(JtvEvent event)
Overrides:
handleEvent(JtvEvent event) in org.viktor44.jtvision.views.JtvWindow
Handles events for the editor window. Delegates to the inherited window handler,
then responds to the cmUpdateTitle broadcast by refreshing the window title
(emitted by the editor when the file name changes after a Save As operation).
Parameters
event- the event to handle
getMinimumSize()
Returns the minimum and maximum size constraints for this editor window. The minimum is 30 columns × 10 rows to ensure the editor and scroll bars remain usable.
Parameters
min- receives the minimum allowable sizemax- receives the maximum allowable size
getEditor()
The embedded file editor view. All text editing is performed by this object.