Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Notify resource change
Notify resource change [message #289551] Mon, 08 August 2005 08:23 Go to next message
Eclipse UserFriend
Originally posted by: vducloux.cosmosbay-vectis.com

Hi, I'm developping a visual editor for my specific type of files (xml-like)

My Eclipse editor represents an xml file as a table. What I would like
is that as soon as an user edits a value of a table, the eclipse button
"Save" shoul appear.

I would like notifying eclipse that the related resource changed and
that it should propose the save action.

anyone knows how to implement this ?

thanks in advance,

Victor
Re: Notify resource change [message #289572 is a reply to message #289551] Mon, 08 August 2005 13:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sunil_kamath.nohotspammail.com

"Ducloux Victor" <vducloux@cosmosbay-vectis.com> wrote in message
news:dd74qn$p6v$1@news.eclipse.org...
> Hi, I'm developping a visual editor for my specific type of files
> (xml-like)
>
> My Eclipse editor represents an xml file as a table. What I would like is
> that as soon as an user edits a value of a table, the eclipse button
> "Save" shoul appear.
>
> I would like notifying eclipse that the related resource changed and that
> it should propose the save action.
>
> anyone knows how to implement this ?
>
> thanks in advance,
>
First:
firePropertyChange(IEditorPart.PROP_DIRTY);

Next, your editor isDirty() method should return true.

---
Sunil
Re: Notify resource change [message #289588 is a reply to message #289572] Mon, 08 August 2005 14:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vducloux.cosmosbay-vectis.com

Hi, thanks so much for the help Sunil !!

Just one thing , how can I do a firePropertyChange(IEditorPart.PROP_DIRTY);
from an CellModifier ???

or am I doing it wrong ?

thanks very much

Sunil Kamath wrote:
> "Ducloux Victor" <vducloux@cosmosbay-vectis.com> wrote in message
> news:dd74qn$p6v$1@news.eclipse.org...
>
>>Hi, I'm developping a visual editor for my specific type of files
>>(xml-like)
>>
>>My Eclipse editor represents an xml file as a table. What I would like is
>>that as soon as an user edits a value of a table, the eclipse button
>>"Save" shoul appear.
>>
>>I would like notifying eclipse that the related resource changed and that
>>it should propose the save action.
>>
>>anyone knows how to implement this ?
>>
>>thanks in advance,
>>
>
> First:
> firePropertyChange(IEditorPart.PROP_DIRTY);
>
> Next, your editor isDirty() method should return true.
>
> ---
> Sunil
>
>
Re: Notify resource change [message #289591 is a reply to message #289588] Mon, 08 August 2005 14:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sunil_kamath.nohotspammail.com

"Ducloux Victor" <vducloux@cosmosbay-vectis.com> wrote in message
news:dd7qs6$aq5$1@news.eclipse.org...
> Hi, thanks so much for the help Sunil !!
>
> Just one thing , how can I do a
> firePropertyChange(IEditorPart.PROP_DIRTY);
> from an CellModifier ???
>
> or am I doing it wrong ?
>
> thanks very much
>
The cell modifier should update your model.
When your model changes, it should fire a notification.
The editor part should listen for the model change.
Then the editor part should firePropertyChange(IEditorPart.PROP_DIRTY)
---
Sunil
Re: Notify resource change [message #289594 is a reply to message #289591] Mon, 08 August 2005 15:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vducloux.cosmosbay-vectis.com

Hi, thanks a lot, I get it know.
I'm really very new to all this so...
Do you know any tutorial ore something where I can get more infos...

So know I will add a boolean property in my model called isModified...
but afterwards I don't know how to do this listening stuff...

Thanks in advance and sorry for disturbing you again,

Victor

Sunil Kamath wrote:
> "Ducloux Victor" <vducloux@cosmosbay-vectis.com> wrote in message
> news:dd7qs6$aq5$1@news.eclipse.org...
>
>>Hi, thanks so much for the help Sunil !!
>>
>>Just one thing , how can I do a
>>firePropertyChange(IEditorPart.PROP_DIRTY);
>>from an CellModifier ???
>>
>>or am I doing it wrong ?
>>
>>thanks very much
>>
>
> The cell modifier should update your model.
> When your model changes, it should fire a notification.
> The editor part should listen for the model change.
> Then the editor part should firePropertyChange(IEditorPart.PROP_DIRTY)
> ---
> Sunil
>
>
Re: Notify resource change [message #289641 is a reply to message #289594] Tue, 09 August 2005 14:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vducloux.cosmosbay-vectis.com

Please, I'm really knew to all this, is there anyone than can help ??

thanks in advance

Victor

Ducloux Victor wrote:
> Hi, thanks a lot, I get it know.
> I'm really very new to all this so...
> Do you know any tutorial ore something where I can get more infos...
>
> So know I will add a boolean property in my model called isModified...
> but afterwards I don't know how to do this listening stuff...
>
> Thanks in advance and sorry for disturbing you again,
>
> Victor
>
> Sunil Kamath wrote:
>
>> "Ducloux Victor" <vducloux@cosmosbay-vectis.com> wrote in message
>> news:dd7qs6$aq5$1@news.eclipse.org...
>>
>>> Hi, thanks so much for the help Sunil !!
>>>
>>> Just one thing , how can I do a
>>> firePropertyChange(IEditorPart.PROP_DIRTY);
>>> from an CellModifier ???
>>>
>>> or am I doing it wrong ?
>>>
>>> thanks very much
>>>
>>
>> The cell modifier should update your model.
>> When your model changes, it should fire a notification.
>> The editor part should listen for the model change.
>> Then the editor part should firePropertyChange(IEditorPart.PROP_DIRTY)
>> ---
>> Sunil
>>
Re: Notify resource change [message #289650 is a reply to message #289641] Tue, 09 August 2005 15:12 Go to previous message
Eclipse UserFriend
Originally posted by: sunil_kamath.nohotspammail.com

"Ducloux Victor" <vducloux@cosmosbay-vectis.com> wrote in message
news:ddaf1d$gfb$1@news.eclipse.org...
> Please, I'm really knew to all this, is there anyone than can help ??
>
> thanks in advance
>
This is the standard Java event paradigm.
Let your model issue an event whenever it changes.
Your editor part should add itself as an event listener to the model.
When it receives a model changed event, it can fire the
IEditorPart.PROP_DIRTY property change.
---
Sunil
Previous Topic:Annotations in external file
Next Topic:[PDE]how to place an editor in a ScrolledComposite ?
Goto Forum:
  


Current Time: Thu Apr 25 08:13:40 GMT 2024

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

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

Back to the top