Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » create children automatically works in EMF editor but not using GMF editor
create children automatically works in EMF editor but not using GMF editor [message #99194] Tue, 30 January 2007 13:58 Go to next message
Eclipse UserFriend
Originally posted by: et.email.ro

Hi,

When I create a certain element of my EMF model, I want some of its
children to be automatically created.Therefore, I modified the method
collectNewChildDescriptors(...) of my XXXItemProvider.java (in the edit
plugin).

When I add the element using EMF editor, its children are created
automatically, as expected, but when I draw the element with the GMF
editor its children are not created (collectNewChildDescriptors(...) is
not invoked)

Do you have an idea why?
Thanks.
elena
Re: create children automatically works in EMF editor but not using GMF editor [message #99208 is a reply to message #99194] Tue, 30 January 2007 14:52 Go to previous message
Eclipse UserFriend
Originally posted by: vcciubot.uwaterloo.ca

Looks like collectNewChildDescriptors does this:

/**
* This implements {@link IEditingDomainItemProvider#getNewChildDescriptors
* IEditingDomainItemProvider.getNewChildDescriptors}, returning {@link
* org.eclipse.emf.edit.command.CommandParameter}s to describe all the possible children that can be added to the
* specified <code>object</code>.
*
* <p>This implementation invokes {@link #collectNewChildDescriptors collectNewChildDescriptors}, which should be
* overridden by derived classes, to build this collection.
*
* <p>If <code>sibling</code> is non-null, an <code>index</code> is added to each <code>CommandParameter</code> with
* a multi-valued <code>feature</code>, to ensure that the new child object gets added in the right position.
*/

It's for showing what kind of children can be added to an element.


If you want to create children automatically, you need to override
getConfigureCommand() on the EditHelper corresponding to that element type.

There are some previous threads on this topic.

-vlad

On Tue, 30 Jan 2007 18:58:43 +0000, elena t wrote:

> Hi,
>
> When I create a certain element of my EMF model, I want some of its
> children to be automatically created.Therefore, I modified the method
> collectNewChildDescriptors(...) of my XXXItemProvider.java (in the edit
> plugin).
>
> When I add the element using EMF editor, its children are created
> automatically, as expected, but when I draw the element with the GMF
> editor its children are not created (collectNewChildDescriptors(...) is
> not invoked)
>
> Do you have an idea why?
> Thanks.
> elena
Previous Topic:Override a toolbar action
Next Topic:Canonical Edit Policy not being called ?
Goto Forum:
  


Current Time: Tue Jul 15 02:01:21 EDT 2025

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

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

Back to the top