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


Java UserAgent.isIE方法代码示例

本文整理汇总了Java中org.waveprotocol.wave.client.common.util.UserAgent.isIE方法的典型用法代码示例。如果您正苦于以下问题:Java UserAgent.isIE方法的具体用法?Java UserAgent.isIE怎么用?Java UserAgent.isIE使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.waveprotocol.wave.client.common.util.UserAgent的用法示例。


在下文中一共展示了UserAgent.isIE方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getStreamFilter

import org.waveprotocol.wave.client.common.util.UserAgent; //导入方法依赖的package包/类
/**
 * Gets the filter for a stream, creating one if one does not already exist.
 */
private FilterButton getStreamFilter(final String stream) {
  FilterButton filter = streamFilters.get(stream);
  if (filter == null) {
    // Just in case a user can cause a stream to be called "'><script
    // src='evil.js'></script><pre '", we only use safe values for CSS
    // classes. There's no need for the class names to be human readable.
    int streamId = streamFilters.countEntries();
    String itemClass = "w-s-" + streamId;
    String containerClass = STREAM_FILTER_PREFIX + streamId;
    filter = new FilterButton(new DoubleClickHandler() {
      @Override
      public void onDoubleClick(DoubleClickEvent event) {
        enableOnlyOneStream(stream);
      }
    }, entries, containerClass, itemClass, stream, css.stream());
    self.add(filter, streamsContainer);
    streamFilters.put(stream, filter);
    // TODO(ohler): Make styles work in IE.
    if (!UserAgent.isIE()) {
      // Replace stylesheet to make the new filter work.
      style.setInnerText(style.getInnerText() + filter.getCssRule());
    }
  }
  return filter;
}
 
开发者ID:ArloJamesBarnes,项目名称:walkaround,代码行数:29,代码来源:LogPanel.java

示例2: LogPanel

import org.waveprotocol.wave.client.common.util.UserAgent; //导入方法依赖的package包/类
private LogPanel(Logs log) {
  this.log = log;
  initWidget(BINDER.createAndBindUi(this));

  // Add filter buttons. Global filter, then log-level filters.
  StringBuilder rules = new StringBuilder();
  rules.append(css.getText());

  for (final Level level : Level.values()) {
    String itemClass = LEVEL_CLASSES.get(level);
    String containerClass = LEVEL_FILTER_PREFIX + itemClass;
    FilterButton levelFilter = new FilterButton(new DoubleClickHandler() {
      @Override
      public void onDoubleClick(DoubleClickEvent event) {
        enableOnlyMoreImportantLevels(level);
      }
    }, entries, containerClass, itemClass, level.name(), css.level());
    levelFilters.put(level, levelFilter);
    self.add(levelFilter, levelsContainer);
    rules.append(levelFilter.getCssRule());
  }

  // TODO(ohler): Make styles work in IE; the log panel consumes the entire
  // screen without them.  In IE8, I've seen this crash in setInnerText().
  if (!UserAgent.isIE()) {
    // Inject style.
    style.setInnerText(rules.toString());
    Document.get().getBody().appendChild(style);
  }

  setActive(true);
}
 
开发者ID:ArloJamesBarnes,项目名称:walkaround,代码行数:33,代码来源:LogPanel.java

示例3: DoubleBufferImage

import org.waveprotocol.wave.client.common.util.UserAgent; //导入方法依赖的package包/类
/**
 * Create a double buffer loader for a given image widget
 *
 * @param spinner
 * @param imageToLoad
 */
