Community
Participate
Working Groups
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.
Could this be looked at please? It is still causing us problems. ContentOutline is example of where partBroughtToTop is handled. Thanks.
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); }
See also bug 2306.
Ignore previous comment. I meant bug 43085.
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...
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.
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.
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.