|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A class implementing this interface can be passed to a CalHTMLPane
at
construction time and will thereafter receive notification of events which have occured within the Pane.
A CalHTMLPane
always has one, and only one, attached CalHTMLObserver
.
If a CalHTMLObserver
is not passed to the Pane during construction, a
DefaultCalHTMLObserver
will be used. DefaultCalHTMLObserver
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 CalHTMLObserver
may be used with several
CalHTMLPanes
.
CalHTMLPane
Method Summary | |
void |
formSubmitUpdate(CalHTMLPane pane,
java.net.URL docBaseURL,
int method,
java.lang.String action,
java.lang.String data)
Notification that a form submission has been initiated. |
void |
historyUpdate(CalHTMLPane pane,
int position)
Notification of a change in position within the Pane's document history. |
void |
linkActivatedUpdate(CalHTMLPane pane,
java.net.URL url,
java.lang.String targetFrame,
java.lang.String jname)
Notification that a hyperlink has been activated via the keyboard or mouse. |
void |
linkFocusedUpdate(CalHTMLPane pane,
java.net.URL url)
Notification that a hyperlink has received or lost keyboard/mouse focus. |
void |
showNewFrameRequest(CalHTMLPane pane,
java.lang.String targetFrame,
java.net.URL url)
Notification for a new CalHTMLPane to be created with
the specified top-level frame name and showing the specified document. |
void |
statusUpdate(CalHTMLPane pane,
int status,
java.net.URL url,
int value,
java.lang.String message)
Gives general notifications of events or errors which are occuring within the Pane. |
Method Detail |
public void linkActivatedUpdate(CalHTMLPane pane, java.net.URL url, java.lang.String targetFrame, java.lang.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 CalHTMLPane
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 Panepublic void linkFocusedUpdate(CalHTMLPane pane, java.net.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 CalHTMLPane
which has called this methodurl
- the URL
of the focused link, or null
if no link has the focuspublic void statusUpdate(CalHTMLPane pane, int status, java.net.URL url, int value, java.lang.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:
CalCons.PRE_CONNECT
URL
to receive data.
CalCons.PARSE_FAILED
URL
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.
CalCons.CONNECTED
URL
and is receiving any content.
CalCons.DOC_LENGTH
URL
is known and is contained
in the value
argument.
CalCons.TITLE
URL
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.
CalCons.PARSE_FAILED_POST_CONNECT
URL
. This will most
likely be an IOException
such as a server time-out.
CalCons.WAITING_FOR_IMAGES
CalCons.DOC_LOADED
pane
- the CalHTMLPane
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 codepublic void formSubmitUpdate(CalHTMLPane pane, java.net.URL docBaseURL, int method, java.lang.String action, java.lang.String data)
handleFormSubmission
is enabled or
disabled by the CalHTMLPreferences
object controlling the Pane.
The method argument will be either CalCons.V_GET, CalCons.V_POST, or CalCons.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 CalHTMLPane
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 resultsCalHTMLPreferences.setHandleFormSubmission(boolean)
public void historyUpdate(CalHTMLPane pane, int position)
if (position == CalCons.AT_HISTORY_MIDDLE) {
//...enable both the 'back' and 'forward' buttons
} else {
if ((position & CalCons.AT_HISTORY_TOP) > 0) {
//...disable the 'forward' button
} else {
//...enable the 'forward' button
}
if ((position & CalCons.AT_HISTORY_BOTTOM) > 0) {
//...disable the 'back' button
} else {
//...enable the 'back' button
}
}
pane
- the CalHTMLPane
which has called this methodposition
- a value denoting the current position within the Pane's historypublic void showNewFrameRequest(CalHTMLPane pane, java.lang.String targetFrame, java.net.URL url)
CalHTMLPane
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
CalHTMLPreferences
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 CalHTMLPane
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 PaneCalHTMLPreferences.setHandleNewFrames(boolean)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |