| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface HTMLObserver
A class implementing this interface can be passed to a HTMLPane at
 construction time and will thereafter receive notification of events which have occured within the Pane.
 A HTMLPane always has one, and only one, attached HTMLObserver.
 
If a HTMLObserver is not passed to the Pane during construction, a
 HTMLObserverAdapter
 will be used. HTMLObserverAdapter implements all the methods of this
 interface as null-ops, allowing the programmer to extend the class and only implement
 those methods of interest.
 
Note that the same HTMLObserver may be used with several
 HTMLPanes.
HTMLPane| Method Summary | |
|---|---|
|  void | formSubmitUpdate(HTMLPane pane,
                 URL docBaseURL,
                 int method,
                 String action,
                 String data)Notification that a form submission has been initiated. | 
|  void | historyUpdate(HTMLPane pane,
              int position)Notification of a change in position within the Pane's document history. | 
|  void | linkActivatedUpdate(HTMLPane pane,
                    URL url,
                    String targetFrame,
                    String jname)Notification that a hyperlink has been activated via the keyboard or mouse. | 
|  void | linkFocusedUpdate(HTMLPane pane,
                  URL url)Notification that a hyperlink has received or lost keyboard/mouse focus. | 
|  void | showNewFrameRequest(HTMLPane pane,
                    String targetFrame,
                    URL url)Notification for a new HTMLPaneto be created with
 the specified top-level frame name and showing the specified document. | 
|  void | statusUpdate(HTMLPane pane,
             int status,
             URL url,
             int value,
             String message)Gives general notifications of events or errors which are occuring within the Pane. | 
| Method Detail | 
|---|
void linkActivatedUpdate(HTMLPane pane,
                         URL url,
                         String targetFrame,
                         String jname)
URL protocol is 'mailto', which the Pane cannot currently handle.
 If the jname argument is not null the pane will not attempt to follow the link, allowing
 it to be handled here.
pane - the HTMLPane which has called this methodurl - the URL of the link that has been activatedtargetFrame - the name of the frame where the contents of the URL are
                    to be displayedjname - A name given to the link so it can be handled outside the calling Pane
void linkFocusedUpdate(HTMLPane pane,
                       URL url)
URL
 sent is not null then a new link has now received focus.
 If the URL is null then a link which previously had focus
 has now lost it, and no link is currently focused.
 This method can be used, for example, to update a status display which shows the currently focused link on the user's screen.
pane - the HTMLPane which has called this methodurl - the URL of the focused link, or null if no link has the focus
void statusUpdate(HTMLPane pane,
                  int status,
                  URL url,
                  int value,
                  String message)
DOC_LENGTH status argument listed below, the value argument sent
 will be the nesting level of the frame initiating this call. A nesting of 0 indicates the
 Pane's top level frame has made the call. Often you will only be interested in calls from the
 top level frame. For example, if a frameset document is loading you may get the DOC_LOADED
 status call several times, but the one that really counts is the frame 0 call, and this is
 never sent until all sub-frames have finished loading.
 The current status arguments sent to this method are:
HTMLConstants.PRE_CONNECTURL to receive data.
 HTMLConstants.PARSE_FAILEDURL or was unable to parse the content.
 Most likely this will be due to an incorrectly specified URL.
 The message argument may contain further details of the reason for failure.
 HTMLConstants.CONNECTEDURL and is receiving any content.
 HTMLConstants.DOC_LENGTHURL is known and is contained
 in the value argument.
 HTMLConstants.TITLEURL is known and is contained
 in the message argument. Only the title of a document in the Pane's top level frame
 will be sent to this method. If the document has no name, the message will be null, unless the
 document is a FrameSet document in which case the message "FrameSet" will be sent.
 HTMLConstants.PARSE_FAILED_POST_CONNECTURL. This will most
 likely be an IOException such as a server time-out.
 HTMLConstants.WAITING_FOR_IMAGESHTMLConstants.DOC_LOADED
pane - the HTMLPane which has called this methodstatus - the status code of the updateurl - a URL related to the status codevalue - a value related to the status codemessage - a message related to the status code
void formSubmitUpdate(HTMLPane pane,
                      URL docBaseURL,
                      int method,
                      String action,
                      String data)
handleFormSubmission is enabled or
 disabled by the Config object controlling the Pane.
 The method argument will be either HTMLConstants.V_GET, HTMLConstants.V_POST, or HTMLConstants.V_JFORM
 If the argument is V_JFORM then the Pane will take no action, irrespective of whether
 handleFormSubmission is enabled. This allows the programmer to treat this method as
 a pseudo actionListener for controls placed within documents.
 
The data argument sent to this method is an x-www-form-urlencoded concatenated string of the form results gathered from successful form controls.
pane - the HTMLPane which has called this methoddocBaseURL - the URL of the document containing the form, possibly modified
                   by the <BASE> tagmethod - a code for the form method - GET, POST or JFORMaction - the value of the action attribute (if any) specified in the FORM tagdata - the concatenated, encoded form resultsHTMLConfig.setHandleFormSubmission(boolean)
void historyUpdate(HTMLPane pane,
                   int position)
 if (position == HTMLConstants.AT_HISTORY_MIDDLE) { 
     //...enable both the 'back' and 'forward' buttons 
 } else { 
     if ((position & HTMLConstants.AT_HISTORY_TOP) > 0) { 
         //...disable the 'forward' button  
     } else {  
         //...enable the 'forward' button  
     }  
     if ((position & HTMLConstants.AT_HISTORY_BOTTOM) > 0) {  
         //...disable the 'back' button   
     } else {   
         //...enable the 'back' button   
     }   
 }
 
pane - the HTMLPane which has called this methodposition - a value denoting the current position within the Pane's history
void showNewFrameRequest(HTMLPane pane,
                         String targetFrame,
                         URL url)
HTMLPane to be created with
 the specified top-level frame name and showing the specified document. This method will be only be called if handleNewFrames is disabled in the
 Config object controlling the Pane. The need for a new frame
 occurs when an HTML anchor or other tag specifies that a URL should be displayed in a
 frame which has a name unknown to the Pane, or when the reserved HTML name "_blank" is
 specified.
pane - the HTMLPane which has called this methodtargetFrame - the name to be given to the top-level frame of the new Pane,
                    or null if no name has been specifiedurl - the URL of the document to be displayed in the new PaneHTMLConfig.setHandleNewFrames(boolean)| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||