From 41a1fd8f729ae84fc882fa5539188eb314b12d78 Mon Sep 17 00:00:00 2001 From: Dustin Hoffman Date: Mon, 9 Feb 2015 15:14:15 -0500 Subject: [PATCH] Added focus and getLineCount methods. --- .../cs/dh/acegwt/client/ace/AceEditor.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/AceGWT/src/edu/ycp/cs/dh/acegwt/client/ace/AceEditor.java b/AceGWT/src/edu/ycp/cs/dh/acegwt/client/ace/AceEditor.java index f35016a..814b52c 100644 --- a/AceGWT/src/edu/ycp/cs/dh/acegwt/client/ace/AceEditor.java +++ b/AceGWT/src/edu/ycp/cs/dh/acegwt/client/ace/AceEditor.java @@ -226,7 +226,24 @@ public native String getText() /*-{ return editor.getSession().getValue(); }-*/; - + /** + * Causes the editor to gain input focus. + */ + public native void focus() /*-{ + var editor = this.@edu.ycp.cs.dh.acegwt.client.ace.AceEditor::editor; + editor.focus(); + }-*/; + + /** + * Retrieves the number of lines in the editor. + * + * @return The number of lines in the editor. + */ + public native int getLineCount() /*-{ + var editor = this.@edu.ycp.cs.dh.acegwt.client.ace.AceEditor::editor; + return editor.session.getLength(); + }-*/; + /** * Set the complete text in the editor from a String. *