Document factory (extension point)
From BioUML platform
- Identifier
- ru.biosoft.workbench.documentFactory
- Plugin
- ru.biosoft.workbench
- Applicable for
- BioUML workbench
Description
This extension points configures document type in BioUML workbench.
Configuration Markup
<!ELEMENT documentFactory> <!ATTLIST documentFactory key CDATA #REQUIRED documentClass CDATA #IMPLIED class CDATA #IMPLIED >
- key
- Fully qualified name of the class implementing
DataElement
interface. Registered document type will be used for elements of given class. - documentClass
- (since 0.9.6) Fully qualified name of the class extending
Document
abstract class. This class is the implementation of the document itself. - class
- Fully qualified name of the class implementing
DocumentFactory
interface. This class should createDocument
instances inDocumentFactory.openDocument
method.
Examples
<extension id="TreeTable document factory" point="ru.biosoft.workbench.documentFactory"> <documentFactory documentClass="ru.biosoft.treetable.TreeTableDocument" key="ru.biosoft.treetable.TreeTableElement" /> </extension>
This extension specifies that tree-tables will be displayed via TreeTableDocument
.
<extension id="table document factory" point="ru.biosoft.workbench.documentFactory"> <documentFactory class="ru.biosoft.table.document.TableFactory" key="ru.biosoft.table.TableDataCollection" /> </extension>
This extension specifies that tables will be displayed using TableFactory
factory.
API information
You must use either documentClass
or class
attribute. If documentClass
is specified, then DefaultDocumentFactory
will be used as factory. If this factory doesn't satisfy your needs (for example, you may want to produce documents of different class), you should create your own factory.
Classes implementing DocumentFactory
interface must have default constructor. Classes extending Document
must have constructor taking one argument of the type specified in key
property.