Package com.google.gwt.search.client

Examples of com.google.gwt.search.client.Result


  private VerticalPanel clips = new VerticalPanel();
  private HorizontalPanel hp = new HorizontalPanel();
  private static final int CLIP_WIDTH = 200;

  public void onKeep(KeepEvent event) {
    final Result result = event.getResult();

    String title;
    if (result instanceof WebResult) {
      WebResult web = (WebResult) result;
      title = web.getTitle();

    } else if (result instanceof NewsResult) {
      NewsResult web = (NewsResult) result;
      title = web.getTitle();
    } else if (result instanceof VideoResult) {
      VideoResult video = (VideoResult) result;
      title = video.getTitle();
      // Metadata is also available
      System.out.println(video.getTbHeight() + "x" + video.getTbWidth() + " "
          + video.getDuration() + "seconds");
    } else {
      // Ads don't have an official interface
      title = "Advertisement";
    }

    HTML h = new HTML(title);
    h.addStyleName("clipLink");
    h.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        PopupPanel p = new PopupPanel(true);
        p.addStyleName("keepPopup");
        p.setWidget(result.getHtml());
        Widget w = (Widget) event.getSource();
        p.setPopupPosition(w.getAbsoluteLeft() + 5, w.getAbsoluteTop()
            + w.getOffsetHeight() + 5);
        p.show();
      }
View Full Code Here


      SearchCompleteEvent event, List<Place> places) {

    JsArray<? extends Result> results = event.getSearch().getResults();

    for (int i = 0; i < results.length(); i++) {
      Result result = results.get(i);
      if (result instanceof LocalResult) {
        LocalResult lsr = (LocalResult) result;
        places.add(new LocalResultPlaceImpl(lsr));
      }
    }
View Full Code Here

TOP

Related Classes of com.google.gwt.search.client.Result

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.