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.
Summary: | Provide an option for formatting a file newly created from template | ||
---|---|---|---|
Product: | platform | Reporter: | Tomasz Slota <tslota> |
Component: | Text | Assignee: | issues@editor <issues> |
Status: | NEW --- | ||
Severity: | blocker | CC: | jlahoda, jtulach, mkrauskopf, tslota |
Priority: | P4 | ||
Version: | 5.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Bug Depends on: | 97622 | ||
Bug Blocks: | 55509 |
Description
Tomasz Slota
2006-11-08 18:33:54 UTC
After integration of issue 13250 the process shall be more or less automatic. The description is at http://openide.netbeans.org/tutorial/reviews/opinions_13250.html and says that your template shall be annotated with a templating engine to use: <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/> and then the IndentEngine.find(mimeTypeOfYourFile) will be used to format your own file. Of course only if there is some useful IndentEngine registered for your mime type. I am reassigning to editor as that is imho the place that shall provide good enough IndentEngines for generic mime types. Well, I generally agree that editor should provide a fallback IndentEngine, which could be used when there is no better one provided by other modules. I believe that 'Simple Indentation Engine' is such an implementation. If there are any problems or suggestions for how SimpleIndentEngine works, please, file defects. Also if there are any problems with modules provided IndentEngines, please, file defects for an appropriate module. Otherwise, from editor's point of view this issue is done and can be closed. Please, reopen it, if I am missing something. Procedure described by Jarda is not working (JSP file is parsed by the freemarker engine, but not formatted). It is because IndentEngine.find("text/x-jsp") returns SimpleFormattingEngine instead of JspFormattingEngine, which is available, but further in the list. IndentEngine.find() should prefer other implentations to SimpleFormattingEngine. See also issue #97622 So maybe our freemarker bridge should be using the workaround described by mmetelka in issue 97622? Reassigning to new module owner mslama. |