/*
 * AceDocumentChangeEventNative.java
 *
 * Copyright (C) 2009-12 by RStudio, Inc.
 *
 * Unless you have received this program directly from RStudio pursuant
 * to the terms of a commercial license agreement with RStudio, then
 * this program is licensed to you under the terms of version 3 of the
 * GNU Affero General Public License. This program is distributed WITHOUT
 * ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT,
 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the
 * AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details.
 *
 */
package org.rstudio.studio.client.workbench.views.source.editors.text.ace;

import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArrayString;

public class AceDocumentChangeEventNative extends JavaScriptObject
{
   protected AceDocumentChangeEventNative() {};
   
   public final native String getAction() /*-{
      return this.action;
   }-*/;

   public final native Range getRange() /*-{
      return this;
   }-*/;
   
   public final native JsArrayString getLines() /*-{
      return this.lines;
   }-*/;
}

@@ -679,52 +679,38 @@
 ort 
-com.google.gwt.core.client.JavaScriptObject;
+jsinterop.annotations.JsType;%0A
 %0Aimp
@@ -760,89 +760,173 @@
 g;%0A%0A
-public class AceDocumentChangeEventNative extends JavaScriptObject%0A%7B%0A   protected
+import jsinterop.annotations.JsOverlay;%0Aimport jsinterop.annotations.JsPackage;%0A%0A@JsType(isNative = true, namespace = JsPackage.GLOBAL, name = %22Object%22)%0Apublic class
  Ace
@@ -954,18 +954,10 @@
 tive
-() %7B%7D;%0A   
+%0A%7B
 %0A   
@@ -967,80 +967,121 @@
 lic 
-final native String getAction() /*-%7B%0A      return this.action;%0A   %7D-*/;%0A
+String action;%0A   public Position start;%0A   public Position end;%0A   public JsArrayString lines;%0A   %0A   @JsOverlay
 %0A   
@@ -1093,23 +1093,16 @@
 c final 
-native 
 Range ge
@@ -1109,20 +1109,20 @@
 tRange()
- /*-
+%0A   
 %7B%0A      
@@ -1132,30 +1132,50 @@
 urn 
-this
+Range.fromPoints(start, end)
 ;%0A   %7D
--*/;
 %0A   %0A   
 publ
@@ -1174,56 +1174,57 @@
 %0A   
-public final native JsArrayString getLines() /*-
+@JsOverlay%0A   public final String getAction()%0A   
 %7B%0A  
@@ -1238,27 +1238,19 @@
 urn 
-this.lines
+action
 ;%0A   %7D
--*/;
 %0A%7D%0A

fix for range construction on Ace document change events