FileDocCategorySizeDatePackage
EditableInputConnection.javaAPI DocAndroid 1.5 API4107Wed May 06 22:41:56 BST 2009com.android.internal.widget

EditableInputConnection

public class EditableInputConnection extends android.view.inputmethod.BaseInputConnection

Fields Summary
private static final boolean
DEBUG
private static final String
TAG
private final android.widget.TextView
mTextView
Constructors Summary
public EditableInputConnection(android.widget.TextView textview)


       
        super(textview, true);
        mTextView = textview;
    
Methods Summary
public booleanbeginBatchEdit()

        mTextView.beginBatchEdit();
        return true;
    
public booleanclearMetaKeyStates(int states)

        final Editable content = getEditable();
        if (content == null) return false;
        KeyListener kl = mTextView.getKeyListener();
        if (kl != null) {
            try {
                kl.clearMetaKeyState(mTextView, content, states);
            } catch (AbstractMethodError e) {
                // This is an old listener that doesn't implement the
                // new method.
            }
        }
        return true;
    
public booleancommitCompletion(android.view.inputmethod.CompletionInfo text)

        if (DEBUG) Log.v(TAG, "commitCompletion " + text);
        mTextView.beginBatchEdit();
        mTextView.onCommitCompletion(text);
        mTextView.endBatchEdit();
        return true;
    
public booleancommitText(java.lang.CharSequence text, int newCursorPosition)

        if (mTextView == null) {
            return super.commitText(text, newCursorPosition);
        }

        CharSequence errorBefore = mTextView.getError();
        boolean success = super.commitText(text, newCursorPosition);
        CharSequence errorAfter = mTextView.getError();

        if (errorAfter != null && errorBefore == errorAfter) {
            mTextView.setError(null, null);
        }

        return success;
    
public booleanendBatchEdit()

        mTextView.endBatchEdit();
        return true;
    
public android.text.EditablegetEditable()

        TextView tv = mTextView;
        if (tv != null) {
            return tv.getEditableText();
        }
        return null;
    
public android.view.inputmethod.ExtractedTextgetExtractedText(android.view.inputmethod.ExtractedTextRequest request, int flags)

        if (mTextView != null) {
            ExtractedText et = new ExtractedText();
            if (mTextView.extractText(request, et)) {
                if ((flags&GET_EXTRACTED_TEXT_MONITOR) != 0) {
                    mTextView.setExtracting(request);
                }
                return et;
            }
        }
        return null;
    
public booleanperformContextMenuAction(int id)

        if (DEBUG) Log.v(TAG, "performContextMenuAction " + id);
        mTextView.beginBatchEdit();
        mTextView.onTextContextMenuItem(id);
        mTextView.endBatchEdit();
        return true;
    
public booleanperformEditorAction(int actionCode)

        if (DEBUG) Log.v(TAG, "performEditorAction " + actionCode);
        mTextView.onEditorAction(actionCode);
        return true;
    
public booleanperformPrivateCommand(java.lang.String action, android.os.Bundle data)

        mTextView.onPrivateIMECommand(action, data);
        return true;