本文整理汇总了Java中com.google.gwt.user.client.Window.Navigator类的典型用法代码示例。如果您正苦于以下问题:Java Navigator类的具体用法?Java Navigator怎么用?Java Navigator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Navigator类属于com.google.gwt.user.client.Window包,在下文中一共展示了Navigator类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getBrowserType
import com.google.gwt.user.client.Window.Navigator; //导入依赖的package包/类
static BrowserType getBrowserType() {
if (browserType == null) {
String userAgent = Navigator.getUserAgent();
System.out.println("UA: " + userAgent);
if (userAgent == null) {
browserType = BrowserType.OTHER;
} else if (userAgent.indexOf("Chrome/") != -1) {
browserType = BrowserType.CHROME;
} else if (userAgent.indexOf("Safari/") != -1) {
browserType = BrowserType.SAFARI;
} else if (userAgent.indexOf("Firefox/") != -1 || userAgent.indexOf("Minefield/") != -1) {
browserType = BrowserType.FIREFOX;
} else {
browserType = BrowserType.OTHER;
}
}
return browserType;
}
开发者ID:artemis-esf,项目名称:quake2-gwt-port,代码行数:20,代码来源:GwtQuake.java
示例2: onModuleLoad
import com.google.gwt.user.client.Window.Navigator; //导入依赖的package包/类
/**
* This is the entry point method.
*/
public void onModuleLoad() {
if(Navigator.getUserAgent().contains("MSIE")) {
NodeList<Element> divs = RootPanel.getBodyElement().getElementsByTagName("div");
for(int j = 0; j < divs.getLength(); j++) {
Element element = divs.getItem(j);
if(element.hasAttribute("name") && element.getAttribute("name").equals("opennms-interfacelist")) {
createView(element);
}
}
}else {
NodeList<Element> nodes = RootPanel.getBodyElement().getElementsByTagName("opennms:interfacelist");
if(nodes.getLength() > 0) {
for(int i = 0; i < nodes.getLength(); i++) {
Element elem = nodes.getItem(i);
createView(elem);
}
}
}
}
开发者ID:qoswork,项目名称:opennmszh,代码行数:25,代码来源:NodeInterfaceList.java
示例3: onModuleLoad
import com.google.gwt.user.client.Window.Navigator; //导入依赖的package包/类
@Override
public void onModuleLoad() {
if(Navigator.getUserAgent().contains("MSIE")) {
NodeList<Element> divs = RootPanel.getBodyElement().getElementsByTagName("div");
for(int j = 0; j < divs.getLength(); j++) {
Element element = divs.getItem(j);
if(element.hasAttribute("name") && element.getAttribute("name").equals("opennms-snmpSelectList")) {
createView(element);
}
}
}else {
NodeList<Element> nodes = RootPanel.getBodyElement().getElementsByTagName("opennms:snmpSelectList");
if(nodes.getLength() > 0) {
for(int i = 0; i < nodes.getLength(); i++) {
Element elem = nodes.getItem(i);
createView(elem);
}
}
}
}
开发者ID:qoswork,项目名称:opennmszh,代码行数:24,代码来源:SnmpSelectListEntry.java
示例4: vertexClickHandler
import com.google.gwt.user.client.Window.Navigator; //导入依赖的package包/类
private Handler<GWTVertex> vertexClickHandler() {
return new D3Events.Handler<GWTVertex>(){
public void call(GWTVertex vertex, int index) {
NativeEvent event = D3.getEvent();
SVGGElement vertexElement = event.getCurrentEventTarget().cast();
vertexElement.getParentElement().appendChild(vertexElement);
m_client.updateVariable(m_paintableId, "clickedVertex", vertex.getId(), false);
m_client.updateVariable(m_paintableId, "shiftKeyPressed", event.getShiftKey(), false);
m_client.updateVariable(m_paintableId, "metaKeyPressed", event.getMetaKey(), false);
m_client.updateVariable(m_paintableId, "ctrlKeyPressed", event.getCtrlKey(), false);
m_client.updateVariable(m_paintableId, "platform", Navigator.getPlatform(), false);
event.preventDefault();
event.stopPropagation();
m_client.sendPendingVariableChanges();
}
};
}
开发者ID:qoswork,项目名称:opennmszh,代码行数:23,代码来源:VTopologyComponent.java
示例5: checkJava
import com.google.gwt.user.client.Window.Navigator; //导入依赖的package包/类
public static void checkJava() throws Throwable {
if (!Navigator.isJavaEnabled()) {
BrowserCheck.openInstallJavaPage();
throw new Exception(
"This application requires Java but it is not installed. Please <a href=\""
+ BrowserCheck.INSTALL_JAVA
+ "\">install Java</a>. ");
}
}
开发者ID:uom-daris,项目名称:daris,代码行数:10,代码来源:BrowserCheck.java
示例6: isMobile
import com.google.gwt.user.client.Window.Navigator; //导入依赖的package包/类
/**
* Checks if the user agent belongs to mobile browser. (iPhone, iPad, android blackberry or Nokia) Note that not all
* mobile devices are supported see detectmobilebrowsers.com for the most recent mobile user agents
*
* @return whether the browser is mobile (true or false)
*/
public static boolean isMobile() {
if (GWT.isClient()) {
String userAgent = Navigator.getUserAgent();
for (String platform : MOBILE_PLATFORMS) {
if (userAgent.toLowerCase().indexOf(platform) != -1) {
return true;
}
}
}
return false;
}
开发者ID:geomajas,项目名称:geomajas-project-client-gwt2,代码行数:19,代码来源:Dom.java
示例7: isTablet
import com.google.gwt.user.client.Window.Navigator; //导入依赖的package包/类
/**
* Check if this is a tablet.
*/
public static boolean isTablet() {
if (Navigator.getUserAgent().contains("iPad")
|| Navigator.getUserAgent().contains("Android")) {
return true;
}
return false;
}
开发者ID:cjmalloy,项目名称:GwtGameUi,代码行数:11,代码来源:UserAgent.java
示例8: initIosScroollHack
import com.google.gwt.user.client.Window.Navigator; //导入依赖的package包/类
private void initIosScroollHack() {
needsIos6ScrollingWorkaround = Navigator.getUserAgent().contains(
" OS 6_")
&& Navigator.getUserAgent().contains(" afari");
// Disable hack if "fullscreen", the hack disturbs e.g. SwipeView a
// LOT as it slows down "warming up" the hardware accelerated layer
if (needsIos6ScrollingWorkaround
&& getOffsetWidth() == RootPanel.get().getOffsetWidth()) {
needsIos6ScrollingWorkaround = false;
}
}
开发者ID:vaadin,项目名称:touchkit,代码行数:12,代码来源:VNavigationManager.java
示例9: isIE
import com.google.gwt.user.client.Window.Navigator; //导入依赖的package包/类
public static boolean isIE() {
String ua = Navigator.getUserAgent().toLowerCase();
return ua.indexOf("msie") != -1;
}
开发者ID:uom-daris,项目名称:daris,代码行数:5,代码来源:BrowserUtil.java
示例10: isChromeFrame
import com.google.gwt.user.client.Window.Navigator; //导入依赖的package包/类
public static boolean isChromeFrame() {
String ua = Navigator.getUserAgent().toLowerCase();
return ua.indexOf("chromeframe") != -1;
}
开发者ID:uom-daris,项目名称:daris,代码行数:5,代码来源:BrowserUtil.java
注:本文中的com.google.gwt.user.client.Window.Navigator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论