Interface CreateElementCallback

  • All Known Implementing Classes:
    InitializeChildCallback

    public interface CreateElementCallback
    This interface allows intercepting the TreeMasterDetailSWTRenderer's create function. The callback can modify the newly created element as well as cancel the action.
    • Method Summary

      All Methods Instance Methods Abstract 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.
    • Method Detail

      • initElement

        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. 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.
        Parameters:
        parent - the future parent
        reference - the parent reference
        newObject - the newly created EObject, which should be initialized.
        Since:
        1.9
      • beforeCreateElement

        boolean beforeCreateElement​(java.lang.Object newElement)
        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.
        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

        void afterCreateElement​(java.lang.Object newElement)
        Gets called after a new element was added to the domain model.
        Parameters:
        newElement - the new Element.
        Since:
        1.9