             newEvent.operation = op;
             dispatchEvent(newEvent);
             
-            // If the event dispatched from this RichEditableText is canceled,
+            // 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())

        textInvalid = true;
        dispatchEvent(new Event("textInvalid"));

        // Dispatch a 'change' event from the RichEditableText
        // as notification that an editing operation has occurred.
        var newEvent:TextOperationEvent =
            new TextOperationEvent(TextOperationEvent.CHANGE);
        newEvent.operation = event.operation;
        dispatchEvent(newEvent);
    }

    private function handlePasteOperation(op:PasteOperation):void
    {
        if (!restrict && !maxChars && !displayAsPassword)
            return;
            
        var textScrap:TextScrap = op.scrapToPaste();
        var pastedText:String = TextUtil.extractText(textScrap.textFlow);

        // We know it's an EditManager or we wouldn't have gotten here.
        var editManager:EditManager = EditManager(textFlow.interactionManager);

        // Generate a CHANGING event for the PasteOperation but not for the
        // DeleteTextOperation or the InsertTextOperation which are also part
        // of the paste.
        dispatchChangingEvent = false;
                        
        var selectionState:SelectionState = 
            new SelectionState(textFlow, op.absoluteStart, 
                    op.absoluteStart + pastedText.length);             
        editManager.deleteText(selectionState);

        // Insert the same text, the same place where the paste was done.
        // This will go thru the InsertPasteOperation and do the right
        // things with restrict, maxChars and displayAsPassword.
        selectionState = 
            new SelectionState(textFlow, op.absoluteStart, op.absoluteStart);
        editManager.insertText(pastedText, selectionState);        

        dispatchChangingEvent = true;
    }

    /**
     *  @private
     */
    private function updateCompleteHandler(event:FlexEvent):void
    {
        lastUnscaledWidth = NaN;
    }

    private function creatingSystemManager():ISystemManager
    {
        return ((moduleFactory != null) && (moduleFactory is ISystemManager))
                ? ISystemManager(moduleFactory)
                : IUIComponent(parent).systemManager;
    }
    
    /**
     * @private
     * 
     * Get the embedded font for a set of font attributes.
     */ 
    private function getEmbeddedFont(fontName:String, bold:Boolean, italic:Boolean):EmbeddedFont
    {
        // Check if we can reuse a cached value.
        if (cachedEmbeddedFont)
        {
            if (cachedEmbeddedFont.fontName == fontName &&
                cachedEmbeddedFont.fontStyle == EmbeddedFontRegistry.getFontStyle(bold, italic))
            {
                return cachedEmbeddedFont;
            }   
        }
        
        cachedEmbeddedFont = new EmbeddedFont(fontName, bold, italic);      
        
        return cachedEmbeddedFont;
    }
}

}


    //--------------------------------------------------------------------------
    //
    //  Constructor
    //
    //--------------------------------------------------------------------------
