ilog.views.appframe.docview
Class IlvAbstractFileDocument

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

public class IlvAbstractFileDocument
extends IlvAbstractDocument
implements IlvFileDocument, IlvStreamDocument

An implementation of the file document interface to serve as a basis for implementing various kinds of file documents.


Field Summary
static String PATHNAME_PROPERTY
          Bound property name for storing the pathname of a document.
 
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
IlvAbstractFileDocument()
          Constructs a new IlvAbstractFileDocument.
 
Method Summary
 void activated(boolean active)
          Invoked when a view of the document has been activated or deactivated, depending on the value of the active parameter.
protected  IlvFileDocumentTemplate getFileDocumentTemplate()
          Returns the template that has created this file document.
 URL getPathName()
          Returns the path of the document.
protected  boolean readDocument(Reader reader, IlvFileFilter filter)
          Reads document data from the specified reader.
 boolean readDocument(URL url, IlvFileFilter filter)
          Initializes the document data from the specified file url.
 boolean readStreamDocument(Reader reader, IlvFileFilter filter)
          Initializes the document data from the specified reader.
 void setPathName(URL path)
          Sets the path of the document.
 boolean writeDocument(URL url, IlvFileFilter filter)
          Stores the document data in the file with the specified url.
 boolean writeDocument(Writer writer, IlvFileFilter filter)
          Writes the document data to the the specified writer.
 boolean writeStreamDocument(Writer writer, IlvFileFilter filter)
          Stores the document data with the specified writer.
 
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, initializeDocument, 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, initializeDocument, 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, initializeDocument, 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

PATHNAME_PROPERTY

public static final String PATHNAME_PROPERTY
Bound property name for storing the pathname of a document.

See Also:
Constant Field Values
Constructor Detail

IlvAbstractFileDocument

public IlvAbstractFileDocument()
Constructs a new IlvAbstractFileDocument.

Method Detail

getPathName

public URL getPathName()
Returns the path of the document.

Specified by:
getPathName in interface IlvFileDocument
Returns:
The path of the document or null if the document is not associated with a file.
See Also:
setPathName(java.net.URL)

setPathName

public void setPathName(URL path)
Sets the path of the document. This method must not be invoked explicitly. It is called by the document template after the document has read its data from a file or after the document has saved its data in a new specified pathname.

Specified by:
setPathName in interface IlvFileDocument
See Also:
getPathName()

readDocument

public boolean readDocument(URL url,
                            IlvFileFilter filter)
Initializes the document data from the specified file url. By default, a reader is created from the specified URL and is given as the parameter to the readDocument(Reader, IlvFileFilter) method.

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

readStreamDocument

public boolean readStreamDocument(Reader reader,
                                  IlvFileFilter filter)
Initializes the document data from the specified reader. By default, the readDocument(Reader, IlvFileFilter) method is invoked with the reader as the parameter.

Specified by:
readStreamDocument in interface IlvStreamDocument
Parameters:
reader - The reader to use for reading the document data.
filter - The file filter that indicates the format to use for reading the data.
Returns:
true if the document could read its data; false otherwise.
See Also:
writeStreamDocument(java.io.Writer, ilog.views.appframe.docview.IlvFileFilter)

readDocument

protected boolean readDocument(Reader reader,
                               IlvFileFilter filter)
Reads document data from the specified reader. This method is invoked either by the readDocument(java.net.URL, IlvFileFilter) or by the readStreamDocument(Reader, IlvFileFilter) method. By default, the implementation of this method is empty.

Parameters:
reader - The reader from which the document data is read.
filter - The file filter that indicates the format to use for reading the data.
Returns:
true if the document could read its data; false otherwise.
See Also:
readDocument(java.net.URL, IlvFileFilter)

writeDocument

public boolean writeDocument(Writer writer,
                             IlvFileFilter filter)
Writes the document data to the the specified writer. This method is invoked either by the writeDocument(java.net.URL, IlvFileFilter) or by the writeStreamDocument(Writer, IlvFileFilter) method. By default, the implementation of this method is empty.

Parameters:
writer - The writer to which the data of the document is written.
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:
writeDocument(java.net.URL, IlvFileFilter)

writeDocument

public boolean writeDocument(URL url,
                             IlvFileFilter filter)
Stores the document data in the file with the specified url. By default, a writer is created from the specified URL and given as the parameter to the writeDocument(Writer, IlvFileFilter) method.

Specified by:
writeDocument in interface IlvFileDocument
Parameters:
url - The URL of the file to which the data is written.
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:
writeDocument(Writer, IlvFileFilter)

writeStreamDocument

public boolean writeStreamDocument(Writer writer,
                                   IlvFileFilter filter)
Stores the document data with the specified writer. By default, the writeDocument(Writer, IlvFileFilter) method is invoked with the writer as the parameter.

Specified by:
writeStreamDocument in interface IlvStreamDocument
Parameters:
writer - The writer to use for writing the document data.
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:
writeDocument(Writer, IlvFileFilter)

activated

public void activated(boolean active)
Invoked when a view of the document has been activated or deactivated, depending on the value of the active parameter.

Specified by:
activated in interface IlvDocument
Overrides:
activated in class IlvAbstractDocument
Parameters:
active - If true, the document has been activated; otherwise, the document has been deactivated.

getFileDocumentTemplate

protected IlvFileDocumentTemplate getFileDocumentTemplate()
Returns the template that has created this file document.

Returns:
The file document template, which is the same document template as the one returned by the method IlvDocument.getDocumentTemplate().


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