How to determine the position of cursor in Text Area?

I have to solve next problem.
I need to create special editor for my application.
Page consist of two regions. First one is Text Area. Second one is Toolbar.
User input Text in Text Area. He can use toolbar for inputing additional text in the cursor position.
It should look like in this forum. When I press on "B", tag <b> inserts in my text, in the cursor position.
Regards, Kostya

If the functionality you need is already implemented in this forum software, just pick it up from there!
Look at the HTML Source of the Post Message page and you will see that the Bold, Italic and Underline buttons call a Javascript function called
onclick="styleTag('b',document.postform.body);return false;All the Javascript functions are in http://forums.oracle.com/forums/utils.js
Thanks

Similar Messages

  • How to determine the position of a word in a line

    hello
    i want to know the position of a word on which caret is at present or the position of the selected word in a line displayed in the JEditorPane. for example, if this line is displayed
    Java is an Object oriented Language.
    if i select "an" then its position i get must be 3. Select Java postion must be 1 and so on.
    thanx in advance
    -Ashish

    Hi,
    you can use a StringTokenizer to break the result of getText() of JEditorPane into words and simply count them until the caret postion is passed. Add a method like this in your JEditorPane subclass:
    public int whichWord() {
    String delimiters = "\n\t "; // checking for new line, tab and space as word breaks
    StringTokenizer st = new StringTokenizer(getText(),delimiters,true);
    int pos = getCaretPosition();
    int count = 0;
    int len = 0;
    while ((len<pos)&st.hasMoreTokens())
    String s = st.nextToken();
    len += s.length();
    if (delimiters.indexOf(s)==-1) { count++; }
    return count;
    }Hope this helps - not tested, coded on the fly into this textbox.
    greetings Marsian

  • How to determine the data type of  a text field

    hi,
    I have a text field, now i need to know what data type i have given?
    it may be numerical, string, date & boolean data type. when i write something after that it will determine the data type of the input text? is it possible in jsp? Is there anyone who can help me about this? Please help me
    With regards
    Bina

    javascript:
    function test(sample){
          if(sample==true || sample==false){
           alert('boolean')
          }else if(isNaN(sample)){
           alert('number')
          }else{
          alert('string')
        }

  • How to remove the last new line in text area ?

    I have a calculator Applet that shows the calculation in a text area.
    if i enter 2+6, the text area shows
    2+
    6
    and i have a clear last button, which deletes the last entry by user.
    in the example above, one hit of clear last, deletes 6. another hit should delete +.
    I can delete the numbers, but I don't know how to go back to the previous line and delete the operator.
    I may have other calculations in that text area above the current calculation. so replaceAll("\n","") would not work here.
    Please someone help me here.

    it's an applet, i am developing in Eclipse ( mac environment)
    so for deleting a number i used this code, and works fine
    String temp = t.getText();
                             String lastChar = temp.substring(temp.length()-1);
                             for (int i=0; i<numbers.length; i++) // deleting a number
                                  if (lastChar.equals(numbers)){
                                       temp = temp.substring(0,temp.length()-1);
                                       number = number.substring(0,number.length()-1);
                                       t.setText(temp);
    which t is the text area, and numbers is the string array of 0 to 9, and number is a string where i store the entered number
    so i thought for deleting an operator i should use something similar, where i need to go back to the previous line and delete it,
    String temp = t.getText();
                             String lastChar = temp.substring(temp.length()-1);
                             if(lastChar.equals("n")){
                                                            temp = temp.substring(0,temp.length()-3);// deleting n , \ , and the operator
                                       t.setText(temp);
                             } but it doesn't work

  • How to determine the positioning order when using tab key?

    Hallo,
    in my jspx-page i want to define the order which the cursor jumps when the user is using the tab key.
    i don't know how to? in html there i can use tabindex. which way i must go?
    Any help is appreciated.

    I found that tabindex is not applicable. But i think it is an important point for better handling.
    Is there no easy way to do it?

  • How to determine the position in code after pause/abort

    Hi there.
    I've been searching for this for quite a while now, but I didn't find a solution, although I might just have looked in the wrong direction.
    Problem is: I'm trying to find a way to see where my program was (i.e. which part of the code it was execution) the moment I click on pause or abort. (Like the "pause" button present in most modern IDEs, when pressed, it halts the tread and jumps to the code-line or ASM-instruction the CPU was executing).
    The reason: I'm using LabView to control a few instruments to do some measurements on OPVCs. During long measurements involving multiple parameter-sweeps and hence numerous reconfigurations of both function generators and scopes, the program sometimes stops, or better "stalls".
    That is, the front panel's still responsive, but the measurement stops. I don't know whether the problem is related to my program or the scope (it's a LeCroy 434 Wavesurfer) or the FG (a Tabor series) - but I cannot find out either because I don't know what the program did last. FYI: when watching the program's execution using the Execution Highlighting tool, the error doesn't show up, so I guess it's some sort of timing issue.
    I'm currently installing the Execution Trace toolkit in the hope it will help, but still, any help would be great!
    Thanks in advance
    Alex

    AlexHofi wrote:
    LV_Pro wrote:
    Do you have any other means to stop your program currently?
    Yes, in theory... in the last few minutes I reviewed some code I wrote months ago when starting with the development and saw some possible dead-locks with the UI. I have two "Stop"-Buttons, one that stops the measurement and one that exits the wohle program, the latter via an event, the first get's polled in the measurement loop via reference. I read elsewhere that this might not be the best way of doing it, as accessing the UI outside the main event loop might cause some problems.
    I've got some spare lab-time today and will look into this again, unfortunately I cann't test the OutputDebugString-Thingy on my development machine as it's on linux.
    Anyway, it's quite exciting that I finally found a board where peopple really try to helpt, even if the questions ask might not be as constructive as theay could/should be. Thank you very much for that!
    Generally it is best to keep UI elements out of your processing code. Not only will a property node force execution to the UI thread it also tightly couples your UI and processing tasks. The prefered method is to use some type of messaging to the processing tasks. This can be implemented using queues, notifiers or user events. Your processing tasks now have a defined interface for interacting with them which makes reuse of the code easier. It is also more maintainable since you can completely change the UI without requiring a change to the processing code.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • How to determine the u2018equivalent position of the same organizationu2019?

    Hi,
    "Position change is a transfer from one position to an equivalent position within the same org reporting structure and under the same chief position"
    How to determine the u2018equivalent position of the same organizationu2019?
    Cheers.

    u can identity the position with help of the Holder
    say for ex: A is the holder of the Position for Executive now the user performent an event called change of position so he changed to Manager (here we can find the chageing on the basis of some parameter so i have taken holder as Parameter as we dont know which has changed or wht has changed)
    in this case we can use the report   RHDESC20  se38
    not an exact solution for ur question
    will try to find some other way

  • How to determine the screen structure of the detail area of a screen...

    Hi all,
              How to determine the screen structure of the detail area of a screen?

    Hi,
    go to se38,
    loop at SCREEN.
    endloop.
    put the cursor on SCREEN and press F1, then u can seee it.
    Regards,
    Pavan
    Edited by: vishnu Pavan on Mar 23, 2009 11:03 AM

  • How can determine the duration of an audio file

    Hi,
    i'm making speech recognition project using java. i can capture sound by michrophone and playback it. the type of the sound is .wav.
    my question is how to determine the recording duration (for example: determine the duration for 0.25 second) because i must recorded syllable,the assumtion is needed less than 0.5 second to say a word. and then.. can this wav file be changed into... binary or integer ?
    thanks for your help

    FYI I'm newbie in Java,
    Yes, I want to limit the audio file lengths to a certain value. What should I do?
    I have read wav file using an AudioInputStream, for audio format I'm using sampleRate = 8000.0F and sampleSizeInBits = 8. My friend said if I used 8 bit for sampleSizeInBit (resolution in amplitude) the binary file should be -128 till 127 in range according to the bit. I try this code and the result is binary file which is zero, positive, and negative.
    the code
    try{
    audioInputStream.read(audioBytes);
    for (int i=0; i<audioBytes.length;i++){
    System.out.println(audioBytes);
    catch(IOException ioe){
    System.out.println("Error"+ioe);
    I'm not sure that the code is right, but it works. Should I change the audioBytes into integer before? I try this code but it doesn't work.
    int a = new int[audioBytes.length];
    for (int i=0;i<audioBytes.length;i++){
    a[i] = new Byte(audioBytes[i]).intValue();
    this binary file has been printed in console (I’m using texpad). So, how I can write that to file.txt? I'm using FileoutputStream but it doesn't work correctly. Here is the code
    FileOutputStream fos = new FileOutputStream(strFilePath);
    {audioInputStream.read(audioBytes);
    fos.write(audioBytes);
    catch (IOException ioe){
    System.out.println("Error"+ioe);
    When I open file .txt is read as character like this üüüüüüüüüüüüûüüüûüûûû ||||||| ||||||| ||||||||||||||||||||||||||||| &#1746;&#1746;&#1746;&#1746;&#1746;&#1746;&#1746;&#1746;&#1746;&#1746;&#1746;&#1746; (like using alt plus number)
    Edited by: anasfr on Mar 19, 2009 9:02 AM

  • How to determine the ROWNUM in a Master Detail Form

    Hello,
    I am working in a Master Detail Form with Orders and Order Items Information; and I created a process that allows the users to select a Product ID on a tabular form, and the next column is populated automatically with the Product Description.
    To achieve that, I followed some instructions by Denes Kubicek (http://apex.oracle.com/pls/otn/f?p=31517:241), but my case is slightly different:
    <ul>I am using a wizard-created tabular form, instead of a manual tabular form; and </ul>
    <ul>Instead of using another page as a Popup to pass the parameter of the ROWNUM, I am using a plug-in called “Tabular Form Super LOV” which is a modified version of the SkillBuilders’ Super LOV that works on Tabular Forms. </ul>
    The Product ID is returned in the correct row by the plug-in; but in the case of the Product Description, it is always returned into the first row; and my problem is that I don't know how to determine the row where the user clicked to call the plug-in.
    I set up an example in apex.oracle.com in case someone would like to look at it:
    Workspace: ediazjorge
    Username: test
    Password: test
    App Name: Sample App
    App Number: 1550
    BTW, I am using Apex 4.1.1.00.23 and Oracle DB 10.3.2.
    Thanks in advance,
    Erick

    Hello VC,
    Thank you for your time and help.
    Unfortunately, it is still not working properly:
    1. When the Popup LOV opens, the first row of the tabular form is 0, the second row is 1, and so on. How can I assign the values starting with 1 and in the format *0001* ? (I am still a novice on Apex and new to JavaScript :-), sorry about that).
    --2. Also, when I close the Popup LOV, the value of P1_ROWNUM is ‘undefined’ again so I'm not sure if the Product Name column will be populated.--
    3. And finally, you are using the jQuery Selector uPopupLOVIcon, which is an attribute of the Cloudy Theme. In my real application (Apex 4.1.1.00.26), my element looks like: *<img src="/i/lov_16x16.gif" width="16" height="16" alt="Popup Lov" alt="List" style="vertical-align:middle;" align="middle" />*. What do you recommend me to use as a jQuery Selector?
    Again, I really appreciate your help and time. I think you solved the most difficult part.
    Thank you so much,
    Erick
    Update: I just found out that the problem with my comment 2 is because I didn’t delete the previous dynamic action that set the value to P1_ROWNUM.
    Edited by: ediazjorge on Sep 18, 2012 11:20 AM

  • How to determine the mount point for directory /tmp ?

    Folks,
    Hello. I am installing Oracle 11gR2 RAC using 2 Virtual Machines (rac1 and rac2 whose OS are Oracle Linux 5.6) in VMPlayer and according to the tutorial
    http://appsdbaworkshop.blogspot.com/2011/10/11gr2-rac-on-linux-56-using-vmware.html
    I am installing Grid infrastructure. I am on step 7 of 10 (verify Grid installation enviroment) and get this error:
    "Free Space: Rac2: /tmp"
    Cause: Could not determine mount point for location specified.
    Action: Ensure location specified is available.
    Expected value: n/a
    Actual value: n/a
    I have checked the free space using the command:
    [root@Rac2 /]# df -k /tmp
    Output:
    Filesystem     1k-blocks     used     Available     Use%     Mounted on
    /dev/sda1     30470144     7826952     21070432     28%     /
    As you see above, the free space is enough, but could not determine mount point for /tmp.
    Do any folk understand how to determine the mount point for directory /tmp ?
    Thanks.

    I have just checked "/home/oracle/.bash_profile". But in my computer, there is no "oracle" under /home directory.Is this your first time Linux and Oracle installation? I had a brief look at your referenced link. The reason why you do not find a "oracle" user is because the instructions use "ora11g" instead, which, btw, is not standard. The directories of your installation and your installation source can be somewhat different from known standards and you will have to adjust it to your system.
    My best guess is that you have either missed something in the instructions or you need to ask the author of the blog what is wrong. The chance to find someone here who has experience with these custom instructions is probably unlikely.
    I suggest you try to locate the cluster verification tool, which should be in the bin directory of your grid installation. Alternatively you might want to check the RAC, ASM & Clusterware Installation forum: RAC, ASM & Clusterware Installation

  • How to determine the field size

    I am going to make a multiplatform application that hopefully
    will run on linux and windows 2000.If the os is 2000, then I will use
    vb.net/aspx else I'll use java servlets. I make the connection
    to the web server ( through HTTP) not directly to database server.
    So, the resultset will be stored in the String object. The columns
    will be separated by delimeter. Our problem is how to determine
    the size and type of the fields of mssql,oracle and postgres database
    so that we can include it in the String object.
    Ex.
    String sResultSet=new String();
    ResultSet rs=statement.executeQuery(sSQL);
    while(rs.next()){
    sResultset=sResultSet + rs.getString(field1) + "||" + rs.getString(field2) + "||";
    vertical bars acts as delimeter
    supposedly this is the code:
    sResultset=sResultSet + rs.getString(field1) +"_" + rs.getFieldType() + "_"+
    rs.getFieldSize() + "||" + rs.getString(field2) +"_" + rs.getFieldType() + "_"+
    rs.getFieldSize() + "||";
    supposedly this is the code if rs.getFieldType() and rs.getFieldSize() methods are existing
    Anyone can give me an idea how to get the field type and field size of the database?
    thanks in advance

    Yes, but I dont know how to do it.
    Can you give me an example of using it.
    Thanks in advance

  • How to determine the cost center

    Dear experts:
    Could you give me some suggestions about how to determine the cost center depending on the different
    storage location when we use the t-cdoe MI07
    Thanks in advance.
    Rong

    Hello experts!!!
    how have you resolved this issue???
    I have the same situation, and i dont know how to manage this.
    Thank you very much in advance.
    Best regards,
    M. Cecilia Vacatello.

  • How to determine the type of the jobject... similar to instanceof

    hi,
    I would like to know how to determine the jobject reference of an instance is of which class.
    this is something similar to instanceof we use in java.
    is there any thing like 'instanceof' in JNI. if there how to use it?
    i got this as objective question for which answers were(i do not remember exactly)
    1.instanceof
    2.assignedto
    i could nt het much help in googling.
    thanks in advance

    Hi
    The JNI provides a native version to the java instanceof operator, this function takes two arguments
    an object refrence and a class refrence and reports JNI_TRUE.
    jclass myclass = env->FindClass("your class name");
    if(env->IsInstanceOf(obj,myclass) == JNI_TRUE)
    // obj is of type myclass
    }Regards
    pradish

  • How to determine the solution's ID in absl?

    Hello Community,
    I have a simple question yet I fear there is no simple answer (possibly no answer at all).
    The question is:
    Does any body know ways how to determine the ID (e.g. Y123ABCDY_) of the solution the code is running in?
    My use case is the following:
    We have a solution template which will be deployed in different customer tenant.
    Thus, each deployment will have a different solution ID.
    Now, somewhere in code, we generat PDFs using the OutputManagementUtilities.GetPDF reuse library.
    This method requires the form template code of the pdf to be generated as a parameter.
    However, this PDF form template code is composed of the solution ID and a fixed suffix.
    Thus, currently I need to modify the absl code in each customer installation to manually modify the form template code prefix to the solutions solution ID.
    Therefore I'd like to construct the form template code in absl but for this I need a way to determine the solution's ID.
    Any ideas?
    Best regards,
    Ludger

    Hi Fernando.
    After reading your post I initially thought "what is the ObjectTypeCode" supposed to do any good to determine the solution ID"?
    Using the Object Type code of a custom bo is indeed a way to solve this problem.
    With a little additional code I can extract the relevant solution ID part from there.
    Thanks for the hint, that was really useful.
    Best reegards,
    Ludger

Maybe you are looking for

  • How to solve Installation Failed Indesign on windows 8

    How I can Instal Indesign. I've tried it. I just want to try this software for the first time. firstly I extract the split file of ofline Indesign installer. Then, I open the setup.exe file, so I followed the instruction, when I enter for step to Pre

  • HT204380 no facetime in iphone 4s...how can i get it

    I bought an Iphone 4s and there is no facetime app, neither I can see it in general settings or in contacts? how to get it.

  • Call a pl/sql function froma jsp

    I need to call an pl/sql function which basically returns true or false depending on the count. based on the return value I have to alert a message. how can i call the pl/sql fucntion in a jsp? thanks for ur help.

  • A cappella recording in Garage Band

    I am recording individual vocal tracks to produce learning tracks for a cappella arrangements.  I've done a cappella recording in a studio before (don't know what program was being used), and we used a pitch track to listen to while recording our ind

  • Exception in thread "main" java.lang.NoClassDefFoundError: continue (wrong

    class Continue { public static void main(String[] args) int i=0; while(i>5) continue; System.out.println("Count is: " + i); i++; when i run this program get an error i.e., Exception in thread "main" java.lang.NoClassDefFoundError: continue (wrong nam