<divid=Content><divclass="CClass"><divclass=CTopicid=MainTopic><h1class=CTitle><aname="mxDefaultToolbarCodec"></a>mxDefaultToolbarCodec</h1><divclass=CBody><p>Custom codec for configuring <ahref="../editor/mxDefaultToolbar-js.html#mxDefaultToolbar"class=LClassid=link5onMouseOver="ShowTip(event, 'tt1', 'link5')"onMouseOut="HideTip('tt1')">mxDefaultToolbar</a>s. This class is created and registered dynamically at load time and used implicitely via <ahref="mxCodec-js.html#mxCodec"class=LClassid=link6onMouseOver="ShowTip(event, 'tt5', 'link6')"onMouseOut="HideTip('tt5')">mxCodec</a> and the <ahref="mxCodecRegistry-js.html#mxCodecRegistry"class=LClassid=link7onMouseOver="ShowTip(event, 'tt6', 'link7')"onMouseOut="HideTip('tt6')">mxCodecRegistry</a>. This codec only reads configuration data for existing toolbars handlers, it does not encode or create toolbars.</p><!--START_ND_SUMMARY--><divclass=Summary><divclass=STitle>Summary</div><divclass=SBorder><tableborder=0cellspacing=0cellpadding=0class=STable><trclass="SMain"><tdclass=SEntry><ahref="#mxDefaultToolbarCodec">mxDefaultToolbarCodec</a></td><tdclass=SDescription>Custom codec for configuring <ahref="../editor/mxDefaultToolbar-js.html#mxDefaultToolbar"class=LClassid=link1onMouseOver="ShowTip(event, 'tt1', 'link1')"onMouseOut="HideTip('tt1')">mxDefaultToolbar</a>s. </td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxDefaultToolbarCodec.Functions">Functions</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxDefaultToolbarCodec.encode"id=link2onMouseOver="ShowTip(event, 'tt2', 'link2')"onMouseOut="HideTip('tt2')">encode</a></td><tdclass=SDescription>Returns null.</td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxDefaultToolbarCodec.decode"id=link3onMouseOver="ShowTip(event, 'tt3', 'link3')"onMouseOut="HideTip('tt3')">decode</a></td><tdclass=SDescription>Reads a sequence of the following child nodes and attributes:</td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxDefaultToolbarCodec.Variables">Variables</a></td><tdclass=SDescription></td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxDefaultToolbarCodec.allowEval"id=link4onMouseOver="ShowTip(event, 'tt4', 'link4')"onMouseOut="HideTip('tt4')">allowEval</a></td><tdclass=SDescription>Static global switch that specifies if the use of eval is allowed for evaluating text content. </td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxDefaultToolbarCodec.decode"></a>decode</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>codec.decode = function(</td><tdclass=PParameternowrap>dec,</td></tr><tr><td></td><tdclass=PParameternowrap>node,</td></tr><tr><td></td><tdclass=PParameternowrap>into</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Reads a sequence of the following child nodes and attributes:</p><h4class=CHeading>Child Nodes</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>add</td><tdclass=CDLDescription>Adds a new item to the toolbar. See below for attributes.</td></tr><tr><tdclass=CDLEntry>separator</td><tdclass=CDLDescription>Adds a vertical separator. No attributes.</td></tr><tr><tdclass=CDLEntry>hr</td><tdclass=CDLDescription>Adds a horizontal separator. No attributes.</td></tr><tr><tdclass=CDLEntry>br</td><tdclass=CDLDescription>Adds a linefeed. No attributes.</td></tr></table><h4class=CHeading>Attributes</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>as</td><tdclass=CDLDescription>Resource key for the label.</td></tr><tr><tdclass=CDLEntry>action</td><tdclass=CDLDescription>Name of the action to execute in enclosing editor.</td></tr><tr><tdclass=CDLEntry>mode</td><tdclass=CDLDescription>Modename (see below).</td></tr><tr><tdclass=CDLEntry>template</td><tdclass=CDLDescription>Template name for cell insertion.</td></tr><tr><tdclass=CDLEntry>style</td><tdclass=CDLDescription>Optional style to override the template style.</td></tr><tr><tdclass=CDLEntry>icon</td><tdclass=CDLDescription>Icon (relative/absolute URL).</td></tr><tr><tdclass=CDLEntry>pressedIcon</td><tdclass=CDLDescription>Optional icon for pressed state (relative/absolute URL).</td></tr><tr><tdclass=CDLEntry>id</td><tdclass=CDLDescription>Optional ID to be used for the created DOM element.</td></tr><tr><tdclass=CDLEntry>toggle</td><tdclass=CDLDescription>Optional 0 or 1 to disable toggling of the element. Default is 1 (true).</td></tr></table><p>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.</p><p>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:</p><blockquote><preclass="prettyprint"><add as="Swimlane" template="swimlane" icon="images/swimlane.gif"><![CDATA[
]]></add></pre></blockquote><p>In the above function, editor is the enclosing <ahref="../editor/mxEditor-js.html#mxEditor"class=LClassid=link8onMouseOver="ShowTip(event, 'tt7', 'link8')"onMouseOut="HideTip('tt7')">mxEditor</a> instance, cell is the clone of the template, evt is the mouse event that represents the drop and targetCell is the cell under the mousepointer where the drop occurred. The targetCell is retrieved using <ahref="../view/mxGraph-js.html#mxGraph.getCellAt"class=LFunctionid=link9onMouseOver="ShowTip(event, 'tt8', 'link9')"onMouseOut="HideTip('tt8')">mxGraph.getCellAt</a>.</p><p>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:</p><blockquote><preclass="prettyprint"><add as="connect" mode="connect"><![CDATA[
]]></add></pre></blockquote><p>Both functions require <ahref="#mxDefaultToolbarCodec.allowEval"class=LVariableid=link10onMouseOver="ShowTip(event, 'tt4', 'link10')"onMouseOut="HideTip('tt4')">mxDefaultToolbarCodec.allowEval</a> to be set to true.</p><h4class=CHeading>Modes</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>select</td><tdclass=CDLDescription>Left mouse button used for rubberband- & cell-selection.</td></tr><tr><tdclass=CDLEntry>connect</td><tdclass=CDLDescription>Allows connecting vertices by inserting new edges.</td></tr><tr><tdclass=CDLEntry>pan</td><tdclass=CDLDescription>Disables selection and switches to panning on the left button.</td></tr></table><h4class=CHeading>Example</h4><h4class=CHeading>To add items to the toolbar</h4><blockquote><preclass="prettyprint"><mxDefaultToolbar as="toolbar">
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxDefaultToolbarCodec.allowEval"></a>allowEval</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxDefaultToolbarCodec.allowEval</td></tr></table></blockquote><p>Static global switch that specifies if the use of eval is allowed for evaluating text content. Default is true. Set this to false if stylesheets may contain user input (see the section on security in the manual).</p></div></div></div>
<divclass=CToolTipid="tt1"><divclass=CClass>Toolbar for the editor. </div></div><divclass=CToolTipid="tt2"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>codec.encode = function(</td><tdclass=PParameternowrap>enc,</td></tr><tr><td></td><tdclass=PParameternowrap>obj</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Returns null.</div></div><divclass=CToolTipid="tt3"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>codec.decode = function(</td><tdclass=PParameternowrap>dec,</td></tr><tr><td></td><tdclass=PParameternowrap>node,</td></tr><tr><td></td><tdclass=PParameternowrap>into</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Reads a sequence of the following child nodes and attributes:</div></div><divclass=CToolTipid="tt4"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxDefaultToolbarCodec.allowEval</td></tr></table></blockquote>Static global switch that specifies if the use of eval is allowed for evaluating text content. </div></div><divclass=CToolTipid="tt5"><divclass=CClass>XML codec for JavaScript object graphs. </div></div><divclass=CToolTipid="tt6"><divclass=CClass>Singleton class that acts as a global registry for codecs.</div></div><divclass=CToolTipid="tt7"><divclass=CClass>Extends mxEventSource to implement a application wrapper for a graph that adds actions, I/O using mxCodec, auto-layout using mxLayoutManager, command history using undoManager, and standard dialogs and widgets, eg. </div></div><divclass=CToolTipid="tt8"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxGraph.prototype.getCellAt = function(</td><tdclass=PParameternowrap>x,</td></tr><tr><td></td><tdclass=PParameternowrap>y,</td></tr><tr><td></td><tdclass=PParameternowrap>parent,</td></tr><tr><td></td><tdclass=PParameternowrap>vertices,</td></tr><tr><td></td><tdclass=PParameternowrap>edges</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Returns the bottom-most cell that intersects the given point (x, y) in the cell hierarchy starting at the given parent. </div></div><!--END_ND_TOOLTIPS-->