Search in sources :

Example 1 with JsArrayInteger

use of com.google.gwt.core.client.JsArrayInteger in project gwtphonegap by dankurka.

the class NotificationMobileImpl method vibrateWithPattern.

@Override
public void vibrateWithPattern(int[] pattern) {
    JsArrayInteger jsPattern = JsArrayUtils.readOnlyJsArray(pattern);
    vibrateWithPattern0(jsPattern);
}
Also used : JsArrayInteger(com.google.gwt.core.client.JsArrayInteger)

Example 2 with JsArrayInteger

use of com.google.gwt.core.client.JsArrayInteger in project gwtphonegap by dankurka.

the class NotificationMobileImpl method vibrateWithPattern.

@Override
@Deprecated
public void vibrateWithPattern(int[] pattern, int repeat) {
    JsArrayInteger jsPattern = JsArrayUtils.readOnlyJsArray(pattern);
    vibrateWithPattern0(jsPattern, repeat);
}
Also used : JsArrayInteger(com.google.gwt.core.client.JsArrayInteger)

Example 3 with JsArrayInteger

use of com.google.gwt.core.client.JsArrayInteger in project che by eclipse.

the class TerminalPresenter method setTerminalSize.

@Override
public void setTerminalSize(int x, int y) {
    if (!connected) {
        return;
    }
    if (width == x && height == y) {
        return;
    }
    terminal.resize(x, y);
    width = x;
    height = y;
    Jso jso = Jso.create();
    JsArrayInteger arr = Jso.createArray().cast();
    arr.set(0, x);
    arr.set(1, y);
    jso.addField("type", "resize");
    jso.addField("data", arr);
    socket.send(jso.serialize());
}
Also used : Jso(org.eclipse.che.ide.collections.Jso) JsArrayInteger(com.google.gwt.core.client.JsArrayInteger)

Example 4 with JsArrayInteger

use of com.google.gwt.core.client.JsArrayInteger in project rstudio by rstudio.

the class CompletionRequester method getCompletions.

public void getCompletions(final String token, final List<String> assocData, final List<Integer> dataType, final List<Integer> numCommas, final String functionCallString, final String chainDataName, final JsArrayString chainAdditionalArgs, final JsArrayString chainExcludeArgs, final boolean chainExcludeArgsFromObject, final String filePath, final String documentId, final boolean implicit, final ServerRequestCallback<CompletionResult> callback) {
    boolean isHelp = dataType.size() > 0 && dataType.get(0) == AutocompletionContext.TYPE_HELP;
    if (usingCache(token, isHelp, callback))
        return;
    doGetCompletions(token, assocData, dataType, numCommas, functionCallString, chainDataName, chainAdditionalArgs, chainExcludeArgs, chainExcludeArgsFromObject, filePath, documentId, new ServerRequestCallback<Completions>() {

        @Override
        public void onError(ServerError error) {
            callback.onError(error);
        }

        @Override
        public void onResponseReceived(Completions response) {
            cachedLinePrefix_ = token;
            String token = response.getToken();
            JsArrayString comp = response.getCompletions();
            JsArrayString pkgs = response.getPackages();
            JsArrayBoolean quote = response.getQuote();
            JsArrayInteger type = response.getType();
            ArrayList<QualifiedName> newComp = new ArrayList<QualifiedName>();
            // Get function completions from the server
            for (int i = 0; i < comp.length(); i++) if (comp.get(i).endsWith(" = "))
                newComp.add(new QualifiedName(comp.get(i), pkgs.get(i), quote.get(i), type.get(i), response.getHelpHandler()));
            // Try getting our own function argument completions
            if (!response.getExcludeOtherCompletions()) {
                addFunctionArgumentCompletions(token, newComp);
                addScopedArgumentCompletions(token, newComp);
            }
            // Get variable completions from the current scope
            if (!response.getExcludeOtherCompletions()) {
                addScopedCompletions(token, newComp, "variable");
                addScopedCompletions(token, newComp, "function");
            }
            // Get other server completions
            for (int i = 0; i < comp.length(); i++) if (!comp.get(i).endsWith(" = "))
                newComp.add(new QualifiedName(comp.get(i), pkgs.get(i), quote.get(i), type.get(i), response.getHelpHandler()));
            // to properly ascertain this.
            if (isTopLevelCompletionRequest())
                addSnippetCompletions(token, newComp);
            // Remove duplicates
            newComp = resolveDuplicates(newComp);
            CompletionResult result = new CompletionResult(response.getToken(), newComp, response.getGuessedFunctionName(), response.getSuggestOnAccept(), response.getOverrideInsertParens());
            if (response.isCacheable()) {
                cachedCompletions_.put("", result);
            }
            callback.onResponseReceived(result);
        }
    });
}
Also used : RnwOptionCompletionResult(org.rstudio.studio.client.workbench.views.source.model.RnwChunkOptions.RnwOptionCompletionResult) ServerError(org.rstudio.studio.client.server.ServerError) JsArrayInteger(com.google.gwt.core.client.JsArrayInteger) ArrayList(java.util.ArrayList) JsArrayString(com.google.gwt.core.client.JsArrayString) JsArrayString(com.google.gwt.core.client.JsArrayString) JsArrayBoolean(com.google.gwt.core.client.JsArrayBoolean) Completions(org.rstudio.studio.client.common.codetools.Completions)

Example 5 with JsArrayInteger

use of com.google.gwt.core.client.JsArrayInteger in project rstudio by rstudio.

the class FindResult method getJavaArray.

private ArrayList<Integer> getJavaArray(String property) {
    JsArrayInteger array = getArray(property);
    ArrayList<Integer> ints = new ArrayList<Integer>();
    for (int i = 0; i < array.length(); i++) ints.add(array.get(i));
    return ints;
}
Also used : JsArrayInteger(com.google.gwt.core.client.JsArrayInteger) JsArrayInteger(com.google.gwt.core.client.JsArrayInteger) ArrayList(java.util.ArrayList)

Aggregations

JsArrayInteger (com.google.gwt.core.client.JsArrayInteger)14 JsArrayString (com.google.gwt.core.client.JsArrayString)4 ArrayList (java.util.ArrayList)4 JsArrayBoolean (com.google.gwt.core.client.JsArrayBoolean)2 ServerError (org.rstudio.studio.client.server.ServerError)2 RnwOptionCompletionResult (org.rstudio.studio.client.workbench.views.source.model.RnwChunkOptions.RnwOptionCompletionResult)2 Jso (org.eclipse.che.ide.collections.Jso)1 Match (org.rstudio.core.client.regex.Match)1 Completions (org.rstudio.studio.client.common.codetools.Completions)1 SpellCheckerResult (org.rstudio.studio.client.common.spelling.model.SpellCheckerResult)1 Range (org.rstudio.studio.client.workbench.views.source.editors.text.ace.Range)1