Using Model.Edit for View [message #397675] |
Wed, 04 January 2006 09:14  |
Eclipse User |
|
|
|
Originally posted by: mohansl.gmail.com
Hi,
I would like to know how I may use Model.Edit to generate a view, just
as Model.Editor is generated.
Regards,
Mohan.
|
|
|
|
|
|
Re: Using Model.Edit for View [message #397763 is a reply to message #397755] |
Mon, 09 January 2006 09:41  |
Eclipse User |
|
|
|
mohansl wrote:
> 1. I am unable to set the right <rootObj>, can somebody give me pointers
> to do this. 2. Also how to add child using the generated Model.Edit
> framework. 3. Is there a way that I can re-use the generated
> ActionBarContributor for the view
> 4. How do I refersh this EMF View.
The argument you're not sure about should be the parent object: the
selected object for a "create child" or the parent of the selected
object for a "create sibling" (both use the same command).
You've got other big problems here: you shouldn't be passing just an
object to add as a child. If that's all you want, you can just use an
AddCommand. You should be delegating to your item providers to return
the valid child descriptors (CommandParameters) for the selected object,
and then creating a CreateChildCommand for each one.
You cannot reuse the generated action bar contributor, since it
ultimately extends EditorActionBarContributor, which is for editors
only. You can, however, create something similar and reuse the EMF
actions in it (although apparently DeleteAction has a problem, which I'm
supposed to look at). As I said before, look for a prototypical action
bar contributor in Eike Stepper's post titled "Model in a View".
You should be able to refresh the view as normal: call refresh() on the
viewer in it.
Cheers,
Dave
|
|
|
Powered by
FUDForum. Page generated in 0.04045 seconds