Skip to main content



      Home
Home » Modeling » EMF » Using Model.Edit for View
Using Model.Edit for View [message #397675] Wed, 04 January 2006 09:14 Go to next message
Eclipse UserFriend
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 #397678 is a reply to message #397675] Wed, 04 January 2006 11:17 Go to previous messageGo to next message
Eclipse UserFriend
mohansl wrote:

> I would like to know how I may use Model.Edit to generate a view, just
> as Model.Editor is generated.

Hi Mohan,

There is currently no support for generating a view, although Eike
Stepper has created a prototypical view and action bar contributor for
it. You should find it if you search the newsgroup.

Cheers,
Dave
Re: Using Model.Edit for View [message #397752 is a reply to message #397678] Sun, 08 January 2006 03:19 Go to previous messageGo to next message
Eclipse UserFriend
Hi,
Thanks for the pointer, however:
1. I tried to edit the model in the editor and refresh the view using
viewer.refresh(), it does not work, how do i go about it.
2. Also can somebody suggest me how to add create actions and refresh.

Regards.
mohan
Re: Using Model.Edit for View [message #397755 is a reply to message #397752] Sun, 08 January 2006 16:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mohansl.gmail.com

Hi,
I am trying creating actions using:
NewChildAction = new Action(){
public void run(){
MYFactory myfactory = MYFactory.eINSTANCE;
Child child = myfactory.createChild();
child.setName("mohansl");
child.setType("Student");
Command cmd = CreateChildCommand.create(editingDomain, <rootObj> ,
child, null);
editingDomain.getCommandStack().execute(cmd);

}

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.

Regards,
Mohan
Re: Using Model.Edit for View [message #397763 is a reply to message #397755] Mon, 09 January 2006 09:41 Go to previous message
Eclipse UserFriend
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
Previous Topic:"Generate Model Code" destroys my build dependencies
Next Topic:EMF Object comparisons.
Goto Forum:
  


Current Time: Sat Sep 20 10:31:28 EDT 2025

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

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

Back to the top