View Javadoc
1   package org.vaadin.aceeditor.client.gwt;
2   
3   import com.google.gwt.core.client.JavaScriptObject;
4   import com.google.gwt.core.client.JsArray;
5   
6   /**
7    * An annotation shown at the Ace editor.
8    * 
9    */
10  public class GwtAceAnnotation extends JavaScriptObject {
11  	protected GwtAceAnnotation() {
12  	}
13  
14  	/**
15  	 * Eg. create("error", "An error on line 5", 4);
16  	 * 
17  	 * @param type
18  	 * @param text
19  	 * @param row
20  	 * @return the annotation
21  	 */
22  	public static final native GwtAceAnnotation create(String type, String text,
23  			int row) /*-{
24  		return {
25  			text: text,
26  			row: row,
27  			type: type,
28  			isVaadinAceEditorAnnotation: true
29  		};
30  	}-*/;
31  
32  	public static final native JsArray<GwtAceAnnotation> createEmptyArray() /*-{
33  		return [];
34  	}-*/;
35  	
36  	public final native String getText() /*-{
37  		return this.text;
38  	}-*/;
39  	
40  	public final native int getRow() /*-{
41  		return this.row;
42  	}-*/;
43  	
44  	public final native String getType() /*-{
45  		return this.type;
46  	}-*/;
47  
48  	public final native boolean isVaadinAceEditorAnnotation() /*-{
49  		return !!this.isVaadinAceEditorAnnotation;
50  	}-*/;
51  }