Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » FormEditor and canLeaveThePage
FormEditor and canLeaveThePage [message #636660] Tue, 02 November 2010 07:26
Boris Stepanov is currently offline 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.
Previous Topic:How to add java project's classpath to a plug-in's classpath?
Next Topic:Changing fonts without effect
Goto Forum:
  


Current Time: Sat Aug 23 03:45:13 EDT 2014

Powered by FUDForum. Page generated in 0.04818 seconds