當前位置: 首頁>>代碼示例>>Java>>正文


Java HasClickHandlers.addClickHandler方法代碼示例

本文整理匯總了Java中com.google.gwt.event.dom.client.HasClickHandlers.addClickHandler方法的典型用法代碼示例。如果您正苦於以下問題:Java HasClickHandlers.addClickHandler方法的具體用法?Java HasClickHandlers.addClickHandler怎麽用?Java HasClickHandlers.addClickHandler使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.gwt.event.dom.client.HasClickHandlers的用法示例。


在下文中一共展示了HasClickHandlers.addClickHandler方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: populateServiceEntries

import com.google.gwt.event.dom.client.HasClickHandlers; //導入方法依賴的package包/類
/**
 * Display the specified service entries in the container provided, while applying the tags
 * generated by the tag processor.
 */
private void populateServiceEntries(Iterable<ServiceDefinition> services,
    EntryAggregatorView toPopulate,
    Set<TagProcessor> tagProcessors) {

  for (final ServiceDefinition service : services) {
    String iconUrl = service.getIcons().getIcon16Url();
    String displayName = NameHelper.generateDisplayTitle(service.getTitle(), service.getName());

    Set<DescriptionTag> tags = Sets.newHashSet();
    for (TagProcessor processor : tagProcessors) {
      tags.addAll(processor.process(service));
    }

    HasClickHandlers rowHandle = toPopulate.addEntry(new ServiceEntry(
        iconUrl, displayName, service.getVersion(), service.getDescription(), tags));
    rowHandle.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
        presenter.handleClickService(service);
      }
    });
  }
}
 
開發者ID:showlowtech,項目名稱:google-apis-explorer,代碼行數:28,代碼來源:FullView.java

示例2: populateHistoryItems

import com.google.gwt.event.dom.client.HasClickHandlers; //導入方法依賴的package包/類
/**
 * Display the spcified history items in the aggregator specified.
 *
 * @param prefix Prefix that should be prepended to the history item URL when an item is clicked,
 *        changes based on whether this was a search result or the history item list.
 * @param historyItems Items which to render and display in the aggregator,
 * @param aggregator Aggregator that will display rendered history items.
 */
private void populateHistoryItems(
    final String prefix, Iterable<HistoryItem> historyItems, EntryAggregatorView aggregator) {

  for (final HistoryItem item : historyItems) {
    ApiRequest request = item.getRequest();
    HasClickHandlers rowHandler = aggregator.addEntry(new HistoryEntry(request.getMethod()
        .getId(), request.getHttpMethod().toString() + " " + request.getRequestPath(), item
        .getEndTime()));
    rowHandler.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
        presenter.handleClickHistoryItem(prefix, item);
      }
    });
  }
}
 
開發者ID:showlowtech,項目名稱:google-apis-explorer,代碼行數:25,代碼來源:FullView.java

示例3: populateMethodEntry

import com.google.gwt.event.dom.client.HasClickHandlers; //導入方法依賴的package包/類
/**
 * Add an aggregator line for the particular method specified. When clicked, append the prefix
 * specified and then the method identifier to the current URL.
 */
private void populateMethodEntry(final ApiMethod method, @Nullable String serviceTitle,
    final String prefix, EntryAggregatorView aggregator) {

  HasClickHandlers rowHandler = aggregator.addEntry(
      new MethodEntry(method.getId(), serviceTitle, method.getDescription()));
  rowHandler.addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent arg0) {
      presenter.handleClickMethod(prefix, method);
    }
  });
}
 
開發者ID:showlowtech,項目名稱:google-apis-explorer,代碼行數:17,代碼來源:FullView.java


注:本文中的com.google.gwt.event.dom.client.HasClickHandlers.addClickHandler方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。