Class InitializeChildCallback

  • All Implemented Interfaces:
    CreateElementCallback

    public class InitializeChildCallback
    extends java.lang.Object
    implements CreateElementCallback
    This CreateElementCallback display a CreateDialog to the user that allows setting initial Values for the newly created element.
    Author:
    Clemens Elflein
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void afterCreateElement​(java.lang.Object newElement)
      Gets called after a new element was added to the domain model.
      boolean beforeCreateElement​(java.lang.Object newElement)
      Gets called after the new Element has been added to the containment tree.
      void initElement​(org.eclipse.emf.ecore.EObject parent, org.eclipse.emf.ecore.EReference reference, org.eclipse.emf.ecore.EObject newObject)
      Gets called before the new object has been added to containment tree.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • InitializeChildCallback

        public InitializeChildCallback()
    • Method Detail

      • initElement

        public void initElement​(org.eclipse.emf.ecore.EObject parent,
                                org.eclipse.emf.ecore.EReference reference,
                                org.eclipse.emf.ecore.EObject newObject)
        Description copied from interface: CreateElementCallback
        Gets called before the new object has been added to containment tree. Users may make changes to the newObject inside this method only. Changing the passed parent or reachable classes in any way might cause unwanted side effects. The future parent is passed to this method for read only reasons in order to perform all necessary init tasks.
        Specified by:
        initElement in interface CreateElementCallback
        Parameters:
        parent - the future parent
        reference - the parent reference
        newObject - the newly created EObject, which should be initialized.
      • beforeCreateElement

        public boolean beforeCreateElement​(java.lang.Object newElement)
        Description copied from interface: CreateElementCallback
        Gets called after the new Element has been added to the containment tree. This method may be used to allow the user to modify the newly created element or to allow the user canceling the add.
        Specified by:
        beforeCreateElement in interface CreateElementCallback
        Parameters:
        newElement - The new element
        Returns:
        true if the element should be kept in the containment tree, false if it should be removed again
      • afterCreateElement

        public void afterCreateElement​(java.lang.Object newElement)
        Description copied from interface: CreateElementCallback
        Gets called after a new element was added to the domain model.
        Specified by:
        afterCreateElement in interface CreateElementCallback
        Parameters:
        newElement - the new Element.