|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.ucsb.nceas.morpho.plugins.metadisplay.MetaDisplay
Top-level controller/Mediator class for an instance of a metadata display panel.
Field Summary | |
static java.lang.String |
BLANK_HTML_PAGE
|
Fields inherited from interface edu.ucsb.nceas.morpho.plugins.MetaDisplayInterface |
CLOSE_EVENT, EDIT_BEGIN_EVENT, HISTORY_BACK_EVENT, NAVIGATION_EVENT |
Constructor Summary | |
MetaDisplay()
constructor |
Method Summary | |
void |
addActionListener(java.awt.event.ActionListener listener)
Register a java.awt.event.ActionListener to listen for
events |
void |
addEditingCompleteListener(EditingCompleteListener listener)
Register an EditingCompleteListener to listen for editor
events |
void |
display(java.lang.String identifier)
method to display metadata in an existing instance of a visual component (metadata identified by the identifier parameter). |
void |
display(java.lang.String identifier,
java.io.Reader XMLDocument)
method to display metadata in an existing instance of a visual component (metadata is provided as a Reader (the "XMLDocument" parameter), and a required corresponding unique identifier parameter) that
can subsequently be used by this component to get the latest instance of
the same "XMLDocument" from the XMLFactoryInterface. |
void |
displayPrevious()
method to redisplay the previous metadata document from History, by re-obtaining the latest instance of the XML document from the XMLFactoryInterface and re-styling it |
void |
editingCanceled(java.lang.String xmlString,
java.lang.String id,
java.lang.String location)
Required by EditingCompleteListener Interface:
this method handles canceled editing |
void |
editingCompleted(java.lang.String xmlString,
java.lang.String id,
java.lang.String location)
Required by EditingCompleteListener Interface:
This method is called when editing is complete |
protected void |
fireActionEvent(int descriptionInt,
java.lang.String commandStr)
Does callback to actionPerformed() method of each
java.awt.event.ActionListener in the list of registered
listeners. |
java.awt.Component |
getDisplayComponent(java.lang.String identifier,
XMLFactoryInterface factory,
java.awt.event.ActionListener listener)
method used to obtain a visual component (a descendent of java.awt.Component , which will display the XML resource
identified by the identifier parameter. |
java.awt.Component |
getDisplayComponent(XMLFactoryInterface factory,
java.awt.event.ActionListener listener)
method used to obtain a visual component (a descendent of java.awt.Component , which will subsequently display the XML
resources identified by unique string IDs. |
XMLFactoryInterface |
getFactory()
Get the current XML factory, used to resolve IDs into XML documents |
protected History |
getHistory()
|
java.lang.String |
getIdentifier()
Get the String identifier associated with the
currently-displayed metadata |
protected MetaDisplayUI |
getMetaDisplayUI()
|
java.lang.String |
getTransformerProperty(java.lang.String key)
method to get the transformer property value corresponding to the passed key |
void |
redisplay()
method to redisplay the current metadata, by re-obtaining the latest instance of the XML document from the XMLFactoryInterface and re-styling it |
void |
removeActionListener(java.awt.event.ActionListener listener)
Remove this java.awt.event.ActionListener from the list of
registered listeners |
void |
removeEditingCompleteListener(EditingCompleteListener listener)
Remove this EditingCompleteListener from the list of
registered listeners |
void |
setFactory(XMLFactoryInterface factory)
Set the current XML factory, used to resolve IDs into XML documents |
void |
useTransformerProperty(java.lang.String key,
java.lang.String value)
method to add a key/value transformer property pair to the properties that will be passed onto the XSL Transformation Engine, and will then be made available to the actual XSL stylesheets as |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String BLANK_HTML_PAGE
Constructor Detail |
public MetaDisplay()
Method Detail |
public java.awt.Component getDisplayComponent(java.lang.String identifier, XMLFactoryInterface factory, java.awt.event.ActionListener listener) throws NullArgumentException, DocumentNotFoundException
java.awt.Component
, which will display the XML resource
identified by the identifier
parameter.getDisplayComponent
in interface MetaDisplayInterface
identifier
- a unique identifier used to determine what resource
to returnfactory
- an instance of a class that implements
XMLFactoryInterface
to enable this obj
to obtain the actual XML document to display, given
the identifier
parameterlistener
- an ActionListener
to be notified of all
events generated by this objjava.awt.Component
, which will display
the XML resource identified by the
identifier
parameter.DocumentNotFoundException
- if id does not point to a document, or
if requested document exists but cannot be accessed.NullArgumentException
- if XML Factory is null.public java.awt.Component getDisplayComponent(XMLFactoryInterface factory, java.awt.event.ActionListener listener) throws NullArgumentException
java.awt.Component
, which will subsequently display the XML
resources identified by unique string IDs. However, the initial
instance of the component returned by this method will be blank.getDisplayComponent
in interface MetaDisplayInterface
factory
- an instance of a class that implements
XMLFactoryInterface
to enable this obj
to obtain the actual XML document to display, given
unique identifier
parameterslistener
- an ActionListener
to be notified of all
events generated by this objjava.awt.Component
, which is currently
blank, but can subsequently be used to display the
XML resources identified by unique
identifier
parameters.NullArgumentException
- if XML Factory is null.public void display(java.lang.String identifier) throws DocumentNotFoundException
identifier
parameter).display
in interface MetaDisplayInterface
identifier
- a unique identifier used to determine what resource
to returnDocumentNotFoundException
- if id does not point to a document, or
if requested document exists but cannot be accessed.public void display(java.lang.String identifier, java.io.Reader XMLDocument) throws NullArgumentException, DocumentNotFoundException
identifier
parameter) that
can subsequently be used by this component to get the latest instance of
the same "XMLDocument" from the XMLFactoryInterface.display
in interface MetaDisplayInterface
identifier
- a unique identifier that can subsequently be used by
this component to get the latest instance of the
same "XMLDocument" from the XMLFactoryInterfaceXMLDocument
- a Reader for the character-based XML documentNullArgumentException
- if id not provided.DocumentNotFoundException
- if Reader isn't null but can't be readpublic void displayPrevious() throws DocumentNotFoundException
displayPrevious
in interface MetaDisplayInterface
DocumentNotFoundException
- if id for previous metadata document
does not point to an actual document
or document cannot be accessed.public void redisplay() throws DocumentNotFoundException
redisplay
in interface MetaDisplayInterface
DocumentNotFoundException
- if id does not point to a document, or
if requested document exists but cannot be accessed.public void addActionListener(java.awt.event.ActionListener listener)
java.awt.event.ActionListener
to listen for
eventsaddActionListener
in interface MetaDisplayInterface
listener
- public void removeActionListener(java.awt.event.ActionListener listener)
java.awt.event.ActionListener
from the list of
registered listenersremoveActionListener
in interface MetaDisplayInterface
listener
- protected void fireActionEvent(int descriptionInt, java.lang.String commandStr)
actionPerformed()
method of each
java.awt.event.ActionListener
in the list of registered
listeners.descriptionInt
- integer describing the type of event; eg:
descriptionInt
- String description of the event that will allow
listeners to determine specific information
about the action and act accordingly. Could be
any unique string identifierMetaDisplayInterface
public void addEditingCompleteListener(EditingCompleteListener listener)
EditingCompleteListener
to listen for editor
eventsaddEditingCompleteListener
in interface MetaDisplayInterface
listener
- public void removeEditingCompleteListener(EditingCompleteListener listener)
EditingCompleteListener
from the list of
registered listenersremoveEditingCompleteListener
in interface MetaDisplayInterface
listener
- public void editingCompleted(java.lang.String xmlString, java.lang.String id, java.lang.String location)
EditingCompleteListener
Interface:
This method is called when editing is completeeditingCompleted
in interface EditingCompleteListener
xmlString
- is the edited XML in String formatpublic void editingCanceled(java.lang.String xmlString, java.lang.String id, java.lang.String location)
EditingCompleteListener
Interface:
this method handles canceled editingeditingCanceled
in interface EditingCompleteListener
public XMLFactoryInterface getFactory()
XMLFactoryInterface
to enable this obj
to obtain the actual XML document to display, given
the identifier
parameterpublic void setFactory(XMLFactoryInterface factory) throws NullArgumentException
factory
- an instance of a class that implements
XMLFactoryInterface
to enable this obj
to obtain the actual XML document to display, given
the identifier
parameterNullArgumentException
- if factory not provided.protected History getHistory()
public java.lang.String getIdentifier()
String
identifier associated with the
currently-displayed metadatagetIdentifier
in interface MetaDisplayInterface
String
identifier associated with the
currently-displayed metadatapublic void useTransformerProperty(java.lang.String key, java.lang.String value)
useTransformerProperty
in interface MetaDisplayInterface
key
- value
- public java.lang.String getTransformerProperty(java.lang.String key)
getTransformerProperty
in interface MetaDisplayInterface
key
- String
value associated with the passed keyprotected MetaDisplayUI getMetaDisplayUI()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |