|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.fcrepo.client.objecteditor.ContentViewer
org.fcrepo.client.objecteditor.ContentEditor
org.fcrepo.client.objecteditor.TextContentEditor
public class TextContentEditor
A general-purpose text editor/viewer with XML pretty-printing.
| Field Summary | |
|---|---|
protected JScrollPane |
m_component
|
protected ActionListener |
m_dataChangeListener
|
protected boolean |
m_dirty
|
protected JTextComponent |
m_editor
|
protected String |
m_origContent
|
protected boolean |
m_xml
|
static String[] |
s_types
This class handles all the common text MIME types by default. |
| Constructor Summary | |
|---|---|
TextContentEditor()
|
|
| Method Summary | |
|---|---|
void |
changedUpdate(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. |
JComponent |
getComponent()
Get the JComponent. |
InputStream |
getContent()
Gets the content in its edited state. |
String[] |
getTypes()
Returns a list of content types that this component can handle. |
void |
init(String type,
InputStream data,
boolean viewOnly)
Initializes the handler. |
void |
insertUpdate(DocumentEvent e)
|
boolean |
isDirty()
Returns true if the content should be considered "dirty" (e.g. |
void |
removeUpdate(DocumentEvent e)
|
void |
setContent(InputStream data)
Re-initializes the handler given new input data. |
void |
setContentChangeListener(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 org.fcrepo.client.objecteditor.ContentEditor |
|---|
isEditor, setPIDAndDSID |
| Methods inherited from class org.fcrepo.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 String[] s_types
protected boolean m_dirty
protected ActionListener m_dataChangeListener
protected JTextComponent m_editor
protected JScrollPane m_component
protected boolean m_xml
protected String m_origContent
| Constructor Detail |
|---|
public TextContentEditor()
| Method Detail |
|---|
public String[] getTypes()
ContentViewer
getTypes in class ContentViewer
public void init(String type,
InputStream data,
boolean viewOnly)
throws IOException
ContentViewer
init in class ContentViewerIOExceptionpublic void setXML(boolean isXML)
public void setContent(InputStream data)
throws IOException
ContentViewer
setContent in class ContentViewerIOExceptionpublic 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(ActionListener listener)
ContentEditor
setContentChangeListener in class ContentEditor
public InputStream getContent()
throws IOException
ContentEditor
getContent in class ContentEditorIOExceptionpublic void changedUpdate(DocumentEvent e)
changedUpdate in interface DocumentListenerpublic void insertUpdate(DocumentEvent e)
insertUpdate in interface DocumentListenerpublic void removeUpdate(DocumentEvent e)
removeUpdate in interface DocumentListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||