ucar.unidata.idv.chooser
Class ThreddsHandler

java.lang.Object
  extended by ucar.unidata.idv.chooser.XmlHandler
      extended by ucar.unidata.idv.chooser.ThreddsHandler

public class ThreddsHandler
extends XmlHandler

This handles the Thredds catalog xml for the XmlChooser.

Version:
$Revision: 1.68 $Date: 2007/07/09 22:59:58 $
Author:
IDV development team

Field Summary
static String NULL_STRING
          More clear than then doing (String)null
 
Fields inherited from class ucar.unidata.idv.chooser.XmlHandler
chooser, path, root, tree
 
Constructor Summary
ThreddsHandler(XmlChooser chooser, Element root, String path)
          Create the handler
 
Method Summary
 void doLoad()
          The user has pressed the 'Load' button.
protected  JComponent doMakeContents()
          Create the UI
protected  String getDocumentationLabel(Element node)
          For the given documentation node return the label that we use (eg:, Summary, rights, etc)
protected  String getDocumentationToolTip(Element node)
          Get the tooltip text to use for the given documentation node.
 String getPropertyAttributeFromChild(Element parent, String nameValueLookingFor, String dflt)
          Look for the named attribute contained by a child of the given element with the given tag name.
static void main(String[] args)
          Test the html generation
 void processNode(Element node)
          Process the given node
protected  void updateStatus()
           
 
Methods inherited from class ucar.unidata.idv.chooser.XmlHandler
getContents, getPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL_STRING

public static final String NULL_STRING
More clear than then doing (String)null

Constructor Detail

ThreddsHandler

public ThreddsHandler(XmlChooser chooser,
                      Element root,
                      String path)
Create the handler

Parameters:
chooser - The chooser we are in
root - The root of the xml tree
path - The url path of the xml document
Method Detail

updateStatus

protected void updateStatus()
Overrides:
updateStatus in class XmlHandler

getDocumentationLabel

protected String getDocumentationLabel(Element node)
For the given documentation node return the label that we use (eg:, Summary, rights, etc)

Parameters:
node - The documentation node
Returns:
The label to use

getDocumentationToolTip

protected String getDocumentationToolTip(Element node)
Get the tooltip text to use for the given documentation node.

Parameters:
node - The xml doc node
Returns:
The tooltip - show the documentation if it is a summary or rights. Else return null.

doMakeContents

protected JComponent doMakeContents()
Create the UI

Specified by:
doMakeContents in class XmlHandler
Returns:
The UI component

doLoad

public void doLoad()
The user has pressed the 'Load' button. Check if a node is selected

Specified by:
doLoad in class XmlHandler

processNode

public void processNode(Element node)
Process the given node

Parameters:
node - node

getPropertyAttributeFromChild

public String getPropertyAttributeFromChild(Element parent,
                                            String nameValueLookingFor,
                                            String dflt)
Look for the named attribute contained by a child of the given element with the given tag name.

Parameters:
parent - The xml node to look within.
nameValueLookingFor - The value we are looking for
dflt - The default value returned.
Returns:
The value of the given attribute or dflt if not found.

main

public static void main(String[] args)
Test the html generation

Parameters:
args - Command line args