public DoubleBufferImage(Widget spinner, Widget error, Image imageToLoad) {
  if (UserAgent.isIE()) {
    DomHelper.makeUnselectable(doubleLoadedImage.getElement());
  }
  this.spinner = spinner;
  this.error = error;
  this.imageToLoad = imageToLoad;
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:15,代码来源:ImageThumbnailWidget.java

示例4: outputHtml

import org.waveprotocol.wave.client.common.util.UserAgent; //导入方法依赖的package包/类
@Override
public void outputHtml(SafeHtmlBuilder output) {
  // All container elements must be block-level HTML elements (styles do not
  // make a difference) in order to validate with contents that are block level.
  //
  // <div thread>
  //   <span toggle expanded|collapsed unread|read >
  //     <span arrow />
  //     <span count>
  //       <span>10</span>
  //       <span>(2)</span>
  //       <span dropContainer>
  //         <span drop/>
  //       </span>
  //     </span>
  //   </span>
  //   <div chrome expanded|collapsed>
  // ...
  //   </div>
  // </div>
  String collapsedStateCss = " " + (collapsed ? css.collapsed() : css.expanded());
  String unselectable = UserAgent.isIE() ? "unselectable='on'" : null;
  String extra = " " + (collapsed ? COLLAPSED_ATTRIBUTE + "='" + COLLAPSED_VALUE + "'" : "") +
      " " + TOTAL_BLIPS_ATTRIBUTE + "='" + totalBlipCount + "'" +
      " " + UNREAD_BLIPS_ATTRIBUTE + "='" + unreadBlipCount + "'";

  openWith(output, id, css.collapsible(), kind, extra);
  {
    openWith(output, Components.CHROME.getDomId(id), css.chrome() + collapsedStateCss,
        TypeCodes.kind(Type.CHROME), unselectable);
    {
      content.outputHtml(output);
    }
    close(output);
  }
  close(output);
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:38,代码来源:CollapsibleBuilder.java

示例5: outputHtml

import org.waveprotocol.wave.client.common.util.UserAgent; //导入方法依赖的package包/类
@Override
public void outputHtml(SafeHtmlBuilder output) {
  // For whitespace in an inline thread to get click events, it needs zoom:1
  // for some reason.
  String extra = UserAgent.isIE() ? "style='zoom:1' unselectable='on'" : null;
  openWith(output, null, null, TypeCodes.kind(Type.INLINE_THREAD_STRUCTURE), extra);
    blips.outputHtml(output);
  close(output);
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:10,代码来源:InlineThreadViewBuilder.java

示例6: outputHtml

import org.waveprotocol.wave.client.common.util.UserAgent; //导入方法依赖的package包/类
@Override
public void outputHtml(SafeHtmlBuilder output) {
  // For whitespace in an inline thread to get click events, it needs zoom:1
  // for some reason.
  String extra = UserAgent.isIE() ? "style='zoom:1' unselectable='on'" : null;
  openWith(output, null, null, null, extra);
  blips.outputHtml(output);
  close(output);
  continuationIndicator.outputHtml(output);
}
 
开发者ID:apache,项目名称:incubator-wave,代码行数:11,代码来源:InlineThreadViewBuilder.java

示例7: create

import org.waveprotocol.wave.client.common.util.UserAgent; //导入方法依赖的package包/类
public static ParagraphHelper create() {
  return UserAgent.isIE() ? new ParagraphHelperIE() : (UserAgent.isWebkit()
      ? new ParagraphHelperWebkit() : new ParagraphHelperAlwaysBr());
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:5,代码来源:ParagraphHelper.java

示例8: outputHtml

import org.waveprotocol.wave.client.common.util.UserAgent; //导入方法依赖的package包/类
@Override
public void outputHtml(SafeHtmlBuilder output) {
  // All container elements must be block-level HTML elements (styles do not
  // make a difference) in order to validate with contents that are block level.
  //
  // <div thread>
  //   <span toggle expanded|collapsed unread|read >
  //     <span arrow />
  //     <span count>
  //       <span>10</span>
  //       <span>(2)</span>
  //       <span dropContainer>
  //         <span drop/>
  //       </span>
  //     </span>
  //   </span>
  //   <div chrome expanded|collapsed>
  // ...
  //   </div>
  // </div>
  String readStateCss = " " + ((unreadBlipCount > 0) ? css.unread() : css.read());
  String collapsedStateCss = " " + (collapsed ? css.collapsed() : css.expanded());
  String unselectable = UserAgent.isIE() ? "unselectable='on'" : null;
  String extra = " " + (collapsed ? COLLAPSED_ATTRIBUTE + "='" + COLLAPSED_VALUE + "'" : "") +
      " " + TOTAL_BLIPS_ATTRIBUTE + "='" + totalBlipCount + "'" +
      " " + UNREAD_BLIPS_ATTRIBUTE + "='" + unreadBlipCount + "'";

  openWith(output, id, css.collapsible(), kind, extra);
  {
    open(output, Components.TOGGLE.getDomId(id), css.toggle() + readStateCss +
        collapsedStateCss, TypeCodes.kind(Type.TOGGLE));
    {
      appendSpan(output, Components.ARROW.getDomId(id), css.arrow(), null);
      openSpan(output, Components.COUNT.getDomId(id), css.count(), null);
      {
        openSpan(output, Components.COUNT_TOTAL.getDomId(id), null, null);
        output.append(totalBlipCount);
        closeSpan(output);

        String unreadExtra = unreadBlipCount <= 0 ? " style='display: none;'" : "";
        openSpanWith(output, Components.COUNT_UNREAD.getDomId(id), null, null, unreadExtra);
        output.appendEscaped("(" + unreadBlipCount + ")");
        closeSpan(output);

        openSpan(output, Components.DROP_CONTAINER.getDomId(id), css.dropContainer() +
            collapsedStateCss, null);
        appendSpan(output, null, css.drop(), null);
        closeSpan(output);
      }
      closeSpan(output);
    }
    close(output);
    openWith(output, Components.CHROME.getDomId(id), css.chrome() + collapsedStateCss, null,
        unselectable);
    {
      content.outputHtml(output);
    }
    close(output);
  }
  close(output);
}
 
开发者ID:apache,项目名称:incubator-wave,代码行数:62,代码来源:CollapsibleBuilder.java


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