com.jniwrapper.win32.ie
Class Browsers

java.lang.Object
  extended by com.jniwrapper.win32.ie.Browsers

public class Browsers
extends java.lang.Object

This is a utility class for browser-related operations.


Field Summary
static InternetFeatures PROCESS_FEATURES
          The Internet features for the current process.
static InternetFeatures THREAD_FEATURES
          The Internet features for the current thread.
static InternetFeatures THREAD_INTERNET_FEATURES
          The Internet features for the Internet zone.
static InternetFeatures THREAD_INTRANET_FEATURES
          The Internet features for the intranet zone.
static InternetFeatures THREAD_LOCALMACHINE_FEATURES
          The Internet features for the local machine zone.
static InternetFeatures THREAD_RESTRICTED_FEATURES
          The Internet features for the restricted zone.
static InternetFeatures THREAD_TRUSTED_FEATURES
          The Internet features for the trusted zone.
 
Method Summary
static void clearCache(com.jniwrapper.win32.wininet.InternetCacheEntry cacheEntry)
          Clears the Internet Explorer cache.
static com.jniwrapper.win32.shdocvw.IWebBrowser2 getBrowserPeer(WebBrowser browser)
          Returns an instance of the native web browser peer IWebBrowser2 of the passed browser object.
static com.jniwrapper.win32.ui.Wnd getBrowserWindow(WebBrowser browser)
          Returns handle of the browser window.
static java.lang.String getIEVersion()
          Returns a major version of system MS Internet Explorer application.
static com.jniwrapper.win32.automation.OleMessageLoop getOleMessageLoop(WebBrowser browser)
          Returns an instance of the message loop support OleMessageLoop of the passed browser object.
static ProxyConfiguration getProxy()
          Returns the system local area network (LAN) proxy settings.
static com.jniwrapper.win32.winhttp.ProxySettings getProxySettings()
          Deprecated. use the getProxy() method instead
static boolean isBrowserSupported()
          Function that determines if the IE browser version is supported.
static boolean isSameBrowserPeer(WebBrowser webBrowser1, WebBrowser webBrowser2)
          Returns true if both object are web browsers for the same native browser.
static void setProxy(ProxyConfiguration conf)
          Updates the system local area network (LAN) proxy settings to the specified proxy server configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

THREAD_FEATURES

public static final InternetFeatures THREAD_FEATURES
The Internet features for the current thread.


PROCESS_FEATURES

public static final InternetFeatures PROCESS_FEATURES
The Internet features for the current process.


THREAD_LOCALMACHINE_FEATURES

public static final InternetFeatures THREAD_LOCALMACHINE_FEATURES
The Internet features for the local machine zone.


THREAD_INTRANET_FEATURES

public static final InternetFeatures THREAD_INTRANET_FEATURES
The Internet features for the intranet zone.


THREAD_TRUSTED_FEATURES

public static final InternetFeatures THREAD_TRUSTED_FEATURES
The Internet features for the trusted zone.


THREAD_INTERNET_FEATURES

public static final InternetFeatures THREAD_INTERNET_FEATURES
The Internet features for the Internet zone.


THREAD_RESTRICTED_FEATURES

public static final InternetFeatures THREAD_RESTRICTED_FEATURES
The Internet features for the restricted zone.

Method Detail

getBrowserPeer

public static com.jniwrapper.win32.shdocvw.IWebBrowser2 getBrowserPeer(WebBrowser browser)
Returns an instance of the native web browser peer IWebBrowser2 of the passed browser object.

Parameters:
browser - browser object.
Returns:
native peer object.

getOleMessageLoop

public static com.jniwrapper.win32.automation.OleMessageLoop getOleMessageLoop(WebBrowser browser)
Returns an instance of the message loop support OleMessageLoop of the passed browser object.

Parameters:
browser - browser object.
Returns:
message loop for the browser.

isSameBrowserPeer

public static boolean isSameBrowserPeer(WebBrowser webBrowser1,
                                        WebBrowser webBrowser2)
Returns true if both object are web browsers for the same native browser.

Parameters:
webBrowser1 - the first instance to compare
webBrowser2 - the second instance to compare
Returns:
true if both browsers use the same native browser

getBrowserWindow

public static com.jniwrapper.win32.ui.Wnd getBrowserWindow(WebBrowser browser)
Returns handle of the browser window.

Parameters:
browser - browser object
Returns:
browser's handle

isBrowserSupported

public static boolean isBrowserSupported()
Function that determines if the IE browser version is supported.

Returns:
true if browser version is 6.x and greater, false otherwise

getProxy

public static ProxyConfiguration getProxy()
Returns the system local area network (LAN) proxy settings.

Returns:
the system proxy settings.
See Also:
setProxy(ProxyConfiguration)

setProxy

public static void setProxy(ProxyConfiguration conf)
Updates the system local area network (LAN) proxy settings to the specified proxy server configuration. The new proxy configuration for LAN will not apply to dial-up or VPN connections, but it will apply to all processes that use global system LAN settings.

To receive information about proxy settings please use the getProxy() method.

Parameters:
conf - the proxy settings to apply.
Throws:
java.lang.IllegalArgumentException - when the conf parameter is null
See Also:
getProxy()

getProxySettings

public static com.jniwrapper.win32.winhttp.ProxySettings getProxySettings()
                                                                   throws com.jniwrapper.win32.winhttp.WinHttpException
Deprecated. use the getProxy() method instead

Returns Internet Explorer proxy settings.

Returns:
information about proxy settings of Internet Explorer
Throws:
com.jniwrapper.win32.winhttp.WinHttpException - when some errors occurs during receiving proxy settings
See Also:
getProxy()

getIEVersion

public static java.lang.String getIEVersion()
Returns a major version of system MS Internet Explorer application.

Returns:
a major version of system MS Internet Explorer application or null when some errors happen during version receiving.

clearCache

public static void clearCache(com.jniwrapper.win32.wininet.InternetCacheEntry cacheEntry)
Clears the Internet Explorer cache.

To clear:

  • Internet Temporary files pass InternetCacheEntry.NORMAL_CACHE_ENTRY value.
  • All stored cookies pass InternetCacheEntry.COOKIE_CACHE_ENTRY value.
  • URL history pass InternetCacheEntry.URLHISTORY_CACHE_ENTRY value.
  • Parameters:
    cacheEntry - Internet cache entry type that will be cleared.