|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.lwuit.html.DefaultHTMLCallback
public class DefaultHTMLCallback
This is a default implementation of HTMLCallback that basically doesn't do much but does keep the HTMLComponent work intact. This class was created so developers will avoid pitfalls of HTMLCallback, as using the wrong return values. Note that in any case an HTMLComponent doesn't have to use an HTMLCallback.
Field Summary | |
---|---|
static int |
ERROR_CSS_ATTIBUTE_VALUE_INVALID
Error code denoting that an invalid attribute value was found in the CSS |
static int |
ERROR_CSS_ATTRIBUTE_NOT_SUPPORTED
Error code denoting that an unsupported CSS attribute (by XHTML-MP 1.0 standards) was found in the HTML or external CSS files |
static int |
ERROR_CSS_NO_BASE_URL
Error code denoting that a relative URL was referenced from a document with no base URL (A document that was loaded via setBody/setHTML/setDOM and not via setPage) In this case the return value of parsingError is not considered - parsing continues and the resource at the URL (CSS file/image) is ignored |
static int |
ERROR_CSS_NOT_FOUND
Error code denoting that a CSS file referenced from the HTML or from another external CSS file was not found |
Fields inherited from interface com.sun.lwuit.html.HTMLCallback |
---|
ERROR_CONNECTING, ERROR_IMAGE_BAD_FORMAT, ERROR_IMAGE_NOT_FOUND, ERROR_INVALID_TAG_HIERARCHY, ERROR_NO_BASE_URL, FIELD_PASSWORD, FIELD_TEXT, LINK_FORBIDDEN, LINK_REGULAR, LINK_VISTED, STATUS_CANCELLED, STATUS_COMPLETED, STATUS_CONNECTED, STATUS_DISPLAYED, STATUS_ERROR, STATUS_NONE, STATUS_PARSED, STATUS_REDIRECTED, STATUS_REQUESTED |
Fields inherited from interface com.sun.lwuit.xml.ParserCallback |
---|
ERROR_ATTIBUTE_VALUE_INVALID, ERROR_ATTRIBUTE_NOT_SUPPORTED, ERROR_ENCODING, ERROR_MULTIPLE_ROOTS, ERROR_NO_CLOSE_TAG, ERROR_NO_ROOTS, ERROR_TAG_NOT_SUPPORTED, ERROR_UNEXPECTED_CHARACTER, ERROR_UNEXPECTED_TAG_CLOSING, ERROR_UNRECOGNIZED_CHAR_ENTITY |
Constructor Summary | |
---|---|
DefaultHTMLCallback()
|
Method Summary | |
---|---|
void |
actionPerformed(ActionEvent evt,
HTMLComponent htmlC,
HTMLElement element)
Called whenever an ActionEvent is triggered in one of the controls in the HTMLComponent For example, button press, checkbox/radiobutton check etc. |
void |
dataChanged(int type,
int index,
HTMLComponent htmlC,
TextField textField,
HTMLElement element)
Called when the user types in a TextField inside the HTMLComponent This method will be called only if HTMLComponent.isEventsEnabled() is true |
java.lang.String |
fieldSubmitted(HTMLComponent htmlC,
TextArea ta,
java.lang.String actionURL,
java.lang.String id,
java.lang.String value,
int type,
java.lang.String errorMsg)
Called whenever a field is submitted to a form. |
void |
focusGained(Component cmp,
HTMLComponent htmlC,
HTMLElement element)
Called when one of the controls in the HTMLComponent obtained focus This method will be called only if HTMLComponent.isEventsEnabled() is true |
void |
focusLost(Component cmp,
HTMLComponent htmlC,
HTMLElement element)
Called when one of the controls in the HTMLComponent lost focus This method will be called only if HTMLComponent.isEventsEnabled() is true |
java.lang.String |
getAutoComplete(HTMLComponent htmlC,
java.lang.String actionURL,
java.lang.String id)
Called on form creation and enabled implementations of this method to return a value to preset in a form field. |
int |
getLinkProperties(HTMLComponent htmlC,
java.lang.String url)
Returns properties about the given link to indicate to HTMLComponent how to render it Note that this method is always called NOT on the EDT thread. |
boolean |
linkClicked(HTMLComponent htmlC,
java.lang.String url)
Called when a link is clicked. |
void |
pageStatusChanged(HTMLComponent htmlC,
int status,
java.lang.String url)
Called when the page status has been changed |
boolean |
parsingError(int errorId,
java.lang.String tag,
java.lang.String attribute,
java.lang.String value,
java.lang.String description)
Called when encountering an error while parsing the XML document. |
void |
selectionChanged(int oldSelected,
int newSelected,
HTMLComponent htmlC,
List list,
HTMLElement element)
Called when the user selects an item in a List inside the HTMLComponent Note: Selection is traversing through the items - once the user has actually decided, an ActionEvent will be sent as well This method will be called only if HTMLComponent.isEventsEnabled() is true |
void |
titleUpdated(HTMLComponent htmlC,
java.lang.String title)
Called when the page's title is updated |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ERROR_CSS_ATTRIBUTE_NOT_SUPPORTED
public static final int ERROR_CSS_ATTIBUTE_VALUE_INVALID
public static final int ERROR_CSS_NOT_FOUND
public static final int ERROR_CSS_NO_BASE_URL
Constructor Detail |
---|
public DefaultHTMLCallback()
Method Detail |
---|
public void titleUpdated(HTMLComponent htmlC, java.lang.String title)
titleUpdated
in interface HTMLCallback
htmlC
- The HTMLComponent that triggered the eventtitle
- The new titlepublic boolean parsingError(int errorId, java.lang.String tag, java.lang.String attribute, java.lang.String value, java.lang.String description)
parsingError
in interface ParserCallback
errorId
- The error ID, one of the ERROR_* constantstag
- The tag in which the error occured (Can be null for non-tag related errors)attribute
- The attribute in which the error occured (Can be null for non-attribute related errors)value
- The value in which the error occured (Can be null for non-value related errors)description
- A verbal description of the error
public void pageStatusChanged(HTMLComponent htmlC, int status, java.lang.String url)
pageStatusChanged
in interface HTMLCallback
htmlC
- The HTMLComponent in which the status change occuredstatus
- The new status, one of the STATUS_* constantsurl
- The URL of the pagepublic java.lang.String fieldSubmitted(HTMLComponent htmlC, TextArea ta, java.lang.String actionURL, java.lang.String id, java.lang.String value, int type, java.lang.String errorMsg)
fieldSubmitted
in interface HTMLCallback
htmlC
- The HTMLComponent in which this event occuredta
- The TextArea/TextField of this fieldactionURL
- The action URL of the formid
- The ID of the fieldvalue
- The value enteredtype
- The type of the field, one of the FIELD_* constantserrorMsg
- The error message if any error occured (i.e. input validation error) or null if no error occured
public java.lang.String getAutoComplete(HTMLComponent htmlC, java.lang.String actionURL, java.lang.String id)
getAutoComplete
in interface HTMLCallback
htmlC
- The HTMLComponent in which this event occuredactionURL
- The action URL of the formid
- The ID of the field
public int getLinkProperties(HTMLComponent htmlC, java.lang.String url)
getLinkProperties
in interface HTMLCallback
htmlC
- The HTMLComponenturl
- The Link URL
public boolean linkClicked(HTMLComponent htmlC, java.lang.String url)
linkClicked
in interface HTMLCallback
htmlC
- The HTMLComponenturl
- The Link URL
public void actionPerformed(ActionEvent evt, HTMLComponent htmlC, HTMLElement element)
actionPerformed
in interface HTMLCallback
evt
- The event triggered, the component can be extracted using getSourcehtmlC
- The HTMLComponentelement
- The element associated with the component that triggered the eventpublic void focusGained(Component cmp, HTMLComponent htmlC, HTMLElement element)
focusGained
in interface HTMLCallback
cmp
- The component that triggered the eventhtmlC
- The HTMLComponentelement
- The element associated with the component that triggered the eventpublic void focusLost(Component cmp, HTMLComponent htmlC, HTMLElement element)
focusLost
in interface HTMLCallback
cmp
- The component that triggered the eventhtmlC
- The HTMLComponentelement
- The element associated with the component that triggered the eventpublic void selectionChanged(int oldSelected, int newSelected, HTMLComponent htmlC, List list, HTMLElement element)
selectionChanged
in interface HTMLCallback
oldSelected
- old selected index in list modelnewSelected
- new selected index in list modelhtmlC
- The HTMLComponentlist
- The list that triggered the event (Usually a ComboBox but not always)element
- The element associated with the component that triggered the event (Should be TAG_SELECT)public void dataChanged(int type, int index, HTMLComponent htmlC, TextField textField, HTMLElement element)
dataChanged
in interface HTMLCallback
type
- the type data change; REMOVED, ADDED or CHANGEDindex
- item index in a list modelhtmlC
- The HTMLComponenttextField
- The TextField that triggerd the eventelement
- The element associated with the component that triggered the event (Should be TAG_INPUT with type text/password)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |