classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] Patch: FYI: add file template


From: Tom Tromey
Subject: [cp-patches] Patch: FYI: add file template
Date: 17 Sep 2005 22:13:47 -0600
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

I'm checking this in.

With this patch, Eclipse will now generate a comment at the top of a
new file that more or less conforms to the Classpath style -- all you
have to do is write a brief description.

The patch is a bit weird in that I ended up putting the comment in 2
places.  I'm not sure why the 'filecomment' setting doesn't work.  I
left it, though, on the theory that someday it will work and we can
more easily just disable the other place this is set.

Tom


Index: ChangeLog
from  Tom Tromey  <address@hidden>

        * .settings/org.eclipse.jdt.ui.prefs: Add file template.

Index: .settings/org.eclipse.jdt.ui.prefs
===================================================================
RCS file: /cvsroot/classpath/classpath/.settings/org.eclipse.jdt.ui.prefs,v
retrieving revision 1.3
diff -u -r1.3 org.eclipse.jdt.ui.prefs
--- .settings/org.eclipse.jdt.ui.prefs  8 Sep 2005 15:45:55 -0000       1.3
+++ .settings/org.eclipse.jdt.ui.prefs  18 Sep 2005 04:16:22 -0000
@@ -1,5 +1,5 @@
-#Wed Sep 07 21:05:21 MDT 2005
+#Sat Sep 17 22:04:29 MDT 2005
 eclipse.preferences.version=1
 formatter_settings_version=8
 internal.default.compliance=user
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" 
encoding\="UTF-8"?>\n<templates/>
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" 
encoding\="UTF-8"?>\n<templates><template 
id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment" 
description\="Comment for getter method" context\="gettercomment_context" 
enabled\="true" deleted\="false" autoinsert\="true">/**\n * @return Returns the 
${bare_field_name}.\n */</template><template 
id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment" 
description\="Comment for setter method" context\="settercomment_context" 
enabled\="true" deleted\="false" autoinsert\="true">/**\n * @param ${param} The 
${bare_field_name} to set.\n */</template><template 
id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" 
name\="constructorcomment" description\="Comment for created constructors" 
context\="constructorcomment_context" enabled\="true" deleted\="false" 
autoinsert\="true">/**\n * ${tags}\n */</template><template 
id\="org.eclipse.jdt.ui.text.codetemplates.fil
 ecomment" name\="filecomment" description\="Comment for created Java files" 
context\="filecomment_context" enabled\="true" deleted\="false" 
autoinsert\="false">/* ${file_name} -- FIXME describe the file briefly\n   
Copyright (C) ${year} Free Software Foundation, Inc.\n\nThis file is part of 
GNU Classpath.\n\nGNU Classpath is free software; you can redistribute it 
and/or modify\nit under the terms of the GNU General Public License as 
published by\nthe Free Software Foundation; either version 2, or (at your 
option)\nany later version.\n\nGNU Classpath is distributed in the hope that it 
will be useful, but\nWITHOUT ANY WARRANTY; without even the implied warranty 
of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\nGeneral 
Public License for more details.\n\nYou should have received a copy of the GNU 
General Public License\nalong with GNU Classpath; see the file COPYING.  If 
not, write to the\nFree Software Foundation, Inc., 51 Franklin Street, Fifth 
Floor, Bos
 ton, MA\n02110-1301 USA.\n\nLinking this library statically or dynamically 
with other modules is\nmaking a combined work based on this library.  Thus, the 
terms and\nconditions of the GNU General Public License cover the 
whole\ncombination.\n\nAs a special exception, the copyright holders of this 
library give you\npermission to link this library with independent modules to 
produce an\nexecutable, regardless of the license terms of these 
independent\nmodules, and to copy and distribute the resulting executable 
under\nterms of your choice, provided that you also meet, for each 
linked\nindependent module, the terms and conditions of the license of 
that\nmodule.  An independent module is a module which is not derived from\nor 
based on this library.  If you modify this library, you may extend\nthis 
exception to your version of the library, but you are not\nobligated to do so.  
If you do not wish to do so, delete this\nexception statement from your 
version. */\n\n\n</template><tem
 plate id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" 
name\="typecomment" description\="Comment for created types" 
context\="typecomment_context" enabled\="true" deleted\="false" 
autoinsert\="true">/**\n * @author ${user}\n *\n * ${tags}\n 
*/</template><template id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" 
name\="fieldcomment" description\="Comment for fields" 
context\="fieldcomment_context" enabled\="true" deleted\="false" 
autoinsert\="true">/**\n * \n */</template><template 
id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment" 
description\="Comment for non-overriding methods" 
context\="methodcomment_context" enabled\="true" deleted\="false" 
autoinsert\="true">/**\n * ${tags}\n */</template><template 
id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" 
name\="overridecomment" description\="Comment for overriding methods" 
context\="overridecomment_context" enabled\="true" deleted\="false" 
autoinsert\="true">/* (non-Javadoc
 )\n * ${see_to_overridden}\n */</template><template 
id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype" 
description\="Newly created files" context\="newtype_context" enabled\="true" 
deleted\="false" autoinsert\="false">/* ${file_name} -- FIXME\: briefly 
describe file purpose\n   Copyright (C) ${year} Free Software Foundation, 
Inc.\n\nThis file is part of GNU Classpath.\n\nGNU Classpath is free software; 
you can redistribute it and/or modify\nit under the terms of the GNU General 
Public License as published by\nthe Free Software Foundation; either version 2, 
or (at your option)\nany later version.\n\nGNU Classpath is distributed in the 
hope that it will be useful, but\nWITHOUT ANY WARRANTY; without even the 
implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See 
the GNU\nGeneral Public License for more details.\n\nYou should have received a 
copy of the GNU General Public License\nalong with GNU Classpath; see the file 
COPYING.  If not, w
 rite to the\nFree Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 
Boston, MA\n02110-1301 USA.\n\nLinking this library statically or dynamically 
with other modules is\nmaking a combined work based on this library.  Thus, the 
terms and\nconditions of the GNU General Public License cover the 
whole\ncombination.\n\nAs a special exception, the copyright holders of this 
library give you\npermission to link this library with independent modules to 
produce an\nexecutable, regardless of the license terms of these 
independent\nmodules, and to copy and distribute the resulting executable 
under\nterms of your choice, provided that you also meet, for each 
linked\nindependent module, the terms and conditions of the license of 
that\nmodule.  An independent module is a module which is not derived from\nor 
based on this library.  If you modify this library, you may extend\nthis 
exception to your version of the library, but you are not\nobligated to do so.  
If you do not wish to d
 o so, delete this\nexception statement from your version. 
*/\n\n\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template
 id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock" 
description\="Code in new catch blocks" context\="catchblock_context" 
enabled\="true" deleted\="false" autoinsert\="true">// ${todo} Auto-generated 
catch block\n${exception_var}.printStackTrace();</template><template 
id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody" 
description\="Code in created method stubs" context\="methodbody_context" 
enabled\="true" deleted\="false" autoinsert\="true">// ${todo} Auto-generated 
method stub\n${body_statement}</template><template 
id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" 
name\="constructorbody" description\="Code in created constructor stubs" 
context\="constructorbody_context" enabled\="true" deleted\="false" 
autoinsert\="true">${body_statement}\n// ${todo} Auto-generated construc
 tor stub</template><template 
id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody" 
description\="Code in created getters" context\="getterbody_context" 
enabled\="true" deleted\="false" autoinsert\="true">return 
${field};</template><template 
id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody" 
description\="Code in created setters" context\="setterbody_context" 
enabled\="true" deleted\="false" autoinsert\="true">${field} \= 
${param};</template></templates>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]