Array containing the variable names that should be ignored by the codec.
Array containing the variable names that should be turned into or converted from references. See Codec.getId and Codec.getObject.
Maps from from fieldnames to XML attribute names.
Maps from from XML attribute names to fieldnames.
Holds the template object associated with this codec.
Static global switch that specifies if expressions in arrays are allowed. Default is false. NOTE: Enabling this carries a possible security risk.
Sets the decoded child node as a value of the given object. If the object is a map, then the value is added with the given fieldname as a key. If the fieldname is not empty, then setFieldValue is called or else, if the object is a collection, the value is added to the collection. For strongly typed languages it may be required to override this with the correct code to add an entry to an object.
Hook for subclassers to post-process the object after decoding. This implementation returns the given object without any changes. The return value of this method is returned to the decoder from decode.
XML node to be decoded.
Object that represents the default decoding.
Hook for subclassers to post-process the node for the given object after encoding and return the post-processed node. This implementation returns the input node. The return value of this method is returned to the encoder from encode.
Codec that controls the encoding process.
Object to be encoded.
XML node that represents the default encoding.
Hook for subclassers to pre-process the node for the specified object and return the node to be used for further processing by decode. The object is created based on the template in the calling method and is never null. This implementation returns the input node. The return value of this function is used in decode to perform the default decoding into the given object.
Codec that controls the decoding process.
XML node to be decoded.
Object to encode the node into.
Hook for subclassers to pre-process the object before encoding. This returns the input object. The return value of this function is used in encode to perform the default encoding into the given node.
Codec that controls the encoding process.
Object to be encoded.
XML node to encode the object into.
Returns a new instance of the template for this codec.
Converts booleans and numeric values to the respective types. Values are numeric if isNumericAttribute returns true.
Codec that controls the decoding process.
XML attribute to be converted.
Objec to convert the attribute for.
Converts true to "1" and false to "0" is isBooleanAttribute returns true. All other values are not converted.
Codec that controls the encoding process.
Objec to convert the attribute for.
Name of the attribute to be converted.
Value to be converted.
Reads a sequence of the following child nodes and attributes:
Child Nodes:
add - Adds a new item to the toolbar. See below for attributes. separator - Adds a vertical separator. No attributes. hr - Adds a horizontal separator. No attributes. br - Adds a linefeed. No attributes.
Attributes:
as - Resource key for the label. action - Name of the action to execute in enclosing editor. mode - Modename (see below). template - Template name for cell insertion. style - Optional style to override the template style. icon - Icon (relative/absolute URL). pressedIcon - Optional icon for pressed state (relative/absolute URL). id - Optional ID to be used for the created DOM element. toggle - Optional 0 or 1 to disable toggling of the element. Default is 1 (true).
The action, mode and template attributes are mutually exclusive. The style can only be used with the template attribute. The add node may contain another sequence of add nodes with as and action attributes to create a combo box in the toolbar. If the icon is specified then a list of the child node is expected to have its template attribute set and the action is ignored instead.
Nodes with a specified template may define a function to be used for inserting the cloned template into the graph. Here is an example of such a node:
<add as="Swimlane" template="swimlane" icon="images/swimlane.gif"><![CDATA[
function (editor, cell, evt, targetCell)
{
let pt = mxUtils.convertPoint(
editor.graph.container, mxEvent.getClientX(evt),
mxEvent.getClientY(evt));
return editor.addVertex(targetCell, cell, pt.x, pt.y);
}
]]></add>
In the above function, editor is the enclosing
Futhermore, nodes with the mode attribute may define a function to be executed upon selection of the respective toolbar icon. In the example below, the default edge style is set when this specific connect-mode is activated:
<add as="connect" mode="connect"><![CDATA[
function (editor)
{
if (editor.defaultEdge != null)
{
editor.defaultEdge.style = 'straightEdge';
}
}
]]></add>
Both functions require <DefaultToolbarCodec.allowEval> to be set to true.
Modes:
select - Left mouse button used for rubberband- & cell-selection. connect - Allows connecting vertices by inserting new edges. pan - Disables selection and switches to panning on the left button.
Example:
To add items to the toolbar:
<EditorToolbar as="toolbar">
<add as="save" action="save" icon="images/save.gif"/>
<br/><hr/>
<add as="select" mode="select" icon="images/select.gif"/>
<add as="connect" mode="connect" icon="images/connect.gif"/>
</EditorToolbar>
Decodes all attributes of the given node using decodeAttribute.
Codec that controls the decoding process.
XML node to be decoded.
Objec to encode the node into.
Decodes all children of the given node using decodeChild.
Codec that controls the decoding process.
XML node to be decoded.
Objec to encode the node into.
Calls decodeAttributes and decodeChildren for the given node.
Codec that controls the decoding process.
XML node to be decoded.
Objec to encode the node into.
Returns null.
Encodes the value of each member in then given obj into the given node using encodeValue.
Codec that controls the encoding process.
Object to be encoded.
XML node that contains the encoded object.
Converts the given value according to the mappings and id-refs in this codec and uses writeAttribute to write the attribute into the given node.
Codec that controls the encoding process.
Object whose property is going to be encoded.
XML node that contains the encoded object.
Value of the property to be encoded.
XML node that contains the encoded object.
Returns the attributename for the given fieldname. Looks up the value in the mapping or returns the input if there is no mapping for the given name.
Returns the fieldname for the given attributename. Looks up the value in the reverse mapping or returns the input if there is no reverse mapping for the given name.
Returns the template instance for the given field. This returns the value of the field, null if the value is an array or an empty collection if the value is a collection. The value is then used to populate the field for a new instance. For strongly typed languages it may be required to override this to return the correct collection instance based on the encoded child.
Returns the name used for the nodenames and lookup of the codec when classes are encoded and nodes are decoded. For classes to work with this the codec registry automatically adds an alias for the classname if that is different than what this returns. The default implementation returns the classname of the template class.
Returns true if the given attribute is to be ignored by the codec. This implementation returns true if the given fieldname is in exclude or if the fieldname equals ObjectIdentity.FIELD_NAME.
Object instance that contains the field.
Fieldname of the field.
Value of the field.
Boolean indicating if the field is being encoded or decoded. Write is true if the field is being encoded, else it is being decoded.
Returns true if the given fieldname is to be treated as a textual reference (ID). This implementation returns true if the given fieldname is in idrefs.
Object instance that contains the field.
Fieldname of the field.
Value of the field.
Boolean indicating if the field is being encoded or decoded. Write is true if the field is being encoded, else it is being decoded.
Returns true if the given node is an include directive and executes the include by decoding the XML document. Returns false if the given node is not an include directive.
Codec that controls the encoding/decoding process.
XML node to be checked.
Optional object to pass-thru to the codec.
Writes the given value into node using writePrimitiveAttribute or writeComplexAttribute depending on the type of the value.
Writes the given value as a child node of the given node.
Writes the given value as an attribute of the given node.
Generated using TypeDoc
Custom codec for configurings. This class is created
and registered dynamically at load time and used implicitly via
and the . This codec only reads configuration
data for existing toolbars handlers, it does not encode or create toolbars.