Mark(highlight, bold, and so on) text in GWT (for help)

I want to display a paragraph text in GWT, in some component(TextArea, or RichTextArea...), and then double-click the words in the text to select them.
Now I want to highlight the words, can GWT support that effects I need?
I have tried to use TextArea to display the plain text, add clickListener and focusListener to it. however, I am confused because I don't know how to mark the selected words with highlighting.
Please tell me how to do that, I will never thank you enough for your help.
showhappy
Edited by: showhappy on Jul 24, 2008 11:57 PM
Edited by: showhappy on Jul 24, 2008 11:58 PM

I have tried to use TextArea to display the plain text, add clickListener and focusListener to it. however, I am confused because I don't know how to mark the selected words with highlighting.HTML is another widget you can use to display text.
Marking the selected text is the first problem. AFAIK only TextBoxBase (including TextArea) has a setSelectionRange(int,int) method.
Figuring out what the selected range should be is the next problem. And I wouldn't have a clue ;( You could use onBrowserEvent() rather than add a click listener. Then you be sent an Event from which you can determine the (x,y) coordinates with respect to the browser's client window. It's up to you to figure out if you are dealing with a double click. The TextBox client coordinates are available from the UIObject methods getAbsoluteTop/Left() but from what I can tell there is no way to determine where (in terms of characters) the click occured.
Perhaps this is just not the sort of thing you should be doing. For instance in the browsers I looked at - FF, Opera and Konqueror - double clicking in a TextBox or an HTML caused the word clicked on to be selected. But this was an action taken by the browser, not the javascript. It happens on any web page and users expect this behaviour (if they use those browsers) so a case could be made for not messing with what happens when they double click.
It might be enough for your click listener (or a ChangeListener?) to detect whether both (1) there is some selected text as revealed by getSelectedText() and (2) the selected text is not the same as last time there was a click. Based on these two things you could detect(*) and respond to new selections. This isn't quite what you asked but it might do.
(* Provided the user is navigating with a mouse, or something that "clicks". Accessibility might be a concern.)
I'm no expert, so maybe others can help you more. But I wonder if they will do so in this forum whose focus is Java programming, not GWT. If this were a JTextArea, you would be directed to the Swing forum. As it is I don't know where the best place would be. (Post back if you find somewhere good.) A couple of comments here recently suggest that the Google Groups gwt group isn't very active: but perhaps it will only become so if people post their questions there.
Good luck. (You'll need it with fscking javascript, even if the source language is Java ...;)

Similar Messages

  • TS1424 I tried downloading an app but it says there is an error and asked me to come here for help. How?

    I tried downloading an app but it says there is an error and asked me to come here for help. How?

    If you are getting a message to contact iTunes Support then you can do so via this link and ask them for help (we are fellow users here on these forums, we won't know why you are getting the message) : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page

  • HT201210 I am trying to download the latest version of itunes and it comes up error 3014 and error -1.  Any ideas for help?

    I am trying to restore my apple and update it.  It comes up error 3014 and -1.  Any ideas for help?

    Try the following user tip:
    Troubleshooting issues with iTunes for Windows updates

  • Ipod touch -cannot connect to itunes store:wifi  connection works, tried reset and still have problem, submitted request for help to apple and they pointed me to a bunch of articles that were of no help, already had tried so I wrote to them, Help

    cannot connect to itunes store
    wifi works and confirmed by accessing google & ew.com
    tried reset and removed everything from ipod
    still receive error cannot connect to itunes store
    did google search and could not find a solution.  found other's also asking for help
    sent request to apple and received response with list of articles.  already tried these and still don't have answer.  inluded ipod model and serial number (ma62ll / 9c740wffw4n) thinking this might help them provide a specific solution.
    version: 1.1.5 (4b1)
    help,  i want to connect to itunes,

    Try:
    Best Fixes for ‘Cannot Connect to iTunes Store’ Errors | iPad Insight

  • Format bold text in field and putting some text on new line - Help!

    I am lost.  I found the rich text formating item to click.  But after that, I don't know what to do next.  I want to bold some characters and I want some reponses on separate lines as I asked previously.  As to spans and the commands - I have no programming experience.  I have just been using what George has given me.  It has worked well, but I just need the bold text in some of the field text to be printed and I need some items to be on separate lines.  But I have no idea where to put the information you are saying about spans and I do not know the script to use to bold text or to start text on new line.  Am I to insert it in the calculation box of the text box?  Sorry to be so lame, but I am void in programming skills.  Help!
    For example, here is the script.  In aISOreq{0], if I want to bold "Patter#1 Check:", where do I put the span and what script do I use to say to bold it.   Could you give me an example, please.  Also, if I want to put "a. Medications on weekend?" on one line and "b. Activities on weekends? Types of activities? Supervision? With who?" on the next line, where do I put the span and what script do I use to say to put on separate lines?  Could you give me an example for this also, please.  I have literally just used the scripts George has given me and they work great - but that is all I know how to do.  Thanks.
    (function () {
        // Set up an array to hold the individual paragraphs of text
        var aISOfreq= [];
        // Populate the array with paragraph text
       aISOfreq[0] = "Pattern #1: Multiple Isolations on Mon & Tues decreasing to Fri.  Pattern # 1 Check: a. Medications on weekend?  b. Activities on weekend? Types of activities? Supervision? With who?";
       aISOfreq[1] = "Pattern #2: Multiple Isolations on specific days.  Note days.  Pattern #2 Check:  a.  Different schedule on these days? Different adult? Block schedule? May need consistent schedule w/same adult.  b.  Are accommodations/modifications occurring? More group v. individual instruction? Does the student need warm-up drills or a specific job?  Does student need a specific lesson routine? c.  Previous night's activities?  Need calming activities before bed?  Need earlier bedtime? Need additional evening structure?";
       aISOfreq[2] = "Pattern #3: Isolations are grouped in intervals.  Note interval.  Pattern #3 Check:  a.  Cyclic behavior?  Review assessment.  Need Mental Health referral for meds and/or therapy intervention?  b.  Medication: supervision? Self-medicating? Taking consistently? Need medication check with physician?  Share concerns with physician?  c.  History of legal/illegal drug abuse?  Share cyclic pattern with physician.  On probation?  Share concerns with PO?";
      aISOfreq[3] = "Patterns #1 & #2: Multiple Isolations on Mondays & Tuesdays decreasing to Fridays AND Multiple Isolations on specific days.  Note days.  Pattern #1 Check:  a. Medications on weekend?  b. Activities on weekend? Types of activities? Supervision? With whom?  Pattern #2 Check:  a. Different schedule on specific days? Different Adult? Block schedule? May need consistent schedule with same adult.  b. Accommodations/modifications occurring? More group v. individual instruction? Need warm-up drills or specific job?  Need a specific lesson routine?  c. Previous night's activities? Need calming activities before bed? Need earlier bedtime? Need additional evening structure? ";
       aISOfreq[4] = "Patterns #1 & #3: Multiple Isolations on Mondays & Tuesdays decreasing to Fridays AND Isolations grouped in intervals.  Note intervals.  Pattern #1 Check:  a. Medications on weekend?  b. Activities on weekend? Types of activities?  Supervision? With whom?   Pattern #3 Check:  a. Cyclic behavior?  Review assessment.  Need Mental Health referral for meds and/or therapy intervention?  b.  Medication supervision? Self-medicating? Taking consistently? Need med check with physician?  Share concerns with physician?  c.  History of legal/illegal drug abuse?  Share cyclic pattern with physician.  On probation?  Share concerns w/PO?"
      aISOfreq[5] = "Patterns #2 & #3: Multiple Isolations on a specific day AND Isolations grouped in intervals.  Note days & intervals.  Pattern #2 Check:  a.  Different schedule? Different Adult? Block schedule? May need consistent schedule w/same adult.  b.  Accommodations/Modifications occurring? More group v. individual instruction? Need warm-up drills or a specific job?  Need a specific lesson routine? c.  Previous night's activities?  Need calming activities before bed?  Need earlier bedtime? Need additional evening structure?  Pattern #3 Check:  a. Cyclic behavior? Review assessment.  Need Mental Health referral for medication and/or therapy intervention?  b.  Medication supervision? Self-medicating? Taking consistently? Need medication check with physician?  Share concerns with physician?  c. History of legal/illegal drug abuse?  Share cyclic pattern with physician.  On probation?  Share concerns w/PO?";
       aISOfreq[6] = "Patterns #1, #2 & #3: Multiple Isolations on Mondays & Tuesdays decreasing to Friday, Multiple Isolations on specific days AND Isolations grouped in intervals.  Note days and intervals.  Pattern #1 Check: a. Medications on weekend?  b. Activities on weekend? Types of activities? Supervision? With whom?   Pattern #2 Check:  a. Different schedule? Adult?  Block schedule?  May need consistent schedule w/same adult.  b.  Accommodations/Modifications occurring? More group v. individual instruction? Need warm-up drills or a specific job?  Need a specific lesson routine? c.  Previous night's activities?  Need calming activities before bed?  Need earlier bedtime? Need additional evening structure?  Pattern #3 Check:  a. Cyclic behavior? Review assessment.  Need Mental Health referral for medication and/or therapy intervention?  b.  Medication supervision? Self-medicating? Taking consistently? Need medication check with physician?  Share concerns with physician?  h.  History of legal/illegal drug abuse?  Share cyclic pattern with physician.  On probation?  Share concerns w/PO?";
       aISOfreq[7] = "No Pattern";
         // Get the selected item, which is the export value of the selected combo box item
        var item = getField("ISO Frequency Pattern").value;
        // Display the text corresponding to the selected item in the text field
        event.value = aISOfreq[item];

    Look at the reference of the richValue property of the Field object. It contains a couple of examples of how it should be done. Also read the reference of the Span object.

  • Hi, I accidentally spilled water on my Mac Air on the very right side of the keyboard. After a few minutes, the screen turned white and a gray folder with a question mark came up and kept flashing. THEN IT DIED HELP.

    After the screen turned white and the folder popped up, it just kept flashing. After a few minutes the screen just turned white completely and I could hear the noise of the drive. It just sat there still with the noise for a good few hours until the battery died and then my mac just shut down completely. I tried to see if the computer could charge, and it does charge. I just can not turn the computer on no matter what. It is dead. It might be the logic board or the drive...I'm hoping it won't cost me a new computer because I just got this 5 months ago....

    Do not attempt to charge as that will only make the damage worse.  You need to take the MacBook Air to an Apple store genius bar and have the technicians check and see what repair work is necessary.  It only takes a very small amount of liquid to cause short circuits and damage.

  • HT4314 My Game Center App support button sends me to the website of the developer, and they say to ask Apple for help. It's a cycle I can't break. I just want to fix my game!

    I downloaded the Sims Freeplay app some time ago and it's been smooth sailing.
    I'm a bit of an achievement hunter when I play my games, so I bought a rather expensive home to earn one particular achievement.
    My "Pro Skater Deam Pad" was built, but the achievement was never awarded. Odd. So I restarted my iPad and thus the game. Still nothing.
    I've had the house for a few days now and I still haven't been awarded an achievement, so I went to the App Store and clicked App Support.
    It sent me to the EA games homepage, and after scouring the help center with no luck, I was finally pushed into making an account so I could ask my question.
    Lo and behold, the EA games cannot access the Game Center or the App Store or anything else like that, and sent me back to Apple.
    Repeat the cycle here.
    So here's my question and I'd love some answers ::
    "What do I need to do to fix the glitch? The app is up to date and is otherwise running perfectly fine."

    I doubt this warranty is still being honoured, since there was a 2 year time limit.
    But just to be sure you could contact Apple directly:
    http://www.apple.com/support/macbook/
    (We are all volunteers here, not Apple employees.)
    Good luck.

  • I received .mov via email and iMessage and quicktime tells me it can't open and to click tell me more for help

    I tried to open .mov from an email and imessage and quicktime says it cant open and to click tell me more but then it doesnt give any information. Ive never had a problem opening videos made from an iphone and emailed before. These arent long clips.

    i downloaded Quicktime 7 on my imac but it still wont open?
    MOV refers to the file container. (MOV is the generic Quicktime file container.) Unfortunately, there cam be many different problems here.
    1) People with different system configurations can place audio and/or video data not compatible with your system into MOV files, send them to you, and they will not play if you do not have the proper codecs installed for the QT 7 player to play them. Therefore, it is normally recommended that you determine what audio and video compression formats were used to create the original file. If the files do not open in either the QT X or QT 7 players, then you can check the file's "Get Info" window to see the the Mac OS X Finder recognizes the compressed data format(s). If it doesen't, them you can try opening the file in an alternate media player like VLC (free download) to see if that play can open, play, and/or tell you the compression formats. Lastly, if an app like VLC can't help you, you can download a generic media information app like MediaInfo (also a free download) to examine the file.
    2) Once you know the compression formats use in the file and the Mac OS X version, and QT player being used, it is usuall a simple matter to determine if the compression format is supposed to be compatible with the QT player used for your Mac OS X or IOS device. This will tetermine whether or not the file can be played natively or must be converted to a different compression format for playback
    3) In a very small percentage of cases, it may turn out that the file sent to you is either correpted or violates a security update installed on your system that prevents plaback. In the case of a corrupted file, about the only thing you can do as request the file be resent to you and hope for better results. In the case of a security problem, the file may be playable and/or convertable by a third-party application that gets around Apple's security trapping that prevents playback.
    4) In the future, if you have problems opening or playing a file, please be more specific as to the nature of the problem. Specify the specific modal message you are getting or describe whether the player quits without a message, crashes, or will not open under one user account but does open under another.
    and how would you resolve this issue on your iphone but updating quicktime player?
    Your original message did not indicate that you were trying to play the file on your iPhone. Since the QT 7 player better handles the playback of "legacy" compression formats—especially under Mavericks—many users are advised to install the QT 7 player to handle compression formats no longer playable by the new AVFoundation software embedded in Mavericks. In addition, the QT 7 player is supported by an older 32-bit structure embedded in the Mac OS X v10.6, 10.7, 10.8, and 10.9 operating systems which can still access third-party codecs if your system is configured for their use—another reason for keeping QT 7 installed on a computer system. Unfortunately, such options will not fix blayback problems on an IOS device where it is normally easier to convert unsupported compression formats to natively supported compression formats—primarily H.264 video with AAC audio in MOV, MP4, or M4V file containers.

  • Display data in bold and red in color in side a table control cell

    Hi,
    I need to display data in side a Table Control cell with Bold and Red in color, can any body help me how to do it.
    Regards,
    Srinivas

    The gui does not support the coloring in table controls.  You can set the hightlight attribute, but this will only make the text blue in color. There is no way to make it any other color.
    Regards,
    Rich Heilman

  • I'm using Adobe Acrobat 9 Pro on my Mac and Cannot edit text?

    Hi,
    I am trying to edit the content of a document that I scanned into a PDF in Adobe Acrobat 9. How do I delete and retype the text?? Please help.

    You would first have to perform OCR on on the scanned pages. Personally, I think if you really want to edit scanned pages, you are better off using a dedicated OCR program rather than Acrobat.

  • After initiating creative cloud begins to install the programs near the end marks a mistake and put me error code 1

    after initiating creative cloud begins to install the programs near the end marks a mistake and put me error code one can help me

    Creative Cloud Error Codes (WIP) | Mylenium's Error Code Database
    Mylenium

  • Every event starts on the 5min mark (10:05) and I can't edit it!!!

    Every event starts on the 5min mark (10:05) and I can't edit it for some reason. I can change the date, the hour, and the am/pm, but not the minutes. It's very strange.
    Is there a way to "reload" or "restore" iCal?
    Using version 3.0.8

    Hi,
    We wonder that if you took any action before this issue occurred such as installed a device/program or updated any driver programs.
    Check your issue under clean boot.
    https://support.microsoft.com/en-us/kb/929135?wa=wsignin1.0
    Use the System File Checker tool to repair missing or corrupted system files
     https://support.microsoft.com/en-us/kb/929833
    Since Windows 10 is still in Technical preview stage, we don’t suggest fixing system problem by using system upgrade. And as mentioned by Frederik Long, There is no "downgrade" path from Windows 10 to Windows 7.
    Regards,
    D. Wu
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Text Data source for Classification Data

    Hi BW Gurus, Ajay Das and Kishore helped me very well on this, just last step doubt. In r/3 system I have added the char tYPE AND kyf TYPE CHARACTERISTICS to classification data now it has generated the Classification customer attribute data source 1CL_0CUSBMW01 and I see the text datasources generated afor char type characteristics in /NCTBW such as 1CL_AABMW01,1CL_AABMW03,  etc.. now when i go back to BW
    i see the customer attribute data source 1CL_0CUSBMW01 and also text datasources generated in datasource overview, but when i go infosource tab in rsa1 I WAS INTstructed to create the infopackage on 0customer for customer attribute data source 1CL_0CUSBMW01 AND load the data now I " Have a doubt I think I also have to create 4 more infopackages and specify the text datasources generated for the characteristic added in CTBW ex 1CL_AABMW01,1CL_AABMW03. to load the text for the characteristics. please clarify asap if it is required to create all these text infopacks to load the text datasource to respective infoobject or just customer attribute data source 1CL_0CUSBMW01 infopack will take careof every thing, beacuse my manager did not told me to create the text infopack so how will the text get loaded for the infoobject
    soniya

    1CL_0CUSBMW01 is the DS containing 0CUSTOMER and the two (or more) characteristics I assume. This has to be used to update 0CUSTOMER. You can either use the existing infosource, or, create a new one to do this. You will then need a new infopackage to run this.
    Let us say one of the characteristics also has text, and you want to bring that to BW using generated DS 1CL_AABMW01. You will replicate it, and use it to update texts to infoobject XXXX (whatever this characteristic is, in BW). This will not be used to update 0CUSTOMER.
    Let us say your class char was COLOR. Its values were 1,2,3,4,... and the associated text was Red, Green, Blue...
    Now, based on the above, 0CUSTOMER will have an attribute COLOR which will have values in Attr table as 1,2,3,4...
    The text table for characteristics COLOR will have values as
    1--Red
    2--Green
    3--Blue.....
    The text will NOT go to 0CUSTOMER if that is what you are asking.

  • How do you highlight text in Pages for iPad? The document I want to create and highlight is a pages document

    I am trying to create a document in Pages for iPad and want to highlight various bits of text but can not find a function in the inspector for this. Can anyone help,please?

    Hi stuartdj,
    I'm not finding a way to highlight text as one can do with iBooks (hold and swipe for black text, background yellow for example).
    One option is to actually color the text itself.
    Select the text, then in Style tools, tap the Font name at the top which shows the Text Options sheet where there is a Color option.  Would changing the font color to Red, Green or Purple accomplish your goals?
    If you do want black text on a colored background (highlighted) it would need to be text in a text box where you can change the fill (background) color.  Style, Style Options, Fill.  But this is not inline text and doesn't flow like just coloring the font itself.
    ivan

  • Text appearing as Bold and Italic in CS4

    Hi Guys
    Whenever I create a new document and type into it the text is automatically 'bold' and 'italics', I have saved the page and opened on another computer running CS4 and the text is fine (not bold or italic). I have created a page on another computer and opened it on the troublesome one and again it is bold and italic ((
    I cannot see anything in the preferences that may cause it, I have also discarded the configuration folder which contains the preferences for the program - no good either (( So as a last resort I have re-installed Dreamweaver and it is still playing up. I guess I can re-installs the complete CS4 suite but rather not as it is going to take a while and also may not fix the problem.
    Any ideas anybody??

    I have just copied the code from the page as below and as you can see there is no bold or italic applied:-
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    hello
    </body>
    </html>

Maybe you are looking for

  • Zen Xtra no longer recognised by sys

    Player: Zen Xtra (30GB) firmware version: .20.08 I installed the software for my zen from the cd, then I upgraded my software from the CD versions to the following versions, and my player is no longer recognised. These are the files I installed: Medi

  • How to Prevent/Control doing MIGO twice for the same material

    Dear The stores clerk by mistake has done MIGO twice for the same material.  Is there any way to prevent/check the same in standard SAP?  Vendor does not send the invoice/delivery challan to stores directly.  Invoice is sent to Finance Department.  R

  • Is it possible to change the baseentry/baseline/basetype in document lines?

    Hi, I have created a PO and a SO with same item in document lines separately. I want to set the BaseEntry, BaseLine and BaseType of PO lines to points to a item line in SO. My code is like below:                 po.Lines.SetCurrentLine(0);           

  • Find linkage of Project defination with the Plant in the activity field

    Hi All,    I am stuck in a situation wherein i need to find the linkage between the Project definition and the plant field in activity.There is one AFVC database table for which we get the linkage of WBS element with all the activities assigned.There

  • Need the Logic for this Prg issue Pls

    Hi Friends, i have an urgent requirement.. i am develop the report that is : Based on Selction Critirea kunnr(knvv-kunnr) i want Delete the          Internet mail (SMTP) address FROM ADR6-MTP_ADDR AND Teletex number FROM ADR4-TTX_NUMBER.. USING TABLE