Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Recursive opening error
Recursive opening error [message #326282] Thu, 13 March 2008 16:33 Go to next message
Phill Perryman is currently offline Phill PerrymanFriend
Messages: 214
Registered: July 2009
Senior Member
This is a multipart message in MIME format.
--=_alternative 005AFF9B8025740B_=
Content-Type: text/plain; charset="US-ASCII"

I am getting a recursive opening editor error. However at the point I get
it the editor and outline view are fully open.

The editor has a few pages and I want to switch to the page relevant to
the selection. So I have a selection changed method which calls
setActivePage. Now this works fine until I select a menu item so that
neither the outline view or the editor are active. I then click in the
outline view which becomes the active part. As far as I can tell it also
fires a selection event which the editor picks up and sets the page. The
problem seems to be that the outline view has not finished its
setActivePart call and so there is already a part being activated when the
setActivePage in the editor happens. Although as the two parts being
activated are not the same I think the error message is somewhat
misleading. It took me a while to figure out it was not the editor
recursively calling itself but that setActivePart is not re-entrant.

I am using the normal selection service and registering the editor as a
listener.

I don't know enought about the way events are handled to figure out how to
get around this.


--=_alternative 005AFF9B8025740B_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2 face="sans-serif">I am getting a recursive opening editor
error. However at the point I get it the editor and outline view are fully
open.</font>
<br>
<br><font size=2 face="sans-serif">The editor has a few pages and I want
to switch to the page relevant to the selection. So I have a selection
changed method which calls setActivePage. Now this works fine until I select
a menu item so that neither the outline view or the editor are active.
I then click in the outline view which becomes the active part. As far
as I can tell it also fires a selection event which the editor picks up
and sets the page. The problem seems to be that the outline view has not
finished its setActivePart call and so there is already a part being activated
when the setActivePage in the editor happens. Although as the two parts
being activated are not the same I think the error message is somewhat
misleading. It took me a while to figure out it was not the editor recursively
calling itself but that setActivePart is not re-entrant.</font>
<br>
<br><font size=2 face="sans-serif">I am using the normal selection service
and registering the editor as a listener.</font>
<br>
<br><font size=2 face="sans-serif">I don't know enought about the way events
are handled to figure out how to get around this.</font>
<br>
<br>
--=_alternative 005AFF9B8025740B_=--
Re: Recursive opening error [message #326283 is a reply to message #326282] Thu, 13 March 2008 16:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------010709070808010807020807
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Phill,

It's probably a good idea to use this type of approach to turn the page
as a separate event

getSite().getShell().getDisplay().asyncExec
(new Runnable()
{
public void run()
{
setActivePage(0);
}
});


Phill_Perryman@Mitel.COM wrote:
>
> I am getting a recursive opening editor error. However at the point I
> get it the editor and outline view are fully open.
>
> The editor has a few pages and I want to switch to the page relevant
> to the selection. So I have a selection changed method which calls
> setActivePage. Now this works fine until I select a menu item so that
> neither the outline view or the editor are active. I then click in the
> outline view which becomes the active part. As far as I can tell it
> also fires a selection event which the editor picks up and sets the
> page. The problem seems to be that the outline view has not finished
> its setActivePart call and so there is already a part being activated
> when the setActivePage in the editor happens. Although as the two
> parts being activated are not the same I think the error message is
> somewhat misleading. It took me a while to figure out it was not the
> editor recursively calling itself but that setActivePart is not
> re-entrant.
>
> I am using the normal selection service and registering the editor as
> a listener.
>
> I don't know enought about the way events are handled to figure out
> how to get around this.
>


--------------010709070808010807020807
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Phill,<br>
<br>
It's probably a good idea to use this type of approach to turn the page
as a separate event<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; getSite().getShell().getDisplay().asyncExec<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; (new Runnable()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; public void run()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setActivePage(0);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; });<br>
<br>
<br>
<a class="moz-txt-link-abbreviated" href="mailto:Phill_Perryman@Mitel.COM">Phill_Perryman@Mitel.COM</a> wrote:
<blockquote cite="mid:frbl1t$sn2$1@build.eclipse.org" type="cite"><br>
<font face="sans-serif" size="2">I am getting a recursive opening
editor
error. However at the point I get it the editor and outline view are
fully
open.</font>
<br>
<br>
<font face="sans-serif" size="2">The editor has a few pages and I
want
to switch to the page relevant to the selection. So I have a selection
changed method which calls setActivePage. Now this works fine until I
select
a menu item so that neither the outline view or the editor are active.
I then click in the outline view which becomes the active part. As far
as I can tell it also fires a selection event which the editor picks up
and sets the page. The problem seems to be that the outline view has
not
finished its setActivePart call and so there is already a part being
activated
when the setActivePage in the editor happens. Although as the two parts
being activated are not the same I think the error message is somewhat
misleading. It took me a while to figure out it was not the editor
recursively
calling itself but that setActivePart is not re-entrant.</font>
<br>
<br>
<font face="sans-serif" size="2">I am using the normal selection
service
and registering the editor as a listener.</font>
<br>
<br>
<font face="sans-serif" size="2">I don't know enought about the way
events
are handled to figure out how to get around this.</font>
<br>
<br>
</blockquote>
<br>
</body>
</html>

--------------010709070808010807020807--
Re: Recursive opening error [message #326290 is a reply to message #326283] Thu, 13 March 2008 20:38 Go to previous messageGo to next message
Phill Perryman is currently offline Phill PerrymanFriend
Messages: 214
Registered: July 2009
Senior Member
<br><font size=2 face="sans-serif">Tried the run asynch (and UIJob), gets
rid of the error however the Menu items which appeared when it is run normally
don't appear now. Looks like the workbench has not seen the selection event.</font>
Re: Recursive opening error [message #326291 is a reply to message #326290] Thu, 13 March 2008 20:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------010008060807010402090408
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Phill,

I'm not really sure of the whole picture in your code, but some
variation of this approach (delayed reaction to selection or delayed
delivery of selection) is likely needed.


Phill_Perryman@Mitel.COM wrote:
>
> Tried the run asynch (and UIJob), gets rid of the error however the
> Menu items which appeared when it is run normally don't appear now.
> Looks like the workbench has not seen the selection event.


--------------010008060807010402090408
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Phill,<br>
<br>
I'm not really sure of the whole picture in your code, but some
variation of this approach (delayed reaction to selection or delayed
delivery of selection) is likely needed.<br>
<br>
<br>
<a class="moz-txt-link-abbreviated" href="mailto:Phill_Perryman@Mitel.COM">Phill_Perryman@Mitel.COM</a> wrote:
<blockquote cite="mid:frc3d5$hgh$1@build.eclipse.org" type="cite"><br>
<font face="sans-serif" size="2">Tried the run asynch (and UIJob),
gets
rid of the error however the Menu items which appeared when it is run
normally
don't appear now. Looks like the workbench has not seen the selection
event.</font>
</blockquote>
<br>
</body>
</html>

--------------010008060807010402090408--
Re: Recursive opening error [message #326302 is a reply to message #326291] Fri, 14 March 2008 08:15 Go to previous message
Phill Perryman is currently offline Phill PerrymanFriend
Messages: 214
Registered: July 2009
Senior Member
This is a multipart message in MIME format.
--=_alternative 002D5DF68025740C_=
Content-Type: text/plain; charset="US-ASCII"

I think I will try capturing the selection and then adding a post
selection listener and using the saved selection to run the code at that
point. At least the selection logic will have finished by then. Thanks for
the idea.
--=_alternative 002D5DF68025740C_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2 face="sans-serif">I think I will try capturing the selection
and then adding a post selection listener and using the saved selection
to run the code at that point. At least the selection logic will have finished
by then. Thanks for the idea.</font>
--=_alternative 002D5DF68025740C_=--
Previous Topic:Question about hyperlink detectors
Next Topic:Cannot find color setting for search hints
Goto Forum:
  


Current Time: Fri Oct 18 11:41:51 GMT 2024

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

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

Back to the top