/*******************************************************************************
 * Copyright (c) 2014 Codenvy, S.A.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   Codenvy, S.A. - initial API and implementation
 *******************************************************************************/
package com.codenvy.ide.editor.codemirror.client.jso.hints;

import com.codenvy.ide.editor.codemirror.client.jso.CMKeymapOverlay;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.dom.client.Element;

/**
 * Overlay class over CodeMirror's completion options objects.
 *
 * @author "Mickaël Leduque"
 */
public class CMHintOptionsOverlay extends JavaScriptObject {

    protected CMHintOptionsOverlay() {
    }

    public final native CMHintFunctionOverlay getHint() /*-{
        return this.hint;
    }-*/;

    public final native void setHint(CMHintFunctionOverlay hintFunction) /*-{
        this.hint = hintFunction;
    }-*/;

    public final native boolean getCompleteSingle() /*-{
        return this.completeSingle;
    }-*/;

    public final native void setCompleteSingle(boolean newValue) /*-{
        this.completeSingle = newValue;
    }-*/;

    public final native boolean getAlignWithWord() /*-{
        return this.alignWithWord;
    }-*/;

    public final native void setAlignWithWord(boolean newValue) /*-{
        this.alignWithWord = newValue;
    }-*/;

    public final native boolean getCloseOnUnfocus() /*-{
        return this.closeOnUnfocus;
    }-*/;

    public final native void setCloseOnUnfocus(boolean newValue) /*-{
        this.closeOnUnfocus = newValue;
    }-*/;

    public final native CMKeymapOverlay getCustomKeys() /*-{
        return this.customKeys;
    }-*/;

    public final native void setCustomKeys(CMKeymapOverlay newValue) /*-{
        this.customKeys = newValue;
    }-*/;

    public final native CMKeymapOverlay getExtraKeys() /*-{
        return this.extraKeys;
    }-*/;

    public final native void setExtraKeys(CMKeymapOverlay newValue) /*-{
        this.extraKeys = newValue;
    }-*/;

    /**
     * Define which element will be the parent of the popup.<br>
     * <em>Optional</em>. If not set, the document will be the parent.
     * @param container the parent of the popup
     */
    public final native void setContainer(Element container) /*-{
        this.container = container;
    }-*/;

    public final native Element getContainer() /*-{
        return this.container;
    }-*/;

    public static final native CMHintOptionsOverlay create() /*-{
        return {};
    }-*/;
}

@@ -806,44 +806,12 @@
 ts.%0A
- *%0A * @author %22Micka%C3%ABl Leduque%22%0A
  */%0A
+
 publ
@@ -1004,32 +1004,117 @@
 int;%0A    %7D-*/;%0A%0A
+    /**%0A     * Hinting function.%0A     * @param hintFunction hinting function%0A     */%0A
     public final
@@ -1316,32 +1316,260 @@
 gle;%0A    %7D-*/;%0A%0A
+    /**%0A     * Determines whether, when only a single completion is available, it is completed without showing%0A     * the dialog.%3Cbr%3E%0A     * Defaults to true.%0A     * @param newValue true to autocomplete single proposals%0A     */%0A
     public final
@@ -1767,32 +1767,224 @@
 ord;%0A    %7D-*/;%0A%0A
+    /**%0A     * Whether the pop-up should be horizontally aligned with the start of the word (true, default), or%0A     * with the cursor (false).%0A     * @param newValue popup align mode%0A     */%0A
     public final
@@ -2182,32 +2182,193 @@
 cus;%0A    %7D-*/;%0A%0A
+    /**%0A     * When enabled (which is the default), the pop-up will close when the editor is unfocused.%0A     * @param newValue true to autoclose on blur%0A     */%0A
     public final
@@ -2568,32 +2568,179 @@
 eys;%0A    %7D-*/;%0A%0A
+    /**%0A     * Allows you to provide a custom key map of keys to be active when the pop-up is active.%0A     * @param newValue custom keymap%0A     */%0A
     public final
@@ -2938,32 +2938,209 @@
 eys;%0A    %7D-*/;%0A%0A
+    /**%0A     * Like customKeys above, but the bindings will be added to the set of default bindings,%0A     * instead of replacing them.%0A     * @param newValue extra keys%0A     */%0A
     public final

Document the hint options