At 03:12 PM 6/27/00 -0300, you wrote:
>As i needed some practice in emacs-lisp:
>here is the sample code needed to respect the java bean spec in the get-set
>method
>wizard :)
>
>(defcustom jde-gen-get-set-var-template
> '(
> "'n>"
> "(P \"Variable type: \" type) \" \""
> "(P \"Variable name: \" name) \";\" 'n> 'n>"
> "\"/**\" 'n>"
> "\"* Get the value of \" (s name) \".\" 'n>"
> "\"* @return value of \" (s name) \".\" 'n>"
> "\"*/\" 'n>"
> "\"public \" (s type)"
> "(if (string= \"boolean\" (jde-gen-lookup-named 'type) ) "
> "\" is\" "
> "\" get\" ) "
> "(jde-gen-init-cap (jde-gen-lookup-named 'name))"
> "\"() {return \" (s name) \";}\" 'n> 'n>"
> "\"/**\" 'n>"
> "\"* Set the value of \" (s name) \".\" 'n>"
> "\"* @param v Value to assign to \" (s name) \".\" 'n>"
> "\"*/\" 'n>"
> "\"public void set\" (jde-gen-init-cap (jde-gen-lookup-named 'name))"
> "\"(\" (s type) \" v) {this.\" (s name) \" = v;}\" 'n>"
> )
> "*Template for creating a get/set method pair.
>Setting this variable defines a template instantiation
>command `jde-gen-get-set', as a side-effect."
> :group 'jde-gen
> :type '(repeat string)
> :set '(lambda (sym val)
> (defalias 'jde-gen-get-set
> (tempo-define-template
> "java-get-set-pair"
> (jde-gen-read-template val)
> nil
> "Insert variable get-set method pair."))
> (set-default sym val)))
>
>
>Excuse me if this code may look dirty , it's my first one.
>
>Wouldn't it be a good idea to place here the K&R bracket style in option as
>in the
>other wizards?
Yes, it would be great to do that. Perhaps you could add the style for
additional practice!
>
>Steff
> (really proud of this small thing that took me 4 hours ;) )
>
You should be. You've joined the elite team of JDE contributers.
Thanks,
Paul