 import flashx.textLayout.formats.IParagraphFormat;
 import flashx.textLayout.formats.ParagraphFormat;
 import flashx.textLayout.operations.ApplyFormatOperation;
+import flashx.textLayout.operations.CutOperation;
+import flashx.textLayout.operations.DeleteTextOperation;
 import flashx.textLayout.operations.FlowOperation;
+import flashx.textLayout.operations.FlowTextOperation;
+import flashx.textLayout.operations.InsertTextOperation;
+import flashx.textLayout.operations.PasteOperation;
 import flashx.textLayout.operations.SplitParagraphOperation;
 
 import mx.core.IViewport;
+import mx.core.mx_internal;
 import mx.core.UIComponent;
 import mx.core.ScrollUnit;
 import mx.events.FlexEvent;
 import mx.events.TextOperationEvent;
+import mx.utils.StringUtil;
 import mx.utils.TextUtil;
 
 //--------------------------------------

    public function get contentWidth():Number
    {
        return _contentWidth;
    }

    //----------------------------------

        {
            event.preventDefault();
            dispatchEvent(new FlexEvent(FlexEvent.ENTER));
            return;
        }
        
        if (op is InsertTextOperation)
        {
            var insertTextOperation:InsertTextOperation =
                InsertTextOperation(op);

            var textToInsert:String = insertTextOperation.text;

            // Note: Must process restrict first, then maxChars,
            // then displayAsPassword last.
            
            if (restrict != null)
                textToInsert = StringUtil.restrict(textToInsert, restrict);

            if (maxChars != 0)
            {
                var length1:int = text.length;
                var length2:int = textToInsert.length;
                if (length1 + length2 > maxChars)
                    textToInsert = textToInsert.substr(0, maxChars - length1);
            }

            if (displayAsPassword)
            {
                _text = splice(_text, insertTextOperation.absoluteStart,
                               insertTextOperation.absoluteEnd, textToInsert);
                textToInsert = StringUtil.repeat(mx_internal::passwordChar,
                                                 textToInsert.length);
            }

            insertTextOperation.text = textToInsert;
        }
        else if (op is PasteOperation)
        {
            // to be implemented
        }
        else if (op is DeleteTextOperation || op is CutOperation)
        {
            var flowTextOperation:FlowTextOperation =
                FlowTextOperation(op);
            
            if (displayAsPassword)
            {
                _text = splice(_text, flowTextOperation.absoluteStart,
                               flowTextOperation.absoluteEnd, "");
            }
        }
        
        // Dispatch a 'changing' event from the TextView
        // as notification that an editing operation is about to occur.
        var newEvent:TextOperationEvent =
            new TextOperationEvent(TextOperationEvent.CHANGING);
        newEvent.operation = op;
        dispatchEvent(newEvent);
        
        // If the event dispatched from this TextView is canceled,
        // cancel the one from the EditManager, which will prevent
        // the editing operation from being processed.
        if (newEvent.isDefaultPrevented())
            event.preventDefault();
    }
    
    /**
