Examples of SuggestBox


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

  }

  private void initParentBox() {
    parent = new HintTextBox();
    sugestParent =
        new SuggestBox(new ProjectNameSuggestOracle(), parent);
    parent.setVisibleLength(50);
  }
View Full Code Here

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

  @SuppressWarnings("unchecked")
  public SubjectsSuggestWidget(List<String> subjects) {

    oracle = new MultiWordSuggestOracle();
    suggestBox = new SuggestBox(oracle);
    suggestBox.setWidth("15px");
    DOM.setStyleAttribute(suggestBox.getElement(), "border", "0");
    DOM.setStyleAttribute(suggestBox.getElement(), "outline", "0");
    this.oracle.addAll(subjects);
View Full Code Here

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

      for (int i = 0; i < enumValues.size(); i++) {
        suggestions.add(new EnumSuggestion(
            enumValues.get(i), enumDescriptions == null ? "" : enumDescriptions.get(i)));
      }
      oracle.setDefaultSuggestions(suggestions);
      this.suggestBox = new SuggestBox(oracle);
      suggestBox.getTextBox().addFocusHandler(new FocusHandler() {
        @Override
        public void onFocus(FocusEvent event) {
          suggestBox.showSuggestionList();
        }
View Full Code Here

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

    this.analytics = analytics;
    this.presenter = new FullViewPresenter(urlManipulator, this);
    this.authManager = authManager;
    PlaceholderTextBox searchBackingTextBox =
        new PlaceholderTextBox("Search for services, methods, and recent requests...");
    this.searchBox = new SuggestBox(searchKeywords, searchBackingTextBox);

    searchBox.setAutoSelectEnabled(false);
    initWidget(uiBinder.createAndBindUi(this));
    setMenuActions();
View Full Code Here

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

    itemBox
        .getElement()
        .setAttribute(
            "style",
            "outline-color: -moz-use-text-color; outline-style: none; outline-width: medium;");
    final SuggestBox box = new SuggestBox(getSuggestions(), itemBox);
    box.getElement().setId("suggestion_box");
    item.add(box);
    list.add(item);

    // this needs to be on the itemBox rather than box, or backspace will
    // get executed twice
    itemBox.addKeyDownHandler(new KeyDownHandler() {
      public void onKeyDown(KeyDownEvent event) {
        if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
          // only allow manual entries with @ signs (assumed email
          // addresses)
          if (itemBox.getValue().contains("@"))
            deselectItem(itemBox, list);
        }
        // handle backspace
        if (event.getNativeKeyCode() == KeyCodes.KEY_BACKSPACE) {
          if ("".equals(itemBox.getValue().trim())) {
            ListItem li = (ListItem) list.getWidget(list
                .getWidgetCount() - 2);
            Paragraph p = (Paragraph) li.getWidget(0);
            if (itemsSelected.contains(p.getText())) {
              itemsSelected.remove(p.getText());
              GWT.log("Removing selected item '" + p.getText()
                  + "'", null);
              GWT.log("Remaining: " + itemsSelected, null);
            }
            list.remove(li);
            itemBox.setFocus(true);
          }
        }
      }
    });

    box
        .addSelectionHandler(new SelectionHandler<SuggestOracle.Suggestion>() {
          public void onSelection(SelectionEvent selectionEvent) {
            deselectItem(itemBox, list);
          }
        });
View Full Code Here

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

  public PlayerSuggestAndAddPanel(ContentRpcServiceAsync contentService, boolean isContributor,
      AsyncCallback<BaseContentItem> callbackWork) {
    this.nameToPlayerMap = new HashMap<String, PlayerContentItem>();
   
    this.oracle = new MultiWordSuggestOracle();
    this.suggestBox = new SuggestBox(oracle);
    this.addOrCreateButton = new Button("Create or Add");
    this.textBox = suggestBox.getTextBox();
   
    this.problemLabel = new Label();
    problemLabel = new Label("Selection did not succeed. Please try again.");
View Full Code Here

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

    for (int i = 0; i < words.length; ++i) {
      oracle.add(words[i]);
    }

    // Create the suggest box
    final SuggestBox suggestBox = new SuggestBox(oracle);
    suggestBox.ensureDebugId("cwSuggestBox");
    VerticalPanel suggestPanel = new VerticalPanel();
    suggestPanel.add(new HTML(constants.cwSuggestBoxLabel()));
    suggestPanel.add(suggestBox);

    // Return the panel
View Full Code Here

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

        this.session = session2;
        tableName = col.getTable().getName();
        columnName = col.getName();
        columnType = col.getType().getName();

        suggestBox = new SuggestBox(new RqbSuggestOracle());
        suggestBox.addSelectionHandler(new SelectionHandler<SuggestOracle.Suggestion>() {
            @Override
            public void onSelection(SelectionEvent<SuggestOracle.Suggestion> event) {
                    ValueChangeEvent.fire(SuggestEditorWidget.this, (T) event.getSelectedItem()
                            .getReplacementString());
View Full Code Here

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

      Browser.emptyText(object(identifier).ofType(TextBox.class));
   }

   @CsvMethod
   public void fillAndSelectInSuggestBoxByIndex(String content, String index, String... identifier) {
      SuggestBox suggestBox = object(identifier).ofType(SuggestBox.class);

      Browser.fillText(content, suggestBox);
      Browser.click(suggestBox, Integer.parseInt(index));
   }
View Full Code Here

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

   }

   @CsvMethod
   public void fillAndSelectInSuggestBoxByText(String content, String selected,
            String... identifier) {
      SuggestBox suggestBox = object(identifier).ofType(SuggestBox.class);

      Browser.fillText(content, suggestBox);

      List<MenuItem> menuItems = WidgetUtils.getMenuItems(suggestBox);
      int i = 0;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.