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

Examples of com.google.gwt.user.client.ui.SuggestBox


        textBox.setName(name);
        textBox.setTitle(title);
        textBox.setTabIndex(0);

        oracle = new PrincipalSuggestOracle(type);
        suggestBox = new SuggestBox(oracle, textBox);
        suggestBox.addValueChangeHandler(new ValueChangeHandler<String>() {
            @Override
            public void onValueChange(ValueChangeEvent<String> event) {
                setModified(true);
                String newValue = event.getValue();
View Full Code Here


        oracle.add("Cat");
        oracle.add("Dog");
        oracle.add("Horse");
        oracle.add("Canary");

        SuggestBox box = new SuggestBox(oracle);


        RootPanel.get().add(box);
        final List events = new ArrayList();
        box.addValueChangeHandler(new ValueChangeHandler() {
            @Override
            public void onValueChange(ValueChangeEvent event) {
                events.add(event);
            }
        });

        box.addSelectionHandler(new SelectionHandler() {

            @Override
            public void onSelection(SelectionEvent event) {
               events.add(event);
               finishTest();
            }

        });

        box.getElement().dispatchEvent(Document.get().createChangeEvent());
        assertEquals(1, events.size());

        box.getElement().setAttribute("value", "Ca");
        box.getElement().dispatchEvent(Document.get().createKeyUpEvent(false, false, false, false, 'C'));

        //System.out.println("X=" + box.getElement().getParentElement().getInnerHTML());
        List<Element> elmts = find(box.getElement(), "item");
        assertEquals(2, elmts.size());
        elmts.get(0).dispatchEvent(Document.get().createClickEvent(0, 0, 0, 0, 0, false, false, false, false));
// event fired as finally..
        //assertEquals(2, events.size());
    }
View Full Code Here

    public Widget asWidget() {

        if(null==oracle)
            throw new RuntimeException("oracle required!");

        this.suggestBox = new SuggestBox(oracle, textBox);
        return suggestBox;
    }
View Full Code Here

  public SuggestBoxItem( String s, String s1, SuggestOracle suggestOracle ) {

    super( s, s1 );

    suggestBoxField = new SuggestBox( suggestOracle );
    suggestBoxField.setWidth( "100%" );

    suggestBoxField.setStyleName( "gwt-SuggestBox" );
    suggestBoxField.setHeight( getHeight() + "px" );
View Full Code Here

    oracle.add("Ursula");
    oracle.add("Vivienne");
    oracle.add("Waldemar");
    oracle.add("Yildirim");
    oracle.add("Zafer");
    suggestBox1 = new SuggestBox(oracle);
    suggestBox2 = new SuggestBox(oracle);
   
   
   
  }
View Full Code Here

        this.resources.navigation().ensureInjected();

        this.activityOracle = new ActivitySuggestOracle();
        Html5TextBox activityTextBox = new Html5TextBox();
        activityTextBox.setPlaceholder("Select or enter a new activity");
        this.activity = new SuggestBox(activityOracle, activityTextBox);

        NamedModelSuggestOracle<Project> projectOracle = new NamedModelSuggestOracle<Project>(projectsCache);
        Html5TextBox projectTextBox = new Html5TextBox();
        projectTextBox.setPlaceholder("Select or enter a new project");
        this.project = new SuggestBox(projectOracle, projectTextBox);

        this.widget = binder.createAndBindUi(this);
        this.today.addStyleName(style.selectedDate());
        this.yesterday.setText(DATE_FORMAT.format(new Date(System.currentTimeMillis() - ONE_DAY)));
        this.theDayBeforeYesterday.setText(DATE_FORMAT.format(new Date(System.currentTimeMillis() - 2 * ONE_DAY)));
 
View Full Code Here

        this.tags = new HashMap<String, Tag>();

        NamedModelSuggestOracle<Tag> tagOracle = new NamedModelSuggestOracle<Tag>(tagsCache);
        Html5TextBox newTagTextBox = new Html5TextBox();
        newTagTextBox.setPlaceholder("New Tag");
        this.newTag = new SuggestBox(tagOracle, newTagTextBox);
        this.newTag.addValueChangeHandler(this);
        this.newTag.addSelectionHandler(this);

        rootPanel.add(tagsPanel);
        rootPanel.add(newTag);
View Full Code Here

        this.activityOracle = new ActivitySuggestOracle();
        Html5TextBox activityTextBox = new Html5TextBox();
        activityTextBox.setPlaceholder("Select or enter a new activity");
        activityTextBox.setAutofocus("autofocus");
        this.name = new SuggestBox(activityOracle, activityTextBox);

        NamedModelSuggestOracle<Project> projectOracle = new NamedModelSuggestOracle<Project>(projectsCache);
        Html5TextBox projectTextBox = new Html5TextBox();
        projectTextBox.setPlaceholder("Select or enter a new project");
        this.project = new SuggestBox(projectOracle, projectTextBox);

        this.tags = new TagsEditorWidget(tagsCache);

        this.popupPanel = binder.createAndBindUi(this);
        this.popupPanel.setWidth("600px");
View Full Code Here

    // No new methods.  Just a parameterized UiBinder.
  }

  public PlaygroundUI(MultiWordSuggestOracle sourceSuggestions,
      MultiWordSuggestOracle policySuggestions) {
    addressField = new SuggestBox(sourceSuggestions);
    policyAddressField = new SuggestBox(policySuggestions);

    initWidget(UI_BINDER.createAndBindUi(this));
  }
View Full Code Here

    }
  }

  private void initPolicyPanel() {
    policyExamples = new MultiWordSuggestOracle();
    playgroundUI.policyAddressField = new SuggestBox(policyExamples);
    playgroundUI.policyAddressField.getTextBox().addFocusHandler(new FocusHandler() {
      public void onFocus(FocusEvent event) {
        playgroundUI.policyAddressField.showSuggestionList();
      }
    });
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.SuggestBox

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.