Bug 23127 - [PropertiesView] should listen to partBroughtToTop also
Summary: [PropertiesView] should listen to partBroughtToTop also
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Eric Moffatt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-09-03 15:46 EDT by Richard Kulp CLA
Modified: 2005-07-27 11:03 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Kulp CLA 2002-09-03 15:46:20 EDT
We ran into a problem because the PropertySheet wasn't listening to 
partBroughtToTop in addition to partActivated.

The problem we ran into was we had two editors open, so there are two property 
sheet pages, one for each editor. We also had an outline view open, so there 
are also two OutlinePages, one for each editor. We had selected the outline 
view, and this then sent out the partActivated and the appropriate 
propertysheet page was brought forward. We then closed the corresponding editor 
by clicking on the 'X' on the editor tab to close it. The correct property 
sheet page and outline page were disposed, and the property sheet switched to 
the default property sheet page (which is the one for the navigator).

However the next thing that happens is that partBroughtToTop is sent to the 
Outline View, which under the covers then brings up one of its outline pages. 
However, since the property sheet view is not listening for partBroughtToTop, 
it doesn't switch the property sheet to the correct corresponding property 
sheet page. It leaves it on the default one.

This then causes a problem because when we select anything in the outline view 
it sends out a selection notification, but the default property sheet page 
doesn't understand the contents of that selection and exceptions are thrown 
because it went to the wrong property sheet page.
Comment 1 Richard Kulp CLA 2003-05-20 14:54:44 EDT
Could this be looked at please? It is still causing us problems. ContentOutline
is example of where partBroughtToTop is handled. Thanks.
Comment 2 Gili Mendel CLA 2004-09-28 16:22:53 EDT
The problem here is that the exception render the property sheet unusable when
this occurs.

All we need is to override in PropertySheet

public void partBroughtToTop(IWorkbenchPart part) {
	partActivated(part);  
}
Comment 3 Nick Edgar CLA 2005-07-05 15:11:18 EDT
See also bug 2306.
Comment 4 Nick Edgar CLA 2005-07-05 15:12:56 EDT
Ignore previous comment.  I meant bug 43085.
Comment 5 Eric Moffatt CLA 2005-07-26 15:20:44 EDT
The suggestion to simply handle 'partBroughtToTop' doesn't work here because 
the part that's brought to the top is the new editor (it's the new 'active' 
part), not the Outline View's corresponding page.

I'll look into this a bit more...

Comment 6 Richard Kulp CLA 2005-07-26 15:29:50 EDT
That's ok. It is the editor that we are interested in. The Outline page is
associated with the new editor. So partBroughtToTop is the new editor and so the
property sheet will select the correct property page for that new editor. 
Comment 7 Eric Moffatt CLA 2005-07-27 09:37:44 EDT
Richard, the editor doesn't need the 'partBroughtToTop' handling, it already 
gets a 'partActivated' since the new editor is becoming the active part.

In this scenario who is contributiing into the Property View...the editor or 
the outline view? The initial comment seems to indicate that it was the 
OutlinePage.
Comment 8 Richard Kulp CLA 2005-07-27 11:03:39 EDT
This is no longer a problem because the sequence of events has changed. It used
to be that if the outline view was active and you click the "x" and closed an
editor, the outline view would stay active and another editor would be brought
to top. But what has changed is that another editor is not brought to top but
instead is activated and focus moved over to it and taken from the outline view.
So now partActivated is called and the appropriate property sheet page is
brought in.

partBroughtToTop might still cause a problem but during my short little testing
this morning I wasn't able to have partBroughtToTop by itself. It was always
followed by a partActivated.