How to refresh models in different editors? [message #147179] |
Wed, 11 August 2004 07:06 |
Eclipse User |
|
|
|
Originally posted by: amy_fang.mailst.xjtu.edu.cn
Hello, everyone
I have created three editors, and they can show the same model with
different figures. Now I edit the model in a editor, and want to refresh
the model's properties in the other two editors. How can I implement this
function?
Thanks in advance.
|
|
|
Re: How to refresh models in different editors? [message #147189 is a reply to message #147179] |
Wed, 11 August 2004 07:59 |
Eclipse User |
|
|
|
Originally posted by: word-up.gmx.de
The best solution for this is to use a notifier mechanism.
The model is the notifier and the editors, or better the editparts should
register for being notified if the model has changed. Then you can call
the refreshVisuals() or refreshChildren() method depending on what hast
changed.
Amy wrote:
> Hello, everyone
> I have created three editors, and they can show the same model with
> different figures. Now I edit the model in a editor, and want to refresh
> the model's properties in the other two editors. How can I implement this
> function?
> Thanks in advance.
|
|
|
|
Re: How to refresh models in different editors? [message #147382 is a reply to message #147260] |
Thu, 12 August 2004 01:16 |
Eclipse User |
|
|
|
Originally posted by: amy_fang.mailst.xjtu.edu.cn
No. Maybe I can say that it is another problem to me. Can I use the same
model instance in different editor?
Randy Hudson wrote:
> Are you sharing the model instances across editors?
> "Amy" <amy_fang@mailst.xjtu.edu.cn> wrote in message
> news:cfcgi5$l8g$1@eclipse.org...
> > Hello, everyone
> >
> > I have created three editors, and they can show the same model with
> > different figures. Now I edit the model in a editor, and want to refresh
> > the model's properties in the other two editors. How can I implement this
> > function?
> >
> > Thanks in advance.
> >
|
|
|
Re: How to refresh models in different editors? [message #147442 is a reply to message #147189] |
Thu, 12 August 2004 02:56 |
Eclipse User |
|
|
|
Originally posted by: amy_fang.mailst.xjtu.edu.cn
I think this solution may be feasible in a editor. But if there are
several editors, how can I add a listener to a model in a editor, but the
other editor can receive the notification if the model has changed?
Max wrote:
> The best solution for this is to use a notifier mechanism.
> The model is the notifier and the editors, or better the editparts should
> register for being notified if the model has changed. Then you can call
> the refreshVisuals() or refreshChildren() method depending on what hast
> changed.
> Amy wrote:
> > Hello, everyone
> > I have created three editors, and they can show the same model with
> > different figures. Now I edit the model in a editor, and want to refresh
> > the model's properties in the other two editors. How can I implement this
> > function?
> > Thanks in advance.
|
|
|
Re: How to refresh models in different editors? [message #147456 is a reply to message #147442] |
Thu, 12 August 2004 06:06 |
Eclipse User |
|
|
|
Originally posted by: word-up.gmx.de
OK, if you use different models that doesn't work......but why do want to
refresh the other editors, because their model has not changed.
To answer your other question: It is definitely possible to share a model
instance across editors. Then works the notification pattern.
Amy wrote:
> I think this solution may be feasible in a editor. But if there are
> several editors, how can I add a listener to a model in a editor, but the
> other editor can receive the notification if the model has changed?
> Max wrote:
> > The best solution for this is to use a notifier mechanism.
> > The model is the notifier and the editors, or better the editparts should
> > register for being notified if the model has changed. Then you can call
> > the refreshVisuals() or refreshChildren() method depending on what hast
> > changed.
> > Amy wrote:
> > > Hello, everyone
> > > I have created three editors, and they can show the same model with
> > > different figures. Now I edit the model in a editor, and want to refresh
> > > the model's properties in the other two editors. How can I implement this
> > > function?
> > > Thanks in advance.
|
|
|
Re: How to refresh models in different editors? [message #147533 is a reply to message #147382] |
Thu, 12 August 2004 13:32 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
Yes, this is what the JDT does with textual documents. All editors are
working on the same document simultaneously.
"Amy" <amy_fang@mailst.xjtu.edu.cn> wrote in message
news:cfege8$n68$1@eclipse.org...
> No. Maybe I can say that it is another problem to me. Can I use the same
> model instance in different editor?
>
> Randy Hudson wrote:
>
> > Are you sharing the model instances across editors?
>
> > "Amy" <amy_fang@mailst.xjtu.edu.cn> wrote in message
> > news:cfcgi5$l8g$1@eclipse.org...
> > > Hello, everyone
> > >
> > > I have created three editors, and they can show the same model with
> > > different figures. Now I edit the model in a editor, and want to
refresh
> > > the model's properties in the other two editors. How can I implement
this
> > > function?
> > >
> > > Thanks in advance.
> > >
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03343 seconds