DevFaqMultipleProgrammaticEdits

(Difference between revisions)
(Created page with '__NOTOC__ ===I want to make some programmatic changes to the edited file. How can I do it so one Undo undoes it all?=== Create a <tt>Runnable</tt> that will do all of the code g…')
Line 1: Line 1:
 +
__NOTOC__
__NOTOC__
__NOTOC__
===I want to make some programmatic changes to the edited file. How can I do it so one Undo undoes it all?===
===I want to make some programmatic changes to the edited file. How can I do it so one Undo undoes it all?===

Revision as of 09:45, 5 November 2009


I want to make some programmatic changes to the edited file. How can I do it so one Undo undoes it all?

Create a Runnable that will do all of the code generation/munging you want to do. Pass it to org.openide.text.NbDocument.runAtomic(doc, runnable). Or BaseDocument.runAtomic() can be used (the Document in the editor should be an instance of BaseDocument - it will be for Java files and most other things).

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo