List of usage examples for org.apache.wicket.protocol.http ClientProperties isBrowserOpera
@Deprecated public boolean isBrowserOpera()
From source file:com.servoy.j2db.server.headlessclient.ServoyRequestCycle.java
License:Open Source License
/** * @see org.apache.wicket.protocol.http.WebRequestCycle#newClientInfo() *///from w ww. j av a 2 s . c om @Override protected ClientInfo newClientInfo() { // We will always do a redirect here. The servoy browser info has to make one. WebClientInfo webClientInfo = new WebClientInfo(this); ClientProperties cp = webClientInfo.getProperties(); if (cp.isBrowserInternetExplorer() || cp.isBrowserMozilla() || cp.isBrowserKonqueror() || cp.isBrowserOpera() || cp.isBrowserSafari() || cp.isBrowserChrome()) { if (cp.isBrowserInternetExplorer() && cp.getBrowserVersionMajor() != -1 && cp.getBrowserVersionMajor() < 7) { // IE6 is no longer supported when anchoring is enabled. boolean enableAnchoring = Utils.getAsBoolean(Settings.getInstance() .getProperty("servoy.webclient.enableAnchors", Boolean.TRUE.toString())); //$NON-NLS-1$ if (enableAnchoring) { throw new RestartResponseException(new UnsupportedBrowserPage("Internet Explorer 6")); //$NON-NLS-1$ } } Page page = getResponsePage(); if (page != null) { throw new RestartResponseAtInterceptPageException( new ServoyBrowserInfoPage(urlFor(page).toString().replaceAll("../", ""))); //$NON-NLS-1$ //$NON-NLS-2$ } else { throw new RestartResponseAtInterceptPageException(new ServoyBrowserInfoPage(getRequest().getURL())); } } return webClientInfo; }
From source file:org.geoserver.web.wicket.CodeMirrorEditor.java
License:Open Source License
private boolean isCodeMirrorSupported() { boolean enableCodeMirror = true; WebClientInfo clientInfo = (WebClientInfo) WebRequestCycle.get().getClientInfo(); ClientProperties clientProperties = clientInfo.getProperties(); if (clientProperties.isBrowserInternetExplorer()) { ClientProperties props = extractIEVersion(clientProperties.getNavigatorUserAgent()); enableCodeMirror = clientProperties.getBrowserVersionMajor() >= 8 || props.getBrowserVersionMajor() >= 8; } else if (clientProperties.isBrowserMozillaFirefox()) { ClientProperties props = extractFirefoxVersion(clientProperties.getNavigatorUserAgent()); enableCodeMirror = clientProperties.getBrowserVersionMajor() >= 3 || props.getBrowserVersionMajor() >= 3; } else if (clientProperties.isBrowserSafari()) { ClientProperties props = extractSafariVersion(clientProperties.getNavigatorAppVersion()); enableCodeMirror = clientProperties.getBrowserVersionMajor() > 5 || (clientProperties.getBrowserVersionMajor() == 5 && clientProperties.getBrowserVersionMinor() >= 2) || props.getBrowserVersionMajor() > 5 || (props.getBrowserVersionMajor() == 5 && props.getBrowserVersionMinor() >= 2); } else if (clientProperties.isBrowserOpera()) { ClientProperties props = extractOperaVersion(clientProperties.getNavigatorAppVersion()); enableCodeMirror = clientProperties.getBrowserVersionMajor() >= 9 || props.getBrowserVersionMajor() >= 9; }// ww w .j av a 2 s . c om return enableCodeMirror; }