ilog.views.appframe.docview
Class IlvDOMDocument

java.lang.Object
  extended by ilog.views.appframe.docview.IlvAbstractDocument
      extended by ilog.views.appframe.docview.IlvAbstractFileDocument
          extended by ilog.views.appframe.docview.IlvDOMDocument
All Implemented Interfaces:
IlvDocument, IlvFileDocument, IlvStreamDocument, ActionHandler, MessageListener, IlvPropertyManager, ActionListener, EventListener

public class IlvDOMDocument
extends IlvAbstractFileDocument

Defines documents that are associated with org.w3c.dom.Document instances. If an IlvDOMDocument is initialized with the initializeDocument(java.lang.Object) method, an empty org.w3c.dom.Document is created and associated with the document.
If an IlvDOMDocument is initialized from a file URL with the method readDocument(java.net.URL, ilog.views.appframe.docview.IlvFileFilter), the specified file is considered as an XML file and its content is parsed into the associated org.w3c.dom.Document instance of the document.

The DOM document associated with an IlvDOMDocument is accessed with the method getDOMDocument().


Field Summary
protected  Document document
          Stores the org.w3c.dom.Document associated with the document.
 
Fields inherited from class ilog.views.appframe.docview.IlvAbstractFileDocument
PATHNAME_PROPERTY
 
Fields inherited from class ilog.views.appframe.docview.IlvAbstractDocument
REDO_CMD, UNDO_CMD
 
Fields inherited from interface ilog.views.appframe.docview.IlvFileDocument
FILE_FILTER_PROPERTY, MRU_PROPERTY
 
Fields inherited from interface ilog.views.appframe.docview.IlvDocument
APPLICATION_PROPERTY, ATTACHED_DOCUMENTS_PROPERTY, DOCUMENT_OWNER_PROPERTY, DOCUMENT_TEMPLATE_PROPERTY, EDITABLE_PROPERTY, MODIFIED_PROPERTY, SAVEABLE_PROPERTY, TITLE_PROPERTY
 
Fields inherited from interface ilog.views.appframe.docview.IlvDocument
APPLICATION_PROPERTY, ATTACHED_DOCUMENTS_PROPERTY, DOCUMENT_OWNER_PROPERTY, DOCUMENT_TEMPLATE_PROPERTY, EDITABLE_PROPERTY, MODIFIED_PROPERTY, SAVEABLE_PROPERTY, TITLE_PROPERTY
 
Constructor Summary
IlvDOMDocument()
          Creates a new IlvDOMDocument.
 
Method Summary
 Document getDOMDocument()
          Returns the DOM document associated with this document.
 boolean initializeDocument(Object userData)
          Initializes a new empty DOM document.
 boolean readDocument(URL url, IlvFileFilter filter)
          Parses the XML file with the specified URL and sets the resulting org.w3c.dom.Document to the document.
 boolean writeDocument(Writer writer, IlvFileFilter filter)
          Writes document data to the specified writer.
 
Methods inherited from class ilog.views.appframe.docview.IlvAbstractFileDocument
activated, getFileDocumentTemplate, getPathName, readDocument, readStreamDocument, setPathName, writeDocument, writeStreamDocument
 
Methods inherited from class ilog.views.appframe.docview.IlvAbstractDocument
actionPerformed, addActionHandler, addEdit, addPropertyChangeListener, addView, attachDocument, canRedo, canUndo, clean, documentClosed, documentClosing, getActiveView, getApplication, getDocumentTemplate, getProperty, getTitle, getUndoManager, getView, getViewCount, getViews, isModified, isProcessingAction, notifyViews, receiveMessage, redo, registerMappings, removeActionHandler, removePropertyChangeListener, removeView, removeViews, setApplication, setModified, setProperty, setTitle, undo, updateAction, updateModificationState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ilog.views.appframe.docview.IlvDocument
addView, clean, documentClosed, documentClosing, getApplication, getDocumentTemplate, getTitle, getView, getViewCount, isModified, removeView, removeViews, setModified, setTitle
 
Methods inherited from interface ilog.views.appframe.event.ActionHandler
isProcessingAction, updateAction
 
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
 
Methods inherited from interface ilog.views.appframe.event.MessageListener
receiveMessage
 
Methods inherited from interface ilog.views.appframe.util.IlvPropertyManager
addPropertyChangeListener, getProperty, removePropertyChangeListener, setProperty
 
Methods inherited from interface ilog.views.appframe.docview.IlvDocument
addView, clean, documentClosed, documentClosing, getApplication, getDocumentTemplate, getTitle, getView, getViewCount, isModified, removeView, removeViews, setModified, setTitle
 
Methods inherited from interface ilog.views.appframe.event.ActionHandler
isProcessingAction, updateAction
 
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
 
Methods inherited from interface ilog.views.appframe.event.MessageListener
receiveMessage
 
Methods inherited from interface ilog.views.appframe.util.IlvPropertyManager
addPropertyChangeListener, getProperty, removePropertyChangeListener, setProperty
 

Field Detail

document

protected Document document
Stores the org.w3c.dom.Document associated with the document.

Constructor Detail

IlvDOMDocument

public IlvDOMDocument()
Creates a new IlvDOMDocument.

Method Detail

initializeDocument

public boolean initializeDocument(Object userData)
Initializes a new empty DOM document. Creates an empty DOM Document.

Specified by:
initializeDocument in interface IlvDocument
Overrides:
initializeDocument in class IlvAbstractDocument
Parameters:
userData - The user data to initialize the document with - can be null. This parameter comes from the user data parameter given to the application methods: This parameter is not used.
Returns:
true if an empty org.w3c.dom.Document could be initialized; false otherwise.
See Also:
IlvApplication.newDocument(java.lang.Object, boolean), IlvApplication.newDocument(), IlvApplication.newDocument(IlvDocumentTemplate, boolean, Object), getDOMDocument()

writeDocument

public boolean writeDocument(Writer writer,
                             IlvFileFilter filter)
Writes document data to the specified writer. By default, this method does nothing. It should be overridden to perform any writing.

Overrides:
writeDocument in class IlvAbstractFileDocument
Parameters:
writer - The writer to write the data of the document to.
filter - The file filter that indicates the format to use for writing the data.
Returns:
true if the document could write its data; false otherwise.
See Also:
IlvAbstractFileDocument.writeDocument(java.net.URL, IlvFileFilter)

readDocument

public boolean readDocument(URL url,
                            IlvFileFilter filter)
Parses the XML file with the specified URL and sets the resulting org.w3c.dom.Document to the document.

Specified by:
readDocument in interface IlvFileDocument
Overrides:
readDocument in class IlvAbstractFileDocument
Parameters:
url - The XML file URL to read the DOM from.
filter - The file filter that indicates the format to use for reading the data.
Returns:
true if the XML file could be parsed; false otherwise.
See Also:
IlvAbstractFileDocument.writeDocument(java.io.Writer, ilog.views.appframe.docview.IlvFileFilter)

getDOMDocument

public Document getDOMDocument()
Returns the DOM document associated with this document.



Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.