Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EEF] Master detail form extension
[EEF] Master detail form extension [message #655092] Fri, 18 February 2011 10:04 Go to next message
Nirmal SasidharanFriend
Messages: 120
Registered: July 2009
Location: Germany
Senior Member
Hello,

I am using the master detail form generated by EEF. I would like to make some extensions to the toolbar in master part.

Currently, the add button does the following in org.eclipse.emf.eef.runtime.ui.widgets.masterdetails.tree.EE FTreeMasterPart:

menuItem.addSelectionListener(new SelectionAdapter() {
	@Override
	public void widgetSelected(SelectionEvent e) {
				
		EList<EObject> list = (EList<EObject>) modelRoot.eGet(commandParameter.getReference());
		EObject value = EcoreUtil.create(commandParameter.geteClass());
		
		if(editingDomain != null) {
			Command command = AddCommand.create(editingDomain, modelRoot,null,value);
			editingDomain.getCommandStack().execute(command);
		}
		try {
			modelRoot.eResource().save(Collections.EMPTY_MAP);
			
		} catch (IOException e1) {
			e1.printStackTrace();
		}
	}
});


It creates an instance of the selected model object and adds it to the model (interestingly, it also saves the model at this point). Instead of this, I would like to bring up the corresponding WizardDialog for the model object so that the user can fill in the required attributes in the wizard itself instead of an empty object getting added (as of now).

Could you give some pointers on how this could be done?

Thanks in advance,

Regards,
Nirmal






Re: [EEF] Master detail form extension [message #663569 is a reply to message #655092] Tue, 05 April 2011 16:38 Go to previous message
Goulwen Le Fur is currently offline Goulwen Le FurFriend
Messages: 125
Registered: July 2009
Senior Member
Hello Nirmal, sorry for the delay,



Le 18/02/2011 11:04, Nirmal Sasidharan a écrit :
> Hello,
>
> I am using the master detail form generated by EEF. I would like to make
> some extensions to the toolbar in master part.
>
> Currently, the add button does the following in
> org.eclipse.emf.eef.runtime.ui.widgets.masterdetails.tree.EE
> FTreeMasterPart:
>
>
> menuItem.addSelectionListener(new SelectionAdapter() {
> @Override
> public void widgetSelected(SelectionEvent e) {
>
> EList<EObject> list = (EList<EObject>)
> modelRoot.eGet(commandParameter.getReference());
> EObject value = EcoreUtil.create(commandParameter.geteClass());
>
> if(editingDomain != null) {
> Command command = AddCommand.create(editingDomain, modelRoot,null,value);
> editingDomain.getCommandStack().execute(command);
> }
> try {
> modelRoot.eResource().save(Collections.EMPTY_MAP);
>
> } catch (IOException e1) {
> e1.printStackTrace();
> }
> }
> });
>
>
> It creates an instance of the selected model object and adds it to the
> model (interestingly, it also saves the model at this point). Instead of
> this, I would like to bring up the corresponding WizardDialog for the
> model object so that the user can fill in the required attributes in the
> wizard itself instead of an empty object getting added (as of now).
>
> Could you give some pointers on how this could be done?
>

Sorry, there isn't a 'simple' way to do that in EEF for the moment. The
only thing you can do is to create your own page with your own MasterPart.

> Thanks in advance,
>

Regards,

--
Goulwen

> Regards,
> Nirmal
>
>
>
>
>
>
>
Previous Topic:[EMF]
Next Topic:EMF AdapterFactory and EEF Editor
Goto Forum:
  


Current Time: Thu Apr 18 10:36:40 GMT 2024

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

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

Back to the top