public class FwkServicesTreeModel
extends javax.swing.tree.DefaultTreeModel
,
Serialized FormModifier and Type | Class and Description |
---|---|
protected static class |
FwkServicesTreeModel.XMLTreeNode
The XML node.
|
Modifier and Type | Field and Description |
---|---|
protected java.lang.StringBuffer |
error |
protected java.io.File[] |
files |
protected java.io.File |
servicesDir |
protected java.util.Vector |
zippedFiles |
protected java.util.HashMap |
zippedNodes |
Constructor and Description |
---|
FwkServicesTreeModel(java.io.File servicesDir)
Creates a new instance of FwkServiceProvider
|
Modifier and Type | Method and Description |
---|---|
void |
addService(java.util.zip.ZipFile zipFile)
Add a service zip
|
protected static org.w3c.dom.Element |
copyElement(org.w3c.dom.Document doc,
org.w3c.dom.Element src) |
void |
copyFiles(java.io.File dir)
Copy the jar files needed by the new services.
|
protected static org.w3c.dom.Node |
copyNode(org.w3c.dom.Document doc,
org.w3c.dom.Node src)
Copy xml node.
|
protected static org.w3c.dom.Text |
copyText(org.w3c.dom.Document doc,
org.w3c.dom.Text src) |
protected void |
copyZipEntry(java.io.File dir,
java.util.zip.ZipFile zipFile,
java.util.zip.ZipEntry entry,
java.util.HashMap handled) |
protected static org.w3c.dom.Element |
createRoot()
Create a root.
|
protected static org.w3c.dom.Document |
getDocument(org.w3c.dom.Node node)
Get the document.
|
org.w3c.dom.Element |
getElement(javax.swing.tree.TreeNode node)
Get the XML element of the given node.
|
java.lang.StringBuffer |
getErrorBuffer()
Get the error buffer.
|
java.io.File[] |
getIncludedFiles()
Get the list of files that are includes.
|
int |
getIncludedFilesCount()
Get the list of files that are includes.
|
java.lang.String |
getIncludedItem(int index)
Get the included item.
|
java.lang.String[] |
getIncludedItems()
Get the included items.
|
java.lang.String |
getInterfaceName(javax.swing.tree.TreeNode node)
Get the class name of the interface of node.
|
java.lang.String |
getNodeClassname(javax.swing.tree.TreeNode node)
Get the classname of the node
|
java.lang.String |
getNodeDescription(javax.swing.tree.TreeNode node)
Get the description of the node.
|
java.lang.String |
getNodeName(javax.swing.tree.TreeNode node)
Get the name of the node
|
java.lang.String |
getNodeURL(javax.swing.tree.TreeNode node)
Get the URL of the node
|
java.lang.String |
getNodeVersion(javax.swing.tree.TreeNode node)
Get the version of the node
|
java.lang.String |
getPropertyLocale(javax.swing.tree.TreeNode node)
Get the locale spec of a property node.
|
java.lang.String |
getPropertyName(javax.swing.tree.TreeNode node)
Get the property name of a property node.
|
java.lang.String |
getPropertyValue(javax.swing.tree.TreeNode node)
Get the property value of a property node.
|
java.lang.String |
getSPIVersion(javax.swing.tree.TreeNode node)
Get the spi version
|
boolean |
isProperty(javax.swing.tree.TreeNode node)
Get a boolean whether the given node is a property
|
boolean |
isRoot(javax.swing.tree.TreeNode node)
Get a boolean whether the given node is the root
|
boolean |
isService(javax.swing.tree.TreeNode node)
Get a boolean whether the given node is a service
|
boolean |
isServiceList(javax.swing.tree.MutableTreeNode node)
Get a boolean whether the given node is a service list
|
boolean |
isSPFNode(javax.swing.tree.TreeNode node)
Get a boolean whether the given node is a SPF added node.
|
static void |
main(java.lang.String[] args) |
protected void |
printAttribute(java.io.PrintStream printer,
java.lang.String spaces,
org.w3c.dom.Node attr)
Write out an attribute
|
protected static void |
printParamterHelp() |
void |
printXML(java.io.PrintStream printer,
java.lang.String prefix,
org.w3c.dom.Node node)
Print the XML output to printz stream.
|
protected org.w3c.dom.Element |
readServiceListFromXML(java.io.File file)
Read the XML files.
|
protected org.w3c.dom.Element |
readServiceListFromXML(java.lang.Object spiKey,
java.io.InputStream is)
Read the XML streams.
|
void |
removeNode(javax.swing.tree.TreeNode node)
Remove the given node from tree.
|
void |
write()
Write the tree back to files.
|
void |
writeServiceListToXML(java.io.File dir)
Write the XML files.
|
void |
writeServiceListToXML(java.io.PrintStream printer)
Write the XML to printer.
|
void |
writeServiceToXMLFile(java.io.File dir,
org.w3c.dom.Node node)
Write a service lit node to files.
|
void |
writeServiceToXMLFile(java.io.PrintStream printer,
org.w3c.dom.Node node)
Write a service lit node to files.
|
addTreeModelListener, asksAllowsChildren, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getChild, getChildCount, getIndexOfChild, getListeners, getPathToRoot, getPathToRoot, getRoot, getTreeModelListeners, insertNodeInto, isLeaf, nodeChanged, nodesChanged, nodeStructureChanged, nodesWereInserted, nodesWereRemoved, reload, reload, removeNodeFromParent, removeTreeModelListener, setAsksAllowsChildren, setRoot, valueForPathChanged
protected java.io.File servicesDir
protected java.io.File[] files
protected java.util.Vector zippedFiles
protected java.util.HashMap zippedNodes
protected java.lang.StringBuffer error
public FwkServicesTreeModel(java.io.File servicesDir)
the
- file where the services are located.public void addService(java.util.zip.ZipFile zipFile)
zipFile
- contains the service plus descriptor.public int getIncludedFilesCount()
public java.io.File[] getIncludedFiles()
public java.lang.String[] getIncludedItems()
public java.lang.String getIncludedItem(int index)
public java.lang.StringBuffer getErrorBuffer()
public boolean isRoot(javax.swing.tree.TreeNode node)
public boolean isServiceList(javax.swing.tree.MutableTreeNode node)
public void removeNode(javax.swing.tree.TreeNode node)
public boolean isService(javax.swing.tree.TreeNode node)
public boolean isSPFNode(javax.swing.tree.TreeNode node)
public boolean isProperty(javax.swing.tree.TreeNode node)
public java.lang.String getSPIVersion(javax.swing.tree.TreeNode node)
public java.lang.String getNodeName(javax.swing.tree.TreeNode node)
public java.lang.String getNodeVersion(javax.swing.tree.TreeNode node)
public java.lang.String getNodeClassname(javax.swing.tree.TreeNode node)
public java.lang.String getNodeURL(javax.swing.tree.TreeNode node)
public java.lang.String getInterfaceName(javax.swing.tree.TreeNode node)
public java.lang.String getNodeDescription(javax.swing.tree.TreeNode node)
public java.lang.String getPropertyValue(javax.swing.tree.TreeNode node)
public java.lang.String getPropertyName(javax.swing.tree.TreeNode node)
public java.lang.String getPropertyLocale(javax.swing.tree.TreeNode node)
public org.w3c.dom.Element getElement(javax.swing.tree.TreeNode node)
protected static org.w3c.dom.Document getDocument(org.w3c.dom.Node node)
protected static org.w3c.dom.Node copyNode(org.w3c.dom.Document doc, org.w3c.dom.Node src)
protected static org.w3c.dom.Element copyElement(org.w3c.dom.Document doc, org.w3c.dom.Element src)
protected static org.w3c.dom.Text copyText(org.w3c.dom.Document doc, org.w3c.dom.Text src)
public void copyFiles(java.io.File dir) throws java.io.IOException
java.io.IOException
protected void copyZipEntry(java.io.File dir, java.util.zip.ZipFile zipFile, java.util.zip.ZipEntry entry, java.util.HashMap handled) throws java.io.IOException, java.io.FileNotFoundException
java.io.IOException
java.io.FileNotFoundException
public void writeServiceListToXML(java.io.File dir) throws java.io.IOException, java.io.FileNotFoundException
java.io.IOException
java.io.FileNotFoundException
public void writeServiceToXMLFile(java.io.File dir, org.w3c.dom.Node node) throws java.io.IOException, java.io.FileNotFoundException
java.io.IOException
java.io.FileNotFoundException
public void writeServiceListToXML(java.io.PrintStream printer) throws java.io.IOException, java.io.FileNotFoundException
java.io.IOException
java.io.FileNotFoundException
public void writeServiceToXMLFile(java.io.PrintStream printer, org.w3c.dom.Node node) throws java.io.IOException, java.io.FileNotFoundException
java.io.IOException
java.io.FileNotFoundException
public void printXML(java.io.PrintStream printer, java.lang.String prefix, org.w3c.dom.Node node)
protected void printAttribute(java.io.PrintStream printer, java.lang.String spaces, org.w3c.dom.Node attr)
protected org.w3c.dom.Element readServiceListFromXML(java.io.File file) throws javax.xml.parsers.ParserConfigurationException, java.io.IOException, java.io.FileNotFoundException, org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
java.io.FileNotFoundException
org.xml.sax.SAXException
protected org.w3c.dom.Element readServiceListFromXML(java.lang.Object spiKey, java.io.InputStream is) throws javax.xml.parsers.ParserConfigurationException, java.io.IOException, java.io.FileNotFoundException, org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
java.io.FileNotFoundException
org.xml.sax.SAXException
protected static org.w3c.dom.Element createRoot()
public void write() throws java.io.IOException
java.io.IOException
protected static void printParamterHelp()
public static void main(java.lang.String[] args)