com.japisoft.xmlpad
Class XMLDocumentInfo

java.lang.Object
  extended bycom.japisoft.xmlpad.XMLDocumentInfo

public class XMLDocumentInfo
extends java.lang.Object

This class contains information about the current document.

Version:
1.1
Author:
(c) 2003 JAPISOFT / A.Brillant

Constructor Summary
XMLDocumentInfo()
           
 
Method Summary
 void addFileExt(java.lang.String ext)
          Add a file extension for loading/saving this document type
 java.lang.String getCurrentDocumentLocation()
           
 java.lang.String getDefaultDocument()
           
 java.lang.String getDefaultDTDLocation()
           
 java.lang.String getDefaultDTDRoot()
           
 java.lang.String getDefaultFileExt()
           
 java.lang.String getDefaultSchemaLocation()
           
 java.lang.String getDefaultSchemaRoot()
           
 java.lang.String getDocumentDescription()
           
 javax.swing.Icon getDocumentIcon()
           
 java.lang.String getDocumentName()
           
 javax.swing.filechooser.FileFilter getFileFilter()
           
 java.lang.String getId()
           
 java.lang.String getParamValue(java.lang.String paramName)
           
 java.lang.String[] getSupportedFileExt()
           
 java.lang.String getTemplate()
           
 java.lang.String getWorkingDirectory()
           
 void removeFileExt(java.lang.String ext)
          Remove this file extension for loading/saving this document type
 void setCurrentDocumentLocation(java.lang.String location)
          Reset the current document location
 void setDefaultDocument(java.lang.String doc)
          Reset the default document.
 void setDefaultDTD(java.lang.String root, java.lang.String location)
          Reset the defaultDTD location for syntax completion
 void setDefaultFileExt(java.lang.String ext)
          Reset the default file ext.
 void setDefaultSchema(java.lang.String root, java.lang.String location)
          Reset the default schema root and location for syntax completion
 void setDocumentDescription(java.lang.String description)
          Reset the document description.
 void setDocumentIcon(javax.swing.Icon icon)
          Reset the document icon
 void setId(java.lang.String id)
          Give an identifier
 void setParamValues(java.util.Hashtable params)
          Reset parameters for template.
 void setTemplate(java.lang.String documentTemplate)
          Set a template for this document type
 void setWorkingDirectory(java.lang.String workingDirectory)
          Reset the default working directory.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLDocumentInfo

public XMLDocumentInfo()
Method Detail

setDefaultDocument

public void setDefaultDocument(java.lang.String doc)
Reset the default document. This document is used bu default for initializing the editor for the new action If no default document is specified a inner default one is used using the com.japisoft.xmlpad.bean.XMLTemplate value

Parameters:
doc -

getDefaultDocument

public java.lang.String getDefaultDocument()
Returns:
the default document

setParamValues

public void setParamValues(java.util.Hashtable params)
Reset parameters for template. A parameter is a "${param}" value. The value from the "param" key will be replaced in the current template usage

Parameters:
params - Set of parameters : name & value

getParamValue

public java.lang.String getParamValue(java.lang.String paramName)
Returns:
a parameter value. If the parameter is unknwon an empty string is returned

addFileExt

public void addFileExt(java.lang.String ext)
Add a file extension for loading/saving this document type


removeFileExt

public void removeFileExt(java.lang.String ext)
Remove this file extension for loading/saving this document type


setDefaultFileExt

public void setDefaultFileExt(java.lang.String ext)
Reset the default file ext. If will be used to complete any file name without extention while loading/saving a file

Parameters:
ext - Default file extension

getDefaultFileExt

public java.lang.String getDefaultFileExt()
Returns:
the default file extention. If no default file ext has been specified, then 'xml' is returned

getSupportedFileExt

public java.lang.String[] getSupportedFileExt()
Returns:
set of file extension for loading/saving this document type

getFileFilter

public javax.swing.filechooser.FileFilter getFileFilter()
Returns:
a file chooser filter for this document. It will use the file ext data

setDocumentDescription

public void setDocumentDescription(java.lang.String description)
Reset the document description. This description will be used inside file dialog box for filtering document


getDocumentDescription

public java.lang.String getDocumentDescription()
Returns:
the document description

setDefaultSchema

public void setDefaultSchema(java.lang.String root,
                             java.lang.String location)
Reset the default schema root and location for syntax completion


getDefaultSchemaLocation

public java.lang.String getDefaultSchemaLocation()
Returns:
the default schema URL location

getDefaultSchemaRoot

public java.lang.String getDefaultSchemaRoot()
Returns:
the default schema root tag

setDefaultDTD

public void setDefaultDTD(java.lang.String root,
                          java.lang.String location)
Reset the defaultDTD location for syntax completion


getDefaultDTDLocation

public java.lang.String getDefaultDTDLocation()
Returns:
the default DTD location for syntax completion

getDefaultDTDRoot

public java.lang.String getDefaultDTDRoot()
Returns:
the default DTD root for syntax completion

setWorkingDirectory

public void setWorkingDirectory(java.lang.String workingDirectory)
Reset the default working directory. It will be used by file dialog for initializing

Parameters:
workingDirectory -

getWorkingDirectory

public java.lang.String getWorkingDirectory()
Returns:
the default working directory

setCurrentDocumentLocation

public void setCurrentDocumentLocation(java.lang.String location)
Reset the current document location


getCurrentDocumentLocation

public java.lang.String getCurrentDocumentLocation()
Returns:
the current document location

getDocumentName

public java.lang.String getDocumentName()
Returns:
a document shortcut name

getDocumentIcon

public javax.swing.Icon getDocumentIcon()
Returns:
the current document icon

setDocumentIcon

public void setDocumentIcon(javax.swing.Icon icon)
Reset the document icon


setTemplate

public void setTemplate(java.lang.String documentTemplate)
Set a template for this document type


getTemplate

public java.lang.String getTemplate()
Returns:
a template for this document

setId

public void setId(java.lang.String id)
Give an identifier


getId

public java.lang.String getId()
Returns:
the document identifier