Android 2.3 Gingerbread

android.webkit
Class WebTextView

java.lang.Object
  extended by android.view.View
      extended by android.widget.TextView
          extended by android.widget.EditText
              extended by android.widget.AutoCompleteTextView
                  extended by android.webkit.WebTextView
All Implemented Interfaces:
Drawable.Callback, AccessibilityEventSource, KeyEvent.Callback, ViewTreeObserver.OnPreDrawListener, Filter.FilterListener

 class WebTextView
extends AutoCompleteTextView

WebTextView is a specialized version of EditText used by WebView to overlay html textfields (and textareas) to use our standard text editing.


Nested Class Summary
static class WebTextView.AutoCompleteAdapter
          This is a special version of ArrayAdapter which changes its text size to match the text size of its host TextView.
 
Nested classes/interfaces inherited from class android.widget.AutoCompleteTextView
AutoCompleteTextView.Validator
 
Nested classes/interfaces inherited from class android.widget.TextView
TextView.BufferType, TextView.OnEditorActionListener, TextView.SavedState
 
Nested classes/interfaces inherited from class android.view.View
View.BaseSavedState, View.MeasureSpec, View.OnClickListener, View.OnCreateContextMenuListener, View.OnFocusChangeListener, View.OnKeyListener, View.OnLongClickListener, View.OnTouchListener
 
Field Summary
(package private) static String LOGTAG
           
 
Fields inherited from class android.view.View
DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, EMPTY_STATE_SET, ENABLED_FOCUSED_SELECTED_STATE_SET, ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_FOCUSED_STATE_SET, ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, ENABLED_SELECTED_STATE_SET, ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_STATE_SET, ENABLED_WINDOW_FOCUSED_STATE_SET, FIRST_STATE_SET, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, FOCUSED_SELECTED_STATE_SET, FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, FOCUSED_STATE_SET, FOCUSED_WINDOW_FOCUSED_STATE_SET, GONE, HAPTIC_FEEDBACK_ENABLED, INVISIBLE, KEEP_SCREEN_ON, LAST_STATE_SET, mBottom, mContext, mCurrentAnimation, MIDDLE_STATE_SET, mLayoutParams, mLeft, mMeasuredHeight, mMeasuredWidth, mOnClickListener, mOnCreateContextMenuListener, mOnFocusChangeListener, mOnLongClickListener, mPaddingBottom, mPaddingLeft, mPaddingRight, mPaddingTop, mParent, mRight, mScrollX, mScrollY, mTag, mTop, NO_ID, OVER_SCROLL_ALWAYS, OVER_SCROLL_IF_CONTENT_SCROLLS, OVER_SCROLL_NEVER, PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET, PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_SELECTED_STATE_SET, PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_STATE_SET, PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET, PRESSED_FIRST_STATE_SET, PRESSED_FOCUSED_SELECTED_STATE_SET, PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_STATE_SET, PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_LAST_STATE_SET, PRESSED_MIDDLE_STATE_SET, PRESSED_SELECTED_STATE_SET, PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_SINGLE_STATE_SET, PRESSED_STATE_SET, PRESSED_WINDOW_FOCUSED_STATE_SET, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SELECTED_STATE_SET, SELECTED_WINDOW_FOCUSED_STATE_SET, SINGLE_STATE_SET, SOUND_EFFECTS_ENABLED, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET
 
Constructor Summary
WebTextView(Context context, WebView webView)
          Create a new WebTextView.
 
Method Summary
(package private)  void bringIntoView()
           
 boolean dispatchKeyEvent(KeyEvent event)
          Dispatch a key event to the next view on the focus path.
(package private)  boolean isSameTextField(int ptr)
          Determine whether this WebTextView currently represents the node represented by ptr.
 InputConnection onCreateInputConnection(EditorInfo outAttrs)
          Create a new InputConnection for an InputMethod to interact with the view.
protected  void onDraw(Canvas canvas)
          Implement this to do your drawing.
 void onDrawSubstitute()
           
 void onEditorAction(int actionCode)
          Called when an attached input method calls InputConnection.performEditorAction() for this text view.
