diff options
author | Eike Stepper | 2011-09-15 11:13:28 +0000 |
---|---|---|
committer | Eike Stepper | 2011-09-15 11:13:28 +0000 |
commit | cbe30d9771b769bb3601b529fb5522f1b8a73728 (patch) | |
tree | a9f34445529a2c99cca09358f3058cf5a71b0a58 /plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf | |
parent | 353dc167ebcd12cafa6aa7dfc1288ee96d4f9c2c (diff) | |
download | cdo-cbe30d9771b769bb3601b529fb5522f1b8a73728.tar.gz cdo-cbe30d9771b769bb3601b529fb5522f1b8a73728.tar.xz cdo-cbe30d9771b769bb3601b529fb5522f1b8a73728.zip |
file headers
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf')
-rw-r--r-- | plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/legacy/model1/impl/PurchaseOrderImpl.java | 39 |
1 files changed, 34 insertions, 5 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/legacy/model1/impl/PurchaseOrderImpl.java b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/legacy/model1/impl/PurchaseOrderImpl.java index 5b6646526a..c9478de015 100644 --- a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/legacy/model1/impl/PurchaseOrderImpl.java +++ b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/legacy/model1/impl/PurchaseOrderImpl.java @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Eike Stepper - initial API and implementation + */ package org.eclipse.emf.cdo.tests.legacy.model1.impl; import org.eclipse.emf.cdo.tests.legacy.model1.Model1Package; @@ -12,11 +22,8 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl; import java.util.Date; -/* - * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others. All rights reserved. This program and the - * accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this - * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: Eike Stepper - initial API - * and implementation +/** + * @author Eike Stepper */ public class PurchaseOrderImpl extends OrderImpl implements PurchaseOrder { @@ -97,7 +104,9 @@ public class PurchaseOrderImpl extends OrderImpl implements PurchaseOrder Date oldDate = date; date = newDate; if (eNotificationRequired()) + { eNotify(new ENotificationImpl(this, Notification.SET, Model1Package.PURCHASE_ORDER__DATE, oldDate, date)); + } } /** @@ -114,8 +123,10 @@ public class PurchaseOrderImpl extends OrderImpl implements PurchaseOrder if (supplier != oldSupplier) { if (eNotificationRequired()) + { eNotify(new ENotificationImpl(this, Notification.RESOLVE, Model1Package.PURCHASE_ORDER__SUPPLIER, oldSupplier, supplier)); + } } } return supplier; @@ -145,9 +156,13 @@ public class PurchaseOrderImpl extends OrderImpl implements PurchaseOrder ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Model1Package.PURCHASE_ORDER__SUPPLIER, oldSupplier, newSupplier); if (msgs == null) + { msgs = notification; + } else + { msgs.add(notification); + } } return msgs; } @@ -163,18 +178,26 @@ public class PurchaseOrderImpl extends OrderImpl implements PurchaseOrder { NotificationChain msgs = null; if (supplier != null) + { msgs = ((InternalEObject)supplier).eInverseRemove(this, Model1Package.SUPPLIER__PURCHASE_ORDERS, Supplier.class, msgs); + } if (newSupplier != null) + { msgs = ((InternalEObject)newSupplier).eInverseAdd(this, Model1Package.SUPPLIER__PURCHASE_ORDERS, Supplier.class, msgs); + } msgs = basicSetSupplier(newSupplier, msgs); if (msgs != null) + { msgs.dispatch(); + } } else if (eNotificationRequired()) + { eNotify(new ENotificationImpl(this, Notification.SET, Model1Package.PURCHASE_ORDER__SUPPLIER, newSupplier, newSupplier)); + } } /** @@ -189,8 +212,10 @@ public class PurchaseOrderImpl extends OrderImpl implements PurchaseOrder { case Model1Package.PURCHASE_ORDER__SUPPLIER: if (supplier != null) + { msgs = ((InternalEObject)supplier).eInverseRemove(this, Model1Package.SUPPLIER__PURCHASE_ORDERS, Supplier.class, msgs); + } return basicSetSupplier((Supplier)otherEnd, msgs); } return super.eInverseAdd(otherEnd, featureID, msgs); @@ -226,7 +251,9 @@ public class PurchaseOrderImpl extends OrderImpl implements PurchaseOrder return getDate(); case Model1Package.PURCHASE_ORDER__SUPPLIER: if (resolve) + { return getSupplier(); + } return basicGetSupplier(); } return super.eGet(featureID, resolve, coreType); @@ -299,7 +326,9 @@ public class PurchaseOrderImpl extends OrderImpl implements PurchaseOrder public String toString() { if (eIsProxy()) + { return super.toString(); + } StringBuffer result = new StringBuffer(super.toString()); result.append(" (date: "); |