Adding undo action to DefaultTreeModel

Is it possible to add undo/ redo actions to a DefaultTreeModel using some inbuilt java class (like java.swing.undo) ?
Please note that, by undo action I mean to undo an addition / deletion / linking of tree nodes.
If yes, is it possible for someone to provide a [SSCCE   |http://mindprod.com/jgloss/sscce.html] or some hints ...

make use of ActionMap and ImageMap:
//the action
Action theAction = new AbstractAction("New") {
  public void actionPerformed(ActionEvent e) {
    //do action
//accelerator for action
theAction.putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke("control N"));
//input map and action map from table
InputMap im = table.getInputMap(JTable.WHEN_FOCUSED);
ActionMap am = table.getActionMap();
am.put("New", theAction);
im.put((KeyStroke)theAction.getValue(Action.ACCELERATOR_KEY), "New");

Similar Messages

  • Photoshop Help | Adding conditional actions | CC, CS6

    This question was posted in response to the following article: http://helpx.adobe.com/photoshop/using/conditional-actions-creative-cloud.html

    David Mac Do
    Conditional actions are not a big deal. In reality they are a one line script built into the fly-out menu and the feature only support a limited number of conditions. To phrase the script in english is a simple one liner
    If Document (condition pulldown list) selected is true Play true action in set(selected) else  Play false action in set (selected). Actions do not need to be select for both true and false. One selection may do what is needed.
    All three supported Photoshop supported scripting languages have support for an "if" statement.
    A javascript was posted years ago "Siva's Photoshop Conditional Action.jsx" do a serach.
    Actions can use scripts and scripts can do actions
    example
    if (activeDocument.height > activeDocument.width) doAction("Rotate", "MyActionSet");  // rotate portraits
    Crafting Actions PackageUPDATED Aug 10, 2014 Added Conditional Action steps to Action Palette Tips.
    Contains
    Action Actions Palette Tips.txt
    Action Creation Guidelines.txt
    Action Dealing with Image Size.txt
    Action Enhanced via Scripted Photoshop Functions.txt
    CraftedActions.atn Sample Action set includes an example Watermarking action
    Sample Actions.txt Photoshop CraftedActions set saved as a text file.
    More then a dozen Scripts for use in actions
    Example
    Download

  • I dont have any Undo actions in Indesign CC2014. Why??

    I dont have any Undo actions in Indesign CC2014. Why??

    Try restoring your InDesign preferences:
    Trash, Replace, Reset, or Restore the application Preferences

  • Adding Photoshop Actions from Complete Digital Photogprahy

    I downloaded the Photoshop CS2 Action Set from Complete Digital Photography and the new actions do not show up in Automator. The installer adds the actions to the user library folder, and I believe an attempt at importing them through the Automator import menu has added them to the root library folder. The process should add Photoshop CS2 as a valid application but it does not show up in the list. I erroneously tried to add a folder in Automator named PS CS2, and I dragged a .action file from my library into that folder. Now all the .action files in both my user and root library files have a folder icon instead of the familiar Automator Action icon.
    I think the actions imported when I ran the installer. Any idea why I wouldn't be able to see them? Also, how do I get the .action files to show the proper Automator action icon?
    Thanks...

    The only idea that comes to mind is that you don't have Photoshop CS2 installed. You need the application installed for the actions to work since the actions use the application. So, without the application, the actions will not show up.
    I mentioned that because you didn't explicitly state you had the app, but also because that's typically the reason.
    As for undoing what you did to change the icon, I'd suggest undoing what you did, i.e. reversing what you did. So, remove that folder that you made wherever it was, and anything else you did. You should also consider logging out and back in after that, or restarting, whichever is easier.
    Installing actions with Automator shouldn't move them to the root folder. Also, any actions I've installed work just fine from my own Library folder in my account.
    Another thing to consider is actions can be made specifically to the version of the associated application. So, the actions might not be allowed to work with other versions of the app, depending on how the developer of the actions made them. It doesn't have to be that way, but it could be that way. Something to consider if you do indeed have Photoshop CS2.

  • Is there any way to undo the "Use this Mailbox for" action besides the undo action

    My Gmail account in Mac mail was confusing me so I set the Gmail folders to be used for certain things (i.e. Drafts, Sent, Junk, Trash), but now I'd like to set it back. I can't use undo because it was a while ago. How should I go about doing this?

    This is the action that I'm talking about. I set certain Gmail folders to be used for these 4 options. I would like to release those folders from their respective duties.

  • Adding custom action to Tabbed User Form

    I am trying to view and delete user tasks (such as deferred task) from a user view (tabbed user form). I am able to list the tasks in a separate tab, however, I would like to be able to delete the task using a manual action. I added a button, however, the clicking on the button refreshes the page, and does not get into the Update User workflow.
    Wanted to check with the forum members if anyone has added any custom action via the TabbedUserForm where the button (or something) will submit the form for change of user view to the Update User workflow.
    Or, if someone has a simpler way - manual action to cancel/delete a deferred task for a user.
    Thanks in advance for any insight.
    Indrajit
    Edited by: indrajitg on Sep 14, 2007 12:43 PM

    It seems I was initially too focused on the VCS API itself, as I was under the impression that the context menu would be exposed through a manager (similar to the Editor API). But it turns out that the view API provides very nice access to the relevant bits and I was able to achieve the desired result by simple listening to view activation and access the context menu from there. It's not ideal as I have to deal with view ids directly, but it works - good enough.

  • Got error prompt while adding an action to a task in WLPI

    Hi All,
    I'm using WLPI2.0 with Weblogic server 6.0 SP2. Every time I want to add a new
    action to a workflow task in the studio, the error dialog shown in the attachment
    file always prompts. However, I can still add the action to the task after I click
    "OK" at the dialog. Is there anyone who knows the problem and the workaround?
    Thanks,
    Fred
    [wlpi_err.gif]

    Fred
    It appears that you have not created the repository tables. Please go to
    the repository directory and run the createdb for your database of choice.
    Tony
    "Fred" <[email protected]> wrote in message
    news:3b7a2a09$[email protected]..
    >
    Hi All,
    I'm using WLPI2.0 with Weblogic server 6.0 SP2. Every time I want to add anew
    action to a workflow task in the studio, the error dialog shown in theattachment
    file always prompts. However, I can still add the action to the task afterI click
    "OK" at the dialog. Is there anyone who knows the problem and theworkaround?
    >
    Thanks,
    Fred

  • Adding soap action in http header

    Hi ,
    Can any tell me how configure proxy to add SoapAction in http header of outgoing message from ESB.
    Thanks

    This can be done using the Transport Headers action in the proxy service's message flow. Simply select the SOAPAction HTTP header and choose whether you want to either copy the value from the inbound request or set it to a new value.
    Read more on how to use the action [url http://edocs.bea.com/alsb/docs26/consolehelp/proxyactions.html#wp1274176]here and read my [url http://dev2dev.bea.com/blog/ctomkins/archive/2007/12/sending_an_email_from_aqualogi_1.html]blog post which shows how to set a different header but demonstrates the principle.

  • Can't go to next slide after adding advanced action to answer and other

    Hi,
    I'm creating a quizz and there are some problems I can't
    solve.
    I have a flash project with login page, where user should
    fill name, company and e-mail. To this e-mail I have to send the
    results of the quizz. After you correctly fill the gaps and click
    OK, my flash aplication starts within the Adobe Captive 4 project
    (swf file). And now problems:
    1. In my captivate project: I have a question, 3 answers, 3
    possible attemps and one correct answer. If user answer wrong,
    there is a grey hightlight box, which should apears over my chosen
    wrong answer and stay there to mark already chosen answer and there
    is also a text animation "Sorry, your answer is not correct." under
    the quizz (on the same slide), which appears instead of error
    message. No problem, it works, I made a script for it, which is
    joined to every wrong answer (in Edit Question > (Answers)
    Advanced > Execute Advanced Action). But the problem is with
    correct answer (it shows text animation "Congratulations!" and
    green hightlight box). If I specify the event on correct answer and
    then submit the right answer, it shows the hightlight box, the text
    animation, but it doesn't continue to next slide! It stucks despite
    of the
    settings Edit Question > Options > (If correct answer)
    Action: Go to next slide). If I add new statement to my
    script, which is "Go to next slide" and then click on the right
    answer, it immediately jump to next page and doesn't show the
    hightlight box and the text animation. How can I wait until the
    duration of the animation ends and after that go to next slide?
    Script for the advanced action on my correct answer is:
    -> show rightHighlightBox
    -> show congratulationsText
    2. I need another pass fail option, for example - I have 30
    questions - 3 answers, one correct, 3 attemps. User submits wrong
    answer, but then he choose the right one, but he choose the wrong
    one at first ---> 0 points. It's e-learning and I need to allow
    users to correct them.
    3. How can I export the value of correctAnswers to my flash?
    Is it possible?
    Thank you very much for reply!

    Hi,
    You need to add a "Continue" statement at the end of your
    script otherwise you will have to click on Skip to go to next
    slide.
    And all the Quzzing information can be accessed from Flash
    using the Quizn variables.
    thanks
    ravi

  • Adding page actions by javascript

    Hi,
    I know that acrobat holds the option to add "open/close page event", it can be done manually, like in this guide: http://acrobatusers.com/tutorials/print/entering-page-actions
    but i want something else, i want to know if there is a JavaScript command that adds a script to a page event, something like:
    this.addScipt(page=2,
                        event=onClose,
                        "app.alert("Page 2 was closed")"
    Thanks.

    Here's a link to the online Acrobat JavaScript documentation: http://help.adobe.com/livedocs/acrobat_sdk/11/Acrobat11_HTMLHelp/wwhelp/wwhimpl/js/html/ww help.htm?href=JavaScript_Secti…

  • Customizing: Adding an action to the Navigation panel

    Hello,
    A customer has asked me to add an action based on a webdynpro component to the Navigation panel.
    He provided me with the component name, the package and the url.
    I already figured out that this has to be done in SPRO > SAP xApp Resource and Portfolio Management (SAP xRPM) > Global Customizing > Process and Service Settings > Define Navigation, but i have no clue how to add this action based on the information i have.
    Could anybody give me a hint or a link to some good documentation about this topic.
    Any help will be apreciated
    Regards,
    Magnus

    make use of ActionMap and ImageMap:
    //the action
    Action theAction = new AbstractAction("New") {
      public void actionPerformed(ActionEvent e) {
        //do action
    //accelerator for action
    theAction.putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke("control N"));
    //input map and action map from table
    InputMap im = table.getInputMap(JTable.WHEN_FOCUSED);
    ActionMap am = table.getActionMap();
    am.put("New", theAction);
    im.put((KeyStroke)theAction.getValue(Action.ACCELERATOR_KEY), "New");

  • Adding Undo-Redo buttons to toolbar?

    Is it possible to add Undo and Redo buttons to the toolbar?  Seems to me like this would be an obvious capability.
    Thanks!

    Well, that would be a Feature Request, and this is a volunteer staffed troubleshooting forum, from time to time Adobe Employees do check in.
    So this would be the proper venue for that request: Photoshop Family Customer Community
    The second part you may not like. Photoshop CS6 is no longer being updated for anything other than Adobe Camera Raw, so even if that feature passed muster, CS6 would not get it.
    Best thing you can do is assign a pair of keyboard shortcuts. F11/F12 for example. That would under Edit > Keyboard Shortcuts.

  • Suddenly I can't undoing actions or restore a project (with changes) in fcpx.

    Hi guys, I don't understand what the **** is wrong with fcpx.  Suddenly, I can not make undoing. So simple.
    Don't you think in our client's changes over video projects or something?
    It's so necessary to make 1000000 versions of a same project to avoid risks?
    Frustrated.
    So.  I don't find a way to revert a project

    ahuvay
    What video card/graphics card does your computer use? If NVIDIA GeForce, then that is within 99.999% certainty your issue here.
    There is a known serious issue specifically with Premiere Elements 10 on a computer that uses a NVIDIA GeForce video card/graphics card.
    The answer has been to roll back the driver version to about May 2013. This specific issue has not been reported for Premiere Elements 11, 12, or 13/NVIDIA GeForce.
    Please refer to Announcement on this at the top of this forum. Also, see
    ATR Premiere Elements Troubleshooting: PE10: NVIDIA Video Card Driver Roll Back
    If your computer is not Windows 8 or 8.1 64 bit, then you should be able to find the older driver at
    NVIDIA Driver Downloads - Advanced Search
    If your computer is Windows 8 or 8.1 64 bit, the fix is not going to be possible since the available NVIDIA GeForce
    driver versions do not go back far enough.
    So, before all else, please determine if this issue applies to you and then we can decide what next if it does not.
    If any questions or need clarification on the above, please do not hesitate to ask.
    Thank you.
    ATR

  • Adobe synce doesn't save added brushes, actions.

    Just finished a complete recovery of windows 8.1 and decided to see if synce worked. the only thing it recovered was my workspace. Brushes and actions were ignored even though I told it to back them up. Luckily I had the foresight to copy the preset folder to a backup disk

    bump, I realize my post is long, but the main issue is that on subsequent calls to this method, the only line that isn't working is the "Save"  method call. For some reason, it seems that Acrobat is maintaining a lock on the file, preventing a save. So that when I call "Save", the result value is "false" rather than "true", and the save never occurs.
    The only solution I can think of is to never save to an existing file. I'd have to come up with a way to delete the current file and then save a file of the same filename in its place, but I haven't implemented this yet and can foresee their being issues with being unable to delete the file if it is being locked. Is this the intended functionality of "Save"? How long would I have to wait for Acrobat to release its lock on the file? Is there a way to cause the file to be unlocked (or saved over) programatically?

  • Make current value default - Undo action

    Hi,
    A simple question - when selecting with the right mouse button a control and pressing "Data Operations/Make Current Value default" how I can undo this operation? Imagine I set some control default value to something and after some time I changed my mind and I want to return the control to its initial value (as it comes when you place the control from the pallete -  "Set to factory value").  I was not able to figure out how to do this. Cntr - Z is not an option since it works only in the close vicinity of the operation (you can't Cntr-Z this operation after 2-3 hours of intensive work over the VI). 
    For example I set numeric control default value to 22, after some time I want to return it to initial state (in this particular case the "factory value" is 0). Well, I can reinitialize the value to 0 but it's different from setting it to "factory" settings.
    Thank you

    I disagree with the idea that the default value is not a valuable tool.
    One example is let's say you have a subVI that had a hardcoded constant, but in new applications, this value is to be fed in from the outside - i.e., the constant is to become a control connected to the connector pane.  This subVI is in a common library so it needs to maintain compatibility with older applications.
    So you right-click on the constant to make it a control with the default value already set to the original constant value, connect it to the connector pane and set the connector to anything but required.  Now the new software has a connector to hook up to while, even though the old code will have to be recompiled, it won't break because, even though there is nothing wired to the control, the default value works just fine.
    I can think lots of other things, but that is among the most useful thing I've done with default values.
    [edit] Maybe I took things a little out of context? [/edit]
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

Maybe you are looking for

  • I bought a new computer and want to move (not sync) everything to my new system - bookmarks, add-ons, etc. How do I do this? I've done it before, but I can't find it anymore

    I've done this before, but now I can't even find an export function. I am on version 9.0.1 on Windows 7. Has this capability been eliminated? I don't want to sync, as I won't be using the old computer any more, and I don't want all of my information

  • How to find out what year model my Mac Mini

    I got a "message" dialog on screen from Apple telling me OSX Mavericks is available for free. The system requirements say my Mac Mini needs to be an "early 2009 or newer" model. I got my Mini at the Apple store in town in 2010, but for all I remember

  • Itunes freeze-up!!!!

    Somebody out there please help!! Here's what happened; After purchasing an album from the itunes store, i was burning a disc of this material and at the end of the burn, it posted a message saying that the disc was 'finishing' and this went on for 30

  • File associations images

    Why does windows photo viewer insist on stealing file associations for image files? No matter how hard i try and set Office Picture manager from office with .png and .tiff. Windows decides that it wants to make photo viewer the default image applicat

  • PDK for Java download

    Hi I am not able to find PDK for Java to download from downloads section. Can anyone help me out with the link? Thanks and regards, Ramesh.