protected  void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect)
          Called by the view system when the focus state of this view changes.
protected  void onScrollChanged(int l, int t, int oldl, int oldt)
          This is called in response to an internal scroll in this view (i.e., the view scrolled its own contents).
protected  void onSelectionChanged(int selStart, int selEnd)
          This method is called when the selection has changed, in case any subclasses would like to know.
protected  void onTextChanged(CharSequence s, int start, int before, int count)
          This method is called when the text is changed, in case any subclasses would like to know.
 boolean onTouchEvent(MotionEvent event)
          Implement this method to handle touch screen motion events.
 boolean onTrackballEvent(MotionEvent event)
          Implement this method to handle trackball motion events.
 boolean performLongClick()
          Call this view's OnLongClickListener, if it is defined.
(package private)  void remove()
          Remove this WebTextView from its host WebView, and return focus to the host.
 boolean requestRectangleOnScreen(Rect rectangle)
          Request that a rectangle of this view be visible on the screen, scrolling if necessary just enough.
 void setAdapterCustom(WebTextView.AutoCompleteAdapter adapter)
          Always use this instead of setAdapter, as this has features specific to the WebTextView.
(package private)  void setDefaultSelection()
          Sets the selection when the user clicks on a textfield or textarea with the trackball or center key, or starts typing into it without clicking on it.
(package private)  void setInPassword(boolean inPassword)
          Determine whether to use the system-wide password disguising method, or to use none.
 void setInputType(int type)
          Set the type of the content with a constant as defined for EditorInfo.inputType.
(package private)  void setNodePointer(int ptr)
          Set the pointer for this node so it can be determined which node this WebTextView represents.
(package private)  void setRect(int x, int y, int width, int height)
          Determine the position and size of WebTextView, and add it to the WebView's view heirarchy.
(package private)  void setSelectionFromWebKit(int start, int end)
          Set the selection, and disable our onSelectionChanged action.
(package private)  void setTextAndKeepSelection(String text)
          Set the text to the new string, but use the old selection, making sure to keep it within the new string.
(package private)  void setType(int type)
          Called by WebView.rebuildWebTextView().
(package private)  void updateCachedTextfield()
          Update the cache to reflect the current text.
 
Methods inherited from class android.widget.AutoCompleteTextView
clearListSelection, convertSelectionToString, dismissDropDown, enoughToFilter, ensureImeVisible, getAdapter, getDropDownAnchor, getDropDownAnimationStyle, getDropDownBackground, getDropDownHeight, getDropDownHorizontalOffset, getDropDownVerticalOffset, getDropDownWidth, getFilter, getItemClickListener, getItemSelectedListener, getListSelection, getOnItemClickListener, getOnItemSelectedListener, getThreshold, getValidator, isDropDownAlwaysVisible, isDropDownDismissedOnCompletion, isInputMethodNotNeeded, isPerformingCompletion, isPopupShowing, onAttachedToWindow, onCommitCompletion, onDetachedFromWindow, onDisplayHint, onFilterComplete, onKeyDown, onKeyPreIme, onKeyUp, onWindowFocusChanged, performCompletion, performFiltering, performValidation, replaceText, setAdapter, setCompletionHint, setDropDownAlwaysVisible, setDropDownAnchor, setDropDownAnimationStyle, setDropDownBackgroundDrawable, setDropDownBackgroundResource, setDropDownDismissedOnCompletion, setDropDownHeight, setDropDownHorizontalOffset, setDropDownVerticalOffset, setDropDownWidth, setForceIgnoreOutsideTouch, setFrame, setListSelection, setOnClickListener, setOnItemClickListener, setOnItemSelectedListener, setText, setThreshold, setValidator, showDropDown, showDropDownAfterLayout
 
Methods inherited from class android.widget.EditText
extendSelection, getDefaultEditable, getDefaultMovementMethod, getText, selectAll, setEllipsize, setSelection, setSelection, setText
 
