increment version number on file/save [message #723150] |
Wed, 07 September 2011 20:29  |
Eclipse User |
|
|
|
I'm trying to keep track of how many times a file is edited by adding code to the existing Java editor so that when the java source file is written, my field is incremented. For example, if I have the following in my program <<private static int editNumber=37; // *autoIncrement*>> when the file is written via Ctrl+S (File/Save) the number 37 would change to 38 just before the file is written. It would also be nice to be able to put a date/time stamp in the file, based on the time of the last file/save operation. <<private static String editTime = "2011.08.07 16:26:47" // *autoTimeStamp*>> Format of date is not important. Does anyone know of any existing plugins or write-hooks that would allow me to do this easily?
|
|
|
Re: increment version number on file/save [message #724957 is a reply to message #723150] |
Tue, 13 September 2011 14:48  |
Eclipse User |
|
|
|
On 07.09.2011 22:29, Edward G Prentice wrote:
> I'm trying to keep track of how many times a file is edited by adding
> code to the existing Java editor so that when the java source file is
> written, my field is incremented. For example, if I have the following
> in my program <<private static int editNumber=37; // *autoIncrement*>>
> when the file is written via Ctrl+S (File/Save) the number 37 would
> change to 38 just before the file is written. It would also be nice
> to be able to put a date/time stamp in the file, based on the time of
> the last file/save operation. <<private static String editTime =
> "2011.08.07 16:26:47" // *autoTimeStamp*>> Format of date is not
> important. Does anyone know of any existing plugins or write-hooks
> that would allow me to do this easily?
>
>
Take a look at the 'org.eclipse.jdt.ui.cleanUps' extension point.
Dani
|
|
|
Powered by
FUDForum. Page generated in 0.02434 seconds