Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dali » question on ResourceModelListener
question on ResourceModelListener [message #435252] Fri, 30 January 2009 05:18 Go to next message
Brian Vosburgh is currently offline Brian VosburghFriend
Messages: 137
Registered: July 2009
Senior Member
Forwarded from dali-dev list:

-------- Original Message --------
Subject: [dali-dev] question on ResourceModelListener
Date: Fri, 30 Jan 2009 00:00:00 -0500
From: Ivy Ho <corporategirl@gmail.com>
Reply-To: General Dali EJB ORM developer discussion. <dali-dev@eclipse.org>
To: dali-dev@eclipse.org


Hi there:

I have implements in from our widget ,ResourceModelListener and
,PropertyChangeListener..

It is funny that if I click on the JPA view,on any fields The
PropertyChangeListener is never invoked but it always go to ResourceModelListener.
However in the method resourceModelChanged() , there is no indication as what
changes trigger the events,.
Is there any other listeners I can use or there is something we can do in the
resourceModelChanged to find out what the change is ?

Thanks so much!

public void resourceModelChanged() {
// TODO Auto-generated method stub

System.out.println("resourceModelChanged...");

}



=== some how the following was never invoked.== don''t know why.====

public void propertyChanged(
org.eclipse.jpt.utility.model.event.PropertyChangeEvent arg0) {
// TODO Auto-generated method stub

System.out.println("org.eclipse.jpt.utility.model.event.PropertyChangeEvent ");
if (arg0!=null)
{
System.out.println("property name="+arg0.getPropertyName());
System.out.println("source="+arg0.getSource());
System.out.println("new value="+arg0.getNewValue()+": old="+arg0.getOldValue());

}
System.out.println("end
org.eclipse.jpt.utility.model.event.PropertyChangeEvent");
}
l
Re: question on ResourceModelListener [message #435255 is a reply to message #435252] Fri, 30 January 2009 05:39 Go to previous messageGo to next message
Brian Vosburgh is currently offline Brian VosburghFriend
Messages: 137
Registered: July 2009
Senior Member
These listeners are very different.

The ResourceModelListener (recently renamed to JpaResourceModelListener)
receives very coarse notifications. It is notified whenever *anything* in the
Dali "resource" model changes. The "resource" model is the Dali representation
of the various Eclipse resources that are relevant to JPA; namely Java source
files, orm.xml files, and the persistence.xml file. If you are interested in
more specific events you will need to add the appropriate listener to the
appropriate "resource" object (e.g. JpaResourceCompilationUnit or
PersistenceXmlResource).

Probably more helpful would be to listen to the "context" model. This is the
model that more accurately describes the JPA "model". It provides *all* the
settings, taking into account defaults, overrides in XML, etc. The "resource"
reflects what is in the resource/file, ignoring defaults etc. To listen to the
"context" model, add the appropriate listener to the appropriate "context"
object (e.g. PersistentType, TypeMapping, or AttributeMapping).

Also, you say you have implemented these listeners, but you do not say what you
added your listeners to. The object you listen to determines the types of events
you will receive. Telling us what you add your listeners to might allow us to
help you further.

Brian


Brian Vosburgh wrote:
> Forwarded from dali-dev list:
>
> -------- Original Message --------
> Subject: [dali-dev] question on ResourceModelListener
> Date: Fri, 30 Jan 2009 00:00:00 -0500
> From: Ivy Ho <corporategirl@gmail.com>
> Reply-To: General Dali EJB ORM developer discussion.
> <dali-dev@eclipse.org>
> To: dali-dev@eclipse.org
>
>
> Hi there:
>
> I have implements in from our widget ,ResourceModelListener and
> ,PropertyChangeListener..
>
> It is funny that if I click on the JPA view,on any fields The
> PropertyChangeListener is never invoked but it always go to
> ResourceModelListener.
> However in the method resourceModelChanged() , there is no indication
> as what changes trigger the events,.
> Is there any other listeners I can use or there is something we can do
> in the resourceModelChanged to find out what the change is ?
>
> Thanks so much!
>
> public void resourceModelChanged() {
> // TODO Auto-generated method stub
>
> System.out.println("resourceModelChanged...");
>
> }
>
>
>
> === some how the following was never invoked.== don''t know why.====
>
> public void propertyChanged(
> org.eclipse.jpt.utility.model.event.PropertyChangeEvent arg0) {
> // TODO Auto-generated method stub
>
>
> System.out.println("org.eclipse.jpt.utility.model.event.PropertyChangeEvent ");
>
> if (arg0!=null)
> {
> System.out.println("property name="+arg0.getPropertyName());
> System.out.println("source="+arg0.getSource());
> System.out.println("new value="+arg0.getNewValue()+":
> old="+arg0.getOldValue());
>
> }
> System.out.println("end
> org.eclipse.jpt.utility.model.event.PropertyChangeEvent");
> }
> l
>
Re: question on ResourceModelListener [message #435256 is a reply to message #435255] Fri, 30 January 2009 19:34 Go to previous messageGo to next message
Brian Vosburgh is currently offline Brian VosburghFriend
Messages: 137
Registered: July 2009
Senior Member
For completeness's sake, yet another re-post from dali-dev:


Brian:

Just one more question: (sorry I forget my password and cannot post it to
org.eclipse)..

I could not find JpaResourceCompilationUnit. I find JpaCompilationUnit instead.


1. Assuming that "JpaResourceCompilationUnit" is JpaCompilationUnit, I got this
object from my jpa project and
add listener to listen different changes, but somehow all the changes I made
from JPA details view, I didn't
get any notification, so to simplify the question, is there a way I can get
notification whenever the change
is made from JPA details view? If I need to go with the some kind of model
change listener, the code below is
the correct?

JavaResourcePersistentType type =
jpaProject.getJavaPersistentTypeResource("com.test.Sess1");
if(type != null) {
JpaCompilationUnit jcu = type.getJpaCompilationUnit();
jcu.addPropertyChangeListener(new PropertyChangeListener() {
.......
});
jcu.addCollectionChangeListener(new CollectionChangeListener() {
.......
});
jcu.addListChangeListener(new ListChangeAdapter() {
.......
});
jcu.addStateChangeListener(new StateChangeListener() {
.......
});
jcu.addTreeChangeListener(new TreeChangeListener() {
.......
});
jcu.getResourceModel().addResourceModelChangeListener(new ResourceModelListener() {
.......
});
}

2. Also can I get the model of an annotation say @Entity in the JPACompilationUnit?


================Thanks for your help!=============================


On 1/30/09, Ivy Ho <corporategirl@gmail.com> wrote:

Thanks so much for such detail reply. It is very informative.
:-)


On 1/30/09, Brian Vosburgh <brian.vosburgh@oracle.com> wrote:

Forwarded to the appropriate forum, the Dali newsgroup:

http://www.eclipse.org/newsportal/thread.php?group=eclipse.t echnology.dali

Ivy Ho wrote:
> Hi there:
>
> I have implements in from our widget ,ResourceModelListener and
,PropertyChangeListener..
>
> It is funny that if I click on the JPA view,on any fields The
PropertyChangeListener is never invoked but it always go to ResourceModelListener.
> However in the method resourceModelChanged() , there is no
indication as what changes trigger the events,.
> Is there any other listeners I can use or there is something we can
do in the resourceModelChanged to find out what the change is ?
>
> Thanks so much!
>
> public void resourceModelChanged() {
> // TODO Auto-generated method stub
>
> System.out.println("resourceModelChanged...");
>
> }
>
>
>
> === some how the following was never invoked.== don''t know why.====
>
> public void propertyChanged(
> org.eclipse.jpt.utility.model.event.PropertyChangeEvent arg0) {
> // TODO Auto-generated method stub
>
>
System.out.println("org.eclipse.jpt.utility.model.event.PropertyChangeEvent ");
> if (arg0!=null)
> {
> System.out.println("property name="+arg0.getPropertyName());
> System.out.println("source="+arg0.getSource());
> System.out.println("new value="+arg0.getNewValue()+":
old="+arg0.getOldValue());
>
> }
> System.out.println("end
org.eclipse.jpt.utility.model.event.PropertyChangeEvent");
> }
> l
>
>
>
> _______________________________________________
> dali-dev mailing list
> dali-dev@eclipse.org
> https://dev.eclipse.org/mailman/listinfo/dali-dev
>



_______________________________________________
dali-dev mailing list
dali-dev@eclipse.org
https://dev.eclipse.org/mailman/listinfo/dali-dev
Re: question on ResourceModelListener [message #435259 is a reply to message #435256] Fri, 30 January 2009 19:35 Go to previous message
Brian Vosburgh is currently offline Brian VosburghFriend
Messages: 137
Registered: July 2009
Senior Member
For completeness's sake, still another re-post from dali-dev:

Sorry about the class names. They have very recently changed,
to make them more consistent and to fit better with work we are
doing to support binary entities in the next release. The class names
I referred to are in the latest development stream. From now on,
I will assume you are using Dali 2.0, which was part of the
Ganymede Java EE release. Let me know if you are using some other release.

ResourceModelListener is very different from the other listeners you
mention. The method resourceModelChanged() is called any time
*anything* within the ResourceModel or any of the objects contained
by the ResourceModel changes. This is used by Dali to trigger an
update of *all* the inter-dependent settings in the "context" model.
E.g. if a Java field name changes (which is part of the "resource" model),
the default column name in the field's mapping changes (which is part
of the "context" model). Instead of tracking all the inter-dependencies
directly, Dali simply uses a brute-force "update" of the entire "context"
model whenever *anything* in the "resource" model changes.

If you are interested in more granular changes, you will need to use
the other listeners (PropertyChangeListener, ListChangeListener, etc.).
You need to add these listeners to the specific object whose state you
are interested in. If you add a PropertyChangeListener to a
JpaCompilationUnit, you will receive notification of changes to the
compilation unit's various properties. I think the only property that can
change is the 'persistentType', which is a JavaResourcePersistentType.
If you interested in changes to the persistent type, you will need to
add the appropriate listener to that object directly.

I would like to repeat: The "context" model is probably more helpful
than the "resource" model. It has much more information and "context"(!).
To get the particular "context" persistent type you are interested in,
you would use code somewhat akin to this:
JpaProject.getRootContext()
JpaRootContextNode.getPersistenceXml()
PersistenceXml.getPersistence()
Persistence.persistenceUnits()
PersistenceUnit.classRefs()
ClassRef.getClassName().equals("com.test.Sess1")
ClassRef.getJavaPersistentType()
JavaPersistentType.getMapping()
etc.

If you are interested in knowing when a type's mapping has changed
(e.g. the @Entity annotation has been added to the class declaration),
you would add a PropertyChangeListener to the JavaPersistentType
returned by the ClassRef above. The "context" model for the @Entity
annotation would be the TypeMapping returned by JavaPersistentType.

If you are using a mapping file (i.e. orm.xml) you will need to use a
slightly different approach to getting the PersistentType you are
interested in.

Also, you log in to the newsgroups using your Bugzilla userid/password.
If you have forgotten your password, you can submit a request to change
it here:
https://bugs.eclipse.org/bugs/index.cgi?GoAheadAndLogIn=1

Brian


Ivy Ho wrote:
> Brian:
>
> Just one more question: (sorry I forget my password and cannot post it to
org.eclipse)..
>
> I could not find JpaResourceCompilationUnit. I find JpaCompilationUnit instead.
>
>
> 1. Assuming that "JpaResourceCompilationUnit" is JpaCompilationUnit, I got
this object from my jpa project and
> add listener to listen different changes, but somehow all the changes I made
from JPA details view, I didn't
> get any notification, so to simplify the question, is there a way I can get
notification whenever the change
> is made from JPA details view? If I need to go with the some kind of model
change listener, the code below is
> the correct?
>
> JavaResourcePersistentType type =
jpaProject.getJavaPersistentTypeResource("com.test.Sess1");
> if(type != null) {
> JpaCompilationUnit jcu = type.getJpaCompilationUnit();
> jcu.addPropertyChangeListener(new PropertyChangeListener() {
> ......
> });
> jcu.addCollectionChangeListener(new CollectionChangeListener() {
> ......
> });
> jcu.addListChangeListener(new ListChangeAdapter() {
> ......
> });
> jcu.addStateChangeListener(new StateChangeListener() {
> ......
> });
> jcu.addTreeChangeListener(new TreeChangeListener() {
> ......
> });
> jcu.getResourceModel().addResourceModelChangeListener(new
ResourceModelListener() {
> ......
> });
> }
>
> 2. Also can I get the model of an annotation say @Entity in the
JPACompilationUnit?
>
>
> ================Thanks for your help!=============================
>
>
> On 1/30/09, Ivy Ho <corporategirl@gmail.com> wrote:
>
> Thanks so much for such detail reply. It is very informative.
> :-)
>
>
> On 1/30/09, Brian Vosburgh <brian.vosburgh@oracle.com> wrote:
>
> Forwarded to the appropriate forum, the Dali newsgroup:
>
http://www.eclipse.org/newsportal/thread.php?group=eclipse.t echnology.dali
>
> Ivy Ho wrote:
>> Hi there:
>>
>> I have implements in from our widget ,ResourceModelListener and
,PropertyChangeListener..
>>
>> It is funny that if I click on the JPA view,on any fields The
PropertyChangeListener is never invoked but it always go to ResourceModelListener.
>> However in the method resourceModelChanged() , there is no
indication as what changes trigger the events,.
>> Is there any other listeners I can use or there is something we can
do in the resourceModelChanged to find out what the change is ?
>>
>> Thanks so much!
>>
>> public void resourceModelChanged() {
>> // TODO Auto-generated method stub
>>
>> System.out.println("resourceModelChanged...");
>>
>> }
>>
>>
>>
>> === some how the following was never invoked.== don''t know why.====
>>
>> public void propertyChanged(
>> org.eclipse.jpt.utility.model.event.PropertyChangeEvent arg0) {
>> // TODO Auto-generated method stub
>>
>>
System.out.println("org.eclipse.jpt.utility.model.event.PropertyChangeEvent ");
>> if (arg0!=null)
>> {
>> System.out.println("property name="+arg0.getPropertyName());
>> System.out.println("source="+arg0.getSource());
>> System.out.println("new value="+arg0.getNewValue()+":
old="+arg0.getOldValue());
>>
>> }
>> System.out.println("end
org.eclipse.jpt.utility.model.event.PropertyChangeEvent");
>> }
>> l
>>
>>
>>
>> _______________________________________________
>> dali-dev mailing list
>> dali-dev@eclipse.org
>> https://dev.eclipse.org/mailman/listinfo/dali-dev
>>
>
>
>
> _______________________________________________
> dali-dev mailing list
> dali-dev@eclipse.org
> https://dev.eclipse.org/mailman/listinfo/dali-dev
>
>
>
Re: question on ResourceModelListener [message #613791 is a reply to message #435252] Fri, 30 January 2009 05:39 Go to previous message
Brian Vosburgh is currently offline Brian VosburghFriend
Messages: 137
Registered: July 2009
Senior Member
These listeners are very different.

The ResourceModelListener (recently renamed to JpaResourceModelListener)
receives very coarse notifications. It is notified whenever *anything* in the
Dali "resource" model changes. The "resource" model is the Dali representation
of the various Eclipse resources that are relevant to JPA; namely Java source
files, orm.xml files, and the persistence.xml file. If you are interested in
more specific events you will need to add the appropriate listener to the
appropriate "resource" object (e.g. JpaResourceCompilationUnit or
PersistenceXmlResource).

Probably more helpful would be to listen to the "context" model. This is the
model that more accurately describes the JPA "model". It provides *all* the
settings, taking into account defaults, overrides in XML, etc. The "resource"
reflects what is in the resource/file, ignoring defaults etc. To listen to the
"context" model, add the appropriate listener to the appropriate "context"
object (e.g. PersistentType, TypeMapping, or AttributeMapping).

Also, you say you have implemented these listeners, but you do not say what you
added your listeners to. The object you listen to determines the types of events
you will receive. Telling us what you add your listeners to might allow us to
help you further.

Brian


Brian Vosburgh wrote:
> Forwarded from dali-dev list:
>
> -------- Original Message --------
> Subject: [dali-dev] question on ResourceModelListener
> Date: Fri, 30 Jan 2009 00:00:00 -0500
> From: Ivy Ho <corporategirl@gmail.com>
> Reply-To: General Dali EJB ORM developer discussion.
> <dali-dev@eclipse.org>
> To: dali-dev@eclipse.org
>
>
> Hi there:
>
> I have implements in from our widget ,ResourceModelListener and
> ,PropertyChangeListener..
>
> It is funny that if I click on the JPA view,on any fields The
> PropertyChangeListener is never invoked but it always go to
> ResourceModelListener.
> However in the method resourceModelChanged() , there is no indication
> as what changes trigger the events,.
> Is there any other listeners I can use or there is something we can do
> in the resourceModelChanged to find out what the change is ?
>
> Thanks so much!
>
> public void resourceModelChanged() {
> // TODO Auto-generated method stub
>
> System.out.println("resourceModelChanged...");
>
> }
>
>
>
> === some how the following was never invoked.== don''t know why.====
>
> public void propertyChanged(
> org.eclipse.jpt.utility.model.event.PropertyChangeEvent arg0) {
> // TODO Auto-generated method stub
>
>
> System.out.println("org.eclipse.jpt.utility.model.event.PropertyChangeEvent ");
>
> if (arg0!=null)
> {
> System.out.println("property name="+arg0.getPropertyName());
> System.out.println("source="+arg0.getSource());
> System.out.println("new value="+arg0.getNewValue()+":
> old="+arg0.getOldValue());
>
> }
> System.out.println("end
> org.eclipse.jpt.utility.model.event.PropertyChangeEvent");
> }
> l
>
Re: question on ResourceModelListener [message #613792 is a reply to message #435255] Fri, 30 January 2009 19:34 Go to previous message
Brian Vosburgh is currently offline Brian VosburghFriend
Messages: 137
Registered: July 2009
Senior Member
For completeness's sake, yet another re-post from dali-dev:


Brian:

Just one more question: (sorry I forget my password and cannot post it to
org.eclipse)..

I could not find JpaResourceCompilationUnit. I find JpaCompilationUnit instead.


1. Assuming that "JpaResourceCompilationUnit" is JpaCompilationUnit, I got this
object from my jpa project and
add listener to listen different changes, but somehow all the changes I made
from JPA details view, I didn't
get any notification, so to simplify the question, is there a way I can get
notification whenever the change
is made from JPA details view? If I need to go with the some kind of model
change listener, the code below is
the correct?

JavaResourcePersistentType type =
jpaProject.getJavaPersistentTypeResource("com.test.Sess1");
if(type != null) {
JpaCompilationUnit jcu = type.getJpaCompilationUnit();
jcu.addPropertyChangeListener(new PropertyChangeListener() {
.......
});
jcu.addCollectionChangeListener(new CollectionChangeListener() {
.......
});
jcu.addListChangeListener(new ListChangeAdapter() {
.......
});
jcu.addStateChangeListener(new StateChangeListener() {
.......
});
jcu.addTreeChangeListener(new TreeChangeListener() {
.......
});
jcu.getResourceModel().addResourceModelChangeListener(new ResourceModelListener() {
.......
});
}

2. Also can I get the model of an annotation say @Entity in the JPACompilationUnit?


================Thanks for your help!=============================


On 1/30/09, Ivy Ho <corporategirl@gmail.com> wrote:

Thanks so much for such detail reply. It is very informative.
:-)


On 1/30/09, Brian Vosburgh <brian.vosburgh@oracle.com> wrote:

Forwarded to the appropriate forum, the Dali newsgroup:

http://www.eclipse.org/newsportal/thread.php?group=eclipse.t echnology.dali

Ivy Ho wrote:
> Hi there:
>
> I have implements in from our widget ,ResourceModelListener and
,PropertyChangeListener..
>
> It is funny that if I click on the JPA view,on any fields The
PropertyChangeListener is never invoked but it always go to ResourceModelListener.
> However in the method resourceModelChanged() , there is no
indication as what changes trigger the events,.
> Is there any other listeners I can use or there is something we can
do in the resourceModelChanged to find out what the change is ?
>
> Thanks so much!
>
> public void resourceModelChanged() {
> // TODO Auto-generated method stub
>
> System.out.println("resourceModelChanged...");
>
> }
>
>
>
> === some how the following was never invoked.== don''t know why.====
>
> public void propertyChanged(
> org.eclipse.jpt.utility.model.event.PropertyChangeEvent arg0) {
> // TODO Auto-generated method stub
>
>
System.out.println("org.eclipse.jpt.utility.model.event.PropertyChangeEvent ");
> if (arg0!=null)
> {
> System.out.println("property name="+arg0.getPropertyName());
> System.out.println("source="+arg0.getSource());
> System.out.println("new value="+arg0.getNewValue()+":
old="+arg0.getOldValue());
>
> }
> System.out.println("end
org.eclipse.jpt.utility.model.event.PropertyChangeEvent");
> }
> l
>
>
>
> _______________________________________________
> dali-dev mailing list
> dali-dev@eclipse.org
> https://dev.eclipse.org/mailman/listinfo/dali-dev
>



_______________________________________________
dali-dev mailing list
dali-dev@eclipse.org
https://dev.eclipse.org/mailman/listinfo/dali-dev
Re: question on ResourceModelListener [message #613793 is a reply to message #435256] Fri, 30 January 2009 19:35 Go to previous message
Brian Vosburgh is currently offline Brian VosburghFriend
Messages: 137
Registered: July 2009
Senior Member
For completeness's sake, still another re-post from dali-dev:

Sorry about the class names. They have very recently changed,
to make them more consistent and to fit better with work we are
doing to support binary entities in the next release. The class names
I referred to are in the latest development stream. From now on,
I will assume you are using Dali 2.0, which was part of the
Ganymede Java EE release. Let me know if you are using some other release.

ResourceModelListener is very different from the other listeners you
mention. The method resourceModelChanged() is called any time
*anything* within the ResourceModel or any of the objects contained
by the ResourceModel changes. This is used by Dali to trigger an
update of *all* the inter-dependent settings in the "context" model.
E.g. if a Java field name changes (which is part of the "resource" model),
the default column name in the field's mapping changes (which is part
of the "context" model). Instead of tracking all the inter-dependencies
directly, Dali simply uses a brute-force "update" of the entire "context"
model whenever *anything* in the "resource" model changes.

If you are interested in more granular changes, you will need to use
the other listeners (PropertyChangeListener, ListChangeListener, etc.).
You need to add these listeners to the specific object whose state you
are interested in. If you add a PropertyChangeListener to a
JpaCompilationUnit, you will receive notification of changes to the
compilation unit's various properties. I think the only property that can
change is the 'persistentType', which is a JavaResourcePersistentType.
If you interested in changes to the persistent type, you will need to
add the appropriate listener to that object directly.

I would like to repeat: The "context" model is probably more helpful
than the "resource" model. It has much more information and "context"(!).
To get the particular "context" persistent type you are interested in,
you would use code somewhat akin to this:
JpaProject.getRootContext()
JpaRootContextNode.getPersistenceXml()
PersistenceXml.getPersistence()
Persistence.persistenceUnits()
PersistenceUnit.classRefs()
ClassRef.getClassName().equals("com.test.Sess1")
ClassRef.getJavaPersistentType()
JavaPersistentType.getMapping()
etc.

If you are interested in knowing when a type's mapping has changed
(e.g. the @Entity annotation has been added to the class declaration),
you would add a PropertyChangeListener to the JavaPersistentType
returned by the ClassRef above. The "context" model for the @Entity
annotation would be the TypeMapping returned by JavaPersistentType.

If you are using a mapping file (i.e. orm.xml) you will need to use a
slightly different approach to getting the PersistentType you are
interested in.

Also, you log in to the newsgroups using your Bugzilla userid/password.
If you have forgotten your password, you can submit a request to change
it here:
https://bugs.eclipse.org/bugs/index.cgi?GoAheadAndLogIn=1

Brian


Ivy Ho wrote:
> Brian:
>
> Just one more question: (sorry I forget my password and cannot post it to
org.eclipse)..
>
> I could not find JpaResourceCompilationUnit. I find JpaCompilationUnit instead.
>
>
> 1. Assuming that "JpaResourceCompilationUnit" is JpaCompilationUnit, I got
this object from my jpa project and
> add listener to listen different changes, but somehow all the changes I made
from JPA details view, I didn't
> get any notification, so to simplify the question, is there a way I can get
notification whenever the change
> is made from JPA details view? If I need to go with the some kind of model
change listener, the code below is
> the correct?
>
> JavaResourcePersistentType type =
jpaProject.getJavaPersistentTypeResource("com.test.Sess1");
> if(type != null) {
> JpaCompilationUnit jcu = type.getJpaCompilationUnit();
> jcu.addPropertyChangeListener(new PropertyChangeListener() {
> ......
> });
> jcu.addCollectionChangeListener(new CollectionChangeListener() {
> ......
> });
> jcu.addListChangeListener(new ListChangeAdapter() {
> ......
> });
> jcu.addStateChangeListener(new StateChangeListener() {
> ......
> });
> jcu.addTreeChangeListener(new TreeChangeListener() {
> ......
> });
> jcu.getResourceModel().addResourceModelChangeListener(new
ResourceModelListener() {
> ......
> });
> }
>
> 2. Also can I get the model of an annotation say @Entity in the
JPACompilationUnit?
>
>
> ================Thanks for your help!=============================
>
>
> On 1/30/09, Ivy Ho <corporategirl@gmail.com> wrote:
>
> Thanks so much for such detail reply. It is very informative.
> :-)
>
>
> On 1/30/09, Brian Vosburgh <brian.vosburgh@oracle.com> wrote:
>
> Forwarded to the appropriate forum, the Dali newsgroup:
>
http://www.eclipse.org/newsportal/thread.php?group=eclipse.t echnology.dali
>
> Ivy Ho wrote:
>> Hi there:
>>
>> I have implements in from our widget ,ResourceModelListener and
,PropertyChangeListener..
>>
>> It is funny that if I click on the JPA view,on any fields The
PropertyChangeListener is never invoked but it always go to ResourceModelListener.
>> However in the method resourceModelChanged() , there is no
indication as what changes trigger the events,.
>> Is there any other listeners I can use or there is something we can
do in the resourceModelChanged to find out what the change is ?
>>
>> Thanks so much!
>>
>> public void resourceModelChanged() {
>> // TODO Auto-generated method stub
>>
>> System.out.println("resourceModelChanged...");
>>
>> }
>>
>>
>>
>> === some how the following was never invoked.== don''t know why.====
>>
>> public void propertyChanged(
>> org.eclipse.jpt.utility.model.event.PropertyChangeEvent arg0) {
>> // TODO Auto-generated method stub
>>
>>
System.out.println("org.eclipse.jpt.utility.model.event.PropertyChangeEvent ");
>> if (arg0!=null)
>> {
>> System.out.println("property name="+arg0.getPropertyName());
>> System.out.println("source="+arg0.getSource());
>> System.out.println("new value="+arg0.getNewValue()+":
old="+arg0.getOldValue());
>>
>> }
>> System.out.println("end
org.eclipse.jpt.utility.model.event.PropertyChangeEvent");
>> }
>> l
>>
>>
>>
>> _______________________________________________
>> dali-dev mailing list
>> dali-dev@eclipse.org
>> https://dev.eclipse.org/mailman/listinfo/dali-dev
>>
>
>
>
> _______________________________________________
> dali-dev mailing list
> dali-dev@eclipse.org
> https://dev.eclipse.org/mailman/listinfo/dali-dev
>
>
>
Previous Topic:Dali 2.2 and JPA 2.0 tolerance
Next Topic:what would it meant to use "Generic" as the JPA platform
Goto Forum:
  


Current Time: Thu Apr 25 16:50:34 GMT 2024

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

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

Back to the top