Methods inherited from class android.widget.TextView
addTextChangedListener, append, append, beginBatchEdit, bringPointIntoView, cancelLongPress, clearComposingText, computeHorizontalScrollRange, computeScroll, computeVerticalScrollExtent, computeVerticalScrollRange, debug, didTouchFocusSelect, dispatchFinishTemporaryDetach, dispatchPopulateAccessibilityEvent, drawableStateChanged, endBatchEdit, extractText, getAutoLinkMask, getBaseline, getBottomPaddingOffset, getCompoundDrawablePadding, getCompoundDrawables, getCompoundPaddingBottom, getCompoundPaddingLeft, getCompoundPaddingRight, getCompoundPaddingTop, getCurrentHintTextColor, getCurrentTextColor, getEditableText, getEllipsize, getError, getExtendedPaddingBottom, getExtendedPaddingTop, getFilters, getFocusedRect, getFreezesText, getGravity, getHint, getHintTextColors, getImeActionId, getImeActionLabel, getImeOptions, getInputExtras, getInputType, getKeyListener, getLayout, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLineBounds, getLineCount, getLineHeight, getLinksClickable, getLinkTextColors, getMovementMethod, getOffset, getPaint, getPaintFlags, getPrivateImeOptions, getRightFadingEdgeStrength, getRightPaddingOffset, getSelectionEnd, getSelectionStart, getTextColor, getTextColors, getTextColors, getTextScaleX, getTextSize, getTopPaddingOffset, getTotalPaddingBottom, getTotalPaddingLeft, getTotalPaddingRight, getTotalPaddingTop, getTransformationMethod, getTypeface, getUrls, hasSelection, invalidateDrawable, isInputMethodTarget, isPaddingOffsetRequired, length, makeNewLayout, moveCursorToVisibleOffset, onBeginBatchEdit, onCheckIsTextEditor, onCreateContextMenu, onEndBatchEdit, onFinishTemporaryDetach, onKeyMultiple, onKeyShortcut, onMeasure, onPreDraw, onPrivateIMECommand, onRestoreInstanceState, onSaveInstanceState, onStartTemporaryDetach, onTextContextMenuItem, onVisibilityChanged, removeTextChangedListener, setAutoLinkMask, setCompoundDrawablePadding, setCompoundDrawables, setCompoundDrawablesWithIntrinsicBounds, setCompoundDrawablesWithIntrinsicBounds, setCursorVisible, setEditableFactory, setEms, setEnabled, setError, setError, setExtractedText, setExtracting, setFilters, setFreezesText, setGravity, setHeight, setHighlightColor, setHint, setHint, setHintTextColor, setHintTextColor, setHorizontallyScrolling, setImeActionLabel, setImeOptions, setIncludeFontPadding, setInputExtras, setKeyListener, setLines, setLineSpacing, setLinksClickable, setLinkTextColor, setLinkTextColor, setMarqueeRepeatLimit, setMaxEms, setMaxHeight, setMaxLines, setMaxWidth, setMinEms, setMinHeight, setMinLines, setMinWidth, setMovementMethod, setOnEditorActionListener, setPadding, setPaintFlags, setPrivateImeOptions, setRawInputType, setScroller, setSelectAllOnFocus, setSelected, setShadowLayer, setSingleLine, setSingleLine, setSpannableFactory, setText, setText, setText, setText, setTextAppearance, setTextColor, setTextColor, setTextKeepState, setTextKeepState, setTextScaleX, setTextSize, setTextSize, setTransformationMethod, setTypeface, setTypeface, setWidth, updateCursorControllerPositions, verifyDrawable
 
