Package com.google.collide.json.shared

Examples of com.google.collide.json.shared.JsonStringSet


  public static JsonStringSet createStringSet() {
    return implementation.createStringSet();
  }

  public static JsonStringSet createStringSet(String... items) {
    JsonStringSet set = createStringSet();
    for (int i = 0, n = items.length; i < n; i++) {
      set.add(items[i]);
    }
    return set;
  }
View Full Code Here


    }
    return set;
  }

  public static JsonStringSet createStringSet(Iterator<String> iterator) {
    JsonStringSet set = createStringSet();
    while (iterator.hasNext()) {
      set.add(iterator.next());
    }
    return set;
  }
View Full Code Here

    helper.parser.begin();
    helper.parseScheduler.requests.get(0).run(10);
    AutocompleteProposals autocompletions =
        helper.autocompleter.jsAutocompleter.findAutocompletions(
            helper.editor.getSelection(), CTRL_SPACE);
    JsonStringSet proposals = JsonCollections.createStringSet();
    for (int i = 0, l = autocompletions.size(); i < l; i++) {
      proposals.add(autocompletions.get(i).getName());
    }
    assertTrue("contains var defined before long line", proposals.contains("bar1"));
    assertTrue("contains var defined after long line", proposals.contains("bar3"));
  }
View Full Code Here

    helper.parser.begin();
    helper.parseScheduler.requests.get(0).run(10);
    AutocompleteProposals autocompletions =
        helper.autocompleter.jsAutocompleter.findAutocompletions(
            helper.editor.getSelection(), CTRL_SPACE);
    JsonStringSet proposals = JsonCollections.createStringSet();
    for (int i = 0, l = autocompletions.size(); i < l; i++) {
      proposals.add(autocompletions.get(i).getName());
    }
    assertTrue("contains var defined in line with regexp", proposals.contains("bar1"));
    assertTrue("contains var defined after line with regexp", proposals.contains("bar2"));
  }
View Full Code Here

  public void testGlobalShortcuts() {
    JsProposalBuilder jsProposalBuilder = new JsProposalBuilder();
    CompletionContext<JsState> context = new CompletionContext<JsState>(
        "", "con", false, CompletionType.GLOBAL, null, 0);
    JsonStringSet prefixes = JsonCollections.createStringSet();
    prefixes.add("");
    prefixes.add("Tofu.");
    jsProposalBuilder.addShortcutsTo(context, prefixes);
    assertEquals(JsonCollections.createStringSet("", "Tofu.", "window."), prefixes);
  }
View Full Code Here

  public void testPropertyShortcuts() {
    JsProposalBuilder jsProposalBuilder = new JsProposalBuilder();
    CompletionContext<JsState> context = new CompletionContext<JsState>(
        "console.", "deb", false, CompletionType.PROPERTY, null, 0);
    JsonStringSet prefixes = JsonCollections.createStringSet();
    prefixes.add("console.");
    prefixes.add("Tofu.console.");
    jsProposalBuilder.addShortcutsTo(context, prefixes);
    assertEquals(JsonCollections.createStringSet("console.", "Tofu.console.", "window.console."),
        prefixes);
  }
View Full Code Here

  public void testThisShortcuts() {
    JsProposalBuilder jsProposalBuilder = new JsProposalBuilder();
    CompletionContext<JsState> context = new CompletionContext<JsState>(
        "this.console.", "deb", true, CompletionType.PROPERTY, null, 0);
    JsonStringSet prefixes = JsonCollections.createStringSet();
    prefixes.add("Tofu.console.");
    jsProposalBuilder.addShortcutsTo(context, prefixes);
    assertEquals(JsonCollections.createStringSet("Tofu.console."), prefixes);
  }
View Full Code Here

    ProposalBuilder<State> proposalBuilder = new MockProposalBuilder();
    CompletionContext<State> context = new CompletionContext<State>(
        "", "", false, CompletionType.GLOBAL, null, 0);
    JsonArray<AutocompleteProposal> proposals = proposalBuilder.doGetProposals(
        context, cursor, builder);
    JsonStringSet expected = JsonCollections.createStringSet(OBJECT_1, METHOD_2, METHOD_1, "var1");
    assertEquals(expected, TestUtils.createNameSet(proposals));
  }
View Full Code Here

    ProposalBuilder<State> proposalBuilder = new MockProposalBuilder();
    CompletionContext<State> context = new CompletionContext<State>(
        "", "MEtH", false, CompletionType.GLOBAL, null, 0);
    JsonArray<AutocompleteProposal> proposals = proposalBuilder.doGetProposals(
        context, cursor, builder);
    JsonStringSet expected = JsonCollections.createStringSet("method2", "method1");
    assertEquals(expected, TestUtils.createNameSet(proposals));
  }
View Full Code Here

    checkExplicit(null, ".root {/*foo*/");
    checkExplicit(null, "@media all { td {");
  }

  public void testOutlineWithMedia() {
    JsonStringSet tags = JsonCollections.createStringSet("td");
    checkOutlineParser("@media screen { td{}}", tags);
    checkOutlineParser("@media screen {td {}}", tags);
  }
View Full Code Here

TOP

Related Classes of com.google.collide.json.shared.JsonStringSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.