public class DefaultMolecularStructureDocument extends AbstractPluginDocument implements MolecularStructureDocument
PluginDocument.ReferencedDocumentsAlwaysLoaded, PluginDocument.ReferencedDocumentsNotLoaded, PluginDocument.SizeRequiredToLoadIntoMemoryProvider
XMLSerializable.OldVersionCompatible, XMLSerializable.VersionSupportType
Modifier and Type | Field and Description |
---|---|
protected static int |
MAXIMUM_HTML_TEXT_LENGTH
the maximum length of the
getStructure() text returned from toHTML() |
FILE_DATA_ATTRIBUTE_NAME, MAXIMUM_HTML_LENGTH, MODIFIED_DATE_FIELD
ROOT_ELEMENT_NAME
Constructor and Description |
---|
DefaultMolecularStructureDocument() |
Modifier and Type | Method and Description |
---|---|
String |
getDescription()
A human readable single line of text describing this document,
to appear in the description field in the document table.
|
List<DocumentField> |
getDisplayableFields()
A list of columns for display in the main document panel.
|
String |
getName()
A short name (preferably one or two words) for the document.
|
String |
getStructure()
A string representing the molecule structure.
|
void |
setDefaultValues(String defaultName,
Date defaultDate,
String data)
Save internally name, creation date and contents.
|
String |
toHTML()
Provide a textual view of document.
|
addDisplayableField, addReferencedDocumentUrn, clearReferencedDocumentUrns, createFromBaseElement, fromXML, getBaseElement, getBaseElementString, getCreationDate, getFieldValue, getFieldValueCodes, getReferencedDocumentUrns, getURN, getVersionSupport, hasProperties, setBaseElement, setCreated, setFieldValue, setFieldValue, setFieldValues, setURN, toXML, toXML
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCreationDate, getFieldValue, getURN
fromXML, toXML
protected static final int MAXIMUM_HTML_TEXT_LENGTH
getStructure()
text returned from toHTML()
public void setDefaultValues(String defaultName, Date defaultDate, String data)
defaultName
- document namedefaultDate
- creation datedata
- contents in various formatspublic List<DocumentField> getDisplayableFields()
PluginDocument
PluginDocument.getFieldValue(String)
.
Each column is specified by a Field. The fields should be obtained from a call to the appropriate
Field.createXXXXField, where XXXX is the appropriate type.
While it is not required, it is recommended that a PluginDocument
handle returning a complete list of its displayable fields before
the document has been properly constructed via a call to XMLSerializable.fromXML(org.jdom.Element)
The returned list need not and should not be modifiable.getDisplayableFields
in interface PluginDocument
getDisplayableFields
in class AbstractPluginDocument
public String getDescription()
PluginDocument
getDescription
in interface PluginDocument
public String getName()
PluginDocument
AnnotatedPluginDocument
then this method
will be overridden and delegate back to AnnotatedPluginDocument.getName()
. One way to look at it is
that when you call PluginDocument.getName() you will get the current name of the document. If you are implementing PluginDocument.getName() then you are
returning the default name for the document.getName
in interface PluginDocument
public String toHTML()
PluginDocument
<html>
toHTML
in interface PluginDocument
public String getStructure()
MolecularStructureDocument
getStructure
in interface MolecularStructureDocument