Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » forcing Resource to be dirty
forcing Resource to be dirty [message #207918] Tue, 09 March 2004 09:06 Go to next message
Eclipse UserFriend
Originally posted by: kneipe.gmx.de

Hi there,

when adding/changing/deleting a Breakpoint I have to make sure the
underlying resource is saved.

My idea was to somehow set the "dirty" flag of the resource. I thought of
different approaches:
1) try to set the dirty flag directly
2) try to fire a ResourceChangeEvent
3) call the resource.touch() method

I already tried 3), which is not working :(

Concerning 1) and 2) I couldn't find out how to do this.

Any suggestions?

Thanx,
Tobias
Re: forcing Resource to be dirty [message #208075 is a reply to message #207918] Tue, 09 March 2004 12:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dj_houghton.nospam.ca.ibm.com

Can you explain your problem a little more?

What do you mean by "ensuring the resource is saved"?

The contents of a resource (IFile) are stored independantly of its
markers (breakpoints).

Thanks.


Tobias Kneiphoff wrote:
> Hi there,
>
> when adding/changing/deleting a Breakpoint I have to make sure the
> underlying resource is saved.
>
> My idea was to somehow set the "dirty" flag of the resource. I thought of
> different approaches:
> 1) try to set the dirty flag directly
> 2) try to fire a ResourceChangeEvent
> 3) call the resource.touch() method
>
> I already tried 3), which is not working :(
>
> Concerning 1) and 2) I couldn't find out how to do this.
>
> Any suggestions?
>
> Thanx,
> Tobias
>
Re: forcing Resource to be dirty [message #208514 is a reply to message #208075] Wed, 10 March 2004 01:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kneipe.gmx.de

Ok, let me see how to get this straight.

I have to save specific markers of a resource in a separated file. I do
this in the save-Method of the resource.
So I have to find a way to somehow "inform" the platform that the resource
has changed when a new marker of this specific type is added (or changed
or deleted).
Speaking in GUI terms: every time I add a specific marker I want the
save-Button to become active and have the small star beside it...

Thanx again,
Tobias

DJ Houghton wrote:

> Can you explain your problem a little more?

> What do you mean by "ensuring the resource is saved"?

> The contents of a resource (IFile) are stored independantly of its
> markers (breakpoints).

> Thanks.


> Tobias Kneiphoff wrote:
> > Hi there,
> >
> > when adding/changing/deleting a Breakpoint I have to make sure the
> > underlying resource is saved.
> >
> > My idea was to somehow set the "dirty" flag of the resource. I thought of
> > different approaches:
> > 1) try to set the dirty flag directly
> > 2) try to fire a ResourceChangeEvent
> > 3) call the resource.touch() method
> >
> > I already tried 3), which is not working :(
> >
> > Concerning 1) and 2) I couldn't find out how to do this.
> >
> > Any suggestions?
> >
> > Thanx,
> > Tobias
> >
Re: forcing Resource to be dirty [message #208788 is a reply to message #208514] Wed, 10 March 2004 08:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dj_houghton.nospam.ca.ibm.com

When you call IResource.createMarker the marker is created, the platform
stores it in a file in the metadata area (eventually when changes are
flushed), and the platform notifies listeners that this resource has
changed.

So if you register a resource change listener and listen for marker
changes on that resource you will be able to pick up the notification.

That's the Core answer but its sounding more like a question about
creating editors for your resource and displaying markers so I leave you
in the capable hands of someone with UI experience....

Tobias Kneiphoff wrote:
> Ok, let me see how to get this straight.
>
> I have to save specific markers of a resource in a separated file. I do
> this in the save-Method of the resource.
> So I have to find a way to somehow "inform" the platform that the resource
> has changed when a new marker of this specific type is added (or changed
> or deleted).
> Speaking in GUI terms: every time I add a specific marker I want the
> save-Button to become active and have the small star beside it...
>
> Thanx again,
> Tobias
>
> DJ Houghton wrote:
>
>
>>Can you explain your problem a little more?
>
>
>>What do you mean by "ensuring the resource is saved"?
>
>
>>The contents of a resource (IFile) are stored independantly of its
>>markers (breakpoints).
>
>
>>Thanks.
>
>
>
>>Tobias Kneiphoff wrote:
>>
>>>Hi there,
>>>
>>>when adding/changing/deleting a Breakpoint I have to make sure the
>>>underlying resource is saved.
>>>
>>>My idea was to somehow set the "dirty" flag of the resource. I thought of
>>>different approaches:
>>>1) try to set the dirty flag directly
>>>2) try to fire a ResourceChangeEvent
>>>3) call the resource.touch() method
>>>
>>>I already tried 3), which is not working :(
>>>
>>>Concerning 1) and 2) I couldn't find out how to do this.
>>>
>>>Any suggestions?
>>>
>>>Thanx,
>>>Tobias
>>>
>
>
>
Re: forcing Resource to be dirty [message #209078 is a reply to message #208514] Wed, 10 March 2004 13:46 Go to previous message
Eclipse UserFriend
Originally posted by: John_Arthorne.oti.com_

Markers do not have a dirty/save/clean lifecycle. They do not need to
be saved after they are created. Just create the markers and don't mark
the editor as dirty.
--

Tobias Kneiphoff wrote:
> Ok, let me see how to get this straight.
>
> I have to save specific markers of a resource in a separated file. I do
> this in the save-Method of the resource.
> So I have to find a way to somehow "inform" the platform that the resource
> has changed when a new marker of this specific type is added (or changed
> or deleted).
> Speaking in GUI terms: every time I add a specific marker I want the
> save-Button to become active and have the small star beside it...
Previous Topic:Get notification everytime a view is 'opened'
Next Topic:How to add library from plug-in
Goto Forum:
  


Current Time: Wed Jun 18 19:12:35 EDT 2025

Powered by FUDForum. Page generated in 0.26722 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top