[EEF] Master detail form extension [message #655092] |
Fri, 18 February 2011 10:04 |
Nirmal Sasidharan 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 |
Goulwen Le Fur 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
>
>
>
>
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02637 seconds