How to concatenate two AttributedString

Hi Everyone
The class java.text.AttributedString looks interesting, but I would like to create one not all at once.
I would like for example to create the AttributedString and addAttributes to it, then append some text at the end and add some attributes to this new text and so on, as I'm reading through a file for example...
I searched a lot and could not find a way to append a string to an already existing AttributedString or to concatenate two AttributedString.
I looked at the source and found that there is a constructor AttributedString(AttributedCharacterIterator[] iterators), that would be perfect but the problem is that this constructor is not public (it's "package"). Anyone knows why this constructor is not public or how to do it another way.
thanks
Adam

If I do this, I need to store all the attributes of my text when I read it and then apply them to the text. That's my plan B actually, because I don't want to store the attributes myself somewhere and then transfer them in the AttributedString. I would prefer to store them directly in the AttributedString as I read them.
The other way would be to read the text twice, first to get the text, then to add the attributes, but then I would have to shift the indexes if I removed some tags in the original text.
Anyway, I appreciate your remarks, it makes me think differently on the problem and see new alternatives...

Similar Messages

  • How to concatenate two column in ALV

    dear,
    How to concatenate two ALV columns
    yatendra sharma

    dear
    I have to concatenate 3 fields
    PERFORM fill_fields_of_fieldcatalog
        USING 'IT_FINAL' 'NAME2' ' ' ' ' 'Customer Address' .
      PERFORM fill_fields_of_fieldcatalog
        USING 'IT_FINAL' 'STRAS' ' ' ' ' 'Street' .
      PERFORM fill_fields_of_fieldcatalog
        USING 'IT_FINAL' 'ORT01' ' ' ' ' 'City'.
    how can we join them
    Yatendra

  • How to concatenate two linked lists?

    Can anyone help me with this? I'm stuck. I'm trying to concatenate two linked lists. I've created a method that adds a node to the beginning of a list and a second method to concatenate. My first method works, but not my second...
    First method:
    public static Node insertFirst(Node head, Node node){
              Node newNode = new Node();          // declare and initialize newNode.
              newNode = node;                    // store the new item in the new node.
              newNode.link = head;               // newNode.link points to the head.
              head = newNode;                    // update head to be newNode.
              return head;
         }Here is where I have my problem:
    public static Node mergeTwoLists(Node a, Node b){
              Node heada = a;
              Node headb = b;
              if(heada == null)
                   return headb;                    //if heada is null then returns list headb.
              else if(headb == null)
                   return heada;                    //if headb is null then returns list heada.
              else if(heada == null && headb == null)     //if both lists are null, returns null.
                   return null;
              else if(heada.link == null){     //only one element in heada.
                   headb = insertFirst(b, a);               // inserts the element in heada into headb.
                   return headb;
              }//end else if(heada.link == null).
              else if(headb.link == null){     //only one element in headb.
                   heada = insertFirst(a,b);               // inserts the element in headb into heada.
                   else {
                        mergeTwoLists(heada.link, headb);
                        return heada;
                   }//end else
              return heada;
              }//end mergeTwoLists method.I think in this method I'm only adding the nodes if there is only one node in one of the lists. But if there are more than one element in a list...I'm confused as to how to code the last else statement that contains the recursive call.
    Can someone help?
    Thanks
    aiki985

    Can't you just point the tail of A to the head of B?
    I don't think I'd do this recursivly at all. Use a
    while look to find the last node in A and then link
    it to whatever the first element in B is.
    while(A.next != null){
    A = A.next;
    A.next = B;
    Java that up a bit and check for nulls and it should
    work.o.k. thanks...let me try that. It does seem awkward recursively...
    aiki985

  • How to concatenate two colums into one single column

    I need some ideas to concatenate two different columns into one single column using a set of distinct values.
    For Example,
    Customer Product Number
    xyz A 1
    xyz B 2
    xyz B 1
    AAA C 7
    AAA A 1
    The result should look like this,
    Customer Value
    xyz A1 B2 B1
    AAA C7 A1
    How would I group this into once value ?
    Thanks in advance ...

    Tom's discussion of writing your own aggregate routines
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:2196162600402
    starts off with a link to the 8i alternatives
    "see
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:229614022562
    for 8i methods (not aggregates)"
    Unforutnately, it's a lot more work in 8i.
    Justin

  • How to concatenate two fields CSKS-KOSTL & CSKT-LTXT in BEx Query?

    Hi,
    I have a requirement to concatenate two fields CSKS-KOSTL (Cost Center) and CSKT-LTXT (Cost Center Text) and show them as one field in the BEx query.
    I do not know what to do, so please help me out.
    Thanks in advance.
    Regards
    Harman

    Hi Harman,
    If cost center is a masterdata, it can have its own text..i doubt why do u have 2 different fileds..
    Anyways if its a masterdata object maitaining its own text, then in the query properties under Display tab select Key&Text option this give you both key and text values in the output.
    If its two different fileds then its better to use concatenate in the transformation.
    Regards,
    Geetha

  • How to Concatenate two rows of same table

    Hi Friends
    I have table
    No Name Id
    1 Raju 6
    2 Dhanshree 7
    3 Shital 6
    4 Priya 7
    I want the query that should display
    Raju Dhanshree.
    Shital Priya
    That Means whenever 6,7 number come the query should Concatenate The name colume

    1 150 IEEE TRANSA CTIONS ON MICR O W A V E THEOR Y AND TECHNIQ UES, V OL. 50, NO. 1, J ANU AR Y 2002
    Times-Roman 4
    2 A Miniaturized MMIC Analog Phase Shifter Using
    Times-Roman 16
    3 T w o Quarter-W a v e-Length T ransmission Lines
    Times-Roman 16
    4 Hitoshi Hayashi
    Times-Roman 7
    5 , Member , IEEE
    Times-Italic 7
    6 , T adao Nakaga w a
    Times-Roman 7
    7 , Member , IEEE
    Times-Italic 7
    8 , and Katsuhik o Araki
    Times-Roman 7
    9 Abstract—
    Times-BoldItalic 6
    10 This paper describes a miniaturized monolithic-mi-
    Times-Bold 6
    11 cr o w a v e integrated-cir cuit (MMIC) analog phase shifter using tw o
    Times-Bold 6
    12 quarter-wa v e-length transmission lines. A con v entional analog
    Times-Bold 6
    13 phase shifter employs an analog phase-shifter topology using a
    Times-Bold 6
    14 3-dB 90
    Times-Bold 6
    15 branch-line h ybrid r equiring f our quarter-wa v e-length
    Times-Bold 6
    16 transmission lines. Thus, in the f irst stage of our study , w e
    Times-Bold 6
    17 pr esent a new analog phase-shifter topology using only tw o
    Times-Bold 6
    18 quarter-wa v e-length transmission lines. The phase shifter her e
    Times-Bold 6
    19 has only one-half as many transmission lines as a con v entional
    Times-Bold 6
    20 analog phase shifter using a 3-dB 90
    Times-Bold 6
    21 branch-line h ybrid, and the
    Times-Bold 6
    22 cir cuit can be miniaturized to less than one-f ourth as compar ed to
    Times-Bold 6
    23 the con v entional analog phase shifter . Furthermor e, we sho w that
    Times-Bold 6
    24 the operating fr equency range of the phase shifter is v ery wide and
    Times-Bold 6
    25 can obtain lar ge phase v ariation with small capacitance v ariation.
    Times-Bold 6
    26 Next, an experimental
    Times-Bold 6
    27 -band MMIC analog phase shifter is
    Times-Bold 6
    28 pr esented. A phase shift of mor e than 180
    Times-Bold 6
    29 and an insertion loss
    Times-Bold 6
    30 of 3.6
    Times-Bold 6
    31 1.1 dB ar e obtained at the fr equency range fr om 12 to
    Times-Bold 6
    32 14 GHz. The chip size of the experimental MMIC phase shifter is
    Times-Bold 6
    33 less than 3.0 mm
    Times-Bold 6
    34
    How will use on this data

  • How to concatenate two different strings?

    I am facing problem in concatenation of two different strings.Basic behind two strings is that 1st string consist today's date (ddmmyy) and second one is two digit number from a loop (01-99).So that I will come with 8 digit unique number(20100801) every time I hit it.
    Can u please give any reference for this?
    I will be very thankful !!
    With Regards,
    Aman Aggarwal

    ... or you could use StringBuilder...
    or you could use the formatting functionality of java.util.Formatter ...
    You need to be more specific about your problem. Concatenating string is the one of the simplest things one can do in Java. If you really are having a problem with it, you should be clearer about your problem. Post a SSCCE.

  • Concatenate two lines?

    How to concatenate two different variables and display them in two different lines.
    eg: var1 = "Hello, How are you doing?"
    var2 = "I am fine, Thank You"
    If I do concat(var1,var2) the output I am getting is as follows:
    "Hello, How are you doing?I am fine, Thank You"
    But I want the output to be like this in two different lines:
    "Hello, How are you doing?
    I am fine, Thank You"
    Can anyone shed some light on this?
    Thanks in advance...
    This is a post from some one else in this forum, but I kind of need to know the answers to that problem. Thank you all!

    Hi
    Something very basic; i dont know if it would work in your case.
    I had a similar requirement. Instead of concatenating two variables, I entered variable1 followed by newline character followed by variable2 and it worked.
    Just give it a try.
    Regards
    Varun

  • How to show two or more PDF in one PDF-Reader / Concatenate PDF-Files

    Hi,
    I want to show two or more PDF files in one PDF reader window or to concatenate two or mor PDF files to one file.
    We use WD4A and ADS.
    Have someone an idea to solve this without an external program?
    Thx in advance
    Jürgen

    We have done this successfully a few times using WDA - it wasn't easy - it took us 2 full weeks to figure it out, so i need to get full points for this one!
    It's going to much easier to do this if you start a brand new WDA. If not, you'll have to re-do all your Context Node navigations within your methods.
    The first thing you need to do is to define your Context properly:
    You need a top level Node defined as 1:1 cardinality (as with all PDF development)
    Next, you need another Container Node 1:n cardinality (this holds the collection of content nodes)
    Finally, you have your PDF Content Node 1:n cardinality - This holds each instance of your PDF form
    In our scenario, we are passed in a list of Project Numbers. We need to generate a PDF sheet for each project in the same PDF session.
    pseudo code - i'm leaving out some of the unnessary details
    Loop through the project number table.
    ADD 1 TO v_cnt.
    * navigate from <TOP> to <PDF_CONTAINER> via lead selection
        lo_nd_pdf_container = lo_nd_top->get_child_node( name = wd_this->wdctx_pdf_container ).
    * This is the Important Part - we check to see if there is an element where index = v_cnt
    * If not, we create one where we can store the new set of data
    * get element via lead selection
        lo_el_pdf_container = lo_nd_pdf_container->get_element( index = v_cnt ).
        IF lo_el_pdf_container IS INITIAL.
          lo_el_pdf_container  = lo_nd_pdf_container->create_element( ).
          lo_nd_pdf_container->bind_element( new_item = lo_el_pdf_container
                                               set_initial_elements = ' '   ).
        ENDIF.
        lo_nd_ideasheet_data =  lo_el_pdf_container->get_child_node( 'IDEASHEET_DATA' ).
        lo_el_ideasheet_data = lo_nd_ideasheet_data->get_element( index = 1 ).
    * fill all the data then bind the structure
    Select * from XXX into lt_XXX
      where project_number = lt_project-project_number.
    * Move Data to appropriate fields/tables
    * Bind the info back to the element
        lo_el_ideasheet_data->set_static_attributes( static_attributes =
                                                  ls_ideasheet_data ).
    Endloop.

  • Concatenate two select query

    Hi ABAPers,
    Can you please tell me how to concatenate this two select qureies.
    select  ebeln knumv from ekko  INTO
    TABLE  tt_knumv
    where ebeln = p_ebeln.
    select ebeln knumv from eslh INTO TABLE
    tt_knumv  FOR ALL ENTRIES IN tt_esll
    where  packno = tt_esll-sub_packno.
    Regards
    Abhinab Mishra

    Hi,
    I dont think inner join is possible in this case since you are selecting the same fields from the two different tables into the single internal table vertically. It can be used to collect the data into the internal table horizontally but that would make no sense in this case. May be you can try something like this
    data: t_temp type table of tt_knumv.
    select ebeln knumv
    from eslh
    INTO TABLE tt_knumv
    FOR ALL ENTRIES IN tt_esll
    where  packno = tt_esll-sub_packno.
    select  ebeln knumv
    from ekko
    INTO TABLE  t_temp
    where ebeln = p_ebeln.
    loop at t_temp.
    move-corresponding t_temp to tt_knumv.
    append tt_knumv.
    endloop.
    Regards,
    Vik

  • How to add two zeros end of field

    how to add two zeros end of field?

    Hi srinu,
    If it's a number field, then just multiply by 100.
    If it's a string, then just use CONCATENATE and add the '00' to your existing string.
    Hope this helps.
    SL

  • Concatenate two fields

    Hi,
      Can anyone let me know how to concatenate the following two fields and use it in the select statement::
    BKPF-AWKEY = MKPF-BELNR + MKPF-MJAHR.
    Please reply at your earliest convenience.
    Thanks,
    Amit.

    hi
    good
    check this example and use accordingly
    DATA: c1(10) TYPE c VALUE  'Sum',
          c2(3)  TYPE c VALUE  'mer',
          c3(5)  TYPE c VALUE  'holi ',
          c4(10) TYPE c VALUE  'day',
          c1 (30) TYPE c,
          sep(3) TYPE c VALUE ' - '.
    CONCATENATE c1 c2 c3 c4 INTO c5.
    WRITE c5.
    CONCATENATE c1 c2 c3 c4 INTO c5 SEPARATED BY sep.
    WRITE / c5.
    The output looks like this:
    Summerholiday
    Sum - mer - holi - day
    In c1 to c5, the trailing blanks are ignored. The separator sep retains them.
    thanks
    mrutyun^

  • Concatenate two infoobject in BeX or Web

    Hi All,
    I have an new request, in which i have characters more than 60 character. Ex: Material which has 80 character.
    So for this i divided them as two infoobject each holding 40 character. Now i would like to know how to concatenate these two chracters either in BeX or in Web report.
    Pls advise.
    Cheers!
    Bhuvana.

    dear Bhuvana,
    please take a look this 'how to hide column' doc,
    using table interface (abap class se24)
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f0aca990-0201-0010-0380-f3aac4127a57
    and search with 'more than 60 char' with 'sdn forum' may lead to some thread discuss this
    Concatinating text char
    60 Character Limitation - Dirk Herzog please help
    Bypassing 60 char limit in an InfoObject
    How to show character length > 60 ,If we split and distribute..??
    hope this helps.

  • Newbie question - how to concatenate in EQL?

    Sorry for such a simple question but the answer is eluding me in the documentation and samples. How do you concatenate two attributes in EQL?
    I have looked at https://wikis.oracle.com/display/endecainformationdiscovery/Endeca+Query+Language+%28EQL%29 but there is not much info there. Is there EQL documentation somewhere online?
    Thank you

    Currently, string concatenation is not supported in EQL. You should perform this concatenation in the ETL by creating a new attribute to house the concatenated value. (e.g. YEAR_MONTH_FIELD = YYYY-MM )

  • How to concatenate many rows to be one row?

    Hi,
    How can I do if I concatenate two rows or many rows become one row in the same column with different values (CHAR or VARCHAR2). It's possible to do that?
    Ex:
    Column A
    ABCD
    EFGH
    to become
    Column A
    ABCDEFGH....
    Anybody can help me, please...
    I will very appreciated.
    Thanks,
    Leny

    I'm not sure if SQL Plus supports this feature. But programmatically it is possible if you use oracle procedure. Also if you're using some front end application (like VB, ASP etc) where you need the concatenated result then you can easily concatenate all rows under a loop on Recordset.

Maybe you are looking for

  • How many computers can I run CS3 on - activation/deactivation?

    Hi All, We purchased the CS3 Design Premium for our office here - I use it the majority of the time and its installed on one other computer that is barely used but still needed (only when I'm not working on the same program) We now need to install it

  • Smartform main window with grid lines...

    Hi Gurus, I am printing the line items in the main window using grid lines of pattern. This main window can print 10 lines only. Here my requirement is i need to get the empty grid lines till the window ends after finishing the printing of all line i

  • Using multiple accounts in Family Sharing

    Can iTunes family sharing members purchase from their own accounts?

  • 9KE0 "Substitution not found"

    Hi, I would like to move a balance from one profit center to another profit center within PCA.  So, I am using transaction 9KE0.  In this transaction, I gave the sender profit center, receiver profit center and same GL account for both of them.  Now

  • I don't have MS Outlook. how do I sync

    Hello, I received a bb 8830 as a gift and installed the 4.2.2 software that it came with. I thought outlook would be a part of the included software. I can't sync my calendar, contact book, memos or tasks. I don't have MS outlook on my computer. I wo