Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sapphire-dev] New topic in forum Sapphire, called Approach for Attaching/Detaching Listeners, by Andreas Weise

Title: Eclipse Community Forums
Subject: Approach for Attaching/Detaching Listeners Author: Andreas Weise Date: Wed, 08 January 2014 16:57
I have a model containing an Element 'Captions', that I want to reuse on several other Elements in the model (using interface inheritance).

The captions element contains a ListPropery 'FooListProperty' that needs to be modified upon value change of a ValueProperty 'RootElement/BarValueProperty', which exists on the root of the model.

I therefore want to create a FilteredListener for each instance of the 'Captions' element or 'FooListProperty' property, that is in charge for making the changes. That listener should be registered on 'RootElement/BarValueProperty'. But I'm stuck on from which place I could attach/detach this listener.

I've tried the Service approach but could not get it running:
1. Service, that registers Listener within init(). Created a CustomService extends Service, added it to META-INF sapphire-extension.xml, annotated it on FooListProperty with @Service > but init() method is never invoked!
2. like 1. + including a Condition Class, that was also added to sapphire-extension.xml > applicable() method is never invoked!

What's required to get the init() method invoked of a CustomService that extends org.eclipse.sapphire.services.Service ?

Or could you please advice whats the easiest approach for attaching/detaching a simple listener on a field. I also did not find a suitable example in the samples project.

Thanks for your answer.
Andreas
[ Reply ][ Quote ][ View Topic/Message ][ Unsubscribe from this forum ]

Back to the top