Modified / Changed file [message #277050] |
Fri, 03 December 2004 09:21  |
Eclipse User |
|
|
|
Hi
I have a requirement which is as follows:
1. Create a Java project "Hello World" using Eclipse standard wizards.
2. Add a file using Eclipse standard New-> File operation to this project
"Hello World".
3. Whenever I modify this file, the user should know that he has changed
this file.
What is the best mechanism to do this?
Warm Regards
Bala
|
|
|
|
Re: Modified / Changed file [message #277181 is a reply to message #277054] |
Mon, 06 December 2004 09:32  |
Eclipse User |
|
|
|
The first thing you will need is a label decorator. A description of how
to do this is in the Platform developers guide that shipw with Eclipse
(just search for "decorator") and I believe there is also an article on
the Eclipse site. Once you have a decorator (the lightweight decorator
is probably the best to use), you will need some mechanism to determine
if a file is dirty. The sequence of interactions would go something like
this.
1) You would listen to resource deltas from the resources plugin.
2) If a file you were interested in changed, you would signal that the
resource needed a label change.
3) The decorator manager would run in the background and ask your
decorator to decorate the resource.
4) Your decorator would determine what state to show (dirty or not).
For steps 2 and 4, you would need some mechanism to detemrine if a file
was dirty. For CVS, a file is dirty if the timestamp of the file differs
from the timestamp of the file recieved from the server. The Decorator
documentation will have more details about each step.
Michael
Balasubramaniyan K wrote:
>
> 3. Whenever I modify this file, the user should know that he has changed
> this file.
> was not clear.
>
> 3.Whenever the user modifies this file, the user should know that he
> has changed this file (using label decorator")
>
>
> Balasubramaniyan K wrote:
>
>> Hi
>
>
>> I have a requirement which is as follows:
>
>
>> 1. Create a Java project "Hello World" using Eclipse standard wizards.
>> 2. Add a file using Eclipse standard New-> File operation to this
>> project "Hello World".
>> 3. Whenever I modify this file, the user should know that he has
>> changed this file.
>
>
>> What is the best mechanism to do this?
>
>
>
>
>> Warm Regards
>> Bala
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04015 seconds