fedora.client.objecteditor
Class RDFTupleEditor

java.lang.Object
  extended by fedora.client.objecteditor.ContentViewer
      extended by fedora.client.objecteditor.ContentEditor
          extended by fedora.client.objecteditor.RDFTupleEditor
All Implemented Interfaces:
java.awt.event.ActionListener, java.beans.PropertyChangeListener, java.util.EventListener, javax.swing.event.DocumentListener

public class RDFTupleEditor
extends ContentEditor
implements javax.swing.event.DocumentListener, java.awt.event.ActionListener, java.beans.PropertyChangeListener

A general-purpose text editor/viewer with XML pretty-printing.


Field Summary
protected  java.lang.String dsid
           
protected  javax.swing.JButton m_add
           
protected  javax.swing.JPanel m_component
           
protected  java.awt.event.ActionListener m_dataChangeListener
           
protected  fedora.client.objecteditor.RDFTupleEditor.RDFDataModel m_dataModel
           
protected  javax.swing.JButton m_delete
           
protected  boolean m_dirty
           
protected  javax.swing.JButton m_edit
           
protected  javax.swing.JTable m_editor
           
protected  boolean m_isEditable
           
protected  java.util.HashMap<java.lang.String,java.lang.String> m_map
           
protected  fedora.client.objecteditor.RDFTupleEditor.RDFDataModel m_origContent
           
protected  javax.swing.JScrollPane m_scrollPane
           
protected  java.lang.String pid
           
static java.lang.String[] s_types
          This class handles all the common text MIME types by default.
 
Constructor Summary
RDFTupleEditor()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void changedUpdate(javax.swing.event.DocumentEvent e)
           
 void changesSaved()
          Called when the caller wants what is in the view to be considered "not dirty" because it's been saved that way.
 javax.swing.JComponent getComponent()
          Get the JComponent.
 java.io.InputStream getContent()
          Gets the content in its edited state.
 java.lang.String[] getTypes()
          Returns a list of content types that this component can handle.
 void init(java.lang.String type, java.io.InputStream data, boolean viewOnly)
          Initializes the handler.
 void insertUpdate(javax.swing.event.DocumentEvent e)
           
 boolean isDirty()
          Returns true if the content should be considered "dirty" (e.g.
 void propertyChange(java.beans.PropertyChangeEvent arg0)
           
 void removeUpdate(javax.swing.event.DocumentEvent e)
           
 void setContent(java.io.InputStream data)
          Re-initializes the handler given new input data.
 void setContentChangeListener(java.awt.event.ActionListener listener)
          Sets the listener that this ContentEditor will notify via listener.actionPerformed(...) when any content-changing events occur that could potentially affect its "dirty state" (whether going from not dirty to dirty, or dirty to not dirty).
 void setPIDAndDSID(java.lang.String pid, java.lang.String dsid)
           
 void undoChanges()
          Called when the caller wants to update the view back to the data was originally passed in.
 
Methods inherited from class fedora.client.objecteditor.ContentEditor
isEditor
 
Methods inherited from class fedora.client.objecteditor.ContentViewer
newInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

s_types

public static java.lang.String[] s_types
This class handles all the common text MIME types by default.


m_dirty

protected boolean m_dirty

m_dataChangeListener

protected java.awt.event.ActionListener m_dataChangeListener

m_editor

protected javax.swing.JTable m_editor

m_scrollPane

protected javax.swing.JScrollPane m_scrollPane

m_component

protected javax.swing.JPanel m_component

m_origContent

protected fedora.client.objecteditor.RDFTupleEditor.RDFDataModel m_origContent

m_dataModel

protected fedora.client.objecteditor.RDFTupleEditor.RDFDataModel m_dataModel

m_isEditable

protected boolean m_isEditable

m_add

protected javax.swing.JButton m_add

m_edit

protected javax.swing.JButton m_edit

m_delete

protected javax.swing.JButton m_delete

pid

protected java.lang.String pid

dsid

protected java.lang.String dsid

m_map

protected java.util.HashMap<java.lang.String,java.lang.String> m_map
Constructor Detail

RDFTupleEditor

public RDFTupleEditor()
Method Detail

getTypes

public java.lang.String[] getTypes()
Description copied from class: ContentViewer
Returns a list of content types that this component can handle. This will usually be a list of MIME Types, but may also include other notions of type known to be understood by the users of ContentHandlerFactory.

Specified by:
getTypes in class ContentViewer

setPIDAndDSID

public void setPIDAndDSID(java.lang.String pid,
                          java.lang.String dsid)
Overrides:
setPIDAndDSID in class ContentEditor

init

public void init(java.lang.String type,
                 java.io.InputStream data,
                 boolean viewOnly)
          throws java.io.IOException
Description copied from class: ContentViewer
Initializes the handler. This should only be called once per instance, and is guaranteed to have been called when this component is provided by the ContentHandlerFactory. The viewOnly parameter signals to ContentEditor implementations that editing capabilities are not desired by the caller.

Specified by:
init in class ContentViewer
Throws:
java.io.IOException

setContent

public void setContent(java.io.InputStream data)
                throws java.io.IOException
Description copied from class: ContentViewer
Re-initializes the handler given new input data. The old data can be discarded.

Specified by:
setContent in class ContentViewer
Throws:
java.io.IOException

getComponent

public javax.swing.JComponent getComponent()
Description copied from class: ContentViewer
Get the JComponent.

Specified by:
getComponent in class ContentViewer

changesSaved

public void changesSaved()
Description copied from class: ContentEditor
Called when the caller wants what is in the view to be considered "not dirty" because it's been saved that way.

Specified by:
changesSaved in class ContentEditor

undoChanges

public void undoChanges()
Description copied from class: ContentEditor
Called when the caller wants to update the view back to the data was originally passed in.

Specified by:
undoChanges in class ContentEditor

isDirty

public boolean isDirty()
Description copied from class: ContentEditor
Returns true if the content should be considered "dirty" (e.g. it has changed due to some form of editing).

Specified by:
isDirty in class ContentEditor

setContentChangeListener

public void setContentChangeListener(java.awt.event.ActionListener listener)
Description copied from class: ContentEditor
Sets the listener that this ContentEditor will notify via listener.actionPerformed(...) when any content-changing events occur that could potentially affect its "dirty state" (whether going from not dirty to dirty, or dirty to not dirty).

Specified by:
setContentChangeListener in class ContentEditor

getContent

public java.io.InputStream getContent()
                               throws java.io.IOException
Description copied from class: ContentEditor
Gets the content in its edited state.

Specified by:
getContent in class ContentEditor
Throws:
java.io.IOException

changedUpdate

public void changedUpdate(javax.swing.event.DocumentEvent e)
Specified by:
changedUpdate in interface javax.swing.event.DocumentListener

insertUpdate

public void insertUpdate(javax.swing.event.DocumentEvent e)
Specified by:
insertUpdate in interface javax.swing.event.DocumentListener

removeUpdate

public void removeUpdate(javax.swing.event.DocumentEvent e)
Specified by:
removeUpdate in interface javax.swing.event.DocumentListener

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent arg0)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener