com.teamdev.jxbrowser.event
Class StateEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.teamdev.jxbrowser.event.WebBrowserEvent
          extended by com.teamdev.jxbrowser.event.RequestEvent
              extended by com.teamdev.jxbrowser.event.StateEvent
All Implemented Interfaces:
java.io.Serializable

public class StateEvent
extends RequestEvent

Indicates that browser state has changed.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.teamdev.jxbrowser.event.RequestEvent
_request
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
StateEvent(WebBrowser source, org.mozilla.interfaces.nsIWebProgress webProgress, org.mozilla.interfaces.nsIRequest request, long stateFlags, long status)
           
 
Method Summary
 long getStateFlags()
          Returns flags indicating the new state.
 long getStatus()
          Returns an error status code associated with the state change.
 boolean isBroken()
          This flag indicates an unknown security state.
 boolean isDocument()
          This flag indicates that the state transition is for a document request.
 boolean isInsecure()
          This flag indicates that the data corresponding to the request was received over an insecure channel.
 boolean isLoadingCompleted()
          Indicates that one navigation request is completed.
 boolean isNegotiating()
          Deprecated. 
 boolean isNetwork()
          This flag indicates that the state transition corresponds to the start or stop of activity in the indicated nsIWebProgress instance.
 boolean isRedirecting()
          This flag indicates that a request is being redirected.
 boolean isRequest()
          This flag indicates that the state transition is for a request, which includes but is not limited to document requests.
 boolean isRestoring()
          This flag indicates that the state transition corresponds to the start or stop of activity for restoring a previously-rendered presentation.
 boolean isSecure()
          This flag indicates that the data corresponding to the request was received over a secure channel.
 boolean isSecureHigh()
          This flag indicates a high degree of security
 boolean isSecureLow()
          This flag indicates a low degree of security
 boolean isSecureMed()
          This flag indicates a medium degree of security
 boolean isStarted()
          This flag indicates the start of a request.
 boolean isStoped()
          This flag indicates the completion of a request.
 boolean isTransferring()
          This flag indicates that data for a request is being transferred to an end consumer
 boolean isWindow()
          This flag indicates that the state transition corresponds to the start or stop of activity in the indicated nsIWebProgress instance.
 java.lang.String toString()
           
 
Methods inherited from class com.teamdev.jxbrowser.event.RequestEvent
getRequestUrlName, isLoadBackground, isLoadByPassCache, isLoadFromCache, isLoadingDocument, isLoadInhibitCaching, isLoadInhibitPersistenCaching, isLoadNormal, isRequestPending
 
Methods inherited from class com.teamdev.jxbrowser.event.WebBrowserEvent
getWebBrowser
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StateEvent

public StateEvent(WebBrowser source,
                  org.mozilla.interfaces.nsIWebProgress webProgress,
                  org.mozilla.interfaces.nsIRequest request,
                  long stateFlags,
                  long status)
Method Detail

getStateFlags

public long getStateFlags()
Returns flags indicating the new state. This value is a combination of one of the State Transition Flags and one or more of the State Type Flags.

Returns:
flags indicating the new state
See Also:
RequestListener.STATE_START, RequestListener.STATE_REDIRECTING, RequestListener.STATE_TRANSFERRING, RequestListener.STATE_NEGOTIATING, RequestListener.STATE_STOP

getStatus

public long getStatus()
Returns an error status code associated with the state change. This parameter should be ignored unless stateFlags includes the RequestListener.STATE_STOP bit. The status code indicates success or failure of the request associated with the state change. NOTE: status may be a success code even for server generated errors, such as the HTTP 404 error. In such cases, the request itself should be queried for extended error information.

Returns:
error status code associated with the state change

isStarted

public boolean isStarted()
This flag indicates the start of a request. This flag is set when a request is initiated.

Returns:
true if state flag is start, else false.

isRedirecting

public boolean isRedirecting()
This flag indicates that a request is being redirected.

Returns:
true if state flag is redirecting, else false.

isTransferring

public boolean isTransferring()
This flag indicates that data for a request is being transferred to an end consumer

Returns:
true if state flag is transferring, else false.

isNegotiating

@Deprecated
public boolean isNegotiating()
Deprecated. 

This flag is not used in current version of mozilla.

Returns:
true if state flag is negotiating, else false.

isStoped

public boolean isStoped()
This flag indicates the completion of a request.

Returns:
true if state flag is stop, else false.

isRequest

public boolean isRequest()
This flag indicates that the state transition is for a request, which includes but is not limited to document requests. (See below for a description of document requests.) Other types of requests, such as requests for inline content (e.g., images and stylesheets) are considered normal requests.

Returns:
true if state flag is request, else false.

isDocument

public boolean isDocument()
This flag indicates that the state transition is for a document request. This flag is set in addition to request. A document request does not complete until all requests associated with the loading of its corresponding document have completed. This includes other document requests (e.g., corresponding to HTML iframe elements). The document corresponding to a document request is available via the DOMWindow attribute.

Returns:
true if state flag is document, else false

isNetwork

public boolean isNetwork()
This flag indicates that the state transition corresponds to the start or stop of activity in the indicated nsIWebProgress instance. This flag is accompanied by either STATE_START or STATE_STOP, and it may be combined with other State Type Flags. Unlike STATE_IS_WINDOW, this flag is only set when activity within the nsIWebProgress instance being observed starts or stops. If activity only occurs in a child nsIWebProgress instance, then this flag will be set to indicate the start and stop of that activity. For example, in the case of navigation within a single frame of a HTML frameset, a nsIWebProgressListener instance attached to the nsIWebProgress of the frameset window will receive onStateChange calls with the STATE_IS_NETWORK flag set to indicate the start and stop of said navigation. In other words, an observer of an outer window can determine when activity, that may be constrained to a child window or set of child windows, starts and stops.

Returns:
true if state flag is network

isWindow

public boolean isWindow()
This flag indicates that the state transition corresponds to the start or stop of activity in the indicated nsIWebProgress instance. This flag is accompanied by either STATE_START or STATE_STOP, and it may be combined with other State Type Flags.

Returns:
true if state flag is window, else false

isRestoring

public boolean isRestoring()
This flag indicates that the state transition corresponds to the start or stop of activity for restoring a previously-rendered presentation. As such, there is no actual network activity associated with this request, and any modifications made to the document or presentation when it was originally loaded will still be present.

Returns:
true if state flag is restoring, else false.

isInsecure

public boolean isInsecure()
This flag indicates that the data corresponding to the request was received over an insecure channel.

Returns:
true if state flag is insecure, else false.

isBroken

public boolean isBroken()
This flag indicates an unknown security state. This may mean that the request is being loaded as part of a page in which some content was received over an insecure channel.

Returns:
true if state flag is broken

isSecure

public boolean isSecure()
This flag indicates that the data corresponding to the request was received over a secure channel. The degree of security is expressed by STATE_SECURE_HIGH, STATE_SECURE_MED, or STATE_SECURE_LOW

Returns:
true if state flag is secure, else false.

isSecureHigh

public boolean isSecureHigh()
This flag indicates a high degree of security

Returns:
true if state flag is secure high, else false

isSecureMed

public boolean isSecureMed()
This flag indicates a medium degree of security

Returns:
true if state flag is secure med, else false

isSecureLow

public boolean isSecureLow()
This flag indicates a low degree of security

Returns:
true if state flag is secure low, else false

isLoadingCompleted

public boolean isLoadingCompleted()
Indicates that one navigation request is completed. This method can only identify that on of the navigation request completed.
This flag may identify that page that you require by WebBrowser.navigate(String) method is loaded fully, but it's also can identify some redirection or some sub-request competition.
To identify finish of WebBrowser.navigate(String) you need to check that this flag gained for the root request.
To do so please look at the sample

Returns:
whether one navigation request is completed

toString

public java.lang.String toString()
Overrides:
toString in class java.util.EventObject