Package com.google.gwt.user.client.ui.MultiWordSuggestOracle

Examples of com.google.gwt.user.client.ui.MultiWordSuggestOracle.MultiWordSuggestion


    final Response response = new Response(suggestions);
    callback.onSuggestionsReady(request, response);
  }

  public void add(String label) {
    suggestions.add(new MultiWordSuggestion(label, label));
  }
View Full Code Here


    // The box becomes disabled
    box.setEnabled(false);

    // Response comes back after that
    Collection<MultiWordSuggestion> suggestions = new ArrayList<MultiWordSuggestion>();
    suggestions.add(new MultiWordSuggestion("one", "one"));
    oracle.callback.onSuggestionsReady(oracle.request, new Response(suggestions));

    // The suggestion list stays hidden
    assertFalse(display.isSuggestionListShowing());
  }
View Full Code Here

        RootPanel.get().add(cb);
        Select s = cb.getSelect();

        // only now give them the enumeration
        Collection<Suggestion> s2 = new ArrayList();
        s2.add(new MultiWordSuggestion("M", "M"));
        s2.add(new MultiWordSuggestion("F", "F"));

        config.getEnumerateCallback().onSuccess(new Response(s2));

        Comparison c = (Comparison) s.getCondition();
        Parameter p = (Parameter) c.getRight();
View Full Code Here

        Configuration config = new Configuration() {
            @Override
            public void fireEnumerate(EnumerateRequest request, AsyncCallback<Response> callback) {
                Collection<Suggestion> s = new ArrayList<Suggestion>();
                if ("category".equals(request.getColumnName())) {
                    s.add(new MultiWordSuggestion("A", "A"));
                    s.add(new MultiWordSuggestion("B", "B"));
                    s.add(new MultiWordSuggestion("C", "C"));
                } else if ("category2".equals(request.getColumnName())) {
                    s.add(new MultiWordSuggestion("X", "X"));
                    s.add(new MultiWordSuggestion("Y", "Y"));
                    s.add(new MultiWordSuggestion("Z", "Z"));
                } else {
                    s.add(new MultiWordSuggestion("M", "M"));
                    s.add(new MultiWordSuggestion("F", "F"));
                }
                callback.onSuccess(new Response(s));
            }

            @Override
            public void fireSuggest(SuggestRequest request,
                    AsyncCallback<Response> callback) {
                Collection<Suggestion> s = new ArrayList<Suggestion>();

                s.add(new MultiWordSuggestion("Lancashire", "Lancashire"));
                s.add(new MultiWordSuggestion("Bedfordshire", "Bedfordshire"));
                s.add(new MultiWordSuggestion("Oxfordshire", "Oxfordshire"));
                callback.onSuccess(new Response(s));
            }
        };
        return config;
    }
View Full Code Here

            JsArray<JsSuggestion> raw = (JsArray<JsSuggestion>) raw2;
            List<Suggestion> suggestions = new ArrayList<Suggestion>();

            for (int i = 0; i < raw.length(); i++) {
                JsSuggestion jss = raw.get(i);
                Suggestion s = new MultiWordSuggestion(jss.getValue(), jss.getLabel());
                suggestions.add(s);
            }

            Response response = new Response(suggestions);
            callback.onSuccess(response);
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.MultiWordSuggestOracle.MultiWordSuggestion

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.