Search in sources :

Example 1 with Parent

use of org.eclipse.m2e.model.edit.pom.Parent in project m2e-core by eclipse-m2e.

the class ModelImpl method basicSetParent.

/**
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 *
 * @generated
 */
public NotificationChain basicSetParent(Parent newParent, NotificationChain msgs) {
    Parent oldParent = parent;
    parent = newParent;
    boolean oldParentESet = parentESet;
    parentESet = true;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PomPackage.MODEL__PARENT, oldParent, newParent, !oldParentESet);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : Parent(org.eclipse.m2e.model.edit.pom.Parent) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Example 2 with Parent

use of org.eclipse.m2e.model.edit.pom.Parent in project m2e-core by eclipse-m2e.

the class ModelImpl method basicUnsetParent.

/**
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 *
 * @generated
 */
public NotificationChain basicUnsetParent(NotificationChain msgs) {
    Parent oldParent = parent;
    parent = null;
    boolean oldParentESet = parentESet;
    parentESet = false;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.UNSET, PomPackage.MODEL__PARENT, oldParent, null, oldParentESet);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : Parent(org.eclipse.m2e.model.edit.pom.Parent) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Example 3 with Parent

use of org.eclipse.m2e.model.edit.pom.Parent in project m2e-core-tests by tesla.

the class MavenModelEditTest method testOneReplace.

@Test
public void testOneReplace() throws Exception {
    PomResourceImpl resource = loadModel("one.xml");
    Model model = resource.getModel();
    Parent parent = model.getParent();
    parent.setArtifactId("tttt");
    assertEquals(loadFile("one_replace.xml"), MavenModelUtil.toString(resource));
    resource.unload();
}
Also used : Parent(org.eclipse.m2e.model.edit.pom.Parent) Model(org.eclipse.m2e.model.edit.pom.Model) PomResourceImpl(org.eclipse.m2e.model.edit.pom.util.PomResourceImpl) Test(org.junit.Test)

Aggregations

Parent (org.eclipse.m2e.model.edit.pom.Parent)3 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)2 Model (org.eclipse.m2e.model.edit.pom.Model)1 PomResourceImpl (org.eclipse.m2e.model.edit.pom.util.PomResourceImpl)1 Test (org.junit.Test)1