FormEditor and canLeaveThePage [message #636660] |
Tue, 02 November 2010 11:26 |
Boris Stepanov Messages: 68 Registered: July 2009 |
Member |
|
|
Hi all,
I found the following issue in FormEditor class:
protected void setActivePage(int pageIndex) {
// fix for window handles problem
// this should be called only when the editor is first opened
if (pages.size() > pageIndex
&& pages.get(pageIndex) instanceof IFormPage) {
super.setActivePage(pageIndex);
IFormPage activePage = (IFormPage) pages.get(pageIndex);
activePage.setActive(true);
} else
super.setActivePage(pageIndex);
updateActionBarContributor(pageIndex);
}
This method calls super.setActivePage(int pageIndex) which executes
pageChange(int newPageIndex), but the last one can cancel page changing
through canLeaveThePage() method of the page (see FormEditor
implementation). setActivePage uses pageIndex variable even when page
change was cancelled in super method and sometimes we can see actions in
menu and toolbar from not active page (we see contributor from first
page, but second page is active).
We use method setActivePage to change page programmatically, if you
click on the tab pageChange protected method will be used, so this issue
cannot be reproduced by clicking on tabs. We have list of pages in
Outline view, so when user click on the one of them, page will be
changed through setActivePage method.
Is this a bug? I did not find anything on bugs.eclipse.org.
Thanks.
|
|
|
Powered by
FUDForum. Page generated in 0.02492 seconds