Methods inherited from class android.view.View
addFocusables, addFocusables, addTouchables, applyDrawableToTransparentRegion, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, checkInputConnectionProxy, clearAnimation, clearFocus, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeVerticalScrollOffset, createContextMenu, debug, debugIndent, destroyDrawingCache, dispatchConfigurationChanged, dispatchConsistencyCheck, dispatchDisplayHint, dispatchDraw, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetPressed, dispatchSetSelected, dispatchStartTemporaryDetach, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowVisibilityChanged, draw, findFocus, findViewById, findViewTraversal, findViewWithTag, findViewWithTagTraversal, fitSystemWindows, focusSearch, forceLayout, gatherTransparentRegion, getAnimation, getApplicationWindowToken, getBackground, getBottom, getBottomFadingEdgeStrength, getContentDescription, getContext, getContextMenuInfo, getDefaultSize, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getFilterTouchesWhenObscured, getFocusables, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getId, getKeepScreenOn, getKeyDispatcherState, getLayoutParams, getLeft, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMeasuredHeight, getMeasuredWidth, getNextFocusDownId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOverScrollMode, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getParent, getResources, getRight, getRootView, getScrollBarStyle, getScrollX, getScrollY, getSolidColor, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getTag, getTag, getTop, getTopFadingEdgeStrength, getTouchables, getTouchDelegate, getVerticalFadingEdgeLength, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, hasFocus, hasFocusable, hasOpaqueScrollbars, hasWindowFocus, inflate, initializeFadingEdge, initializeScrollbars, invalidate, invalidate, invalidate, isClickable, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFitsSystemWindowsFlagSet, isFocusable, isFocusableInTouchMode, isFocused, isHapticFeedbackEnabled, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isInEditMode, isInTouchMode, isLayoutRequested, isLongClickable, isOpaque, isPressed, isRootNamespace, isSaveEnabled, isScrollbarFadingEnabled, isSelected, isShown, isSoundEffectsEnabled, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, isVerticalScrollBarHidden, layout, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAnimationEnd, onAnimationStart, onCloseSystemDialogs, onConfigurationChanged, onConsistencyCheck, onCreateDrawableState, onDrawHorizontalScrollBar, onDrawScrollBars, onDrawVerticalScrollBar, onFilterTouchEventForSecurity, onFinishInflate, onFocusLost, onKeyLongPress, onLayout, onOverScrolled, onSetAlpha, onSizeChanged, onWindowVisibilityChanged, overScrollBy, performClick, performHapticFeedback, performHapticFeedback, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, refreshDrawableState, removeCallbacks, requestFocus, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestRectangleOnScreen, resolveSize, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAnimation, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setClickable, setContentDescription, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFocusable, setFocusableInTouchMode, setHapticFeedbackEnabled, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setId, setIsRootNamespace, setKeepScreenOn, setLayoutParams, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNextFocusDownId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnCreateContextMenuListener, setOnFocusChangeListener, setOnKeyListener, setOnLongClickListener, setOnTouchListener, setOverScrollMode, setPressed, setSaveEnabled, setScrollbarFadingEnabled, setScrollBarStyle, setScrollContainer, setSoundEffectsEnabled, setTag, setTag, setTagInternal, setTouchDelegate, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVisibility, setWillNotCacheDrawing, setWillNotDraw, showContextMenu, startAnimation, unscheduleDrawable, unscheduleDrawable, willNotCacheDrawing, willNotDraw
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGTAG

static final String LOGTAG
See Also:
Constant Field Values
Constructor Detail

WebTextView

WebTextView(Context context,
            WebView webView)
Create a new WebTextView.

Parameters:
context - The Context for this WebTextView.
webView - The WebView that created this.
Method Detail

dispatchKeyEvent

public boolean dispatchKeyEvent(KeyEvent event)
Description copied from class: View
Dispatch a key event to the next view on the focus path. This path runs from the top of the view tree down to the currently focused view. If this view has focus, it will dispatch to itself. Otherwise it will dispatch the next node down the focus path. This method also fires any key listeners.

Overrides:
dispatchKeyEvent in class View
Parameters:
event - The key event to be dispatched.
Returns:
True if the event was handled, false otherwise.

isSameTextField

boolean isSameTextField(int ptr)
Determine whether this WebTextView currently represents the node represented by ptr.

Parameters:
ptr - Pointer to a node to compare to.
Returns:
boolean Whether this WebTextView already represents the node pointed to by ptr.

onCreateInputConnection

public InputConnection onCreateInputConnection(EditorInfo outAttrs)
Description copied from class: View
Create a new InputConnection for an InputMethod to interact with the view. The default implementation returns null, since it doesn't support input methods. You can override this to implement such support. This is only needed for views that take focus and text input.

When implementing this, you probably also want to implement View.onCheckIsTextEditor() to indicate you will return a non-null InputConnection.

Overrides:
onCreateInputConnection in class TextView
Parameters:
outAttrs - Fill in with attribute information about the connection.

onDraw

protected void onDraw(Canvas canvas)
Description copied from class: View
Implement this to do your drawing.

Overrides:
onDraw in class TextView
Parameters:
canvas - the canvas on which the background will be drawn

onDrawSubstitute

public void onDrawSubstitute()

onEditorAction

public void onEditorAction(int actionCode)
Description copied from class: TextView
Called when an attached input method calls InputConnection.performEditorAction() for this text view. The default implementation will call your action listener supplied to TextView.setOnEditorActionListener(android.widget.TextView.OnEditorActionListener), or perform a standard operation for EditorInfo.IME_ACTION_NEXT or EditorInfo.IME_ACTION_DONE.

For backwards compatibility, if no IME options have been set and the text view would not normally advance focus on enter, then the NEXT and DONE actions received here will be turned into an enter key down/up pair to go through the normal key handling.

Overrides:
onEditorAction in class TextView
Parameters:
actionCode - The code of the action being performed.
See Also:
TextView.setOnEditorActionListener(android.widget.TextView.OnEditorActionListener)

onFocusChanged

protected void onFocusChanged(boolean focused,
                              int direction,
                              Rect previouslyFocusedRect)
Description copied from class: View
Called by the view system when the focus state of this view changes. When the focus change event is caused by directional navigation, direction and previouslyFocusedRect provide insight into where the focus is coming from. When overriding, be sure to call up through to the super class so that the standard focus handling will occur.

Overrides:
onFocusChanged in class AutoCompleteTextView
Parameters:
focused - True if the View has focus; false otherwise.
direction - The direction focus has moved when requestFocus() is called to give this view focus. Values are View.FOCUS_UP, View.FOCUS_DOWN, View.FOCUS_LEFT or View.FOCUS_RIGHT. It may not always apply, in which case use the default.
previouslyFocusedRect - The rectangle, in this view's coordinate system, of the previously focused view. If applicable, this will be passed in as finer grained information about where the focus is coming from (in addition to direction). Will be null otherwise.

onScrollChanged

protected void onScrollChanged(int l,
                               int t,
                               int oldl,
                               int oldt)
Description copied from class: View
This is called in response to an internal scroll in this view (i.e., the view scrolled its own contents). This is typically as a result of View.scrollBy(int, int) or View.scrollTo(int, int) having been called.

Overrides:
onScrollChanged in class View
Parameters:
l - Current horizontal scroll origin.
t - Current vertical scroll origin.
oldl - Previous horizontal scroll origin.
oldt - Previous vertical scroll origin.

onSelectionChanged

protected void onSelectionChanged(int selStart,
                                  int selEnd)
Description copied from class: TextView
This method is called when the selection has changed, in case any subclasses would like to know.

Overrides:
onSelectionChanged in class TextView
Parameters:
selStart - The new selection start location.
selEnd - The new selection end location.

onTextChanged

protected void onTextChanged(CharSequence s,
                             int start,
                             int before,
                             int count)
Description copied from class: TextView
This method is called when the text is changed, in case any subclasses would like to know.

Overrides:
onTextChanged in class TextView
Parameters:
s - The text the TextView is displaying.
start - The offset of the start of the range of the text that was modified.
before - The offset of the former end of the range of the text that was modified. If text was simply inserted, this will be the same as start. If text was replaced with new text or deleted, the length of the old text was before-start.
count - The offset of the end of the range of the text that was modified. If text was simply deleted, this will be the same as start. If text was replaced with new text or inserted, the length of the new text is after-start.

onTouchEvent

