Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » FormEditor.selectReveal() not working(Is IFormPage loading too lazy?)
FormEditor.selectReveal() not working [message #1050596] Sat, 27 April 2013 12:28 Go to next message
Ben Cox is currently offline Ben CoxFriend
Messages: 17
Registered: June 2012
Junior Member
Hi All,

I'm currently trying to use FormEditor.selectReveal(Object pageInput) on a multi-page FormEditor. It's currently working fine... as long as I've previously viewed the page that the pageInput is found on!

The problem is that the UI for the IFormPage is lazily loaded (great feature), but all the IFormParts (such as SectionParts) are added to the IManagedForm during that period of UI creation, because they all rely on being passed or creating their Sections etc in their constructors. Therefore, they're not registered when selectReveal(...) comes iterates through the IManagedForm's IFormParts.

Is there any way of registering the IFormParts with the IManagedForm before the pages are shown for the first time, without having to create all the pages up-front?
Re: FormEditor.selectReveal() not working [message #1421496 is a reply to message #1050596] Thu, 11 September 2014 12:45 Go to previous message
Arye Shemesh is currently offline Arye ShemeshFriend
Messages: 19
Registered: November 2012
Junior Member
Hi Ben,

Although it's been a (long) while since you asked, and I'm not sure my solution is perfect, here's what I did to overcome this issue:

I implemented selectReveal in my form. If form was previously activated I call super.selectReveal(). If not, I check if the input object is related to my model, and if it is I call setActivePage(getId()) to activate my form, and then call super.selectReveal().

	@Override
	public boolean selectReveal(Object object) {
		if (getPartControl() == null) {
		//Page not initialized                  
 
			if (objectIsNotRelevantToPage()) {
				return false;
			}
			getEditor().setActivePage(getId()); //Initializes Page
		}
		return super.selectReveal(object);
	}


Hope this helps. I'll be happy to hear of any other solution that might be relevant.
Previous Topic:Need help with Jface in eclipse
Next Topic:TreeViewer refresh/update specific TreeColumn
Goto Forum:
  


Current Time: Sat Dec 20 00:17:31 GMT 2014

Powered by FUDForum. Page generated in 0.18451 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software