com.darwinsys.notepad
Class Notepad
java.lang.Object
com.darwinsys.notepad.Notepad
public class Notepad
- extends java.lang.Object
Simple text editor, relying heavily on the Swing JTextArea.
Is it MVC? Well, the JTextArea is the Model, the
Actions are Controllers, and the rest is View.
|
Field Summary |
protected boolean |
dirty
|
protected java.util.prefs.Preferences |
prefsNode
|
|
Constructor Summary |
Notepad()
|
Notepad(boolean isStandalone)
|
Notepad(java.util.prefs.Preferences prefs)
|
Notepad(java.util.prefs.Preferences prefs,
boolean isStandalone)
|
|
Method Summary |
void |
doLoad(java.io.File file)
|
void |
doLoad(java.lang.String fileName)
|
void |
doNew()
|
void |
doPrint()
Print a file by name |
void |
doSave(java.io.File file)
Save the file to disk, in such a way as to map the UNIX
line-endings used inside JTextArea to the correct
platform-specific line endings as generated by println(). |
void |
doSave(java.lang.String fileName)
Thin wrapper for doSave(File). |
javax.swing.JMenu |
getFileMenu()
|
javax.swing.JMenu |
getHelpMenu()
|
boolean |
isDirty()
|
void |
setDirty(boolean dirty)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
dirty
protected boolean dirty
prefsNode
protected java.util.prefs.Preferences prefsNode
Notepad
public Notepad()
Notepad
public Notepad(boolean isStandalone)
Notepad
public Notepad(java.util.prefs.Preferences prefs)
Notepad
public Notepad(java.util.prefs.Preferences prefs,
boolean isStandalone)
doPrint
public final void doPrint()
throws java.io.IOException,
javax.print.PrintException
- Print a file by name
- Throws:
java.io.IOException
javax.print.PrintException
doNew
public final void doNew()
doLoad
public final void doLoad(java.io.File file)
throws java.io.IOException
- Throws:
java.io.IOException
doLoad
public final void doLoad(java.lang.String fileName)
throws java.io.IOException
- Throws:
java.io.IOException
doSave
public final void doSave(java.lang.String fileName)
throws java.io.IOException
- Thin wrapper for doSave(File).
- Parameters:
fileName -
- Throws:
java.io.IOException
doSave
public final void doSave(java.io.File file)
throws java.io.IOException
- Save the file to disk, in such a way as to map the UNIX
line-endings used inside JTextArea to the correct
platform-specific line endings as generated by println().
- Parameters:
file -
- Throws:
java.io.IOException
isDirty
public final boolean isDirty()
setDirty
public final void setDirty(boolean dirty)
getFileMenu
public javax.swing.JMenu getFileMenu()
getHelpMenu
public javax.swing.JMenu getHelpMenu()
Copyright © 1996-2004 Ian F. Darwin. See license.html for usage license.