本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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());
}
示例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);
}