|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfedora.client.objecteditor.ContentViewer
fedora.client.objecteditor.ContentEditor
fedora.client.objecteditor.TextContentEditor
public class TextContentEditor
A general-purpose text editor/viewer with XML pretty-printing.
| Field Summary | |
|---|---|
protected javax.swing.JScrollPane |
m_component
|
protected java.awt.event.ActionListener |
m_dataChangeListener
|
protected boolean |
m_dirty
|
protected javax.swing.text.JTextComponent |
m_editor
|
protected java.lang.String |
m_origContent
|
protected boolean |
m_xml
|
static java.lang.String[] |
s_types
This class handles all the common text MIME types by default. |
| Constructor Summary | |
|---|---|
TextContentEditor()
|
|
| Method Summary | |
|---|---|
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 |
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 |
setXML(boolean isXML)
|
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 |
|---|
public static java.lang.String[] s_types
protected boolean m_dirty
protected java.awt.event.ActionListener m_dataChangeListener
protected javax.swing.text.JTextComponent m_editor
protected javax.swing.JScrollPane m_component
protected boolean m_xml
protected java.lang.String m_origContent
| Constructor Detail |
|---|
public TextContentEditor()
| Method Detail |
|---|
public java.lang.String[] getTypes()
ContentViewer
getTypes in class ContentViewer
public void init(java.lang.String type,
java.io.InputStream data,
boolean viewOnly)
throws java.io.IOException
ContentViewer
init in class ContentViewerjava.io.IOExceptionpublic void setXML(boolean isXML)
public void setContent(java.io.InputStream data)
throws java.io.IOException
ContentViewer
setContent in class ContentViewerjava.io.IOExceptionpublic javax.swing.JComponent getComponent()
ContentViewer
getComponent in class ContentViewerpublic void changesSaved()
ContentEditor
changesSaved in class ContentEditorpublic void undoChanges()
ContentEditor
undoChanges in class ContentEditorpublic boolean isDirty()
ContentEditor
isDirty in class ContentEditorpublic void setContentChangeListener(java.awt.event.ActionListener listener)
ContentEditor
setContentChangeListener in class ContentEditor
public java.io.InputStream getContent()
throws java.io.IOException
ContentEditor
getContent in class ContentEditorjava.io.IOExceptionpublic void changedUpdate(javax.swing.event.DocumentEvent e)
changedUpdate in interface javax.swing.event.DocumentListenerpublic void insertUpdate(javax.swing.event.DocumentEvent e)
insertUpdate in interface javax.swing.event.DocumentListenerpublic void removeUpdate(javax.swing.event.DocumentEvent e)
removeUpdate in interface javax.swing.event.DocumentListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||