Java 类com.google.gwt.user.client.Window.Navigator 实例源码

项目:quake2-gwt-port    文件:GwtQuake.java   
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;
}
项目:opennmszh    文件:NodeInterfaceList.java   
/**
 * 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);
            }
        }
    }

}
项目:opennmszh    文件:SnmpSelectListEntry.java   
@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);
            }

        }
    }
}
项目:opennmszh    文件:VTopologyComponent.java   
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();

        }
    };
}
项目:OpenNMS    文件:NodeInterfaceList.java   
/**
 * 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);
            }
        }
    }

}
项目:OpenNMS    文件:NodeInterfaceList.java   
/**
 * 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);
            }
        }
    }

}
项目:OpenNMS    文件:SnmpSelectListEntry.java   
@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);
            }

        }
    }
}
项目:OpenNMS    文件:SnmpSelectListEntry.java   
@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);
            }

        }
    }
}
项目:daris    文件:BrowserCheck.java   
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>. ");
    }
}
项目:geomajas-project-client-gwt2    文件:Dom.java   
/**
 * 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;
}
项目:GwtGameUi    文件:UserAgent.java   
/**
 * Check if this is a tablet.
 */
public static boolean isTablet() {
  if (Navigator.getUserAgent().contains("iPad")
      || Navigator.getUserAgent().contains("Android")) {
    return true;
  }
  return false;
}
项目:touchkit    文件:VNavigationManager.java   
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;
    }
}
项目:daris    文件:BrowserUtil.java   
public static boolean isIE() {
    String ua = Navigator.getUserAgent().toLowerCase();
    return ua.indexOf("msie") != -1;
}
项目:daris    文件:BrowserUtil.java   
public static boolean isChromeFrame() {
    String ua = Navigator.getUserAgent().toLowerCase();
    return ua.indexOf("chromeframe") != -1;
}