Jump to: navigation, search

PTP/photran/code templates

< PTP‎ | photran

Overview

Code templates allow the user to begin typing a construct and then use content assist to "fill in" the rest of the construct.  This will be particularly useful for Photran, since Fortran is a verbose language: every "if" is accompanied by "then" and "end if," every "module" by "end module," etc.

Bug 315666 has been opened for this contribution.

Links

Kurt Hendle provided the following:

The following 6 links should be a really good foundation on how to enable everything and actually make templates to go along with the Photran editors.

how to actually make it possible to add templates:
http://eclipse.dzone.com/articles/how-enable-template-feature-cu

making effective templates(same website as above):
http://eclipse.dzone.com/news/effective-eclipse-custom-templ

how to make a template:
http://www.java-tips.org/other-api-tips/eclipse/how-to-add-your-own-code-template-in-eclipse.html

IBM tutorial on using templates (requires creating an account):
https://www6.software.ibm.com/developerworks/education/os-eclipse-code-templates/index.html

Eclipse reference on adding templates to a custom editor:
http://help.eclipse.org/help33/ntopic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ui/editors/text/templates/package-summary.html

Good example on enabling templates in a custom editor:
http://is00hcw.spaces.live.com/blog/cns!30EBEBD8BCD440DC!490.entry