MCPcopy Create free account
hub / github.com/Card-Forge/forge / insertText

Method insertText

forge-gui-mobile/src/forge/toolbox/FTextField.java:103–115  ·  view source on GitHub ↗
(String text0)

Source from the content-addressed store, hash-verified

101 }
102
103 protected void insertText(String text0) {
104 int insertLength = text0.length();
105 if (selStart > 0) {
106 text0 = text.substring(0, selStart) + text0;
107 }
108 int selEnd = selStart + selLength;
109 if (selEnd < text.length()) {
110 text0 += text.substring(selEnd);
111 }
112 text = text0;
113 selStart += insertLength; //put cursor after inserted text
114 selLength = 0;
115 }
116
117 public String getSelectedText() {
118 if (selLength > 0) {

Callers 3

buildMenuMethod · 0.95
keyTypedMethod · 0.95
keyDownMethod · 0.95

Calls 1

lengthMethod · 0.80

Tested by

no test coverage detected