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.3
Author:
(c) 2003 JAPISOFT / A.Brillant

Field Summary
 java.lang.String originalDTDLocation
           
 
Constructor Summary
XMLDocumentInfo()
           
 
Method Summary
 void addFileExt(java.lang.String ext)
          Add a file extension for loading/saving this document type
 XMLDocumentInfo cloneDocument()
           
 java.lang.String getCurrentDocumentLocation()
           
 java.lang.String getDefaultDocument()
           
 java.lang.String getDefaultDTDLocation()
           
 java.lang.String getDefaultDTDRoot()
           
 java.lang.String getDefaultFileExt()
           
 java.lang.String getDefaultNamespacePrefix()
           
 java.lang.String getDefaultSchemaLocation()
           
 java.lang.String getDefaultSchemaRoot()
           
 java.lang.String getDocumentDescription()
           
 javax.swing.Icon getDocumentIcon()
           
 java.lang.String getDocumentIconPath()
           
 java.lang.String getDocumentName()
           
 javax.swing.filechooser.FileFilter getFileFilter()
           
 java.lang.String getId()
           
 java.lang.String getOriginalDTDLocation()
          Particular case when a mapping is done with the DTD location
 java.lang.String getParamValue(java.lang.String paramName)
           
 java.lang.String[] getSupportedFileExt()
           
 SystemHelper getSystemHelper()
           
 java.lang.String getSystemHelperClass()
           
 java.lang.String getTemplate()
           
 java.lang.String getType()
           
 java.lang.String getWorkingDirectory()
           
 boolean hasAutoClosing()
           
 boolean hasSyntaxColor()
           
 boolean hasSyntaxHelper()
           
 boolean isRealTimeTree()
           
 boolean isSystemDocument()
           
 boolean isTreeAvailable()
           
 boolean matchFileExt(java.lang.String ext)
           
 void removeFileExt(java.lang.String ext)
          Remove this file extension for loading/saving this document type
 void setAutoClosing(boolean autoClosing)
          Set the auto tag closing feature.
 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 setDocumentIconPath(java.lang.String iconPath)
          Information relative to the current document icon path
 void setId(java.lang.String id)
          Give an identifier
 void setOriginalDTDLocation(java.lang.String dtd)
          Particular case when a mapping is done with the DTD location
 void setParam(java.lang.String param, java.lang.String value)
          For template usage
 void setParamValues(java.util.HashMap params)
          Reset parameters for template.
 void setRealTimeTree(boolean realTimeTree)
          The real time tree will be available : By default true
 void setSyntaxColor(boolean syntaxColor)
           
 void setSyntaxHelper(boolean sh)
          Reset the syntax helper.
 void setSystemDocument(boolean system)
          Special flag for multiple document usage
 void setSystemHelperClass(java.lang.String helper)
          Reset a class name for the system helper
 void setTemplate(java.lang.String documentTemplate)
          Set a template for this document type
 void setTreeAvailable(boolean tree)
          The tree will be available for this document
 void setType(java.lang.String type)
          Reset a known type for this document
 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
 

Field Detail

originalDTDLocation

public java.lang.String originalDTDLocation
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

setSystemDocument

public void setSystemDocument(boolean system)
Special flag for multiple document usage


isSystemDocument

public boolean isSystemDocument()

setParamValues

public void setParamValues(java.util.HashMap 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

setParam

public void setParam(java.lang.String param,
                     java.lang.String value)
For template usage


getParamValue

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

matchFileExt

public boolean matchFileExt(java.lang.String ext)
Returns:
true if this document matched this file extention

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


setOriginalDTDLocation

public void setOriginalDTDLocation(java.lang.String dtd)
Particular case when a mapping is done with the DTD location


getOriginalDTDLocation

public java.lang.String getOriginalDTDLocation()
Particular case when a mapping is done with the DTD location


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


setDocumentIconPath

public void setDocumentIconPath(java.lang.String iconPath)
Information relative to the current document icon path


getDocumentIconPath

public java.lang.String getDocumentIconPath()
Returns:
information relative to the current document icon path

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

getSystemHelper

public SystemHelper getSystemHelper()
Returns:
a system helper for this document. This helper is provided thanks to the sysHelper property

getSystemHelperClass

public java.lang.String getSystemHelperClass()
Returns:
a class name for the system helper

setSystemHelperClass

public void setSystemHelperClass(java.lang.String helper)
Reset a class name for the system helper


setTreeAvailable

public void setTreeAvailable(boolean tree)
The tree will be available for this document


isTreeAvailable

public boolean isTreeAvailable()
Returns:
true if the tree is available. By default to true

setRealTimeTree

public void setRealTimeTree(boolean realTimeTree)
The real time tree will be available : By default true


isRealTimeTree

public boolean isRealTimeTree()
Returns:
true if the real time tree is available for this document

hasSyntaxColor

public boolean hasSyntaxColor()
Returns:
true if an XML syntax color is available

setSyntaxColor

public void setSyntaxColor(boolean syntaxColor)
Parameters:
syntaxColor - define if a XML syntax color is available. By default true

hasAutoClosing

public boolean hasAutoClosing()
Returns:
true if the auto tag closing is available

hasSyntaxHelper

public boolean hasSyntaxHelper()
Returns:
true if the syntax helper is available

setSyntaxHelper

public void setSyntaxHelper(boolean sh)
Reset the syntax helper. By default to true


setAutoClosing

public void setAutoClosing(boolean autoClosing)
Set the auto tag closing feature. By default to true


setType

public void setType(java.lang.String type)
Reset a known type for this document


getType

public java.lang.String getType()
Returns:
the current document type, like XML, DTD...

cloneDocument

public XMLDocumentInfo cloneDocument()
Returns:
another XMLDocumentInfo instance from this one

getDefaultNamespacePrefix

public java.lang.String getDefaultNamespacePrefix()