How To Provide More Informative Undo Presentation Names for Document Edits

Hello,
Hopefully, I can state this clearly enough where people will know what I'm talking about.
I'm working on an app that makes use of JTextArea to provide display and editing capabilities for text files. I've registered an UndoableEditListener with the Document underlying the JTextArea, so that I can provide undo/redo capability for all the various edits.
Here's my problem, the edits sent to my listener are of the type AbstractDocument.DefaultDocumentEvent, and so they provide very little information about exactly what sort of event has taken place. IIRC, everything (cut, paste, typing, etc.) shows up as an insert or a removal. I'd like to be able to provide a better presentation name (e.g, "Undo Cut", "Undo Paste", etc.) for my undoable events than is provided by the AbstractDocument.DefaultDocumentEvent , but I'm not sure how exactly to go about this. Do I create my own edits that operate directly on the Document, and avoid the AbstractDocument.DefaultDocumentEvent altogether, or is there some easier way? Anyone have any experience trying to do this? Thanks.
- sixtyten

That's exactly the problem: the information we need isn't available, and there's no way to reconstruct it, so let's have the client tell us what we need to know. What I'm proposing is an UndoManager that requires its client to notify it when an action is about to be performed, and again when the action is finished. Upon receiving the first notification, it creates a CompoundEdit with the presentation name that was provided in the notification. After that, any edits that come in via the undoableEditHappened() method get added to the CompoundEdit instead of directly to the undo stack. When it receives the second notification, the UndoManager ends the CompoundEdit and adds it to the undo stack. Here's a very simplistic example: public class SuperUndoManager extends UndoManager
  // basically just a CompoundEdit with a 'name' attribute.
  private NamedCompoundEdit currentEdit;
  public void beginCompoundEdit(String name)
    currentEdit = new NamedCompoundEdit(name);
  public void endCompoundEdit()
    currentEdit.end();
    addEdit(currentEdit);
  public void undoableEditHappened(UndoableEditEvent evt)
    currentEdit.addEdit(evt.getEdit());
} The biggest problem is getting the clients (i.e., JTextComponents and the Actions defined in their EditorKits) to call these methods without having to do something drastic like replacing them all. I think it can be done (he said with a barely noticeable quaver in his voice).