public boolean onTouchEvent(MotionEvent event)
Description copied from class: View
Implement this method to handle touch screen motion events.

Overrides:
onTouchEvent in class TextView
Parameters:
event - The motion event.
Returns:
True if the event was handled, false otherwise.

onTrackballEvent

public boolean onTrackballEvent(MotionEvent event)
Description copied from class: View
Implement this method to handle trackball motion events. The relative movement of the trackball since the last event can be retrieve with MotionEvent.getX() and MotionEvent.getY(). These are normalized so that a movement of 1 corresponds to the user pressing one DPAD key (so they will often be fractional values, representing the more fine-grained movement information available from a trackball).

Overrides:
onTrackballEvent in class TextView
Parameters:
event - The motion event.
Returns:
True if the event was handled, false otherwise.

performLongClick

public boolean performLongClick()
Description copied from class: View
Call this view's OnLongClickListener, if it is defined. Invokes the context menu if the OnLongClickListener did not consume the event.

Overrides:
performLongClick in class TextView
Returns:
True if one of the above receivers consumed the event, false otherwise.

remove

void remove()
Remove this WebTextView from its host WebView, and return focus to the host.


bringIntoView

void bringIntoView()

setAdapterCustom

public void setAdapterCustom(WebTextView.AutoCompleteAdapter adapter)
Always use this instead of setAdapter, as this has features specific to the WebTextView.


setDefaultSelection

void setDefaultSelection()
Sets the selection when the user clicks on a textfield or textarea with the trackball or center key, or starts typing into it without clicking on it.


setInPassword

void setInPassword(boolean inPassword)
Determine whether to use the system-wide password disguising method, or to use none.

Parameters:
inPassword - True if the textfield is a password field.

setInputType

public void setInputType(int type)
Description copied from class: TextView
Set the type of the content with a constant as defined for EditorInfo.inputType. This will take care of changing the key listener, by calling TextView.setKeyListener(KeyListener), to match the given content type. If the given content type is InputType.TYPE_NULL then a soft keyboard will not be displayed for this text view.

Overrides:
setInputType in class TextView
See Also:
TextView.getInputType(), TextView.setRawInputType(int), InputType

setNodePointer

void setNodePointer(int ptr)
Set the pointer for this node so it can be determined which node this WebTextView represents.

Parameters:
ptr - Integer representing the pointer to the node which this WebTextView represents.

setRect

void setRect(int x,
             int y,
             int width,
             int height)
Determine the position and size of WebTextView, and add it to the WebView's view heirarchy. All parameters are presumed to be in view coordinates. Also requests Focus and sets the cursor to not request to be in view.

Parameters:
x - x-position of the textfield.
y - y-position of the textfield.
width - width of the textfield.
height - height of the textfield.

setSelectionFromWebKit

void setSelectionFromWebKit(int start,
                            int end)
Set the selection, and disable our onSelectionChanged action.


setTextAndKeepSelection

void setTextAndKeepSelection(String text)
Set the text to the new string, but use the old selection, making sure to keep it within the new string.

Parameters:
text - The new text to place in the textfield.

setType

void setType(int type)
Called by WebView.rebuildWebTextView(). Based on the type of the element, set up the WebTextView, its InputType, and IME Options properly.

Parameters:
type - int corresponding to enum "type" defined in WebView.cpp. Does not correspond to HTMLInputElement::InputType so this is unaffected if that changes, and also because that has no type corresponding to textarea (which is its own tag).

updateCachedTextfield

void updateCachedTextfield()
Update the cache to reflect the current text.


requestRectangleOnScreen

public boolean requestRectangleOnScreen(Rect rectangle)
Description copied from class: View
Request that a rectangle of this view be visible on the screen, scrolling if necessary just enough.

A View should call this if it maintains some notion of which part of its content is interesting. For example, a text editing view should call this when its cursor moves.

Overrides:
requestRectangleOnScreen in class View
Parameters:
rectangle - The rectangle.
Returns:
Whether any parent scrolled.

Android 2.3 Gingerbread