|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.saic.isd.printscreen.Util
Provides a variety of static functions to support the print screen package.
Constructor Summary | |
Util()
|
Method Summary | |
static void |
copyToClipboard(java.lang.String contents)
Copies a string to the clipbaord. |
static javax.swing.text.html.HTMLDocument |
getHTMLDocument(java.lang.String convertMe)
Converts String to HTMLDocument. |
static java.lang.String |
getTextFromFile(java.io.File file)
Gets a string from a file. |
static java.io.File |
getUserHomeDirectory()
Returns a data directory for this user for saving stuff into. |
static void |
main(java.lang.String[] args)
|
static void |
preview(javax.swing.JDialog dialog,
java.lang.String printMe,
javax.swing.text.EditorKit kit)
|
static void |
previewHTML(java.awt.Component owner,
java.lang.String title,
java.lang.String printMe)
|
static void |
previewText(java.awt.Component owner,
java.lang.String title,
java.lang.String printMe)
|
static void |
print(java.lang.String printMe,
javax.swing.text.EditorKit kit)
Sends a string to the printer using the editor kit provided. |
static void |
printHtml(java.lang.String printMe)
Sends an HTML string to the printer. |
static void |
printText(java.lang.String printMe)
Sends a plain text string to the printer. |
static void |
saveToFile(java.lang.String contents,
SimpleFileFilter filter,
java.awt.Component component)
Asks the user a file name and saves a string to a file. |
static java.io.InputStream |
stringToInputStream(java.lang.String convertMe)
Converts String to InputStream. |
static void |
writeTextToFile(java.io.File file,
java.lang.String write)
Writes a String to a file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Util()
Method Detail |
public static void printHtml(java.lang.String printMe)
printMe
- String containing a complete HTML 3.2 document.public static void previewHTML(java.awt.Component owner, java.lang.String title, java.lang.String printMe)
public static void printText(java.lang.String printMe)
printMe
- Unformatted text string.public static void previewText(java.awt.Component owner, java.lang.String title, java.lang.String printMe)
public static void preview(javax.swing.JDialog dialog, java.lang.String printMe, javax.swing.text.EditorKit kit)
public static void print(java.lang.String printMe, javax.swing.text.EditorKit kit)
Note that if you pass in a DefaultEditorKit, it likely that nothing will print. Instead, use a StyledEditorKit or HTMLEditorKit.
printMe
- text to printkit
- how to printpublic static javax.swing.text.html.HTMLDocument getHTMLDocument(java.lang.String convertMe) throws java.io.IOException, javax.swing.text.BadLocationException
convertMe
- text to convert
java.io.IOException
javax.swing.text.BadLocationException
public static java.io.InputStream stringToInputStream(java.lang.String convertMe)
convertMe
- String to convert
public static java.lang.String getTextFromFile(java.io.File file) throws java.io.FileNotFoundException, java.io.IOException
file
- File to get text from.
java.io.FileNotFoundException
java.io.IOException
public static void writeTextToFile(java.io.File file, java.lang.String write) throws java.io.IOException
file
- file to write to.write
- text to write.
java.io.IOException
public static java.io.File getUserHomeDirectory()
public static void copyToClipboard(java.lang.String contents)
contents
- public static void saveToFile(java.lang.String contents, SimpleFileFilter filter, java.awt.Component component)
contents
- What to save into the file.filter
- Files to show; file type to be saved.public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |