FileDocCategorySizeDatePackage
ExtractEditText.javaAPI DocAndroid 1.5 API3830Wed May 06 22:41:54 BST 2009android.inputmethodservice

ExtractEditText

public class ExtractEditText extends android.widget.EditText
Specialization of {@link EditText} for showing and interacting with the extracted text in a full-screen input method.

Fields Summary
private InputMethodService
mIME
private int
mSettingExtractedText
Constructors Summary
public ExtractEditText(android.content.Context context)

        super(context, null);
    
public ExtractEditText(android.content.Context context, android.util.AttributeSet attrs)

        super(context, attrs, com.android.internal.R.attr.editTextStyle);
    
public ExtractEditText(android.content.Context context, android.util.AttributeSet attrs, int defStyle)

        super(context, attrs, defStyle);
    
Methods Summary
public voidfinishInternalChanges()
Finish making changes that will not be reported to the client. That is, {@link #onSelectionChanged(int, int)} will not result in sending the new selection to the client

        mSettingExtractedText -= 1;
    
public booleanhasFocus()
Pretend like this view always has focus, so its highlight and cursor will be displayed.

        return this.isEnabled() ? true : false;
    
public booleanhasVerticalScrollBar()
Return true if the edit text is currently showing a scroll bar.

        return computeVerticalScrollRange() > computeVerticalScrollExtent();
    
public booleanhasWindowFocus()
Pretend like the window this view is in always has focus, so its highlight and cursor will be displayed.

        return this.isEnabled() ? true : false;
    
public booleanisFocused()
Pretend like this view always has focus, so its highlight and cursor will be displayed.

        return this.isEnabled() ? true : false;
    
public booleanisInputMethodTarget()
We are always considered to be an input method target.

        return true;
    
protected voidonSelectionChanged(int selStart, int selEnd)
Report to the underlying text editor about selection changes.

        if (mSettingExtractedText == 0 && mIME != null && selStart >= 0 && selEnd >= 0) {
            mIME.onExtractedSelectionChanged(selStart, selEnd);
        }
    
public booleanonTextContextMenuItem(int id)

        if (mIME != null) {
            if (mIME.onExtractTextContextMenuItem(id)) {
                return true;
            }
        }
        return super.onTextContextMenuItem(id);
    
public booleanperformClick()
Redirect clicks to the IME for handling there. First allows any on click handler to run, though.

        if (!super.performClick() && mIME != null) {
            mIME.onExtractedTextClicked();
            return true;
        }
        return false;
    
public voidsetExtractedText(android.view.inputmethod.ExtractedText text)
Implement just to keep track of when we are setting text from the client (vs. seeing changes in ourself from the user).

        try {
            mSettingExtractedText++;
            super.setExtractedText(text);
        } finally {
            mSettingExtractedText--;
        }
    
voidsetIME(InputMethodService ime)

        mIME = ime;
    
public voidstartInternalChanges()
Start making changes that will not be reported to the client. That is, {@link #onSelectionChanged(int, int)} will not result in sending the new selection to the client

        mSettingExtractedText += 1;