Similar Messages

  • I am using the Order Analysis Toolkit and want to get more information about the compensation for "Reference Signal Processing", which is scarce in the manuals, the website and the examples installed with the toolkit.

    I am using the Order Analysis Toolkit and want to get more information about the compensation for "Reference Signal Processing", which is scarce in the manuals, the website and the examples installed with the toolkit.
    In particular, I am analyzing the example "Even Angle Reference Signal Processing (Digital Tacho, DAQmx).vi", whose documentation I am reproducing in the following:
    <B>DESCRIPTIONS</B>:
    This VI demonstrates how to extract even angle reference signals and remove the slow-roll errors. It uses DAQmx VIs to acquire sound or vibration signals and a digital tachometer signal. This VI includes a two-step process: acquire data at low rotational speed to extract even angle reference; use the even angle reference to remove the errors in the vibration signal acquired at normal operation.
    <B>INSTRUCTIONS</B>:
    1. Run the VI.
    2. On the <B>DAQ Configurations</B> tab, specify the <B>sample rate</B>, <B>samples per channel</B>, device and channel configurations, and tachometer channel information.
    <B>NOTE</B>: You need to use DSA PXI-447x/PXI-446x and PXI TIO device in a PXI chassis to run this example. The DSA device must be in slot 2 of the PXI chassis.
    3. Switch to <B>Extract Even Angle Reference</B> tab. Specify the <B>number of samples to acquire</B> and the <B># of revs in reference</B> which determines the number of samples in even angle reference. Click <B>Start</B> to take a one-shot data acquisition of the vibration and tachometer signals. After the acquisition, you can see the extracted even angle references in <B>Even Angle Reference</B>.
    4. Switch to the <B>Remove Slow-roll Errors</B> tab. Click <B>Start</B> to acquire data continuously and view the compensate results. Click <B>Stop</B> in this tab to stop the acquisition.
    <B>ORDER ANALYSIS VIs USED IN THIS EXAMPLE</B>:
    1. SVL Scale Voltage to EU.vi
    2. OAT Digital Tacho Process.vi
    3. OAT Get Even Angle Reference.vi
    4. OAT Convert to Even Angle Signal.vi
    5. OAT Compensate Even Angle Signal.vi
    My question is: How is the synchronization produced at the time of the compensation ? How is it possible to eliminate the errors in a synchronized fashion with respect to the surface of the shaft bearing in mind that I am acquired data at a low rotation speed in order to get the "even angle reference" and then I use it to remove the errors in the vibration signal acquired at normal operation. In this application both operations are made in different acquisitions, therefore the reference of the correction signal is lost. Is it simply compensated without synchronizing ?
    Our application is based on FPGA and we need to clarity those aspects before implementing the procedure.
    Solved!
    Go to Solution.

    Hi CracKatoA.
    Take a look at the link bellow:
    http://forums.ni.com/ni/board/message?board.id=170&message.id=255126&requireLogin=False
    Regards,
    Filipe Silva

  • How do I change the .php file name for a page of my site?

    how do I change the .php file name for a page of my site? The only link to the page is the nav. button link for it in the global nav. The reason I need to change the file name is we want the breadcrumbing name to change and the breadcrumbing is linked to the file name.

    The reason I need to change the file name is we want the breadcrumbing name to change and the breadcrumbing is linked to the file name.
    I don't understand this reason. How would changing the file extension solve your breadcrumb issue? Why don't you explain the issue in more detail.

  • How to display more than one column with for each

    Hi guys,
    how to display more than one column with for each like below?
    for each
    Item1
    Item2
    Item3
    Item4
    Item5
    Item6
    Item7
    Item8
    Item9
    Item10
    End for each
    for each          
    Item1     Item2     Item3
    Item4     Item5     Item6
    Item7     Item8     Item9
    Item10          
    End for each

    Take a look at this to see if the solution provided would work for you: https://blogs.oracle.com/xmlpublisher/entry/multi_column_row_woes
    Won't you have more than 10 records in your data file ? If you are going to have only 10 items then you may be able to use position() function to limit it to 3 each..
    Take a look at this: https://blogs.oracle.com/xmlpublisher/entry/turning_rows_into_columns
    Thanks,
    Bipuser

  • How do I change the artist/owner name for my podcast?

    How do I change the artist/owner name for my podcast?
    For eg, a podcast has 'The Ricky Gervais Podcast' and underneath 'Ricky Gervais'. I can't see where to change the latter. I can't change that through our podcast host Libsyn.
    Is it done through iTunes?
    Jack

    You can't change anything in iTunes: all infomation is carried in the feed, in this case in the 'itunes:author' tag. there will certainly be somewhere to enter it but if you can't find it you will need to contacts Libsyn; or quite possible Rob Walch, who works for them and posts here, will see this question.

  • How to have more months and years appear for selection in the archives for blog posts?

    Hello,
    How to have more months and years appear for selection in the archives for blog posts?  It just shows past 3 months in the year 2014, but we have many blog posts in years 2013, 2012 and 2011 and further back.  I am using the OOB SharePoint blog
    feature.
    Paul

    Hi,
    Thanks for the reply; it doesn't add anything as RSA6 was one of the options I listed and this was my fall back option if there was no other special treatment for the COPA datasources.
    I have found out why this, and other fields, are not available in KEB0.  The program uses a Function called KERA_COPA_METADATA_INTERFACE within which there is a section that selects the COPA fields:
    ***** 1. RULES (choice/class)
    * set rules for fixed fields
      PERFORM COPA_SET_RULES_FIXED_FIELDS USING I_ACCTCOST
                                          CHANGING E_T_RULES[].
    When you look at this code section there is a hard coded list of fields to exclude:
      MRULE 'MANDT     ' NEVER FORGET_IT NEVER FORGET_IT.
      MRULE 'PAOBJNR   ' NEVER FORGET_IT NEVER FORGET_IT.
      MRULE 'PASUBNR   ' NEVER FORGET_IT NEVER FORGET_IT.
      MRULE 'PAPAOBJNR ' NEVER FORGET_IT NEVER FORGET_IT.
      MRULE 'PAPASUBNR ' NEVER FORGET_IT NEVER FORGET_IT.
      MRULE 'HRKFT     ' NEVER FORGET_IT NEVER FORGET_IT.
      MRULE 'HZDAT     ' NEVER FORGET_IT NEVER FORGET_IT.
      MRULE 'USNAM     ' NEVER FORGET_IT NEVER FORGET_IT.
      MRULE 'RKESTATU  ' NEVER FORGET_IT NEVER FORGET_IT.
      MRULE 'TIMESTMP  ' NEVER FORGET_IT NEVER FORGET_IT.
      MRULE 'PERDE     ' NEVER FORGET_IT NEVER FORGET_IT.
      MRULE 'PERIO     ' OBLIGATORY CHAR_CE3 OBLIGATORY CHAR_CE3.
      MRULE 'COPA_AWTYP' NEVER FORGET_IT NEVER FORGET_IT.
      MRULE 'COPA_AWORG' NEVER FORGET_IT NEVER FORGET_IT.
    As this is a standard delivered SAP function I do not recommend that you change this code as you will invalid your SAP support and upgrade paths.
    Thanks
    Neil

  • How can I authorize my new HP computer for digital editions?

    How can I authorize my new HP computer for digital editions/

    First download Adobe Digital Editions from: Download | Adobe Digital Editions.
    After that follow these steps:
    If you aren't prompted to authorize ADE the first time you open it, you can go to Help > Authorize Computer to start the process manually.
    If you have an Adobe ID, enter it along with your password.
    If you do not have an Adobe ID, click Create an Adobe ID to make one on Adobe's website.
    Once you're done, return to the "Computer Authorization" dialog box and enter your Adobe ID and password.
    Click Authorize. Your computer is now authorized with your Adobe ID.
    IMPORTANT: If you choose to authorize your computer without an ID, you will still be able to view eBooks on your computer. However, you will not be able to transfer or download those titles to other devices.
    Source: OverDrive | How to authorize Adobe Digital Editions ...
    Hope it helps.

  • Iplanet  web server 7 -how to get more information when a certificate is untrusted ?

    Hi
    When a client tries to access to iplanet 7.0.15, we only get a line in the errors log with a simple error., for instance SSL_ERROR_UNKOWN_CA_ALERT...
    We would like to know if it is possible to configure iplanet to get more information about this request..
    iPLANET is receiving requests from a lot of clients and sometime it is difficult to identify the source of a error without more information..
    We would like have similar information that access log shows when certificate is valid
    We get the same information with log-level = info or finest..
    Thanks
    Uge

    Hi Uge,
    Setting the iPlanet Web Server log level to 'finest' will give you more information, but it is very verbose, and you still might not get the information you are looking for. You might want to try 'fine' or 'finer' first to see if either of those gives you the information you  need.
    With regards to the above error, SSL_ERROR_UNKOWN_CA_ALERT, this means that the client presented a certificate in the SSL handshake that was signed by a CA that the Web Server doesn't have in it's certificate database. In order to ensure the Web Server is kept upto date with the latest set of public CA certificates, I would recommend you upgrade to the latest version.
    If you know that the certificates the clients are using are from an internal CA, you need to ensure the Root CA Certificate from that internal CA is installed in the Web Servers certificate database as a trusted certificate.
    regards
    Tracey

  • How to get more information regarding a service call

    So are all of your services working now?

    Here are the gory details. This is how I described the problem when I called for service: 'I am a u-verse customer. I have TV, internet and phone. There was an outage of all services for 15 hours. Voice and TV returned. But not my broadband internet connection.'  Tech arrived. Used his i-pad and says internet is 'working'. I tell him my computer, tablet, etc etc will not connect. He says he is writing down that internet works. My devices not his concern he says. Well OK I say forget my devices but I want ALL the TV channels that are part of my u-verse package to work before you leave. He says 'but TV is working'. I say no, this is not true unless ALL the channels I pay for are working, --please check this channel (interactive Country Deep--530 in my channel lineup). He says oh that channel is probably not part of your package. Excuse me I say. I pay over $200 a month for my services and U300 is my package and it most certainly includes the Country Deep channel which is not working (it is spinning, spinning) and which I do watch. I know from the user perspective that there is a difference between the Country Deep channel which loads data before it plays and the 'normal' channels. He looks at me like I have two heads. However I felt quite certain that if he took care of the problem with that interactive channel then I would be able to get all my devices to work. He threatened to depart because I was not listening to him. However he was not listening to me either. He would not 'own' that there was any u-verse problem. Since this did not make sense to me and I had already invested at least eight hours of my life attempting to get help I was frustrated and I will certainly confess to not 'listening' to him very well. Unfortunately I then had to leave and go to work. He left no information about what was done and no information with the person I left in charge but it took over 4 hours and apparently a number phone calls to other people. And I do know he swapped out my DVR because I lost all recordings but that is all I know. I tried to look online at the workorder but no further information was available.

  • How to add more fields at level task for importing to MsProject

    Hi everyone,
    We would like to have the same number of fields either for importing as exporting; or at least, the fields that we need.
    The problem is when we are configurating the fields for exporting from cProjects to MsProject, we found 81 available fields and then we don't find the same amount for importing (34). So, in some cases we don't find fields which were configurated for exporting and it is no posible to upload the information back because the field is no available for importing.
    Does anyone knows how to add more fields for importing at the cProjects side?
    Thanks a lot,
    CAMILO URIBE

    Some fields can not be migrated because of MsProject designe. The above is the reason why cProjects' customizing does not offer the
    mapping of the same nuember of fields.

  • How to have more than 8 release code for a release strategy

    Hi,
    In standard only 8 level of release is possible for a release strategy.  Our client requires more than 8 levels i.e., more than 8 release codes for a release strategy.  How can we achieve this?
    Pls provide your views/ideas.
    Reards,

    Hello,
    In case you require more than 8 levels in release strategy , write to SAP, maybe they could give a fitting reply.
    By the way , 8 levels of release should be more than enough . Try to incorporate the client business process
    within this.
    Regards
    Anis

  • How-To Find the R/3 Table Name for a BW Data Source

    Hi there,
      Please advice how can I find the respective table name in R/3 for a particular BW DataSource ?
      P/S : I would like a technical how-to instead of referring the table names at HELP.SAP.COM
      For instance, for my Standard Business Content Info Cube 0CCA_C03(CO-OM-CCA: Statistical Key Figures) which extracts from BW Data Source: 0CO_OM_CCA_4
      My question is, how can I find out which specific tables in SAP R/3 is this Data Source pulling the data from ?

    Hi Dinesh,
       Data Source: 0CO_OM_CCA_4
       1) In my R/3, I ran SE16 : Table -> ROOSOURCE
       2) OLTPSOURCE -> 0CO_OM_CCA_4
       3) EXMETHOD = F1
         (Hence, I assume the Extraction Method is a Function Module)
       4) So, Function Module = BWOM_RS_GET_CTRSTA
       5) Run SE37 in R/3
          How do I find out the specific tables in this Function Module ?
          Would you please list them for me, so I can further refer to the individual tables ?

  • Clicking on "View more information about this update" for 31.5.0 does nothing

    I got a pop-up today that Thunderbird 31.5.0 is available. I clicked on "View more information about this update" because that usually takes me to the release notes and I prefer to read about updates and download and install them myself, rather than have the system do it for me. (I do this so I can save previous versions in case I run into a problem with the latest and want to go back.) But when I clicked on "View more information about this update" nothing happened. It didn't switch over to the browser nor start loading the release notes.

    About 5-10 minutes after I had clicked on "View more information about this update" a few times (and had manually gone to https://www.mozilla.org/en-US/thunderbird/31.5.0/releasenotes/ and downloaded and was in the process of installing the new release), my browser opened up three tabs on that page. I guess it was just a very delayed response.

  • How to have more than one free good for a material ?

    Hi everyone,
    we have this requirement from the user where he wants give more than one free good for a material.
    As far as i know we can configure only one free good for a material in standard SAP.
    if have any idea about how to achieve this please guide me how to configure the same in SAP.
    thank you in advance

    Hi
    Check my two links where I have explained this.
    Free goods using Sale order BOM methodology
    Different business scenarios and Sales BOM techniques for header and item level stock and prices
    Thank$

  • How do i change the HTML file names for existing index

    Hi,
    How do i change my existing HTML file names for indexes. The Html file name is disabled when we click on properties.
    Ex:   Index Keywork : Architecture
            Old HTML Page/URL =: Architecture.htm
    I want to change  Old HTML Page/URL =: Architecture.htm to architecture_new.htm
    Please find the screenshot attached.

    That's because you are looking at the Properties and that is not how you create index entries.
    Highlight the Index keyword ("Paste" in this example). It shows below what is already linked. If you delete that, the keyword will be displayed in bold to show no keyword is attached. You can add further keywords by dragging them from the Topic List.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

Maybe you are looking for