This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Using in 051111 on Mustang b60: org.netbeans.jackpot [1.1.7 051112] org.netbeans.modules.jackpot/1 [1.1.7 051112 @BUILD_NUMBER_SUBST@] org.netbeans.modules.jackpot.rules [1.1.4 051112] [Note unsubstituted token in second module! Delete OIDE-M-I-V from your manifest.mf...] 1. Jackpot | Command Manager 2. Select Transformers | Remove Unnecessary Casts 3. Open in Editor 4. Try to type anything -> error in status bar: "org/netbeans/modules/jackpot/resources/RemoveUnneededCasts.rules cannot be locked because it is read-only" Is this intentionally r/o? Seems like it should be editable, at least if you offer the option to open it in the editor... or if not, should be copiable thru Command Manager to something that is editable.
Right, Tim Boudreau wanted to be able to view the built-in rule files, which are jar resources and thus read-only. Should I instead copy the rule file resources during module installation, so they are editable? Copying sounds like a nice option -- is a right-click menu action sufficient, or do you think a button is necessary?
The customary way to do this kind of thing (used e.g. for templates) is to declare the standard rules as files in some part of your XML layer, and always access them via Repository.default.defaultFileSystem (for both reading and writing). Any edits will be stored in the corresponding location in your user directory. If you wipe out part or all of your user directory, the corresponding edits will be reverted as a result. Upgrades to the Jackpot module will change effectively change only those rule files which have not been edited.
Okay, I'll add them to the Repository. Currently I have "JackpotCommand" instances in a services folder, which are simple beans with command name and the name of the command (rule or class file) to execute. Do you think I should still keep these beans, or replace them with the actual command files?
Well it's up to you, but I might suggest just having something like <folder name="Jackpot"> <folder n="Transformers"> <!-- editable, .rules file present in JAR next to layer --> <file n="RemoveUnneededCasts.rules" url="RemoveUnneededCasts.rules"/> <!-- not editable, impl in code --> <file n="o-n-m-jackpot-SpecialTransformer.instance"/> </> </>
Built-in rule files are now stored as recommended, and so are editable.