|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.ucsb.nceas.morpho.datapackage.ReferencesHandler
Constructor Summary | |
ReferencesHandler(java.lang.String genericName,
java.lang.String[] surrogateXPaths)
constructor |
Method Summary | |
void |
addReferencesListener(ReferencesListener listener)
register a listener |
static org.w3c.dom.Node |
deleteOriginalReferenceSubtree(AbstractDataPackage adp,
java.lang.String subtreeID)
deletes referenced subtree and transfers its children to te first subtree that references it (if any) |
java.lang.String |
getGenericName()
Method to return genericName |
javax.swing.JComboBox |
getJComboBox(AbstractDataPackage dataPkg,
ReferencesListener listener,
java.awt.Frame parent)
get a JComboBox containing a blank entry at location (0), an entry to launch an ExternalRefsDialog at location (1), and all the IDs in the current DataPackage that point to subtree root-nodes corresponding to the genericName used to instantiate this ReferencesHandler, and whose values are String surrogates for those referenced subtrees |
protected java.util.List |
getReferences(AbstractDataPackage dataPkg,
java.lang.String suppressRefID)
get a Map whose keys are all the IDs currently in the DataPackage that point to subtree root-nodes corresponding to the genericName used to instantiate this ReferencesHandler, and whose values are String surrogates for those referenced subtrees |
void |
removeReferencesListener(ReferencesListener listener)
unregister a listener |
void |
setDisplayName(java.lang.String displayName)
Method to set displayName for the ExternalRefsDialog |
void |
updateJComboBox(AbstractDataPackage dataPkg,
javax.swing.JComboBox dropdown,
java.lang.String suppressRefID)
update the ListModel backing the passed JComboBox - @see getJComboBox() |
static org.w3c.dom.Node |
updateOriginalReferenceSubtree(AbstractDataPackage adp,
java.lang.String subtreeID,
OrderedMap newData)
gets the subtree with refID "subtreeID" from the datapackage "adp", and replaces it with the subtree described in the newData OrderedMap |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ReferencesHandler(java.lang.String genericName, java.lang.String[] surrogateXPaths)
genericName
- String that defines which part of the EML schema this
ReferencesHandler will be handling (eg Party, etc). Generic name strings
are defined in schema-specific KeymapConfig xml file (e.g.
eml200KeymapConfig.xml)surrogateXPaths
- String[] array containing any mixture of:(a) xpaths pointing to the fields within the DOM subtree that should be used to construct the surrogate strings returned by this class. XPaths must start with a "/" and be relative to the subtree root-node, but must *NOT* include the subtree root node itself (because, for example, if the subtree is "Party", its root node could be "Creator" or "Owner" or any number of other things
(b) strings that will be inserted between the values returned from the above xpaths (these strings are identified by their first character not being a "/").
So for example, if the genericName is set to "parties" and you want the surrogate to be: "firstname lastname - (role)", then the array will look like this for EML2.0:
{ "/individualName/givenName", "/individualName/surName", " - (", "/role", ")", }
Method Detail |
public void setDisplayName(java.lang.String displayName)
displayName
- displayName for the ExternalRefsDialogpublic java.lang.String getGenericName()
protected java.util.List getReferences(AbstractDataPackage dataPkg, java.lang.String suppressRefID)
dataPkg
- the AbstractDataPackage from whence the references should
be obtained. If this is null, an empty Map is returnedsuppressRefID
- String
public javax.swing.JComboBox getJComboBox(AbstractDataPackage dataPkg, ReferencesListener listener, java.awt.Frame parent)
dataPkg
- the AbstractDataPackage from whence the references should
be obtained. If this is null, an empty JComboBox is returnedlistener
- ReferencesListener to be called back when a selection is
made.parent
- JFrame that will be the parent of any modal dialogs that
this class may create
public void updateJComboBox(AbstractDataPackage dataPkg, javax.swing.JComboBox dropdown, java.lang.String suppressRefID)
dataPkg
- the AbstractDataPackage from whence the references should
be obtained. If this is null, an empty JComboBox is returneddropdown
- ReferencesListener to be called back when a selection is
made.suppressRefID
- String refID whose list entry will be removed - set
this to the refID of the subtree represented by the calling dialog, so
the dialog can't reference itselfpublic static org.w3c.dom.Node updateOriginalReferenceSubtree(AbstractDataPackage adp, java.lang.String subtreeID, OrderedMap newData)
adp
- AbstractDataPackage the current datapkgsubtreeID
- String refID of the subtree to be replacednewData
- OrderedMap containing new data to replace referenced subtree
public static org.w3c.dom.Node deleteOriginalReferenceSubtree(AbstractDataPackage adp, java.lang.String subtreeID)
adp
- CustomListsubtreeID
- String
public void addReferencesListener(ReferencesListener listener)
listener
- ReferencesListenerpublic void removeReferencesListener(ReferencesListener listener)
listener
- ReferencesListener
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |