ISaveablePart2 and Perspective [message #467059] |
Fri, 27 April 2007 14:02  |
Eclipse User |
|
|
|
hi guys,
I run into an issue with Eclipse 3.2.2 view implementing ISaveablePart2
when there are multiple perspectives. Here's the case: 1 have a view which
implements ISavablePart2, which means user will be prompted when the 'X'
is clicked and my application has 2 perspectives (called p1 & p2). When
the application starts up, it will be loaded into one of the perspective,
for now, let say it's p1 and view is created as well. and it gets switched
to p2. With p2 as the active perspective, the 'X' on the view is clicked.
What happen at this point is a dialog comes up asking user whether to
close the view and the perspective gets switched back to p1. After a
little investigation i found the following code in
EditorManager.saveAll(1147 to 1153):
if (part instanceof IViewPart) {
Perspective perspective =
page .getFirstPerspectiveWithView((IViewPart) part);
if (perspective != null) {
page.setPerspective(perspective.getDesc());
}
}
so, according to the snippet above, before the confirmation dialog is
pop, it will always switch back to the least recently used perspective. It
uses the WorkbechPage.persList.usedList, and this list keeps tracks of
recent used perspective, and the last one on the list is the the most
recent one and the first one is the least recently used. So my question
is, is this a bug? or, there's something i did incorrectly?
thanks in advance.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05178 seconds