Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » setting a new model in an opened editor
setting a new model in an opened editor [message #193586] Fri, 26 August 2005 16:50 Go to next message
Eclipse UserFriend
Originally posted by: no.yes.maybe

Hi,
I want to set a completely new model in a previously opened GEF editor.
what method should I call to get the view recreated? refreshVisual() is
not doing it...

thanks,
Roberto
Re: setting a new model in an opened editor [message #193594 is a reply to message #193586] Fri, 26 August 2005 17:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mvsteenbergen.eljakim.scratch-this.nl

Try calling getGraphicalViewer().setContents(Object model). If you're
doing this from outside your GraphicalEditor, you might need to create
an extra method to provide access to the normally protected GraphicalViewer.

Regards,

Martijn.

roberto wrote:
> I want to set a completely new model in a previously opened GEF editor.
Re: setting a new model in an opened editor [message #193609 is a reply to message #193594] Fri, 26 August 2005 17:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: no.yes.maybe

Ok, I did that, but....
I've a periodic task that checks for certain conditions. If the
condition is met, it replaces the model. I'm using jdk 1.5 concurrency
to implement the periodic task. When I invoke the setContents() in the
run() of the new thread, I get an exception.

I take it that I have to run the code in some Eclipse thread. How do I
do that?

ROberto


Martijn van Steenbergen wrote:

> Try calling getGraphicalViewer().setContents(Object model). If you're
> doing this from outside your GraphicalEditor, you might need to create
> an extra method to provide access to the normally protected
> GraphicalViewer.
>
> Regards,
>
> Martijn.
>
> roberto wrote:
>
>> I want to set a completely new model in a previously opened GEF editor.
Re: setting a new model in an opened editor [message #193617 is a reply to message #193609] Fri, 26 August 2005 18:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mvsteenbergen.eljakim.scratch-this.nl

roberto wrote:
> I take it that I have to run the code in some Eclipse thread. How do I
> do that?

http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/plat form-swt-home/faq.html#uithread

M.
Re: setting a new model in an opened editor [message #193625 is a reply to message #193617] Fri, 26 August 2005 18:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: no.yes.maybe

Ok, I've done it. No more exceptions, but the editor graphics are not
updated according to the new model. Is there anything else I need to do?


Martijn van Steenbergen wrote:

> roberto wrote:
>
>> I take it that I have to run the code in some Eclipse thread. How do I
>> do that?
>
>
> http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/plat form-swt-home/faq.html#uithread
>
>
> M.
Re: setting a new model in an opened editor [message #193650 is a reply to message #193617] Fri, 26 August 2005 19:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: no.yes.maybe

Ok, I have a different problem. The solution mentioned here fixes one
editor. However I also have the outline view on the same model, and
that's not updated automatically. What do I need to do to get every view
on the model updated?

Thanks,
Roberto


Martijn van Steenbergen wrote:

> roberto wrote:
>
>> I take it that I have to run the code in some Eclipse thread. How do I
>> do that?
>
>
> http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/plat form-swt-home/faq.html#uithread
>
>
> M.
Re: setting a new model in an opened editor [message #193681 is a reply to message #193650] Fri, 26 August 2005 21:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.unknown.com

Same thing as you did in the first viewer.

"roberto" <no@yes.maybe> wrote in message news:430F6890.1060008@yes.maybe...
> Ok, I have a different problem. The solution mentioned here fixes one
> editor. However I also have the outline view on the same model, and
> that's not updated automatically. What do I need to do to get every view
> on the model updated?
>
> Thanks,
> Roberto
>
>
> Martijn van Steenbergen wrote:
>
> > roberto wrote:
> >
> >> I take it that I have to run the code in some Eclipse thread. How do I
> >> do that?
> >
> >
> >
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/plat form-swt-home/faq.html#uithread
> >
> >
> > M.
Re: setting a new model in an opened editor [message #218715 is a reply to message #193650] Wed, 28 June 2006 15:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: glebsattel.gmail.com

hi roberto,

how did you solve your problem with the outline view. i have the same
problem.
1. Step: Refresh my Editor with
getGraphicalViewer().setContents(myNewModel);
2. Step: Refresh my Outline: how do i get the outline to do the same
like above?

Olaf

roberto schrieb:

> Ok, I have a different problem. The solution mentioned here fixes one
> editor. However I also have the outline view on the same model, and
> that's not updated automatically. What do I need to do to get every view
> on the model updated?
>
> Thanks,
> Roberto
>
>
> Martijn van Steenbergen wrote:
>
>> roberto wrote:
>>
>>> I take it that I have to run the code in some Eclipse thread. How do
>>> I do that?
>>
>>
>>
>> http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/plat form-swt-home/faq.html#uithread
>>
>>
>> M.
Re: setting a new model in an opened editor [message #218731 is a reply to message #218715] Wed, 28 June 2006 19:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: lamont_gilbert.rigidsoftware.com

Is your outline view tracking any other view or selection?

Glebsattel wrote:

> hi roberto,
>
> how did you solve your problem with the outline view. i have the same
> problem.
> 1. Step: Refresh my Editor with
> getGraphicalViewer().setContents(myNewModel);
> 2. Step: Refresh my Outline: how do i get the outline to do the same
> like above?
>
> Olaf
>
> roberto schrieb:
>
>> Ok, I have a different problem. The solution mentioned here fixes one
>> editor. However I also have the outline view on the same model, and
>> that's not updated automatically. What do I need to do to get every view
>> on the model updated?
>>
>> Thanks,
>> Roberto
>>
>>
>> Martijn van Steenbergen wrote:
>>
>>> roberto wrote:
>>>
>>>> I take it that I have to run the code in some Eclipse thread. How do
>>>> I do that?
>>>
>>>
>>>
>>>
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/plat form-swt-home/faq.html#uithread
>>>
>>>
>>> M.

--
Respectfully,

CL Gilbert
"Verily, verily, I say unto you, He that entereth not by the door() into the
sheepfold{}, but climbeth up some other *way, the same is a thief and a
robber."
Re: setting a new model in an opened editor [message #218746 is a reply to message #218731] Thu, 29 June 2006 08:19 Go to previous message
Eclipse UserFriend
Originally posted by: glebsattel.hardsoftware.de

I've realized it like the ShapesEditor. The viewer of the outline is a
TreeViewer which presents my model. The PropertySheet is tracking the
outline view (and the Editor) and shows the properties of each node (or
EditParts in the Editor) in the tree. This works fine when I load my
model at the first time!

Now I update my model with a different content from the db (for example
I switch the language). The editor (here FlowPages) shows the right
content and the interaction with the PropertySheet works fine!

Only the outline stil has the model with the old content. Which is the
right way to set the new content to the TreeViewer in the outline.


In the Editor are different

CL [dnoyeb] Gilbert schrieb:
> Is your outline view tracking any other view or selection?
>
> Glebsattel wrote:
>
>
>>hi roberto,
>>
>>how did you solve your problem with the outline view. i have the same
>>problem.
>>1. Step: Refresh my Editor with
>>getGraphicalViewer().setContents(myNewModel);
>>2. Step: Refresh my Outline: how do i get the outline to do the same
>>like above?
>>
>>Olaf
>>
>>roberto schrieb:
>>
>>
>>>Ok, I have a different problem. The solution mentioned here fixes one
>>>editor. However I also have the outline view on the same model, and
>>>that's not updated automatically. What do I need to do to get every view
>>>on the model updated?
>>>
>>> Thanks,
>>> Roberto
>>>
>>>
>>>Martijn van Steenbergen wrote:
>>>
>>>
>>>>roberto wrote:
>>>>
>>>>
>>>>>I take it that I have to run the code in some Eclipse thread. How do
>>>>>I do that?
>>>>
>>>>
>>>>
>>>>
> http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/plat form-swt-home/faq.html#uithread
>
>>>>
>>>>M.
>
>
Previous Topic:Dynamic context menu for an editpart
Next Topic:Unhandled event loop exception --> java.lang.NullPointerException
Goto Forum:
  


Current Time: Thu Mar 28 08:06:27 GMT 2024

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

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

Back to the top