• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SuggestOracle类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: init

import com.google.gwt.user.client.ui.SuggestOracle; //导入依赖的package包/类
@Override
public void init(SolrCore solrCore) {
    setActive(solrCore.getConfiguration().isActive(TermsConfig.class));

    if (!isActive()) {
        searchPane.setSearchTextBox(new TextBox());
        return;
    }

    oracle = new SuggestOracle() {
        public void requestSuggestions(final Request request, final Callback callback) {
            findSuggestions(request.getQuery(), new org.apache.solr.explorer.client.util.Callback<List<Suggestion>>() {
                public void onSuccess(List<Suggestion> suggestions) {
                    callback.onSuggestionsReady(request, new Response(suggestions));
                }
            });

        }
    };
    suggestBox = new SuggestBox(oracle);
    suggestBox.setPopupStyleName("AutoCompletionPopup");

    suggestBox.addKeyDownHandler(new EnterKeyHandler() {
        @Override
        protected void onEnter(KeyDownEvent keyDownEvent) {
            if (!suggestBox.isSuggestionListShowing()) {
                searchPane.executeSearch();
            }
        }
    });
    suggestBox.setAutoSelectEnabled(false);
    suggestBox.setAnimationEnabled(true);

    searchPane.setSearchTextBox(suggestBox);
}
 
开发者ID:cominvent,项目名称:solr-explorer,代码行数:36,代码来源:SearchAutoCompletionPlugin.java


示例17: AutoSuggestTextEditor

import com.google.gwt.user.client.ui.SuggestOracle; //导入依赖的package包/类
public AutoSuggestTextEditor(SuggestOracle oracle, String defaultText, boolean enabled) {
    box = new SuggestBox(oracle);
    box.setPopupStyleName("AutoCompletionPopup");
    box.setAnimationEnabled(true);
    box.setText(defaultText == null ? "" : defaultText);
    box.getTextBox().setEnabled(enabled);
}
 
开发者ID:cominvent,项目名称:solr-explorer,代码行数:8,代码来源:AutoSuggestTextEditor.java


示例18: AriaSuggestBox

import com.google.gwt.user.client.ui.SuggestOracle; //导入依赖的package包/类
public AriaSuggestBox(SuggestOracle oracle) {
	this(new AriaTextBox(), oracle);
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:4,代码来源:AriaSuggestBox.java


示例19: SuggestionBox

import com.google.gwt.user.client.ui.SuggestOracle; //导入依赖的package包/类
public SuggestionBox(SuggestOracle oracle) {
	super(oracle);
	addKeyboardListener(this);
	addFocusListener(this);

}
 
开发者ID:kuzavas,项目名称:ephesoft,代码行数:7,代码来源:SuggestionBox.java


示例20: NaifOracleCallback

import com.google.gwt.user.client.ui.SuggestOracle; //导入依赖的package包/类
NaifOracleCallback(SuggestOracle.Request request, SuggestOracle.Callback cb) {
    this.request= request;
    this.cb= cb;
}
 
开发者ID:lsst,项目名称:firefly,代码行数:5,代码来源:NaifTargetPanel.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ModelImpl类代码示例发布时间:2022-05-21
下一篇:
Java SmackDebugger类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap