UNPKG

gojs

Version:

Interactive diagrams, charts, and graphs, such as trees, flowcharts, orgcharts, UML, BPMN, or business diagrams

1,571 lines (563 loc) 58.9 kB
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>GoJS&reg; TextEditingTool Class</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="../../assets/js/bootstrap.min.js"></script> <script src="../../assets/js/highlight.js"></script> <script src="../../assets/js/api.js"></script> <link href="../../assets/css/bootstrap.min.css" rel="stylesheet" > <!-- custom CSS after bootstrap --> <link href="../../assets/css/main.css" rel="stylesheet" type="text/css"/> <link href="../../assets/css/api.css" rel="stylesheet" type="text/css"/> <!--<link rel="stylesheet" href="../../assets/css/api.css" type="text/css" media="all" />--> <link rel="stylesheet" href="../../assets/css/highlight.css" type="text/css" media="all" /> </head> <body> <!-- <div id="topbar"> <div id="topbar-inner"> <ul> <li><a href="../../index.html">Home</a></li> <li><a href="../../learn/index.html">Learn</a></li> <li><a href="../../samples/index.html">Samples</a></li> <li><a href="../../intro/index.html">Intro</a></li> <li><a href="../index.html">API</a></li> <li><a href="https://www.nwoods.com/components/evalform.htm">Register</a></li> <li><a href="../../doc/download.html">Download</a></li> <li><a href="https://forum.nwoods.com/c/gojs">Forum</a></li> <li><a href="https://www.nwoods.com/support/query.htm">Contact</a></li> <li class="buy"><a href="https://www.nwoods.com/sales/ordering.htm">Buy</a></li> <li class="activate"><a href="https://www.nwoods.com/app/activate.aspx?sku=gojs">Activate</a></li> </ul> </div> </div> --> <!-- non-fixed navbar --> <nav id="api-nav" class="navbar navbar-inverse navbar-top"> <div class="container"> <div class="navbar-header" data-toggle="collapse" data-target="#navbar"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <!--<a class="navbar-brand" href="#">GoJS</a>--> </div> <div id="navbar" class="navbar-collapse collapse"> <ul class="nav navbar-nav navbar-right"> <li class="active"><a href="../../index.html">Home</a></li> <li><a href="../../learn/index.html">Learn</a></li> <li><a href="../../samples/index.html">Samples</a></li> <li><a href="../../intro/index.html">Intro</a></li> <li><a href="../../api/index.html">API</a></li> <li><a href="https://www.nwoods.com/components/evalform.htm">Register</a></li> <li><a href="../../doc/download.html">Download</a></li> <li><a href="https://forum.nwoods.com/c/gojs">Forum</a></li> <li><a href="https://www.nwoods.com/support/query.htm">Contact</a></li> <li class="buy"><a href="https://www.nwoods.com/sales/ordering.htm">Buy</a></li> <li class="activate"><a href="https://www.nwoods.com/app/activate.aspx?sku=gojs">Activate</a></li> </ul> </div><!--/.nav-collapse --> </div> </nav> <div class="container-fluid" id="api-container"> <div class="row"> <!-- ============================== classes index ============================ --> <div id="navindex" class="col-md-2"> <!-- begin publish.classesIndex --> <!-- <div><a href="../index.html">GoJS Class Index</a></div> --> <div class="sidebar-nav"> <div class="navbar navbar-default" role="navigation"> <div class="navbar-header" data-toggle="collapse" data-target="#DiagramNavbar"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#DiagramNavbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <span class="navbar-brand">Diagram Classes</span> </div> <div id="DiagramNavbar" class="navbar-collapse collapse sidebar-navbar-collapse"> <ul class="classList nav navbar-nav"> <li><a href="../symbols/Adornment.html" class="linkConstructor">Adornment</a></li> <li><a href="../symbols/AnimationManager.html" class="linkConstructor">AnimationManager</a></li> <li><a href="../symbols/CommandHandler.html" class="linkConstructor">CommandHandler</a></li> <li><a href="../symbols/Diagram.html" class="linkConstructor">Diagram</a></li> <li><a href="../symbols/DiagramEvent.html" class="linkConstructor">DiagramEvent</a></li> <li><a href="../symbols/GraphObject.html" class="linkConstructor">GraphObject</a></li> <li><a href="../symbols/Group.html" class="linkConstructor">Group</a></li> <li><a href="../symbols/InputEvent.html" class="linkConstructor">InputEvent</a></li> <li><a href="../symbols/Layer.html" class="linkConstructor">Layer</a></li> <li><a href="../symbols/Link.html" class="linkConstructor">Link</a></li> <li><a href="../symbols/Node.html" class="linkConstructor">Node</a></li> <li><a href="../symbols/Overview.html" class="linkConstructor">Overview</a></li> <li><a href="../symbols/Palette.html" class="linkConstructor">Palette</a></li> <li><a href="../symbols/Panel.html" class="linkConstructor">Panel</a></li> <li><a href="../symbols/Part.html" class="linkConstructor">Part</a></li> <li><a href="../symbols/Picture.html" class="linkConstructor">Picture</a></li> <li><a href="../symbols/Placeholder.html" class="linkConstructor">Placeholder</a></li> <li><a href="../symbols/RowColumnDefinition.html" class="linkConstructor">RowColumnDefinition</a></li> <li><a href="../symbols/Shape.html" class="linkConstructor">Shape</a></li> <li><a href="../symbols/TextBlock.html" class="linkConstructor">TextBlock</a></li> </ul> </div> </div> <div class="navbar navbar-default" role="navigation"> <div class="navbar-header" data-toggle="collapse" data-target="#GeometryNavbar"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#GeometryNavbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <span class="navbar-brand">Geometry Classes</span> </div> <div id="GeometryNavbar" class="navbar-collapse collapse sidebar-navbar-collapse"> <ul class="classList nav navbar-nav"> <li><a href="../symbols/Brush.html" class="linkConstructor">Brush</a></li> <li><a href="../symbols/Geometry.html" class="linkConstructor">Geometry</a></li> <li><a href="../symbols/Margin.html" class="linkConstructor">Margin</a></li> <li><a href="../symbols/PathFigure.html" class="linkConstructor">PathFigure</a></li> <li><a href="../symbols/PathSegment.html" class="linkConstructor">PathSegment</a></li> <li><a href="../symbols/Point.html" class="linkConstructor">Point</a></li> <li><a href="../symbols/Rect.html" class="linkConstructor">Rect</a></li> <li><a href="../symbols/Size.html" class="linkConstructor">Size</a></li> <li><a href="../symbols/Spot.html" class="linkConstructor">Spot</a></li> </ul> </div> </div> <div class="navbar navbar-default" role="navigation"> <div class="navbar-header" data-toggle="collapse" data-target="#ModelNavbar"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#ModelNavbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <span class="navbar-brand">Model Classes</span> </div> <div id="ModelNavbar" class="navbar-collapse collapse sidebar-navbar-collapse"> <ul class="classList nav navbar-nav"> <li><a href="../symbols/Binding.html" class="linkConstructor">Binding</a></li> <li><a href="../symbols/ChangedEvent.html" class="linkConstructor">ChangedEvent</a></li> <li><a href="../symbols/GraphLinksModel.html" class="linkConstructor">GraphLinksModel</a></li> <li><a href="../symbols/Model.html" class="linkConstructor">Model</a></li> <li><a href="../symbols/Transaction.html" class="linkConstructor">Transaction</a></li> <li><a href="../symbols/TreeModel.html" class="linkConstructor">TreeModel</a></li> <li><a href="../symbols/UndoManager.html" class="linkConstructor">UndoManager</a></li> </ul> </div> </div> <div class="navbar navbar-default" role="navigation"> <div class="navbar-header" data-toggle="collapse" data-target="#LayoutNavbar"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#LayoutNavbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <span class="navbar-brand">Layout Classes</span> </div> <div id="LayoutNavbar" class="navbar-collapse collapse sidebar-navbar-collapse"> <ul class="classList nav navbar-nav"> <li><a href="../symbols/CircularLayout.html" class="linkConstructor">CircularLayout</a></li> <li><a href="../symbols/ForceDirectedLayout.html" class="linkConstructor">ForceDirectedLayout</a></li> <li><a href="../symbols/GridLayout.html" class="linkConstructor">GridLayout</a></li> <li><a href="../symbols/LayeredDigraphLayout.html" class="linkConstructor">LayeredDigraphLayout</a></li> <li><a href="../symbols/Layout.html" class="linkConstructor">Layout</a></li> <li><a href="../symbols/LayoutNetwork.html" class="linkConstructor">LayoutNetwork</a></li> <li><a href="../symbols/TreeLayout.html" class="linkConstructor">TreeLayout</a></li> </ul> </div> </div> <div class="navbar navbar-default" role="navigation"> <div class="navbar-header" data-toggle="collapse" data-target="#ToolNavbar"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#ToolNavbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <span class="navbar-brand">Tool Classes</span> </div> <div id="ToolNavbar" class="navbar-collapse collapse sidebar-navbar-collapse"> <ul class="classList nav navbar-nav"> <li><a href="../symbols/ActionTool.html" class="linkConstructor">ActionTool</a></li> <li><a href="../symbols/ClickCreatingTool.html" class="linkConstructor">ClickCreatingTool</a></li> <li><a href="../symbols/ClickSelectingTool.html" class="linkConstructor">ClickSelectingTool</a></li> <li><a href="../symbols/ContextMenuTool.html" class="linkConstructor">ContextMenuTool</a></li> <li><a href="../symbols/DraggingTool.html" class="linkConstructor">DraggingTool</a></li> <li><a href="../symbols/DragSelectingTool.html" class="linkConstructor">DragSelectingTool</a></li> <li><a href="../symbols/LinkingBaseTool.html" class="linkConstructor">LinkingBaseTool</a></li> <li><a href="../symbols/LinkingTool.html" class="linkConstructor">LinkingTool</a></li> <li><a href="../symbols/LinkReshapingTool.html" class="linkConstructor">LinkReshapingTool</a></li> <li><a href="../symbols/PanningTool.html" class="linkConstructor">PanningTool</a></li> <li><a href="../symbols/RelinkingTool.html" class="linkConstructor">RelinkingTool</a></li> <li><a href="../symbols/ResizingTool.html" class="linkConstructor">ResizingTool</a></li> <li><a href="../symbols/RotatingTool.html" class="linkConstructor">RotatingTool</a></li> <li><a href="../symbols/TextEditingTool.html" class="linkConstructor">TextEditingTool</a></li> <li><a href="../symbols/Tool.html" class="linkConstructor">Tool</a></li> <li><a href="../symbols/ToolManager.html" class="linkConstructor">ToolManager</a></li> </ul> </div> </div> <div class="navbar navbar-default" role="navigation"> <div class="navbar-header" data-toggle="collapse" data-target="#CollectionNavbar"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#CollectionNavbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <span class="navbar-brand">Collection Classes</span> </div> <div id="CollectionNavbar" class="navbar-collapse collapse sidebar-navbar-collapse"> <ul class="classList nav navbar-nav"> <li><a href="../symbols/Iterable.html" class="linkConstructor">Iterable</a></li> <li><a href="../symbols/Iterator.html" class="linkConstructor">Iterator</a></li> <li><a href="../symbols/List.html" class="linkConstructor">List</a></li> <li><a href="../symbols/Map.html" class="linkConstructor">Map</a></li> <li><a href="../symbols/Set.html" class="linkConstructor">Set</a></li> </ul> </div> </div> </div> <!-- /class="sidebar-nav --> <!-- end publish.classesIndex --> </div> <div id="contentBody" class="col-md-10"> <!-- ============================== header ================================= --> <div id="header" class="fineprint mt30"> <b>GoJS</b>&reg; Diagramming Components<br/>version 1.6.10 for JavaScript/HTML<br/>by <a href="https://www.nwoods.com/">Northwoods Software&reg;</a> </div> <!-- ============================== class title ============================ --> <h2 class="classTitle mt30"> Class TextEditingTool </h2> <!-- ============================== class summary ========================== --> <span class="hideshowall"> <span class="nodetails"><button id="buttonShow">Show Details</button></span> <span class="details"><button id="buttonHide">Show Summaries</button></span> </span> <p class="classsummary"> <span class="extends"> Extends <a href="../symbols/Tool.html" class="linkConstructor">Tool</a>.</span> The TextEditingTool is used to let the user interactively edit text in place. This sets the <a href="../symbols/TextBlock.html#text" class="linkProperty">TextBlock.text</a> property; you may want to save the changed text to the model by using a TwoWay <a href="../symbols/Binding.html" class="linkConstructor">Binding</a> on the "text" property of editable TextBlocks. <p> Typically this is used by setting the <a href="../symbols/TextBlock.html#editable" class="linkProperty">TextBlock.editable</a> property to true on a particular <c>TextBlock</c> in a part. When the part is selected and the user clicks on the <a href="../symbols/TextBlock.html" class="linkConstructor">TextBlock</a> or invokes the <a href="../symbols/CommandHandler.html#editTextBlock" class="linkMethod">CommandHandler.editTextBlock</a> command, this tool is started and it uses an HTMLTextArea to perform in-place text editing. (For more details see the description for <a href="../symbols/TextEditingTool.html#doActivate" class="linkMethod">TextEditingTool.doActivate</a>.) <p> The <a href="../symbols/TextBlock.html" class="linkConstructor">TextBlock</a> is accessible as the <a href="../symbols/TextEditingTool.html#textBlock" class="linkProperty">TextEditingTool.textBlock</a> property. The text editor is accessible as the <a href="../symbols/TextEditingTool.html#currentTextEditor" class="linkProperty">TextEditingTool.currentTextEditor</a> property. From the text editor control one can access the <c>TextBlock</c> being edited via the 'textEditingTool' property to get to this tool, from which one can use the <a href="../symbols/TextEditingTool.html#textBlock" class="linkProperty">TextEditingTool.textBlock</a> property. <p> You can disable mouse clicking from starting this text editing tool by setting <a href="../symbols/Tool.html#isEnabled" class="linkProperty">Tool.isEnabled</a> to false. You can disable the F2 key from starting this text editing tool by making sure <a href="../symbols/Part.html#canEdit" class="linkMethod">Part.canEdit</a> returns false, by either setting <a href="../symbols/Diagram.html#allowTextEdit" class="linkProperty">Diagram.allowTextEdit</a> to false or by setting <a href="../symbols/Part.html#textEditable" class="linkProperty">Part.textEditable</a> to false. <p> If you want to programmatically start the user editing a particular TextBlock, call CommandHandler.editTextBlock. That command method is also invoked by the F2 key on the keyboard. </p> <!-- ============================== constructor summary ==================== --> <h2 id="constructor" class="summaryCaption"> Constructor <span class="nodetails"> Summary</span><span class="details"> Details</span></h2> <div class="table-responsive"> <table class="summaryTable table table-bordered table-condensed" summary="A summary of the constructor documented in the class TextEditingTool."> <thead> <tr> <th scope="col" class="name">Name</th> <th scope="col" class="description">Description</th> </tr> </thead> <tbody> <tr> <td class="name" > <div class="name"> TextEditingTool() </div> </td> <td class="description"> <div class="description"> <!--newp--><p><p>You do not normally need to create an instance of this tool because one already exists as the <a href="../symbols/ToolManager.html#textEditingTool" class="linkProperty">ToolManager.textEditingTool</a>, which you can modify.<span class="nodetails" id="xconTextEditingTool"><a class="morelink" onclick="hst('conTextEditingTool')">More...</a></span> <span class="details" id="conTextEditingTool"> </span><div class="details" id="dconTextEditingTool"><p> The <a href="../symbols/Tool.html#name" class="linkProperty">Tool.name</a> of this tool is "TextEditing".</div> </div> </td> </tr> </tbody> </table> </div><!-- class="table-responsive">--> <!-- ============================== properties summary ===================== --> <h2 class="summaryCaption">Properties<span class="nodetails"> Summary</span><span class="details"> Details</span></h2> <div class="table-responsive"> <table class="summaryTable table table-bordered table-condensed" summary="A summary of the properties documented in the class TextEditingTool."> <thead> <tr> <th scope="col" class="name">Name, Value Type</th> <th scope="col" class="description">Description</th> </tr> </thead> <tbody> <tr id="currentTextEditor" > <td class="name"> <div class="name"> currentTextEditor </div> <div class="attributes"> <span class="light">{Element}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets the HTML element that is editing the text. </div> </td> </tr> <tr id="defaultTextEditor" > <td class="name"> <div class="name"> defaultTextEditor </div> <div class="attributes"> <span class="light">{Element}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets the default HTML element that edits the text.<span class="nodetails" id="xpropdefaultTextEditor"><a class="morelink" onclick="hst('propdefaultTextEditor')">More...</a></span> <span class="details" id="propdefaultTextEditor"> This is used by <a href="../symbols/TextEditingTool.html#doActivate" class="linkMethod">TextEditingTool.doActivate</a> in case the TextBlock does not provide a <a href="../symbols/TextBlock.html#textEditor" class="linkProperty">TextBlock.textEditor</a>. The HTML element will be added and removed automatically, and should have a way of calling <a href="../symbols/TextEditingTool.html#acceptText" class="linkMethod">TextEditingTool.acceptText</a>. By default the value is an HTMLTextArea.</span> </div> </td> </tr> <tr id="selectsTextOnActivate" > <td class="name"> <div class="name"> selectsTextOnActivate </div> <div class="attributes"> <span class="light">{boolean}</span> <span class="since" title="since">1.5</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets whether to select (highlight) the editable text when the TextEditingTool is activated.<span class="nodetails" id="xpropselectsTextOnActivate"><a class="morelink" onclick="hst('propselectsTextOnActivate')">More...</a></span> <span class="details" id="propselectsTextOnActivate"> The default is true.</span> </div> </td> </tr> <tr id="starting" > <td class="name"> <div class="name"> starting </div> <div class="attributes"> <span class="light">{EnumValue}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets how user gestures can start in-place editing of text.<span class="nodetails" id="xpropstarting"><a class="morelink" onclick="hst('propstarting')">More...</a></span> <span class="details" id="propstarting"> </span><div class="details" id="dpropstarting"><p> Possible values are <a href="../symbols/TextEditingTool.html#SingleClickSelected" class="linkConstant">TextEditingTool.SingleClickSelected</a> and <a href="../symbols/TextEditingTool.html#SingleClick" class="linkConstant">TextEditingTool.SingleClick</a> <p> The default is <a href="../symbols/TextEditingTool.html#SingleClickSelected" class="linkConstant">TextEditingTool.SingleClickSelected</a></div> </div> </td> </tr> <tr id="textBlock" > <td class="name"> <div class="name"> textBlock </div> <div class="attributes"> <span class="light">{<a href="../symbols/TextBlock.html" class="linkConstructor">TextBlock</a>}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets the <a href="../symbols/TextBlock.html" class="linkConstructor">TextBlock</a> that is being edited.<span class="nodetails" id="xproptextBlock"><a class="morelink" onclick="hst('proptextBlock')">More...</a></span> <span class="details" id="proptextBlock"> This property is initially null and is set in <a href="../symbols/TextEditingTool.html#doActivate" class="linkMethod">TextEditingTool.doActivate</a> as the <a href="../symbols/TextBlock.html" class="linkConstructor">TextBlock</a> at the mouse click point. However, if you set this property beforehand, <a href="../symbols/TextEditingTool.html#doActivate" class="linkMethod">TextEditingTool.doActivate</a> will not set it, and this tool will edit the given <a href="../symbols/TextBlock.html" class="linkConstructor">TextBlock</a>.</span> </div> </td> </tr> <tr id="textValidation" > <td class="name"> <div class="name"> textValidation </div> <div class="attributes"> <span class="light">{function(TextBlock, string, string):boolean | null}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets the predicate that determines whether or not a string of text is valid.<span class="nodetails" id="xproptextValidation"><a class="morelink" onclick="hst('proptextValidation')">More...</a></span> <span class="details" id="proptextValidation"> If this is non-null, this predicate is called in addition to any <a href="../symbols/TextBlock.html#textValidation" class="linkProperty">TextBlock.textValidation</a> predicate. See <a href="../symbols/TextEditingTool.html#isValidText" class="linkMethod">isValidText</a> for more details. The default predicate is null, which is equivalent to simply returning true. </span><div class="details" id="dproptextValidation"><p> The function, if supplied, must not have any side-effects.</div> </div> </td> </tr> </tbody> </table> </div><!-- class="table-responsive">--> <dl class="inheritsList"> <dt>Properties borrowed from class <a href="../symbols/Tool.html" class="linkConstructor">Tool</a>: </dt><dd><a href="../symbols/Tool.html#diagram" class="linkProperty">diagram</a>, <a href="../symbols/Tool.html#isActive" class="linkProperty">isActive</a>, <a href="../symbols/Tool.html#isEnabled" class="linkProperty">isEnabled</a>, <a href="../symbols/Tool.html#name" class="linkProperty">name</a>, <a href="../symbols/Tool.html#transactionResult" class="linkProperty">transactionResult</a></dd> </dl> <!-- ============================== methods summary ======================== --> <h2 class="summaryCaption">Method <span class="nodetails"> Summary</span><span class="details"> Details</span></h2> <div class="table-responsive"> <table class="summaryTable table table-bordered table-condensed" summary="A summary of the methods documented in the class TextEditingTool."> <thead> <tr> <th scope="col" class="name">Name, Return Type</th> <th scope="col" class="description">Description</th> </tr> </thead> <tbody> <tr id="acceptText"> <td class="name"> <div class="name"> acceptText(reason) </div> <div class="attributes"> </div> </td> <td class="description"> <div class="description"> <!--newp--><p><p>Finish editing by trying to accept the new text.<span class="nodetails" id="xmethacceptText"><a class="morelink" onclick="hst('methacceptText')">More...</a></span> <span class="details" id="methacceptText"> </span><div class="details" id="dmethacceptText"><p> Please read the Introduction page on <a href="../../intro/extensions.html">Extensions</a> for how to override methods and how to call this base method.</div> <dl class="detailList"> <dt class="heading">Parameters:</dt> <dt> <span class="light fixedFont">{EnumValue}</span> <b>reason</b> </dt> <dd>The reason must be either <a href="../symbols/TextEditingTool.html#LostFocus" class="linkConstant">TextEditingTool.LostFocus</a>, <a href="../symbols/TextEditingTool.html#MouseDown" class="linkConstant">TextEditingTool.MouseDown</a>, <a href="../symbols/TextEditingTool.html#Tab" class="linkConstant">TextEditingTool.Tab</a>, or <a href="../symbols/TextEditingTool.html#Enter" class="linkConstant">TextEditingTool.Enter</a>.</dd> </dl> </div> </td> </tr> <tr id="canStart"> <td class="name"> <div class="name"> canStart() </div> <div class="attributes"> <span class="light">{boolean}</span> </div> </td> <td class="description"> <div class="description"> <!--newp--><p><p>This may run when there is a mouse-click on a <a href="../symbols/TextBlock.html" class="linkConstructor">TextBlock</a> for which the <a href="../symbols/TextBlock.html#editable" class="linkProperty">TextBlock.editable</a> property is true in a <a href="../symbols/Part.html" class="linkConstructor">Part</a> that <a href="../symbols/Part.html#isSelected" class="linkProperty">Part.isSelected</a>.<span class="nodetails" id="xmethcanStart"><a class="morelink" onclick="hst('methcanStart')">More...</a></span> <span class="details" id="methcanStart"> </span><div class="details" id="dmethcanStart"><p> This method may be overridden. Please read the Introduction page on <a href="../../intro/extensions.html">Extensions</a> for how to override methods and how to call this base method.</div> <dl class="detailList"> <dt class="heading">Returns:</dt> <dt><span class="light fixedFont">{boolean}</span> </dt> </dl> </div> </td> </tr> <tr id="doActivate"> <td class="name"> <div class="name"> doActivate() </div> <div class="attributes"> </div> </td> <td class="description"> <div class="description"> <!--newp--><p><p>Start editing the text for a <a href="../symbols/TextEditingTool.html#textBlock" class="linkProperty">textBlock</a>.<span class="nodetails" id="xmethdoActivate"><a class="morelink" onclick="hst('methdoActivate')">More...</a></span> <span class="details" id="methdoActivate"> </span><div class="details" id="dmethdoActivate"><p> If <a href="../symbols/TextEditingTool.html#textBlock" class="linkProperty">TextEditingTool.textBlock</a> is not already specified, this looks for one at the current mouse point. If none is found, this method does nothing. <p> Then this method need an HTMLElement to manage the editing. If <a href="../symbols/TextBlock.html#textEditor" class="linkProperty">TextBlock.textEditor</a> is defined on the <c>TextBlock</c> it will use that. If one is supplied for <a href="../symbols/TextEditingTool.html#defaultTextEditor" class="linkProperty">defaultTextEditor</a> it uses that. Finally, by default it creates and uses an HTMLTextArea. <p> This sets <a href="../symbols/Tool.html#isActive" class="linkProperty">Tool.isActive</a> to true. Custom text editors should call <a href="../symbols/TextEditingTool.html#acceptText" class="linkMethod">TextEditingTool.acceptText</a> to finish the edit by modifying the <a href="../symbols/TextBlock.html" class="linkConstructor">TextBlock</a> and committing the edit transaction. Or call <a href="../symbols/TextEditingTool.html#doCancel" class="linkMethod">TextEditingTool.doCancel</a> to abort the edit.</div> </div> </td> </tr> <tr id="doCancel"> <td class="name"> <div class="name"> doCancel() </div> <div class="attributes"> </div> </td> <td class="description"> <div class="description"> <!--newp--><p><p>Abort any text editing operation. </div> </td> </tr> <tr id="doDeactivate"> <td class="name"> <div class="name"> doDeactivate() </div> <div class="attributes"> </div> </td> <td class="description"> <div class="description"> <!--newp--><p><p>Release the mouse. </div> </td> </tr> <tr id="doMouseDown"> <td class="name"> <div class="name"> doMouseDown() </div> <div class="attributes"> </div> </td> <td class="description"> <div class="description"> <!--newp--><p><p>This calls <a href="../symbols/TextEditingTool.html#acceptText" class="linkMethod">acceptText</a> with the reason TextEditingTool.MouseDown, if this tool <a href="../symbols/Tool.html#isActive" class="linkProperty">Tool.isActive</a>. </div> </td> </tr> <tr id="doMouseUp"> <td class="name"> <div class="name"> doMouseUp() </div> <div class="attributes"> </div> </td> <td class="description"> <div class="description"> <!--newp--><p><p>A click (mouse up) calls <a href="../symbols/TextEditingTool.html#doActivate" class="linkMethod">TextEditingTool.doActivate</a> if this tool is not already active and if <a href="../symbols/TextEditingTool.html#canStart" class="linkMethod">TextEditingTool.canStart</a> returns true. </div> </td> </tr> <tr id="doStart"> <td class="name"> <div class="name"> doStart() </div> <div class="attributes"> </div> </td> <td class="description"> <div class="description"> <!--newp--><p><p>This calls <a href="../symbols/TextEditingTool.html#doActivate" class="linkMethod">TextEditingTool.doActivate</a> if there is a <a href="../symbols/TextEditingTool.html#textBlock" class="linkProperty">textBlock</a> set.<span class="nodetails" id="xmethdoStart"><a class="morelink" onclick="hst('methdoStart')">More...</a></span> <span class="details" id="methdoStart"> <a href="../symbols/TextEditingTool.html#doActivate" class="linkMethod">doActivate</a> attempts to set <a href="../symbols/TextEditingTool.html#textBlock" class="linkProperty">textBlock</a> if it is null.</span> </div> </td> </tr> <tr id="isValidText"> <td class="name"> <div class="name"> isValidText(textblock, oldstr, newstr) </div> <div class="attributes"> <span class="light">{boolean}</span> </div> </td> <td class="description"> <div class="description"> <!--newp--><p><p>This predicate checks any <a href="../symbols/TextBlock.html#textValidation" class="linkProperty">TextBlock.textValidation</a> predicate and this tool's <a href="../symbols/TextEditingTool.html#textValidation" class="linkProperty">textValidation</a> predicate to make sure the <a href="../symbols/TextBlock.html#text" class="linkProperty">TextBlock.text</a> property may be set to the new string.<span class="nodetails" id="xmethisValidText"><a class="morelink" onclick="hst('methisValidText')">More...</a></span> <span class="details" id="methisValidText"> </span><div class="details" id="dmethisValidText"><p> This method may be overridden, although usually it is sufficient to set <a href="../symbols/TextEditingTool.html#textValidation" class="linkProperty">textValidation</a>. Please read the Introduction page on <a href="../../intro/extensions.html">Extensions</a> for how to override methods and how to call this base method.</div> <dl class="detailList"> <dt class="heading">Parameters:</dt> <dt> <span class="light fixedFont">{<a href="../symbols/TextBlock.html" class="linkConstructor">TextBlock</a>}</span> <b>textblock</b> </dt> <dd>the <a href="../symbols/TextBlock.html" class="linkConstructor">TextBlock</a> that is being edited.</dd> <dt> <span class="light fixedFont">{string}</span> <b>oldstr</b> </dt> <dd>the previous string value.</dd> <dt> <span class="light fixedFont">{string}</span> <b>newstr</b> </dt> <dd>the proposed new string value.</dd> </dl> <dl class="detailList"> <dt class="heading">Returns:</dt> <dt><span class="light fixedFont">{boolean}</span> true if the new string is valid for the given TextBlock.</dt> </dl> </div> </td> </tr> </tbody> </table> </div><!-- class="table-responsive">--> <dl class="inheritsList"> <dt>Methods borrowed from class <a href="../symbols/Tool.html" class="linkConstructor">Tool</a>: </dt><dd><a href="../symbols/Tool.html#cancelWaitAfter" class="linkMethod">cancelWaitAfter</a>, <a href="../symbols/Tool.html#canStartMultiTouch" class="linkMethod">canStartMultiTouch</a>, <a href="../symbols/Tool.html#doKeyDown" class="linkMethod">doKeyDown</a>, <a href="../symbol