# Class Ads

java.lang.Object
com.codename1.ui.Component
com.codename1.ui.Container
com.codename1.components.Ads

All Implemented Interfaces:
  `Animation, Editable, StyleListener, HTMLCallback, ParserCallback, Iterable<Component>`

public class Ads extends Container implements HTMLCallback
This is an Ads Component, this Component can displays banner/text ads on a Form. This is a generic Ads Component that can support different type of Ads Network Services, at the Moment Codename One supports innerActive ads, to gain an appId please refer to http://console.inner-active.com/iamp/publisher/register?ref_id=affiliate_CodenameOne

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `ERROR_CSS_ATTIBUTE_VALUE_INVALID`
  Error code denoting that an invalid attribute value was found in the CSS
  `static final 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 final 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 final 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 class Component

  `BASELINE, BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, CROSSHAIR_CURSOR, DEFAULT_CURSOR, DRAG_REGION_IMMEDIATELY_DRAG_X, DRAG_REGION_IMMEDIATELY_DRAG_XY, DRAG_REGION_IMMEDIATELY_DRAG_Y, DRAG_REGION_LIKELY_DRAG_X, DRAG_REGION_LIKELY_DRAG_XY, DRAG_REGION_LIKELY_DRAG_Y, DRAG_REGION_NOT_DRAGGABLE, DRAG_REGION_POSSIBLE_DRAG_X, DRAG_REGION_POSSIBLE_DRAG_XY, DRAG_REGION_POSSIBLE_DRAG_Y, E_RESIZE_CURSOR, HAND_CURSOR, LEFT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NW_RESIZE_CURSOR, RIGHT, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, TOP, W_RESIZE_CURSOR, WAIT_CURSOR`

  ### Fields inherited from interface 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 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

  Constructors
  Constructor
  Description
  `Ads()`
  Default constructor for GUI builder
  `Ads(String appId)`
  Simple constructor to create an Ad Component
  `Ads(String appId, boolean refreshAd)`

  ###### Parameters

- ## Method Summary

  Modifier and Type
  Method
  Description
  `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.
  `boolean`
  `animate()`
  Allows the animation to reduce "repaint" calls when it returns false.
  `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
  `protected void`
  `deinitialize()`
  Invoked to indicate that the component initialization is being reversed since the component was detached from the container hierarchy.
  `String`
  `fieldSubmitted(HTMLComponent htmlC, TextArea ta, String actionURL, String id, String value, int type, 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
  `String`
  `getAd()`
  HTML ad received from the server
  `String`
  `getAge()`
  Users age
  `String`
  `getAppID()`
  Simple getter of the unique identifier of the app on the ads service network.
  `String`
  `getAutoComplete(HTMLComponent htmlC, String actionURL, String id)`
  Called on form creation and enabled implementations of this method to return a value to preset in a form field.
  `String`
  `getCategory()`
  Category is a single word description of the application.
  `String`
  `getGender()`
  The user gender can be: M/m, F/f, Male, Female.
  `String[]`
  `getKeywords()`
  Keywords relevant to this user specific session
  `int`
  `getLinkProperties(HTMLComponent htmlC, 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.
  `String`
  `getLocation()`
  Location string is a comma separated list of country, state/province, city For example: US, NY, NY
  `String[]`
  `getPropertyNames()`
  A component may expose mutable property names for a UI designer to manipulate, this API is designed for usage internally by the GUI builder code
  `String[]`
  `getPropertyTypeNames()`
  This method is here to workaround an XMLVM array type bug where property types aren't identified properly, it returns the names of the types using the following type names: String,int,double,long,byte,short,char,String[],String[][],byte[],Image,Image[],Object[],ListModel,ListCellRenderer
  `Class[]`
  `getPropertyTypes()`
  Matches the property names method (see that method for further details).
  `Object`
  `getPropertyValue(String name)`
  Returns the current value of the property name, this method is used by the GUI builder
  `int`
  `getUpdateDuration()`
  The amount of time needed to update the ad
  `void`
  `initComponent()`
  Allows subclasses to bind functionality that relies on fully initialized and "ready for action" component state
  `void`
  `keyReleased(int code)`
  If this Component is focused, the key released event will call this method
  `boolean`
  `linkClicked(HTMLComponent htmlC, String url)`
  Called when a link is clicked.
  `void`
  `pageStatusChanged(HTMLComponent htmlC, int status, String url)`
  Called when the page status has been changed
  `boolean`
  `parsingError(int errorId, String tag, String attribute, String value, String description)`
  Called when encountering an error while parsing the XML document.
  `void`
  `pointerReleased(int x, int y)`
  If this Component is focused, the pointer released event will call this method
  `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`
  `setAd(String ad)`
  HTML ad received from the server
  `void`
  `setAge(String age)`
  Sets the users age
  `void`
  `setAppID(String appId)`
  Simple setter of the unique identifier of the app on the ads service network, no need to manually use this the createAdsService uses this.
  `void`
  `setCategory(String category)`
  Category is a single word description of the application.
  `void`
  `setGender(String gender)`
  Sets Gender if applicable can be one of the following: 'F', 'f', 'M', 'm', 'Female', 'female', 'Male', 'male'
  `void`
  `setHeight(int height)`
  Sets the Component height, this method is exposed for the purpose of external layout managers and should not be invoked directly.
  `void`
  `setKeywords(String[] keywords)`
  Keywords relevant to this user specific session
  `void`
  `setLocation(String location)`
  Location string is a comma separated list of country, state/province, city For example: US, NY, NY
  `String`
  `setPropertyValue(String name, Object value)`
  Sets a new value to the given property, returns an error message if failed and null if successful.
  `void`
  `setUpdateDuration(int updateDuration)`
  The amount of time needed to update the ad
  `void`
  `titleUpdated(HTMLComponent htmlC, String title)`
  Called when the page's title is updated

  ### Methods inherited from class Container

  `add, add, add, add, add, add, addAll, addComponent, addComponent, addComponent, addComponent, animateHierarchy, animateHierarchyAndWait, animateHierarchyFade, animateHierarchyFadeAndWait, animateLayout, animateLayoutAndWait, animateLayoutFade, animateLayoutFadeAndWait, animateUnlayout, animateUnlayoutAndWait, applyRTL, calcPreferredSize, cancelRepaints, clearClientProperties, constrainHeightWhenScrollable, constrainWidthWhenScrollable, contains, createAnimateHierarchy, createAnimateHierarchyFade, createAnimateLayout, createAnimateLayoutFade, createAnimateLayoutFadeAndWait, createAnimateMotion, createAnimateUnlayout, createReplaceTransition, dragInitiated, drop, encloseIn, encloseIn, findDropTargetAt, findFirstFocusable, fireClicked, flushReplace, forceRevalidate, getBottomGap, getChildrenAsList, getClosestComponentTo, getComponentAt, getComponentAt, getComponentCount, getComponentIndex, getGridPosX, getGridPosY, getLayout, getLayoutHeight, getLayoutWidth, getLeadComponent, getLeadParent, getResponderAt, getSafeAreaRoot, getScrollIncrement, getSideGap, getUIManager, initLaf, invalidate, isEnabled, isSafeArea, isSafeAreaRoot, isScrollableX, isScrollableY, isSelectableInteraction, isSurface, iterator, iterator, keyPressed, layoutContainer, morph, morphAndWait, paint, paintComponentBackground, paintGlass, paramString, pointerPressed, refreshTheme, removeAll, removeComponent, replace, replace, replaceAndWait, replaceAndWait, replaceAndWait, revalidate, revalidateLater, revalidateWithAnimationSafety, scrollComponentToVisible, setCellRenderer, setEnabled, setLayout, setLeadComponent, setSafeArea, setSafeAreaRoot, setScrollable, setScrollableX, setScrollableY, setScrollIncrement, setShouldCalcPreferredSize, setShouldLayout, setUIManager, updateTabIndices`

  ### Methods inherited from class Component

  `addDragFinishedListener, addDragOverListener, addDropListener, addFocusListener, addLongPressListener, addPointerDraggedListener, addPointerPressedListener, addPointerReleasedListener, addPullToRefresh, addScrollListener, addStateChangeListener, announceForAccessibility, bindProperty, blocksSideSwipe, calcScrollSize, contains, containsOrOwns, createStyleAnimation, deinitializeCustomStyle, dragEnter, dragExit, dragFinished, draggingOver, drawDraggedImage, focusGained, focusLost, getAbsoluteX, getAbsoluteY, getAccessibilityText, getAllStyles, getAnimationManager, getBaseline, getBaselineResizeBehavior, getBindablePropertyNames, getBindablePropertyTypes, getBorder, getBoundPropertyValue, getBounds, getBounds, getClientProperty, getCloudBoundProperty, getCloudDestinationProperty, getComponentForm, getComponentState, getCursor, getDefaultDragTransparency, getDirtyRegion, getDisabledStyle, getDraggedx, getDraggedy, getDragImage, getDragRegionStatus, getDragSpeed, getDragTransparency, getEditingDelegate, getHeight, getInlineAllStyles, getInlineDisabledStyles, getInlinePressedStyles, getInlineSelectedStyles, getInlineStylesTheme, getInlineUnselectedStyles, getInnerHeight, getInnerPreferredH, getInnerPreferredW, getInnerWidth, getInnerX, getInnerY, getLabelForComponent, getName, getNativeOverlay, getNextFocusDown, getNextFocusLeft, getNextFocusRight, getNextFocusUp, getOuterHeight, getOuterPreferredH, getOuterPreferredW, getOuterWidth, getOuterX, getOuterY, getOwner, getParent, getPreferredH, getPreferredSize, getPreferredSizeStr, getPreferredTabIndex, getPreferredW, getPressedStyle, getSameHeight, getSameWidth, getScrollable, getScrollAnimationSpeed, getScrollDimension, getScrollOpacity, getScrollOpacityChangeSpeed, getScrollX, getScrollY, getSelectCommandText, getSelectedRect, getSelectedStyle, getStyle, getTabIndex, getTensileLength, getTextSelectionSupport, getTooltip, getUIID, getUnselectedStyle, getVisibleBounds, getVisibleBounds, getWidth, getX, getY, growShrink, handlesInput, hasFixedPreferredSize, hasFocus, hideNativeOverlay, initCustomStyle, initDisabledStyle, initPressedStyle, initSelectedStyle, initUnselectedStyle, installDefaultPainter, isAlwaysTensile, isBlockLead, isCellRenderer, isChildOf, isDragActivated, isDragAndDropOperation, isDraggable, isDragRegion, isDropTarget, isEditable, isEditing, isFlatten, isFocusable, isGrabsPointerEvents, isHidden, isHidden, isHideInLandscape, isHideInPortrait, isIgnorePointerEvents, isInClippingRegion, isInitialized, isOpaque, isOwnedBy, isPinchBlocksDragAndDrop, isRippleEffect, isRTL, isScrollable, isScrollVisible, isSetCursorSupported, isSmoothScrolling, isSnapToGrid, isStickyDrag, isTactileTouch, isTactileTouch, isTensileDragEnabled, isTraversable, isVisible, keyRepeated, laidOut, longKeyPress, longPointerPress, onScrollX, onScrollY, onSetFocusable, paintBackground, paintBackgrounds, paintBorder, paintBorderBackground, paintComponent, paintComponent, paintIntersectingComponentsAbove, paintLock, paintLockRelease, paintRippleOverlay, paintScrollbars, paintScrollbarX, paintScrollbarY, paintShadows, parsePreferredSize, pinch, pinch, pinchReleased, pointerDragged, pointerDragged, pointerHover, pointerHoverPressed, pointerHoverReleased, pointerPressed, pointerReleased, putClientProperty, refreshTheme, refreshTheme, remove, removeDragFinishedListener, removeDragOverListener, removeDropListener, removeFocusListener, removeLongPressListener, removePointerDraggedListener, removePointerPressedListener, removePointerReleasedListener, removeScrollListener, removeStateChangeListener, repaint, repaint, requestFocus, resetFocusable, respondsToPointerEvents, scrollRectToVisible, scrollRectToVisible, setAccessibilityText, setAlwaysTensile, setBlockLead, setBoundPropertyValue, setCloudBoundProperty, setCloudDestinationProperty, setComponentState, setCursor, setDefaultDragTransparency, setDirtyRegion, setDisabledStyle, setDraggable, setDragTransparency, setDropTarget, setEditingDelegate, setFlatten, setFocus, setFocusable, setGrabsPointerEvents, setHandlesInput, setHidden, setHidden, setHideInLandscape, setHideInPortrait, setIgnorePointerEvents, setInitialized, setInlineAllStyles, setInlineDisabledStyles, setInlinePressedStyles, setInlineSelectedStyles, setInlineStylesTheme, setInlineUnselectedStyles, setIsScrollVisible, setLabelForComponent, setName, setNextFocusDown, setNextFocusLeft, setNextFocusRight, setNextFocusUp, setOpaque, setOwner, setPinchBlocksDragAndDrop, setPreferredH, setPreferredSize, setPreferredSizeStr, setPreferredTabIndex, setPreferredW, setPressedStyle, setRippleEffect, setRTL, setSameHeight, setSameSize, setSameWidth, setScrollAnimationSpeed, setScrollOpacityChangeSpeed, setScrollSize, setScrollVisible, setScrollX, setScrollY, setSelectCommandText, setSelectedStyle, setSize, setSmoothScrolling, setSnapToGrid, setTabIndex, setTactileTouch, setTensileDragEnabled, setTensileLength, setTooltip, setTraversable, setUIID, setUIID, setUIIDFinal, setUnselectedStyle, setVisible, setWidth, setX, setY, shouldBlockSideSwipe, shouldBlockSideSwipeLeft, shouldBlockSideSwipeRight, shouldRenderComponentSelection, showNativeOverlay, startEditingAsync, stopEditing, stripMarginAndPadding, styleChanged, toImage, toString, unbindProperty, updateNativeOverlay, visibleBoundsContains`

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### ERROR_CSS_ATTRIBUTE_NOT_SUPPORTED

    static final 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
    See Also:
      - Constant Field Values

  - ### ERROR_CSS_ATTIBUTE_VALUE_INVALID

    static final int ERROR_CSS_ATTIBUTE_VALUE_INVALID
    Error code denoting that an invalid attribute value was found in the CSS
    See Also:
      - Constant Field Values

  - ### ERROR_CSS_NOT_FOUND

    static final 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
    See Also:
      - Constant Field Values

  - ### ERROR_CSS_NO_BASE_URL

    static final 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
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### Ads

    public Ads()
    Default constructor for GUI builder

  - ### Ads

    public Ads(String appId)

    Simple constructor to create an Ad Component

    ###### Parameters

    - `appId`: @param appId unique identifier of the app, to gain an appId please refer to http://console.inner-active.com/iamp/publisher/register?ref_id=affiliate_CodenameOne

  - ### Ads

    public Ads(String appId, boolean refreshAd)

    ###### Parameters

    - `appId`: @param appId unique identifier of the app, to gain an appId please refer to http://console.inner-active.com/iamp/publisher/register?ref_id=affiliate_CodenameOne

    - `refreshAd`: @param refreshAd if true this Component will refresh the Ad every 60 seconds, if false no refresh will occur

- ## Method Details

  - ### initComponent

    public void initComponent()
    Allows subclasses to bind functionality that relies on fully initialized and "ready for action" component state
    Overrides:
      `initComponent` in class `Component`

  - ### deinitialize

    protected void deinitialize()
    Invoked to indicate that the component initialization is being reversed since the component was detached from the container hierarchy. This allows the component to deregister animators and cleanup after itself. This method is the opposite of the initComponent() method.
    Overrides:
      `deinitialize` in class `Component`

  - ### animate

    public boolean animate()

    Allows the animation to reduce "repaint" calls when it returns false. It is called once for every frame. Frames are defined by the `com.codename1.ui.Display` class.

    ###### Returns

    true if a repaint is desired or false if no repaint is necessary

    Specified by:
      `animate` in interface `Animation`
    Overrides:
      `animate` in class `Component`

  - ### keyReleased

    public void keyReleased(int code)

    If this Component is focused, the key released event will call this method

    ###### Parameters

    - `keyCode`: the key code value to indicate a physical key.
    Overrides:
      `keyReleased` in class `Container`

  - ### pointerReleased

    public void pointerReleased(int x, int y)

    If this Component is focused, the pointer released event will call this method

    ###### Parameters

    - `x`: the pointer x coordinate

    - `y`: the pointer y coordinate

    Overrides:
      `pointerReleased` in class `Component`

  - ### getAd

    public String getAd()

    HTML ad received from the server

    ###### Returns

    the ad

  - ### setAd

    public void setAd(String ad)

    HTML ad received from the server

    ###### Parameters

    - `ad`: the ad to set

  - ### getUpdateDuration

    public int getUpdateDuration()

    The amount of time needed to update the ad

    ###### Returns

    the updateDuration

  - ### setUpdateDuration

    public void setUpdateDuration(int updateDuration)

    The amount of time needed to update the ad

    ###### Parameters

    - `updateDuration`: the updateDuration to set

  - ### titleUpdated

    public void titleUpdated(HTMLComponent htmlC, String title)

    Called when the page's title is updated

    ###### Parameters

    - `htmlC`: The HTMLComponent that triggered the event

    - `title`: The new title

    Specified by:
      `titleUpdated` in interface `HTMLCallback`

  - ### pageStatusChanged

    public void pageStatusChanged(HTMLComponent htmlC, int status, String url)

    Called when the page status has been changed

    ###### Parameters

    - `htmlC`: The HTMLComponent in which the status change occured

    - `status`: The new status, one of the STATUS_* constants

    - `url`: The URL of the page

    Specified by:
      `pageStatusChanged` in interface `HTMLCallback`

  - ### fieldSubmitted

    public String fieldSubmitted(HTMLComponent htmlC, TextArea ta, String actionURL, String id, String value, int type, String errorMsg)

    Called whenever a field is submitted to a form. This can be used to perform sanity checks and/or to store values for auto complete.

    ###### Parameters

    - `htmlC`: The HTMLComponent in which this event occured

    - `ta`: The TextArea/TextField of this field

    - `actionURL`: The action URL of the form

    - `id`: The ID of the field

    - `value`: The value entered

    - `type`: The type of the field, one of the FIELD_* constants

    - `errorMsg`: The error message if any error occured (i.e. input validation error) or null if no error occured

    ###### Returns

    The string to submit to the form (Should return value if nothing changed)

    Specified by:
      `fieldSubmitted` in interface `HTMLCallback`

  - ### getAutoComplete

    public String getAutoComplete(HTMLComponent htmlC, String actionURL, String id)

    Called on form creation and enabled implementations of this method to return a value to preset in a form field. This can be used to auto complete previously entered value Note that this method is always called NOT on the EDT thread.

    ###### Parameters

    - `htmlC`: The HTMLComponent in which this event occured

    - `actionURL`: The action URL of the form

    - `id`: The ID of the field

    ###### Returns

    The string to place in the indicated field

    Specified by:
      `getAutoComplete` in interface `HTMLCallback`

  - ### getLinkProperties

    public int getLinkProperties(HTMLComponent htmlC, 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.

    ###### Parameters

    - `htmlC`: The HTMLComponent

    - `url`: The Link URL

    ###### Returns

    LINK_REGULAR or LINK_VISITED or LINK_FORBIDDEN or a mask of those

    Specified by:
      `getLinkProperties` in interface `HTMLCallback`

  - ### linkClicked

    public boolean linkClicked(HTMLComponent htmlC, String url)

    Called when a link is clicked. This can be used to process links that needs additional/alternate handling than fetching an HTML.

    ###### Parameters

    - `htmlC`: The HTMLComponent

    - `url`: The Link URL

    ###### Returns

    true if regular link processing should continue, false otherwise

    Specified by:
      `linkClicked` in interface `HTMLCallback`

  - ### actionPerformed

    public 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. This method will be called only if HTMLComponent.isEventsEnabled() is true

    ###### Parameters

    - `evt`: The event triggered, the component can be extracted using getSource

    - `htmlC`: The HTMLComponent

    - `element`: The element associated with the component that triggered the event

    Specified by:
      `actionPerformed` in interface `HTMLCallback`

  - ### focusGained

    public 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

    ###### Parameters

    - `cmp`: The component that triggered the event

    - `htmlC`: The HTMLComponent

    - `element`: The element associated with the component that triggered the event

    Specified by:
      `focusGained` in interface `HTMLCallback`

  - ### focusLost

    public 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

    ###### Parameters

    - `cmp`: The component that triggered the event

    - `htmlC`: The HTMLComponent

    - `element`: The element associated with the component that triggered the event

    Specified by:
      `focusLost` in interface `HTMLCallback`

  - ### dataChanged

    public 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

    ###### Parameters

    - `type`: the type data change; REMOVED, ADDED or CHANGED

    - `index`: item index in a list model

    - `htmlC`: The HTMLComponent

    - `textField`: The TextField that triggerd the event

    - `element`: The element associated with the component that triggered the event (Should be TAG_INPUT with type text/password)

    Specified by:
      `dataChanged` in interface `HTMLCallback`

  - ### parsingError

    public boolean parsingError(int errorId, String tag, String attribute, String value, String description)

    Called when encountering an error while parsing the XML document. When implementing this, the developer should return true if the error should be ignored and the document needs to be further parsed, or false to stop parsing and issue an error to the user Note that this method is always called NOT on the EDT thread.

    ###### Parameters

    - `errorId`: The error ID, one of the ERROR_* constants

    - `tag`: 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

    ###### Returns

    true to continue parsing, false to stop

    Specified by:
      `parsingError` in interface `ParserCallback`

  - ### selectionChanged

    public 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

    ###### Parameters

    - `oldSelected`: old selected index in list model

    - `newSelected`: new selected index in list model

    - `htmlC`: The HTMLComponent

    - `list`: 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)

    Specified by:
      `selectionChanged` in interface `HTMLCallback`

  - ### setHeight

    public void setHeight(int height)

    Sets the Component height, this method is exposed for the purpose of external layout managers and should not be invoked directly.

    If a user wishes to affect the component size, setPreferredSize should be used.

    ###### Parameters

    - `height`: the height of the component

    ###### See also

    - #setPreferredSize
    Overrides:
      `setHeight` in class `Component`

  - ### getAppID

    public String getAppID()

    Simple getter of the unique identifier of the app on the ads service network.

    ###### Returns

    the app unique identifier.

  - ### setAppID

    public void setAppID(String appId)

    Simple setter of the unique identifier of the app on the ads service network, no need to manually use this the createAdsService uses this.

    ###### Parameters

    - `appId`: @param appId unique identifier of the app, to gain an appId please refer to http://console.inner-active.com/iamp/publisher/register?ref_id=affiliate_CodenameOne

  - ### getAge

    public String getAge()

    Users age

    ###### Returns

    the user age

  - ### setAge

    public void setAge(String age)

    Sets the users age

    ###### Parameters

    - `age`

  - ### getGender

    public String getGender()
    The user gender can be: M/m, F/f, Male, Female.

  - ### setGender

    public void setGender(String gender)

    Sets Gender if applicable can be one of the following: 'F', 'f', 'M', 'm', 'Female', 'female', 'Male', 'male'

    ###### Parameters

    - `gender`

  - ### getKeywords

    public String[] getKeywords()
    Keywords relevant to this user specific session

  - ### setKeywords

    public void setKeywords(String[] keywords)

    Keywords relevant to this user specific session

    ###### Parameters

    - `keywords`

  - ### getCategory

    public String getCategory()

    Category is a single word description of the application.

    ###### Returns

    a single word description of the application.

  - ### setCategory

    public void setCategory(String category)

    Category is a single word description of the application.

    ###### Parameters

    - `category`

  - ### getLocation

    public String getLocation()
    Location string is a comma separated list of country, state/province, city For example: US, NY, NY

  - ### setLocation

    public void setLocation(String location)

    Location string is a comma separated list of country, state/province, city For example: US, NY, NY

    ###### Parameters

    - `location`

  - ### getPropertyNames

    public String[] getPropertyNames()

    A component may expose mutable property names for a UI designer to manipulate, this API is designed for usage internally by the GUI builder code

    ###### Returns

    the property names allowing mutation

    Overrides:
      `getPropertyNames` in class `Component`

  - ### getPropertyTypes

    public Class[] getPropertyTypes()

    Matches the property names method (see that method for further details).

    ###### Returns

    the types of the properties

    Overrides:
      `getPropertyTypes` in class `Component`

  - ### getPropertyTypeNames

    public String[] getPropertyTypeNames()

    This method is here to workaround an XMLVM array type bug where property types aren't identified properly, it returns the names of the types using the following type names: String,int,double,long,byte,short,char,String[],String[][],byte[],Image,Image[],Object[],ListModel,ListCellRenderer

    ###### Returns

    Array of type names

    Overrides:
      `getPropertyTypeNames` in class `Component`

  - ### getPropertyValue

    public Object getPropertyValue(String name)

    Returns the current value of the property name, this method is used by the GUI builder

    ###### Parameters

    - `name`: the name of the property

    ###### Returns

    the value of said property

    Overrides:
      `getPropertyValue` in class `Component`

  - ### setPropertyValue

    public String setPropertyValue(String name, Object value)

    Sets a new value to the given property, returns an error message if failed and null if successful. Notice that some builtin properties such as "$designMode" might be sent to components to indicate application state.

    ###### Parameters

    - `name`: the name of the property

    - `value`: new value for the property

    ###### Returns

    error message or null

    Overrides:
      `setPropertyValue` in class `Component`