>>>>> "Eric" == Eric D Friedman <[EMAIL PROTECTED]> writes:
Eric> Has anyone coded up something for interfaces that does the
Eric> same thing as jde-gen-class-buffer and jde-gen-class ?
Not sure whether I managed to send this first time...
Or the second...apologies if I sent this three times!
;;;Support for additional templates for JDE
(defcustom jde-gen-interface-buffer-template
(list
"(funcall jde-gen-boilerplate-function) 'n"
"\"/**\" 'n"
"\" * \""
"(file-name-nondirectory buffer-file-name) 'n"
"\" *\" 'n"
"\" *\" 'n"
"\" * Created: \" (current-time-string) 'n"
"\" *\" 'n"
"\" * @author \" (user-full-name) 'n"
"\" * @version\" 'n"
"\" */\" 'n>"
"'n>"
"\"public interface \""
"(file-name-sans-extension (file-name-nondirectory buffer-file-name))"
"\" \" (jde-gen-get-super-interface)"
(if jde-gen-k&r
"\" {\" 'n"
"'n")
(if jde-gen-k&r
""
"\"{\"> 'n>")
"'n>"
"\"}\">"
"\"// \""
"(file-name-sans-extension (file-name-nondirectory buffer-file-name))"
"'n>")
"*Template for new Java interface.
Setting this variable defines a template instantiation
command `jde-gen-interface', as a side-effect."
:group 'jde-gen
:type '(repeat string)
:set '(lambda (sym val)
(defalias 'jde-gen-interface
(tempo-define-template "java-interface-buffer-template"
(jde-gen-read-template val)
nil
"Insert a generic Java interface buffer skeleton."))
(set-default sym val)))
;;;###autoload
(defun jde-gen-interface-buffer (file)
"Create a new Java buffer containing a class of the same name.
This command inserts the class template generated by `jde-gen-interface'.
It then moves the point to the location to the constructor."
(interactive "F")
(find-file file)
(jde-gen-interface)
(beginning-of-buffer)
(search-forward "{"))
(defun jde-gen-get-super-interface ()
(let ((super-class (read-from-minibuffer "extends: ")))
(if (not (string= super-class ""))
(concat "extends " super-class "\n" )
"")))
(provide 'jde-templates)