Skip to main content

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: 37
Registered: November 2012
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().

	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:Is it possible to add connections between two TreeViewers in an Editor?
Next Topic:Modifying ProjectionDrawingStrategy
Goto Forum:

Current Time: Mon May 21 19:06:47 GMT 2018

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

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

Back to the top