X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.diagram%2Fsrc%2Forg%2Fsimantics%2Fdiagram%2Felements%2FTextNode.java;h=2991d234c462bdb09e150e7d81892e7c18013f2c;hp=0b33ae3c4f65dda2250adf361cfeb7868d872056;hb=3538e24e9b8791ffedfc0c3c26ab212c77d5eab5;hpb=2bc244dcb1f23667bb26da82da7d484d227467c4 diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/elements/TextNode.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/elements/TextNode.java index 0b33ae3c4..2991d234c 100644 --- a/bundles/org.simantics.diagram/src/org/simantics/diagram/elements/TextNode.java +++ b/bundles/org.simantics.diagram/src/org/simantics/diagram/elements/TextNode.java @@ -857,6 +857,18 @@ public class TextNode extends G2DNode implements IDynamicSelectionPainterNode, L protected void renderSelectedHover(Graphics2D g, boolean isSelected, boolean isHovering) { } + public String editText(String text) { + + String error = validator != null ? validator.apply(text) : null; + if (error == null) { + this.text = text; + if (textListener != null) { + textListener.textEditingEnded(); + } + } + return error; + } + /** * Replaces the current selection with the content or inserts * the content at caret. After the insertion the caret