Overview
This page describes how to extend the document model in Spotfire® using the Document Model Framework API.
The document model is a node tree. It is extended by adding new nodes.
Usually the custom document node will be designed for a specific purpose, which may greatly differ between nodes. You will inherit from the specialised classes such as CustomPanel or CustomVisual or from the all-purpose CustomNode. In the end, all these classes inherit from DocumentNode. If your specialized node contains additional nodes, you can add nodes directly inheriting from DocumentNode.
Creating a document node
The general work order when adding a document node is as follows:
-
Create a DocumentNode class.
DocumentNode is the abstract base class for all types in the model. The document is extended by creating, attaching and configuring nodes. The class must derive from the DocumentNode base class or a subclass to it.
The class must be marked with the Serializable and PersistenceVersion attributes.
-
Create an inner PropertyNames class.
Every property of a custom document node must have an associated identifier, a Property Name.
-
Add Undoable Nodes.
Document nodes must not be modified. Instead they may contain Undoable Nodes, a special, modifiable kind of nodes.
-
Add Readonly Properties.
Some properties stored in ordinary readonly fields never change after initialization. They nevertheless must be initialized in a special way for the Document Model Framework to keep track of them.
-
Optionally, add the following entities to your node:
-
Runtime Properties.
A runtime property is defined at runtime. It can be computed from other properties in the document.
-
Event Handlers for internal events.
The Document Model Framework separates internal and external events. Internal events update the model to a consistent state. External events update the view to reflect the state of the model.
-
A configuration phase.
- Public methods
-
Runtime Properties.
Recommended Comments
There are no comments to display.