DocumentListener #removeUpdate -- Retrieving the removed text

Hi,
I have a DocumentListener registered on a Document. I not only want to know when text is removed, but I want to know what text was removed. It appears to me that the document structure is updated before the listeners are notified (even though sticky positions aren't ...?), meaning the offset/length methods will not work for my needs.
Is this correct? If so, how would one retrieve the removed text?
I don't want to override #insertString(int, String, AttributeSet) nor #remove(int, int) because these apparently aren't called when UndoableEvents from the document are undone/redone. It's been my experience that only DocumentListener methods are called universally (that is, for undo/redo and normal user operations).
Passing the line associated with the offset into DocumentEvent#getChange(Element) gives null. Aside, even if it did return something, what concrete implementation of Element represents a character in the document? Or, what is the lowest level of the hierarchy -- line or character?
Thanks in advance,
Brien

Thanks for the references.
As for casting the event to a CompoundEdit, it is definitely doable, but how would I use the CompundEdit? It's unfortunate that many classes in the java.swing.text package aren't designed to be flexible for different uses. It seems the two members that would be useful, #lastEdit and #edits, are protected.
Even if I could get the UndoableEdit, like GapContent.RemoveUndo, how would I get to the internal String representing the removed text?
I could really use the details on this.
I see two options if I want to pursue this further --
1. Use reflection to access the protected fields (super bad).
2. To get what I want, I could, in the removeUpdate method, temporarily undo the event, check the document, then redo the event. This seems very sloppy, wasteful, and the implementation would have to be very careful with the infinite mutual recursion.
As it stands, I likely won't pursue it. It's not very critical, but it's very disappointing.

Similar Messages

  • Retrieving the Change Texts per Line Item (Purchase Order) - Very urgent

    Hi,
    How do you retrieve the Change Texts per Line Item (Purchase Order).
    Table T166T does not list these values per line item.
    Please help. This is very urgent & important.
    Best Regards,
    John

    if you are lookin out for change of item texts ...
    then use the function module ... READ_TEXT.
    and 2 tables r used ... STXH and TLINE ....
    double click on item data ...
    goto PO TEXT tab ....
    double click on text ...
    from menu ...
    goto header ... u'll get 4 fields that u need to consider ...
    TDID
    TDOBJECT
    TDHEAD
    TDNAME
    ALL THESE U'LL FIND IN  STXH
    ITEM TEXT is stored in TLINE
    Edited by: anjali rana on Mar 5, 2008 4:55 AM

  • How to retrieve the long texts from  purchase Info record (ME13)

    Hi,
    How do I retrieve the long texts data from the tab, Texts of the Purchase Info record(ME13).  I want to retrieve the current long texts data(long text1, long text2 long text3, long text4) for a given purchase info record. These long texts points to the structure BRM06I.
    So, now how do I fetch the data from the structure BRM06I. Is there any function module for the same..
    Thanks.

    Hello,
    Texts are stored in tables STXH & STXL (header and item). You can search these tables by selecting Text object = EINA and Text name = Info Rec #. The text ID's you will see are the ID for various texts maintained.
    Cheers !

  • Problem with retrieve the chinese text from oracle DB

    my running enviroment is
    Linux 6.0+ apache Jserv+java 1.1+oracle 8.05
    my db character set is zhs16cgb231280.
    when i retrieve the chinese text using servlet and forward to client browser. it doesnt display the text property.but if i transfer the data to an Applet. it will be ok.
    my knowledge is oracle using unicode to communicate between db and JDBC.
    So i dont know how to solve my problme.
    Who can help me?
    Thanks Advanced

    Hello,
    What's the charset of your database? Mine is AMERICAN_AMERICA.UTF8
    In this case, I could successfully insert and retrieve the Chinese characters without any encoding parameter in the getString() method. Perhaps you could try it.

  • How to retrieve the item text from VL03 transaction .

    How to retrieve the item text from VL03 transaction .
    The requirement is like this, the item text thus retrieved should be printed in the script under the item.

    Jagadieshwar,
    Use <b>READ_TEXT</b> function module to get the proper item text of Delivery.
    <b>ID</b>: Probably you want 0002 (Item Note), but it depends which text you want Item Note, Material Sales Text ,etc..
    <b>NAME</b>: CONCATENATE Delivery Doc. Number + Delivery Item Number (e.g. 0080001729000010)
    <b>OBJECT</b>: VBBP
    <b>
    LANGUAGE</b>: sy-langu or whatever you want.

  • How to retrieve the header texts for a contract

    HI,
      i think we need to use the FM read_text to get the header texts for a contract but dont know how to use the FM like what all the parameters are passed to that to get the header texts of a contract(va43).
    any help is appreciated with points.
    thanks
    prasad

    Hi,
      Pls refer this code,    
        CALL FUNCTION 'READ_TEXT'
                  EXPORTING
                    client                  = sy-mandt
                    id                      = '0001'
                    language                = sy-langu
                    name                    = v_textid
                    object                  = 'KNMT'
                  IMPORTING
                    header                  = t_header
                  TABLES
                    lines                   = t_lines
                  EXCEPTIONS
                    id                      = 1
                    language                = 2
                    name                    = 3
                    not_found               = 4
                    object                  = 5
                    reference_check         = 6
                    wrong_access_to_archive = 7
                    OTHERS                  = 8.
                IF sy-subrc EQ 0.
                  LOOP AT t_lines.
                    CONCATENATE w_arktx t_lines-tdline INTO w_arktx
                                       SEPARATED BY space.
                  ENDLOOP.
                ENDIF.
                IF w_arktx NE space.
                  MOVE w_arktx+1(1583) TO t_lips-arktx.
                ELSEIF w_arktx EQ space.
                  CLEAR w_text_name.
                  CLEAR v_textid.
                  wa_lips-matnr = t_lips-matnr.
                  wa_lips-vkorg = t_likp-vkorg.
                  wa_lips-vtweg = t_lips-vtweg.
                  w_text_name = wa_lips.
                  CLEAR w_arktx.
    Retrieval of Sales Text
                  CALL FUNCTION 'READ_TEXT'
                    EXPORTING
                      client                  = sy-mandt
                      id                      = '0001'
                      language                = sy-langu
                      name                    = w_text_name
                      object                  = 'MVKE'
                    IMPORTING
                      header                  = t_header
                    TABLES
                      lines                   = t_lines
                    EXCEPTIONS
                      id                      = 1
                      language                = 2
                      name                    = 3
                      not_found               = 4
                      object                  = 5
                      reference_check         = 6
                      wrong_access_to_archive = 7
                      OTHERS                  = 8.
                  IF sy-subrc EQ 0.
                    LOOP AT t_lines.
                      CONCATENATE w_arktx t_lines-tdline INTO w_arktx
                                         SEPARATED BY space.
                    ENDLOOP.
                  ENDIF.
                  IF w_arktx NE space.
                    MOVE w_arktx+1(1583) TO t_lips-arktx.
                  ELSE.
    REgards
    srinivas

  • Enhacement for removing case sensitive of the short text entered in Me21n

    Hi very one ,
    i want  to write a enhancement to remove the case sensitive of the short text entered in me21n transaction code for service Number  .  ie .. whether i enter the text in captain letter or small letters it should fetch  the exact data accordingly to the short text entered ( the respective service number should be retrieved )  , i think there will be some function  module that will remove this case sensitive thing  . plz help me out
    Regards
    Syed Akbar

    Thank you, Kappy, for your quick and helpful reply to my (admittedly) not very quick question!
    It strikes me as odd that Apple would appear to make the use of both lower- and upper-case letters possible in the short user-name, leaving the possibility that upper-case letters might lead to some problems/conflicts down the line. It would be helpful if they'd provide some explanation about this. Anyway, as I said, I'm very far from being an expert in all this, and appreciate that people like yourself on these
    forums are willing to provide helpful feedback.
    Best regards,
    Stephen

  • How can I remove the 'Qty' text from individual product descriptions?

    I didn't know if this was possible or not... I've recently taken the reins of handling an ecommerce site that had been published before I got on board. My boss wants me to remove the 'Qty:' description from some products because the image shown for some products is a misleading description of the actual quantity available (i.e. there is a picture that shows a stack of conveyors parts, and it says 'Qty: 1' to represent one 'stack' of conveyor parts - this confuses customers into thinking there's only one individual conveyor part available however). To avoid any confusion he requested that I remove the 'Qty' text from similar images. I see that you can change the 'In Stock' amount of a particular product underneath the 'Inventory' tab of the 'Products' menu, but I didn't know if it was possible just to remove the quantity description altogether without just typing the quantity in at zero. This is likely a strange question but I didn't know where else to ask! I would appreciate any help or advice Thank you

    Hi ewhelhalu,
    I just figured out a way to do it, but it's a little weird and complex, and I have no idea what the consequences for editing this .plist string might be. I'm thinking it'll be OK, but you never know what might happen when you screw around with Apple's intentions.
    So if you have the Developer Tools on your install of OS X, you can use the Property List Editor to edit the Dock files. (If you don't have this program, you can use a program like [Pacifist|http://www.charlessoft.com> to selectively install stuff from your Leopard disk).
    The file you're interested in is within Macintosh HD > Users > Your Username > Library > Preferences, and it's called com.apple.dock.plist. Open that up with Property List Editor, and open the arrow drop-down next to "Root." The lines you're looking for are "persistent-apps" (the left side of your Dock) and "persistent-others" (the right side). If you open the drop-down arrows, you'll see there are numbers below each. The numbers correspond to your Dock items, from left to right.
    If you click on drop-arrows by the numbers, a sample hierarchy looks like this: 0 > tile-data > file-label. It's the "file-label" string that you want to edit. Just make it ("it" being the name of the icon under the "value" column) blank, save the file, go into Terminal and type "killall Dock" without the quotes, and your Dock icon should appear without a name. You'll have to do this for all of them.
    I should insert the usual caveats here about backing up beforehand and making sure that you have a copy of the .plist file before you start tweaking it so that you can replace it if things go wrong. And perhaps someone with more knowledge of Terminal or third-party apps than I have will come along and suggest a simpler solution. But that's the only one I have.
    Hope that helps!
    —Hazy

  • In keynote - Leather Book theme - is there a way to remove the artwork in the middle of the cover page (between the two text boxes) (the squiggly thing)??

    I am trying to create a poster - in Keynote - transferring it to PDF then to JPEG so I can print it - and while I like the background in this Keynote theme (leather book) I can't seem to remove the artwork that is positioned between the two text boxes. Does anyone know how??? Can it even be done?

    I somehow ended up on creating a new master slide. I can FINALLY access the artwork - it has a box around it of x's - but I can't seem to do anything. Delete doesn't work. Trying to shrink the box doesn't work. I'm not getting a dialog box when I click on it that is specific to the x'ed area. It pertains to the full background page. I'm obviously missing something - the fact that I have never been in Keynote before may have something to do with it! :-)

  • I recently removed an outlook account and now all of my calendar events are missing. The majority of them were added from my iphone 4s. How do I retrieve the events? Backing up with iCloud did not help, as I assumed it would.

    I recently removed an outlook account and now all of my calendar events are missing. The majority of them were added from my iphone 4s. How do I retrieve the events? Backing up with iCloud did not help, as I assumed it would.

    Outlook is a mail client for PC's (and Macs). It is not a type of account. Do you mean an "Exchange Account"?
    If so, then re-add it. The calendar events live on the Exchange Server. The only way to get them back is to re-add the account to the phone. The contents of Exchange and IMAP accounts are not part of the 'backup' as they already exist elsewhere.

  • How to retrieve the 'Where Clause' text?

    Hello all,
    I have created a package to retrieve all the DML's executed against the database for the day, for a particular user. DBMS_LOGMNR package was used to retrieve DMLs. But the DMLs retrieved have their 'WHERE' clause text converted to ROWID's. I need to find out the 'WHERE' clause with the parameters.
    I tried retrieving values from the v$sql views, but that information is cryptic and very volatile.
    Is there a way to retrieve the 'Where' clause? If not, is there a way to retrieve the 'WHERE' clause information using a trigger against the corresponding table.
    I am desparately lookin'for a solution. Hope someone out there can help me out.
    Regards,
    Prabu Raghav.

    Hi Andrew,
    Thanks for the suggestion.
    I am using Oracle 8i not 9i.FGA using DBMS_RLS let's me add policies and retrieve all other information about a user except the SQL statement that's executed by the user.
    I want to retrieve the Current sql statement executed against the table by a particular user and record it.
    Any suggestions?
    Regards,
    Prabu Raghav.

  • The text "Remove" is not appearing in the remove button of Bookmarks.

    Hi,
    The text "Remove" is not appearing in the remove button of Bookmarks. My problem is the same as mentioned in this question.
    https://support.mozilla.org/en-US/questions/1017302
    The solutions suggested on the link don't seem to work. How do I resolve this? For me this problem is persisting everyday.
    Thanks

    You already tested in Firefox's Safe Mode and that did not make any difference?
    Can you associate this problem with any software changes, such as upgrading from Firefox 31 to Firefox 32, or updating an add-on, or Windows, etc.?
    Have you noticed problems with any other dialogs or menus?
    Occasionally a corrupted settings file may cause issues with dialogs. This file also stores toolbar customizations. You can rename the file and customize from scratch.
    Open your current Firefox settings (AKA Firefox profile) folder using either
    * "3-bar" menu button > "?" button > Troubleshooting Information
    * (menu bar) Help > Troubleshooting Information
    * type or paste about:support in the address bar and press Enter
    In the first table on the page, click the "Show Folder" button
    Leaving that window open, switch back to Firefox and Exit, either:
    * "3-bar" menu button > "power" button
    * (menu bar) File > Exit
    Pause while Firefox finishes its cleanup, then rename '''localstore.rdf''' to something like localstore.old
    Start Firefox back up again. Any improvement in the Edit Bookmarks dialog?

  • How to retrieve the text in pa20 (HR-ABAP)

    Hi HR-ABAP experts,
    I Need to retrieve the text stored for a emplyee.below i am giving the full details,
    In Pa20 transaction if we give the perso. no and select the 0008 infotype.then click on overview tab.then in overview screen if  i select any record i.e any period of dates and clicks on display.in display window menu bar
    <b>EDIT-> maintain text</b> .
    they are maintaing some text in that.if i click on display text the text was displaying.
    i need to fetch that data in my custom report.
    can anybody helps from where this text can be selected.which ifotype?.
    hope my question is understood .
    Thanks,
    JK.
    Message was edited by:
            janakiram reddy madi reddy

    Hi,
    <ItemType name="uwl.task.webflow.decision.TS91100000" connector="WebFlowConnector" defaultView="DefaultView">
    <ItemTypeCriteria connector="WebFlowConnector" externalType="TS91100000"/>
    <Actions>
      <Action name="accept" groupAction="yes" handler="UserDecisionHandler">
       <Properties>
        <Property name="decisionKey" value="2"/>
        <Property name="UserDecisionNote" value="true"/>
       </Properties>
      </Action>
      <Action name="reject" groupAction="yes" handler="UserDecisionHandler">
       <Properties>
        <Property name="decisionKey" value="1"/>
       </Properties>
      </Action>
    </Actions>
    </ItemType>
    I have implemented the above code and i got the Text Box,  but now the problem is i couldnt retrieve the
    text entered in the Text box.  I checked in the  attachobjects   container element related to the task and the subsequent task but the text is not appearing there.  Can you help me to get the text entered in the text box.
    Thanks & Regards,
    Manikandan.S

  • How to retrieve the Text entered in the Text Box provided in the UWL Inbox

    Hi Experts,
    I have created a workflow with user decision task. for that task in UWL inbox i provided a text box using XML Code, but i couldnt retrieve the Text entered in the text box. I hope the text will automatically upload in the "_Attach_object" container element of the Workflow,  but it couldnt upload in that,  If anyone can help me to solve this issue.
    Thanks & Regards,

    Hi,
    <ItemType name="uwl.task.webflow.decision.TS91100000" connector="WebFlowConnector" defaultView="DefaultView">
    <ItemTypeCriteria connector="WebFlowConnector" externalType="TS91100000"/>
    <Actions>
      <Action name="accept" groupAction="yes" handler="UserDecisionHandler">
       <Properties>
        <Property name="decisionKey" value="2"/>
        <Property name="UserDecisionNote" value="true"/>
       </Properties>
      </Action>
      <Action name="reject" groupAction="yes" handler="UserDecisionHandler">
       <Properties>
        <Property name="decisionKey" value="1"/>
       </Properties>
      </Action>
    </Actions>
    </ItemType>
    I have implemented the above code and i got the Text Box,  but now the problem is i couldnt retrieve the
    text entered in the Text box.  I checked in the  attachobjects   container element related to the task and the subsequent task but the text is not appearing there.  Can you help me to get the text entered in the text box.
    Thanks & Regards,
    Manikandan.S

  • How do I remove drop shadows from the default text in the labels of a Numbers pie chart?

    I set up a pie chart in Numbers and set labels for percentage.  The default text has drop shadowss.  They do print well at the scale needed for the page.  I cannot find out how to remove these shadows for clearer printing.  Can the shadows be removed?

    Nevermind.  Found the answer in nthe side bar under "Re:how can I print the figures (text) in a chart WITHOUT a cast shadow.  I had the Font window set too narrow and it did not show the Text Shadow button in the tool bar.  Unclicking that worked.

Maybe you are looking for

  • Fetching data from a table

    Hi, I have a table and the below query is used to fetch around 3 lakh record. select * from emp where start_date between sysdate and (sysdate -30). It was taking more time(more than 1hr), hence i created index on the start_date column and now could g

  • Why am I having major graphical glitches when running windows 7 on my mid 2010 mac book pro

    I installed windows 7 on my mid 2010 macbook pro 13". It does not seem like I can tie it to any specific update or driver update. Has any one else noticed this. I found switching to the basic theme has stop the start menu and bottom task bar from gli

  • Displaying documents in 'Comments' section of IE on query

    Hi; When opening a query in Internet Explorer there appears buttons at the top of the page.  These buttons are New Analysis, Open, Save As, Information and Comments. When the user clicks on the Comments he can store (upload or add formatted text) doc

  • Recovery of photos after reformatting

    Hi, I had to reformat and reinstall Snow Leopard OS X 10.6.8 after a hard drive problem. Unfortunately I have not backed up my photos and videos as I was using the mac rarely so I thought nothing can go wrong. Now I know better! I would like to know

  • Visual Age 3.5 and Weblogic Intergration Kit (License Expired, please Contact BEA Systems Inc)

    Hi, I started to run the Weblogic Server on my machine yesterday and I suddenly got this error: "License Expired, Please Contact BEA Systems Inc" This is the message I got on the Visual Age Console: "Invalid BEA WLS Integration Kit License. Please ca