[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.technology.dali] Re: question on ResourceModelListener
|
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@xxxxxxxxx> wrote:
Thanks so much for such detail reply. It is very informative.
:-)
On 1/30/09, Brian Vosburgh <brian.vosburgh@xxxxxxxxxx> wrote:
Forwarded to the appropriate forum, the Dali newsgroup:
http://www.eclipse.org/newsportal/thread.php?group=eclipse.technology.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@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/dali-dev
>
_______________________________________________
dali-dev mailing list
dali-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dali-dev