当前位置: 首页>>代码示例>>Java>>正文


Java SuggestOracle类代码示例

本文整理汇总了Java中com.google.gwt.user.client.ui.SuggestOracle的典型用法代码示例。如果您正苦于以下问题:Java SuggestOracle类的具体用法?Java SuggestOracle怎么用?Java SuggestOracle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SuggestOracle类属于com.google.gwt.user.client.ui包,在下文中一共展示了SuggestOracle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initContentOracle

import com.google.gwt.user.client.ui.SuggestOracle; //导入依赖的package包/类
void initContentOracle() {
  contentOracle = new MultiWordSuggestOracle();

  contentSuggestBox = new SuggestBox(contentOracle);
  contentSuggestBox.getElement().setId("content-box");

  // Some initial content xml strings
  contentOracle.add("");
  contentOracle.add("abcd");

  contentSuggestBox.addSelectionHandler(new SelectionHandler<SuggestOracle.Suggestion>() {
    @Override public void onSelection(SelectionEvent<SuggestOracle.Suggestion> event) {
      setFromContentBox();
    }
  });

  String[] extra = extendSampleContent();
  if (extra != null) {
    for (String content : extra) {
      contentOracle.add(content);
    }
  }
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:24,代码来源:EditorHarness.java

示例2: AddMemberBox

import com.google.gwt.user.client.ui.SuggestOracle; //导入依赖的package包/类
public AddMemberBox(final String buttonLabel, String hint, SuggestOracle suggestOracle) {
  addPanel = new FlowPanel();
  addMember = new Button(buttonLabel);

  suggestBox = new RemoteSuggestBox(suggestOracle);
  suggestBox.setStyleName(Gerrit.RESOURCES.css().addMemberTextBox());
  suggestBox.setVisibleLength(50);
  suggestBox.setHintText(hint);
  suggestBox.addSelectionHandler(
      new SelectionHandler<String>() {
        @Override
        public void onSelection(SelectionEvent<String> event) {
          addMember.fireEvent(new ClickEvent() {});
        }
      });

  addPanel.add(suggestBox);
  addPanel.add(addMember);

  initWidget(addPanel);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:22,代码来源:AddMemberBox.java

示例3: FullView

import com.google.gwt.user.client.ui.SuggestOracle; //导入依赖的package包/类
public FullView(URLManipulator urlManipulator, AuthManager authManager,
    AnalyticsManager analytics, SuggestOracle searchKeywords) {

  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();

  // Add a fixed css class name that I can use to be able to style the menu.
  settingsMenu.setStyleName(SETTINGS_MENU_CSS_RULE + " " + settingsMenu.getStyleName());

  // Set the style of the search box.
  searchBackingTextBox.setPlaceholderTextStyleName(style.searchPlaceholderText());
}
 
开发者ID:showlowtech,项目名称:google-apis-explorer,代码行数:21,代码来源:FullView.java

示例4: findSuggestions

import com.google.gwt.user.client.ui.SuggestOracle; //导入依赖的package包/类
private void findSuggestions(String query, final AsyncCallback<List<SuggestOracle.Suggestion>> callback) {
    if (!termsContext.isEnabled()) {
        callback.onSuccess(new ArrayList<SuggestOracle.Suggestion>());
        return;
    }
    String[] terms = query.trim().split("\\s");
    String lastTerm = terms[terms.length - 1];
    termsContext.setPrefix(lastTerm);
    termsManager.getTerms(new Callback<TermsResult>() {
        public void onSuccess(TermsResult termsResult) {
            List<SuggestOracle.Suggestion> suggestions = new ArrayList<SuggestOracle.Suggestion>();
            for (TermResult termResult : termsResult.getTermResultByFieldName().values()) {
                for (TermEntry termEntry : termResult.getEntries()) {
                    suggestions.add(new TermSuggestion(termEntry));
                }
            }
            callback.onSuccess(suggestions);
        }
    });
}
 
开发者ID:cominvent,项目名称:solr-explorer,代码行数:21,代码来源:SearchAutoCompletionPlugin.java

示例5: getSelectedUsers

import com.google.gwt.user.client.ui.SuggestOracle; //导入依赖的package包/类
public List<User> getSelectedUsers() {
    List<? extends SuggestOracle.Suggestion> values = acList.getValue();
    List<User> users = new ArrayList<>(values.size());
    for(SuggestOracle.Suggestion value : values){
        if(value instanceof UserSuggestion){
            UserSuggestion us = (UserSuggestion) value;
            User user = us.getUser();
            users.add(user);
        }
    }
    return users;
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-demo,代码行数:13,代码来源:AutoCompleteView.java

示例6: onFailure

import com.google.gwt.user.client.ui.SuggestOracle; //导入依赖的package包/类
public void onFailure(Throwable caught) {
    if (!completed) {
        List<NaifSuggestion> sugList= new ArrayList<NaifSuggestion>(0);
        SuggestOracle.Response response= new SuggestOracle.Response(sugList);
        cb.onSuggestionsReady(request,response);
        activeList= null;
    }
    completed= true;
}
 
开发者ID:lsst,项目名称:firefly,代码行数:10,代码来源:NaifTargetPanel.java

示例7: onSuccess

import com.google.gwt.user.client.ui.SuggestOracle; //导入依赖的package包/类
public void onSuccess(List<EphPair> result) {
    if (!completed) {
        List<NaifSuggestion> sugList= new ArrayList<NaifSuggestion>(result.size());
        for(EphPair ep : result)  sugList.add(new NaifSuggestion(ep));
        SuggestOracle.Response response= new SuggestOracle.Response(sugList);
        cb.onSuggestionsReady(request,response);
        activeList= result;
    }
    completed= true;
}
 
开发者ID:lsst,项目名称:firefly,代码行数:11,代码来源:NaifTargetPanel.java

示例8: oracle

import com.google.gwt.user.client.ui.SuggestOracle; //导入依赖的package包/类
public SuggestOracle oracle () {
	if (oracle == null) {
		oracle = new UserOracle();
	}

	return oracle;
}
 
开发者ID:billy1380,项目名称:blogwt,代码行数:8,代码来源:UserController.java

示例9: oracle

import com.google.gwt.user.client.ui.SuggestOracle; //导入依赖的package包/类
public SuggestOracle oracle () {
	if (oracle == null) {
		oracle = new PageOracle();
	}

	return oracle;
}
 
开发者ID:billy1380,项目名称:blogwt,代码行数:8,代码来源:PageController.java

示例10: oracle

import com.google.gwt.user.client.ui.SuggestOracle; //导入依赖的package包/类
/**
 * @return
 */
public SuggestOracle oracle () {
	if (oracle == null) {
		oracle = new PostOracle();
	}

	return oracle;
}
 
开发者ID:billy1380,项目名称:blogwt,代码行数:11,代码来源:PostController.java

示例11: oracle

import com.google.gwt.user.client.ui.SuggestOracle; //导入依赖的package包/类
public SuggestOracle oracle () {
	if (oracle == null) {
		oracle = new RoleOracle();
	}

	return oracle;
}
 
开发者ID:billy1380,项目名称:blogwt,代码行数:8,代码来源:RoleController.java

示例12: SuggestBoxItem

import com.google.gwt.user.client.ui.SuggestOracle; //导入依赖的package包/类
public SuggestBoxItem(String s, String s1, SuggestOracle suggestOracle) {
	super(s, s1);

	suggestBoxField = new SuggestBox(suggestOracle);

	suggestBoxField.setStyleName("gwt-SuggestBox");
	suggestBoxField.setHeight(getHeight() + "px");

	canvas.setHeight(getHeight());
	canvas.setStyleName("gwt-SuggestBoxCanvas");
	canvas.addChild(suggestBoxField);

	setCanvas(canvas);
}
 
开发者ID:WELTEN,项目名称:dojo-ibl,代码行数:15,代码来源:SuggestBoxItem.java

示例13: wrapSuggestions

import com.google.gwt.user.client.ui.SuggestOracle; //导入依赖的package包/类
private List<SuggestOracle.Suggestion> wrapSuggestions(
		List<SuggestFieldSuggestion> in) {
	List<SuggestOracle.Suggestion> out = new ArrayList<SuggestOracle.Suggestion>();
	for (final SuggestFieldSuggestion wrappedSuggestion : in) {
		out.add(new OracleSuggestionImpl(wrappedSuggestion));
	}
	return out;

}
 
开发者ID:markoradinovic,项目名称:suggestfield,代码行数:10,代码来源:VSuggestField.java

示例14: DTOSuggestBox

import com.google.gwt.user.client.ui.SuggestOracle; //导入依赖的package包/类
public DTOSuggestBox() {
    super(new DTOSuggestOracle<T>());
    addSelectionHandler(new SelectionHandler<SuggestOracle.Suggestion>() {

        @SuppressWarnings("unchecked")
        @Override
        public void onSelection(SelectionEvent<Suggestion> event) {
            selected = ((DTOSuggestion<T>) event.getSelectedItem()).getDTO();
        }
    });
}
 
开发者ID:rkfg,项目名称:gwtutil,代码行数:12,代码来源:DTOSuggestBox.java

示例15: requestSuggestions

import com.google.gwt.user.client.ui.SuggestOracle; //导入依赖的package包/类
@Override
public void requestSuggestions(final Request request, final Callback callback) {
	String searchTextVal = request.getQuery();
	if (!searchTextVal.trim().isEmpty()) {
		List<SearchCriteriaIFace> stList = getSearchTextCriteriaList(searchTextVal);
		int mode = modeTypesList.getSelectedIndex() + 1;
		List<SearchCriteriaIFace> slCriteria = new ArrayList<SearchCriteriaIFace>();
		PropertyOptions.adjustForPModeSearchCriteria(slCriteria, mode);
		GetSearchProperties action = new GetSearchProperties(PropertyOptions.DEFAULT_SUGGESTBOX_SEARCH_PROFILE,
				slCriteria, stList, true, CommonConstants.SUGGESTBOX_RESULTS_SIZE);
		dispatcher.execute(action, new AsyncCallback<GetSearchPropertiesResult>() {
			@Override
			public void onFailure(Throwable caught) {

			}

			@Override
			public void onSuccess(GetSearchPropertiesResult result) {
				Set<PropertiesSuggestion> suggestions = new HashSet<PropertiesSuggestion>();
				if (result.getSearchProperties().size() == 0) {
					suggestions.add(new PropertiesSuggestion(PropertyOptions.noPropertyFound));
				} else {
					for (PropertiesDTO p : result.getSearchProperties()) {
						suggestions.add(new PropertiesSuggestion(p.getSuburb() + ", " + p.getCity() + ", "
								+ p.getState() + ", " + p.getPostCode()));
					}
				}

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

}
 
开发者ID:jchaganti,项目名称:gharonda,代码行数:37,代码来源:HomeView.java


注:本文中的com.google.gwt.user.client.ui.SuggestOracle类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。