Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF Parsley » Standalone form?(Form for model element on top of view)
Standalone form? [message #1777826] Tue, 05 December 2017 02:04 Go to next message
Ulrich Lang is currently offline Ulrich LangFriend
Messages: 14
Registered: August 2015
Junior Member
Hi again ;)

I'm trying to create a form to edit an EMF model element

@Inject FormFactory formFactory;
@Inject AdapterFactoryEditingDomain eddom;

I've tried to manually instantiate:

FormDetailComposite x = new FormDetailComposite(activeShell, SWT.NONE);
x.init(alias, eddom);

Got a nullpointer at org.eclipse.emf.parsley.composite.AbstractDetailComposite.init(AbstractDetailComposite.java:59)

Also tried this way and got a nullpointer again:
FormDetailComposite formComposite =
formFactory.createFormDetailComposite(activeShell, SWT.NONE);
x.init(alias, eddom);

also tried to leave out the eddom...in init, which gives me another nullpointer: at org.eclipse.emf.parsley.composite.AbstractDetailComposite.init(AbstractDetailComposite.java:47)

Do you have any examples of how a form for a model element could be instantiated and displayed in RAP?

Thanks!
Ulrich
Re: Standalone form? [message #1778008 is a reply to message #1777826] Thu, 07 December 2017 17:06 Go to previous messageGo to next message
Francesco Guidieri is currently offline Francesco GuidieriFriend
Messages: 12
Registered: July 2009
Junior Member
Hi Ulrich,
sorry for the late reply.

Did you create the view with Parsley ExecutableExtensionFactory? It seems that injected attributes are not properly initialized.
It' s automagically managed by parsley it your plugin has the Parsley nature and you define your view in the dsl.

Let me know if this reply helps you.

Francesco
Re: Standalone form? [message #1778493 is a reply to message #1778008] Thu, 14 December 2017 22:21 Go to previous messageGo to next message
Ulrich Lang is currently offline Ulrich LangFriend
Messages: 14
Registered: August 2015
Junior Member
Hi Francesco.

Sorry I didn't ask the question correctly. I am trying to reuse some of your widgets, esp. the dual list box. Not sure if this is possible? I tried something like this, with the hope of opening just the dialog as a standalone widget (like a popup).

DetailFormBasedDialog x = new DetailFormBasedDialog(shell, "test", eobject, null);
x.create();
shell.open();
x.setBlockOnOpen(true);
x.open();

I understand that this poking around in Parsley's internals isn't intended, but if it works it would be quite nice (consistent widgets everywhere)

Thanks
Ulrich
Re: Standalone form? [message #1778545 is a reply to message #1778493] Sat, 16 December 2017 14:44 Go to previous message
Vincenzo Caselli is currently offline Vincenzo CaselliFriend
Messages: 235
Registered: January 2012
Senior Member

Hi Ulrich,
you can of course use Parsley for your goal, as long as you don't create explicitly (using new) the instance of DetailFormBasedDialog.
Always let a factory do this.
Your code may do something like this for example:

	@Inject DialogFactory dialogFactory;
	@Inject AdapterFactoryEditingDomain eddom;

	private Mail mail;

			...
			DetailFormBasedDialog x = dialogFactory.createDetailFormBasedDialog(
						getSite().getShell(), "Modify Mail message", mail, eddom);
			x.create();
			x.setBlockOnOpen(true);
			x.open();

(I just tried this in the Parsley Mail RCP Example)

Let us know if this works for you
Vincenzo
Previous Topic:actionAdd replaces context menus instead of adding
Next Topic:Bug or Design? Cannot further extend an extended EmfParsleyJavaGuiceModule
Goto Forum:
  


Current Time: Sat Apr 20 04:04:20 GMT 2024

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

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

Back to the top