本文整理汇总了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);
}
}
}
示例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);
}
示例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());
}
示例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);
}
});
}
示例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;
}
示例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;
}
示例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;
}
示例8: oracle
import com.google.gwt.user.client.ui.SuggestOracle; //导入依赖的package包/类
public SuggestOracle oracle () {
if (oracle == null) {
oracle = new UserOracle();
}
return oracle;
}
示例9: oracle
import com.google.gwt.user.client.ui.SuggestOracle; //导入依赖的package包/类
public SuggestOracle oracle () {
if (oracle == null) {
oracle = new PageOracle();
}
return oracle;
}
示例10: oracle
import com.google.gwt.user.client.ui.SuggestOracle; //导入依赖的package包/类
/**
* @return
*/
public SuggestOracle oracle () {
if (oracle == null) {
oracle = new PostOracle();
}
return oracle;
}
示例11: oracle
import com.google.gwt.user.client.ui.SuggestOracle; //导入依赖的package包/类
public SuggestOracle oracle () {
if (oracle == null) {
oracle = new RoleOracle();
}
return oracle;
}
示例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);
}
示例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;
}
示例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();
}
});
}
示例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);
}
});
}
}