[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.emf] Re: Custom code after initialization (Short question) [to: Zac]

Zac Woof wrote:
I had a similar requirement and I ended up overriding the doDefaultElementCreation() method in the CreateCommand class for my element and creating the child objects there on the actual EObject. Something like this:

/**
   * @generated NOT
   */
  @Override
  protected EObject doDefaultElementCreation() {
    MyObject obj = (MyObject) super.doDefaultElementCreation();
    obj.createChildObjects();
    return obj;
  }

Hi!

This worked great for running customized code when an object is created, but my problem now is that the diagram element do not have a create command - so I can't create objects on diagram startup using this method.


Regards,

Tomas Zijdemans