Build 1.0_r1(from source)

android.webkit
Class TextDialog

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.TextDialog
All Implemented Interfaces:
Drawable.Callback, KeyEvent.Callback, ViewTreeObserver.OnPreDrawListener, Filter.FilterListener

 class TextDialog
extends AutoCompleteTextView

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


Nested Class Summary
 
Nested classes/interfaces inherited from class android.widget.AutoCompleteTextView
AutoCompleteTextView.Validator
 
Nested classes/interfaces inherited from class android.widget.TextView
TextView.BufferType, 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
 
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, FOCUSED_SELECTED_STATE_SET, FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, FOCUSED_STATE_SET, FOCUSED_WINDOW_FOCUSED_STATE_SET, GONE, INVISIBLE, KEEP_SCREEN_ON, LAST_STATE_SET, mBottom, mContext, mCurrentAnimation, MIDDLE_STATE_SET, mLayoutParams, mLeft, mLocation, mMeasuredHeight, mMeasuredWidth, mOnClickListener, mOnCreateContextMenuListener, mOnFocusChangeListener, mOnLongClickListener, mPaddingBottom, mPaddingLeft, mPaddingRight, mPaddingTop, mParent, mRight, mScrollX, mScrollY, mTag, mTop, NO_ID, 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
TextDialog(Context context, WebView webView)
          Create a new TextDialog.
 
Method Summary
 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 TextDialog currently represents the node represented by ptr.
 boolean onPreDraw()
          Callback method to be invoked when the view tree is about to be drawn.
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 onTrackballEvent(MotionEvent event)
          Implement this method to handle trackball motion events.
(package private)  void remove()
          Remove this TextDialog 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.
(package private)  void setInPassword(boolean inPassword)
          Determine whether to use the system-wide password disguising method, or to use none.
(package private)  void setMaxLength(int maxLength)
           
(package private)  void setNodePointer(int ptr)
          Set the pointer for this node so it can be determined which node this TextDialog represents.
(package private)  void setRect(int x, int y, int width, int height)
          Determine the position and size of TextDialog, and add it to the WebView's view heirarchy.
 void setSingleLine(boolean single)
          Set whether this is a single-line textfield or a multi-line textarea.
(package private)  void setText(CharSequence text, int start, int end)
          Set the text for this TextDialog, and set the selection to (start, end)
(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 updateCachedTextfield()
          Update the cache to reflect the current text.
 
Methods inherited from class android.widget.AutoCompleteTextView
convertSelectionToString, dismissDropDown, enoughToFilter, getAdapter, getFilter, getItemClickListener, getItemSelectedListener, getThreshold, getValidator, isPopupShowing, onFilterComplete, onFocusChanged, onKeyDown, onKeyUp, onWindowFocusChanged, performCompletion, performFiltering, performValidation, replaceText, setAdapter, setCompletionHint, setFrame, setOnItemClickListener, setOnItemSelectedListener, setThreshold, setValidator, showDropDown
 
Methods inherited from class android.widget.EditText
extendSelection, getDefaultEditable, getDefaultMovementMethod, getText, selectAll, setSelection, setSelection, setText
 
Methods inherited from class android.widget.TextView
addTextChangedListener, append, append, computeHorizontalScrollRange, computeScroll, computeVerticalScrollRange, debug, drawableStateChanged, getAutoLinkMask, getBaseline, getCompoundDrawablePadding, getCompoundDrawables, getCompoundPaddingBottom, getCompoundPaddingLeft, getCompoundPaddingRight, getCompoundPaddingTop, getCurrentHintTextColor, getCurrentTextColor, getEllipsize, getError, getExtendedPaddingBottom, getExtendedPaddingTop, getFilters, getFocusedRect, getFreezesText, getGravity, getHint, getHintTextColors, getKeyListener, getLayout, getLineBounds, getLineCount, getLineHeight, getLinksClickable, getLinkTextColors, getMovementMethod, getPaint, getPaintFlags, getSelectionEnd, getSelectionStart, getTextColor, getTextColors, getTextColors, getTextScaleX, getTextSize, getTotalPaddingBottom, getTotalPaddingLeft, getTotalPaddingRight, getTotalPaddingTop, getTransformationMethod, getTypeface, getUrls, hasSelection, length, makeNewLayout, onCreateContextMenu, onDetachedFromWindow, onDraw, onKeyShortcut, onMeasure, onRestoreInstanceState, onSaveInstanceState, onTouchEvent, performLongClick, removeTextChangedListener, setAutoLinkMask, setCompoundDrawablePadding, setCompoundDrawables, setCompoundDrawablesWithIntrinsicBounds, setCursorVisible, setEditableFactory, setEllipsize, setEms, setError, setError, setFilters, setFreezesText, setGravity, setHeight, setHighlightColor, setHint, setHint, setHintTextColor, setHintTextColor, setHorizontallyScrolling, setIncludeFontPadding, setKeyListener, setLines, setLineSpacing, setLinksClickable, setLinkTextColor, setLinkTextColor, setMaxEms, setMaxHeight, setMaxLines, setMaxWidth, setMinEms, setMinHeight, setMinLines, setMinWidth, setMovementMethod, setPadding, setPaintFlags, setScroller, setSelectAllOnFocus, setShadowLayer, setSingleLine, setSpannableFactory, setText, setText, setText, setText, setTextAppearance, setTextColor, setTextColor, setTextKeepState, setTextKeepState, setTextScaleX, setTextSize, setTextSize, setTransformationMethod, setTypeface, setTypeface, setWidth
 
Methods inherited from class android.view.View
addFocusables, addTouchables, applyDrawableToTransparentRegion, bringToFront, buildDrawingCache, cancelLongPress, clearAnimation, clearFocus, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeVerticalScrollExtent, computeVerticalScrollOffset, createContextMenu, debug, debugIndent, destroyDrawingCache, dispatchDraw, dispatchKeyShortcutEvent, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetPressed, dispatchSetSelected, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchWindowFocusChanged, dispatchWindowVisibilityChanged, draw, finalize, findFocus, findViewById, findViewTraversal, findViewWithTag, findViewWithTagTraversal, fitSystemWindows, focusSearch, forceLayout, gatherTransparentRegion, getAnimation, getApplicationWindowToken, getBackground, getBottom, getBottomFadingEdgeStrength, getContext, getContextMenuInfo, getDefaultSize, getDrawableState, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getFocusables, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getId, getKeepScreenOn, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMeasuredHeight, getMeasuredWidth, getNextFocusDownId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getParent, getResources, getRight, getRightFadingEdgeStrength, getRootView, getScrollBarStyle, getScrollX, getScrollY, getSolidColor, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getTag, getTop, getTopFadingEdgeStrength, getTouchables, getTouchDelegate, getVerticalFadingEdgeLength, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowToken, getWindowVisibility, hasFocus, hasFocusable, hasWindowFocus, inflate, initializeFadingEdge, initializeScrollbars, invalidate, invalidate, invalidate, invalidateDrawable, isClickable, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isInTouchMode, isLayoutRequested, isLongClickable, isPressed, isRootNamespace, isSaveEnabled, isSelected, isShown, isSoundEffectsEnabled, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, layout, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAnimationEnd, onAnimationStart, onAttachedToWindow, onCreateDrawableState, onFinishInflate, onKeyMultiple, onLayout, onScrollChanged, onSetAlpha, onSizeChanged, onWindowVisibilityChanged, performClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, refreshDrawableState, removeCallbacks, requestFocus, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestRectangleOnScreen, resolveSize, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, setAnimation, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setClickable, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setEnabled, setFadingEdgeLength, setFocusable, setFocusableInTouchMode, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setId, setIsRootNamespace, setKeepScreenOn, setLayoutParams, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNextFocusDownId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnClickListener, setOnCreateContextMenuListener, setOnFocusChangeListener, setOnKeyListener, setOnLongClickListener, setOnTouchListener, setPressed, setSaveEnabled, setScrollBarStyle, setSelected, setSoundEffectsEnabled, setTag, setTouchDelegate, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVisibility, setWillNotCacheDrawing, setWillNotDraw, showContextMenu, startAnimation, unscheduleDrawable, unscheduleDrawable, verifyDrawable, willNotCacheDrawing, willNotDraw
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextDialog

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

Parameters:
context - The Context for this TextDialog.
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 TextDialog currently represents the node represented by ptr.

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

onPreDraw

public boolean onPreDraw()
Description copied from class: TextView
Callback method to be invoked when the view tree is about to be drawn. At this point, all views in the tree have been measured and given a frame. Clients can use this to adjust their scroll bounds or even to request a new layout before drawing occurs.

Specified by:
onPreDraw in interface ViewTreeObserver.OnPreDrawListener
Overrides:
onPreDraw in class TextView
Returns:
Return true to proceed with the current drawing pass, or false to cancel.
See Also:
View.onMeasure(int, int), View.onLayout(boolean, int, int, int, int), View.onDraw(android.graphics.Canvas)

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 AutoCompleteTextView
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.

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.

remove

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


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.

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.

setMaxLength

void setMaxLength(int maxLength)

setNodePointer

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

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

setRect

void setRect(int x,
             int y,
             int width,
             int height)
Determine the position and size of TextDialog, 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.

setSingleLine

public void setSingleLine(boolean single)
Set whether this is a single-line textfield or a multi-line textarea. Textfields scroll horizontally, and do not handle the enter key. Textareas behave oppositely.

Overrides:
setSingleLine in class TextView

setText

void setText(CharSequence text,
             int start,
             int end)
Set the text for this TextDialog, and set the selection to (start, end)

Parameters:
text - Text to go into this TextDialog.
start - Beginning of the selection.
end - End of the selection.

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.

updateCachedTextfield

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


Build 1.0_r1(from source)

Please submit a feedback, bug or feature