Spark TextArea, performance setFormatOfRange problem

Hi you

I'm building the syntax highlight editor using spark.components.textarea

my application calls setFormatOfRange to put the color on the syntax. but I find that this API is very very slow.

I need wait more than 10 seconds before the UI response me


And if I comment on the setFormatOfRange, it works fine without delay

Seems that the TLF is very slow at this point, is it not?

Should I change back to use mx.controls.TextArea?  is it faster?

Thank you

Richard is the quickest way you can get to form a large number of words in a TextArea. Unfortunately, this solution may not be appropriate in some cases. Say you're listening to TextOperationEvent.CHANGE on a text box for changes to the wording and based on them to highlight certain words (similar to a code editor). If you apply the format using interactionManager, you get another TextOperationEvent.CHANGE and this can lead to an infinite loop.

What I did to find out how setFormatOfRange works and imitate the code inside this method, using the ApplyFormatOperation and the CompositeOperation. Of course, normally you'll cope with such operations because that is the purpose of EditManager, but sometimes you need just a quick and the working solution.

You can check this post for more details on how to use operations to format text inside a RichEditableText.

Tags: Adobe Open Source

Similar Questions

  • How to hide or disable copy/paste option in the contextual menu on spark TextArea in Adobe AIR?

    I need to hide or disable copy/paste option in the contextual menu on spark TextArea in Adobe AIR.please help me. Thank you

    Try with this

    protected function editor_rightMouseDownHandler(event:MouseEvent):void

    {

    If ((editor.textDisplay as RichEditableText)! = null & .contextMenu (editor.textDisplay as RichEditableText)! = null)

    {

    ((Editor.textDisplay As RichEditableText).) ContextMenu as ContextMenu) .hideBuiltInItems ();

    ((Editor.textDisplay As RichEditableText).) ContextMenu as ContextMenu) .clipboardMenu = false;

    }

    }

    protected function editor_copyHandler(event:Event):void

    {

    Event.preventDefault ();

    System.setClipboard("");

    Clipboard.generalClipboard.clear ();

    }

  • Spark textArea - how to capture an event a link html click event

    The MX TextArea component has had in the past a TextEvent.LINK event that triggered when the user has clicked on a link inside the html text.  This has been removed from the component of the spark. I'm looking to intercept the event which opens the browser when a user clicks on a link inside the html text using the spark textArea component.

    See you soon

    StyleableTextField should be easier to handle.   If you change the URL in the href attribute of the tags to use the event: instead of http: and then the link even fires and you can then decide if you want to call NavigateToURL or not.

  • Spark TextArea remove border (borderVisible) in Flex 4.5 Hero

    When dealing with the text box for the development Mobile Flex Hero 4.5 I can't find a way to remove the border.

    < s:TextArea id = "lblPOC" left = "10" right = "10" top = low "10" = "10".

    borderColor = "#FFFFFF" borderVisible = "false" color = "#000000".

    contentBackgroundColor = "#FFFFFF" editable = "false" skinClass = "{null}"/ >

    setStyle does not work on the spark components, that I just discovered.
    Even htmlTexh, I had to:
    MobileTextField (lblPOC.textDisplay) .htmlText =

    Can someone help me remove the resident a spark TextArea in Flex 4.5?

    Thank you

    Eric

    Looks like you were using the preview version of Flex 4.5.  Setting to false BorderVisible works for me in the build of the 4.5 version:

    http://ns.Adobe.com/MXML/2009.

    xmlns:s = "library://ns.adobe.com/flex/spark" >

  • Performance Y560 problem

    Hi all!

    I did deal with such a problem - when power adapter connected 3dMark 11 combined score 1231, when I test without ac adapter combined score is 532. It is very strange that Y560 is so dependent on electricity. Please help solve this problem.

    Actually by default in windows 7, al devices are configured to operate on maximum health of the battery on the maximum performance when it's plugged in and the battery. You need to change this setting. Click the batteryicon in system tray icon. I have little thing will pop up. Click more power options. Now a new window will open which shows two levels of electrical energy. It is written change plan settings on the side each plan. Once again the new windows will be open. Now you should see the advanced power options. Open it and a relatively small new windows will be open again. Now change the graphics settings ati on battery power for maximum performance. I think this should do.

  • Performance Z580 problem

    Lenovo Z580 3 days, I bought a, clean (without installed Win7), after the first start-up, I installed Windows 7 Ultimate, to my surprise, it took nearly 2 hours. After a few resets I got to the Windows desktop, put Lenovo's CD inside and started to install drivers. Everything went smoothly, but I noticed one thing, performance of the laptop were really low, I mean, he was reacting slowly to the movement of the mouse, switch between windows, etc. I thought that this is because I had to restart the system, so I did. It did not help. So I launched Windows Update, hoping it would help. After getting every single update, I reboot, as requested, but nothing has changed because of the performance. At the present time, I noticed the new show, when I listen to the music and start to do something else, like launch Google Chrome, the music starts to crack. It is the same with movies, so I think it's a kind of sound. I tried to play games, launched Skyrim to possible lowest graphics settings, he did me like 20 FPS. I have no idea what could be the cause, or what to do to fix. Is there someone who faced similar problems and can help me?


  • Performance Aero problem

    I feel that I've searched high and low, and I can't find a solution to this problem I'm having.
    Here are the specs of my machine:
    OS: Vista Ultimate 64
    RAM: 9 GB
    Processor: Intel Xeon Quad Core 2.93 GHz
    Video: 2 nvidia quadro fx 580's (4 monitors)

    Basically, Wheneve my PC is under heavier than normal CPU load or graphic support, I get a message bubble in the taskbar that says:
    "The color scheme has been changed to Windows Vista Basic - the color scheme current has exceeded its allowed memory, so the color scheme has been changed automatically to improve performance." Click for more information".

    When I click on the message, it disappears. CPU usage was never more 50% and the memory has never been more 60%. Can someone tell me why this happens and is it possible to allow more memory aero combat this problem? Thanks in advance for any response.

    Here is a link to the screen shot of the error:
    http://www.RESOURCEFORK.com/archive/WWWserver/user_docs/Blake/VistaPerformanceMessage.PNG

    Hello agkeyser,

    Thank you for using the Microsoft answers Forum.

    This problem appears if a program that you are running is not compatible with the view that Aero model indicated in the section below I have pasted the link which is also included below.

    Why are some Visual elements will automatically turn off?

     

    A program that you are using is not compatible with the Windows Aero color scheme. When you run a program that is not compatible with the Windows Aero color scheme, some Visual elements are automatically disabled. When the program is not is more running, the Visual elements that have been disabled will be activated automatically.

    While some third-party programs may be compatible with Windows Vista, these programs cannot take advantage of all the features that are included with Windows Vista.

    Using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.

    Judd
    Engineer Microsoft Support answers visit our Microsoft answers feedback Forum and let us know what you think.

  • Performance graphics problem because the time change?

    Hello

    It seems that there is a problem with the graphic display of Performance on my system (vsphere 4.1 esx 4.0 servers) from 31. October 2010. I suspect it has something to do with the time change that occurred last Sunday night in my area of time (time Switzerland).

    (1) in time real Perfomance data are displayed on the VM and ESX Server objects.

    (2) any other array performance (daily, weekly, annually) fails to display

    If 3) use graph custom, I can go back until 1 November (until today), but not yet back. This is why I think it has to do with the time change of last Sunday.

    When I look at stats.log, there are error messages as in the txt File attached.

    Any ideas? It is not tragic if the old performance data are lost... were put in place with a new DB in September... but I would like to see in the future the performance stats...

    Here a KB for this issue: http://kb.vmware.com/kb/1030305

    To work around the problem of time atothr, you can try to use "Advanced" on the performance tab reports.

  • Flex 4 Spark Textarea without border

    Hello

    I have a s:TextArea in Flex 4.1 where I try to hide the border. Without success.

    I thought it would:

    < s:TextArea
    borderVisible = "false" >

    but the border is still there, also I can't change the color of the font.

    How would I do that?

    Thank you.

    Paul

    It works for me in Flex 4.1 and the latest internal builds:

    
    http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark">
        
            
        
        
            
            
            
        
    
        
    
    
    
    Peter
  • Spark textarea in ItemRenderer

    I have a problem with the text or text box in an ItemRenderer.

    I created a simple ItemRenderer with two textarea.

    In the complete creation of the ItemRenderer, I put the text in the box to a variabele of the oject of data of the item converter.

    As follows:

    chatText.text = this.data.message; (I know with certainty that the message string contains text at this stage).

    When I use this ItemRenderer in a list it will show lines in the list, but the text box don't contain any text.

    But when I click on the text box in a line, the text becomes vissible somehow.

    It only occurs when use the textarea sparkles, the mx textarea shows the text immediately.

    Am I missing a setting or what's new in flex 4?

    Well, look at me as if it was a timing issue, need you adjust the data when the data arrives.

    Try;

    
    
        
            
        
        
            
            
            
        
    
    
    

    Mike

    PS If you get a response from pointer zero return, you may need to invalidation. I don't remember if the new converters have their created children before or after the data set.

  • ultimate performance sp2 problems, of Vistax64 after reboot

    I turned off my computer and restarted it about 5 minutes later.  When I started this new he would start slower than usual.  Once it was launched upward, everything was slow.  I tried to disable all startup programs and restarted the process, it was still slow.

    When a program starts, it works very well, but their startup is very slow and causes other programs not responding.

    Between switching programs is slow and causes others to not answer.

    I get a lot of program does not not errors.

    I did some major changes lately.

    Everything worked fine until the closing.

    running vistax64 ultimate, sp2,.

    Thanks in advance for any help

    Hello

    This was immediately after installation of SP2 or later on?

    So immediately, it's probably a conflict with SP2 and a resident as software antivirus/antimalware program. Usually, this requires a patch from the vendor of the program. Disabling any resident program is the only real way to isolate the problem.

    If "later on", then you may have a hardware problem, which means a component fails. First thing I would do is run a disk check. Run chkdsk c: /r from a command prompt and reboot when prompted.

    It runs slowly if started in safe mode?

    Good luck, Rick Rogers, aka "Crazy" - Microsoft MVP http://mvp.support.microsoft.com Windows help - www.rickrogers.org

  • Performance TextFilter problem...

    Hi, I use textFielter in my CustomEditField in my Page of my connection request. TextFilter.Interger works fine but the problem is that it slows down the speed of typing in my editField... I also write my codes for my customTextFilter, login and CustomEdit Field... Kindly give me solution and suggestions for that...

    ----------------------------------------------LoginPage---------------------------------------------------------

    package mypackage;

    import java.util.Date;

    Import net.rim.device.api.lowmemory.LowMemoryListener;
    Import net.rim.device.api.lowmemory.LowMemoryManager;
    Import net.rim.device.api.system.Display;
    Import net.rim.device.api.ui.DrawStyle;
    Import net.rim.device.api.ui.Field;
    Import net.rim.device.api.ui.FieldChangeListener;
    Import net.rim.device.api.ui.Font;
    Import net.rim.device.api.ui.Manager;
    Import net.rim.device.api.ui.UiApplication;
    Import net.rim.device.api.ui.component.Dialog;
    Import net.rim.device.api.ui.component.EditField;
    Import net.rim.device.api.ui.container.MainScreen;
    Import net.rim.device.api.ui.container.VerticalFieldManager;
    Import net.rim.device.api.ui.text.TextFilter;

    /**
    * A class that extends the class screen, which offers default standard
    * behavior for BlackBerry GUI applications.
    */
    public class AgAppLoginPage extends screen implements FieldChangeListener / /, LowMemoryListener
    {

    Private CustomEditField txtMobileNumber;
    Private EditField editField.
    Private CustomPasswordEditField txtPinNumber;
    Private CustomButtonField btnLogin;
    private static String stxtMobileNumber;
    private static String stxtPinNumber;

    public AgAppLoginPage()
    {

    VerticalFieldManager vertMgr = VerticalFieldManager(Manager.VERTICAL_SCROLL | nouveau Manager.VERTICAL_SCROLLBAR |) USE_ALL_WIDTH | USE_ALL_HEIGHT)
    {
    protected void sublayout (int maxWidth, maxHeight int)
    {

    Super.sublayout (Display.getWidth (), Display.getHeight ());
    setExtent (Display.getWidth (), Display.getHeight ());

    }

    };

    LockedHeaderHorizontalManager HorMgr = new LockedHeaderHorizontalManager("LoginPage");

    vertMgr.add (HorMgr);

    CustomLabelField lblTop = new CustomLabelField ("Sign In", Font.getDefault () .getHeight () + 10, Field.FIELD_HCENTER |) DrawStyle.LEFT);
    txtMobileNumber = new CustomEditField ("Mobile number");
    txtPinNumber = new CustomPasswordEditField ("PIN");
    editField = new EditField("MyTextFilterEditField","");
    btnLogin = new CustomButtonField ("Log In", "Wide", "login.png");

    lblTop.setMargin (5,0,0,0);
    vertMgr.add (lblTop);

    txtMobileNumber.setMargin (5,0,0,0);
    vertMgr.add (txtMobileNumber);

    txtPinNumber.setMargin (5,0,0,0);
    vertMgr.add (txtPinNumber);

    vertMgr.add (editField);
    btnLogin.setMargin (5,0,0,0);
    btnLogin.setChangeListener (this);
    vertMgr.add (btnLogin);
    Add (vertMgr);
    This.Add
    }

    public void close()
    {
    If (Dialog.ask (4, "Do you really want to leave MCB-Lite") == Dialog.OK)
    System.Exit (0);
    }

    ' Public Sub fieldChanged (field field, int context)
    {
    if(Field == btnLogin)
    {
    If (txtMobileNumber.getTextLength () == 0 | txtPinNumber.getTextLength () == 0)
    {
    Dialog.Alert ("Please enter all info!");
    }
    on the other
    {
    stxtMobileNumber = txtMobileNumber.getText ();
    txtMobileNumber.setFilter (MyTextFilter.get (TextFilter.NUMERIC));
    editField.setFilter (MyTextFilter.get (TextFilter.NUMERIC));
    stxtPinNumber = txtPinNumber.getText ();
    getResponse processRequestAndWait = new processRequestAndWait();
    AgAppPleaseWaitScreen.showScreenAndWait (getResponse);
    txtPinNumber = null;

    }
    }

    }

    static class processRequestAndWait implements Runnable
    {

    public void run()
    {
    final String [] [] xmlResponse.

    If (AgAppHelperMethods.agAppConnection.CompareTo ("SMS")! = 0)
    {
    xmlResponse = AgAppHelperMethods.AgAppXMLParser ("AG_IT_App/AgMainServlet? messageType = LOG & pine = "+ AgAppHelperMethods.getPIN (stxtPinNumber) +" & mobile = "+ stxtMobileNumber +"& source ="+ stxtMobileNumber +" & channel = INTERNET; deviceside = true");
    = AgAppHelperMethods.AgAppXMLResponse xmlResponse (XMLResponse.login ());
    }
    on the other
    {
    AgAppHelperMethods.msg = "AGLOG" + stxtMobileNumber + stxtMobileNumber + AgAppHelperMethods.getPIN (stxtPinNumber); ".
    xmlResponse = AgAppHelperMethods.AgAppSMSParser ();
    }

    UiApplication.getUiApplication () .invokeLater (new Runnable()
    {
    public void run()
    {
    if(xmlResponse[0][0].) CompareTo ("null") == 0)
    {
    UiApplication.getUiApplication () .pushScreen (new AgAppResponseScreen ("Login screen", "host not Responding", Font.getDefault () .getHeight ()));
    }
    if(xmlResponse[1][1].) CompareTo("00") == 0)
    {
    TimeCalculator.timeStart = new Date();
    TimeCalculator.timeEnd = new Date();

    AgAppHelperMethods.varName = xmlResponse [3] [1];
    AgAppHelperMethods.varBalance = xmlResponse [4] [1];
    AgAppHelperMethods.varMobileNo = stxtMobileNumber;
    UiApplication.getUiApplication () .pushScreen (new AgAppHomePage());

    }
    on the other
    {
    UiApplication.getUiApplication () .pushScreen (new AgAppResponseScreen ("Login Screen", AgAppHelperMethods.getStatus(xmlResponse[1][1]), Font.getDefault () .getHeight ()));
    }
    }
    });
    }

    }

    }

    ----------------------------------------------------CustomEditField----------------------------------------------------------

    package mypackage;

    Import net.rim.device.api.ui.Color;
    Import net.rim.device.api.ui.Font;
    Import net.rim.device.api.ui.Graphics;
    Import net.rim.device.api.ui.XYEdges;
    Import net.rim.device.api.ui.component.EditField;
    Import net.rim.device.api.ui.decor.BackgroundFactory;
    Import net.rim.device.api.ui.decor.Border;
    Import net.rim.device.api.ui.decor.BorderFactory;
    Import net.rim.device.api.ui.text.TextFilter;

    class CustomEditField extends EditField
    {
    Private boolean _focusableFlag;
    private String defaultText;

    public CustomEditField (String defaultText)
    {
    Super (FIELD_HCENTER);
    this.defaultText = defaultText;

    }

    {} public void setFocusable (boolean focusable)
    _focusableFlag = active;
    }

    protected void layout (int width, int height)
    {
    Width = Font.getDefault () .derive (Font.BOLD, Font.getDefault () .getHeight () - 2) .getAdvance ("transfer of my linked account") + 40.
    height = Font.getDefault () .getHeight ();
    Super.Layout (Width, Height);
    super.setExtent (width, height);
    super.setFilter (MyTextFilter.get (TextFilter.NUMERIC));

    }

    protected void paint (Graphics g)
    {
    setBorder (BorderFactory.createRoundedBorder (new XYEdges (5,5,5,5), 0xD0D0D0, Border.STYLE_SOLID));
    setBackground (BackgroundFactory.createSolidBackground (Color.WHITE));

    If (Super.GetText () .length () == 0)
    {
    g.setColor (0xD0D0D0);
    g.drawText (defaultText, 0, 0);
    }

    g.setColor (0x484C54);
    Super.Paint (g);

    }

    }

    ----------------------------------------------------------MyTextFilter---------------------------------------------------

    package mypackage;

    Import net.rim.device.api.ui.text.TextFilter;
    Import net.rim.device.api.util.CharacterUtilities;

    SerializableAttribute public class MyTextFilter extends TextFilter {}

    public char convert (character char, int status) {}
    TODO self-generating method stub
    If (! validate (character))
    {
    return 0;
    }
    Returns the character;
    }

    public boolean validate (char character) {}
    TODO self-generating method stub

    If (CharacterUtilities.isDigit (character))
    Returns true;
    ElseIf (CharacterUtilities.isLetter (character))
    {
    If ((caractère == serait ') |) (caractère == serait '))
    {
    Returns true;
    }
    }
    Returns false;
    }
    }

    It's a little hard to dig through the wall of the code, please use code tags next time.

    I don't think that the textfilter slows your app, I think that you run on the user interface thread things that belong here.
    Move to a thread blocking operations separate, you can use a callback model, for example.
    See
    http://supportforums.BlackBerry.com/T5/Java-development/what-is-the-event-thread/Ta-p/446865

  • performance com_sync_index problem

    How I can dissect from performance in ctxsys.drvdml.com_sync_index (: idxname,: idxmem,: partname); is run?

    William - it's an Oracle procedure that is used to synchronize the full-text index.

  • OBIEE 11 g - Performance Essbase problem

    Hi all

    I have a request to OBIEE with hardcoded filter (for example year '2012' =), the query sent to Essbase contains this filter.
    But if I use the Session Variable in the filter (for example year = NQ_SESSION. VALUEOF (CURRENT_YEAR)), the query does not contain this filter send to Essbase.
    Thus, the query in Essbase take a lot of time, and then OBIEE takes time to filter the data to the server in OBIEE.

    My question: how to replace OBIEE Session Variable before sending questionable to Essbase?

    Thank you
    Youssef

    Hi John,

    Maybe you could create a dashboard with your filter and with a default NQ_SESSION value. VALUEOF (CURRENT_YEAR)).
    After in your report, add you a filter "invited" in your field.
    If you wish, you can hide the dashboard prompt to not show.
    It is not the best solution, but it could be a workaround in your case - I didn't test it.

    It will be useful,

    Benoit

  • HTML "BOLD" text and regular on the Spark components with embeded fonts

    Hello!

    I took a quick glance to the textflow Flex 4 new (at least new to me).

    I use a spark textarea that is assigned to a style that uses a font embed, the problem is that when the textarea component renders the text marked in bold (using < span fontWeight = "bold" >) you lose the embeded font style.

    How to display bold text and text in the same text box using embeded fonts?

    Thanks in advance

    That's exactly what I was looking for:

    {@font-face}

    SRC:URL("..) ("/ assets/MyriadWebPro.ttf");

    fontFamily: myFont;

    embedAsCFF: true;

    }

    {@font-face}

    SRC:URL("..) /Assets/MyriadWebPro-bold.ttf");

    fontFamily: myFont;

    fontWeight: bold;

    embedAsCFF: true;

    }

    {@font-face}

    SRC:URL("..) /Assets/MyriadWebPro-italic.ttf");

    fontFamily: myFont;

    fontStyle: italic;

    embedAsCFF: true;

    }

    {.myPlainStyle}

    fontSize: 20;

    fontFamily: myFont;

    }

    {.myBoldStyle}

    fontSize: 20;

    fontFamily: myFont;

    fontWeight: bold;

    }

    {.myItalicStyle}

    fontSize: 20;

    fontFamily: myFont;

    fontStyle: italic;

    }

    so now I can put fonts on "myFont" style, and the Flash will be made to the police as a result.

    http://help.Adobe.com/en_US/Flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7f5f.html

    Nice!

Maybe you are looking for

  • Once installed the unlocker how do you use it

    I have a file on my desktop to delete.  I was told to download "unlocker", now that I have, how to use it?

  • code device Slimtype dvd a ds8a2l 19

    Hello I have Compaq Presario CQ60 and can't play and form of media in the cd/dvd drive. He returns constantly with the error code 19. I've done several things to try to solve but nothings working. # Help, please!

  • ISE CSR not displayed

    I have a monitor main ISE node that the server certificate has expired.  I generated a new CSR and he pointed out that it has been created and can be found under the tab of certificate signing requests but it never showed up.  Tried to re - generatin

  • Intel platform dynamic and thermal environment parameters for Windows 10

    Hello world I recently watched my battery settings and I discovered that, on 10 of Windows, all possible settings for Intel platform dynamic and thermal setting of my XPS 13 9343 lack, so were present on Windows 8.1. I also tried to reinstall the dri

  • Need to restore the tile from photo library

    I accidentally hid the tile of photos under the Photo app library. Anyone know how I can restore it?