gov.sns.application.demo
Class MyDocument

java.lang.Object
  |
  +--gov.sns.application.XalDocument
        |
        +--gov.sns.application.demo.MyDocument
All Implemented Interfaces:
java.awt.print.Pageable

public class MyDocument
extends XalDocument

MyDocument is a custom XalDocument for my application. Each document instance manages a single plain text document. The document manages the data that is displayed in the window.


Field Summary
protected  javax.swing.text.PlainDocument textDocument
          The document for the text pane in the main window.
 
Fields inherited from class gov.sns.application.XalDocument
documentListenerProxy, hasChanges, mainWindow, messageCenter, NO_OPTION, source, title, YES_OPTION
 
Fields inherited from interface java.awt.print.Pageable
UNKNOWN_NUMBER_OF_PAGES
 
Constructor Summary
MyDocument()
          Create a new empty document
MyDocument(java.net.URL url)
          Create a new document loaded from the URL file
 
Method Summary
 void makeMainWindow()
          Make a main window by instantiating the my custom window.
 void saveDocumentAs(java.net.URL url)
          Save the document to the specified URL.
 
Methods inherited from class gov.sns.application.XalDocument
addXalDocumentListener, closeDocument, customizeCommands, displayConfirmDialog, displayError, displayError, displayError, displayWarning, displayWarning, displayWarning, freeCustomResources, freeResources, generateDocumentTitle, getCustomMenuDefinitionPath, getDisplayFilePath, getEmptyDocumentPath, getMainWindow, getNumberOfPages, getPageFormat, getPrintable, getSource, getTitle, hasChanges, hideDocument, isEmpty, registerEvents, removeXalDocumentListener, saveDocument, setHasChanges, setSource, setTitle, showDocument, warnUserOfUnsavedChangesWhenClosing, willClose, writableDocumentTypes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

textDocument

protected javax.swing.text.PlainDocument textDocument
The document for the text pane in the main window.

Constructor Detail

MyDocument

public MyDocument()
Create a new empty document


MyDocument

public MyDocument(java.net.URL url)
Create a new document loaded from the URL file

Parameters:
url - The URL of the file to load into the new document.
Method Detail

makeMainWindow

public void makeMainWindow()
Make a main window by instantiating the my custom window. Set the text pane to use the textDocument variable as its document.

Specified by:
makeMainWindow in class XalDocument

saveDocumentAs

public void saveDocumentAs(java.net.URL url)
Save the document to the specified URL.

Specified by:
saveDocumentAs in class XalDocument
Parameters:
url - The URL to which the document should be saved.