Commit 94c2cf8e authored by Dominique Marcadet's avatar Dominique Marcadet

add RefersToDO in DOI

parent 40075e6b
......@@ -1278,3 +1278,5 @@ _UI_AbstractDataObject_name_feature = Name
_UI_AbstractDataObject_type_feature = Type
_UI_AbstractDataObject_RefersToDOType_feature = Refers To DO Type
_UI_AbstractDataObject_ReferredByExtRef_feature = Referred By Ext Ref
_UI_DO_ReferredByDOI_feature = Referred By DOI
_UI_DOI_RefersToDO_feature = Refers To DO
......@@ -64,6 +64,7 @@ public class DOIItemProvider extends UnNamingItemProvider {
addIxPropertyDescriptor(object);
addAccessControlPropertyDescriptor(object);
addNamePropertyDescriptor(object);
addRefersToDOPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
......@@ -134,6 +135,28 @@ public class DOIItemProvider extends UnNamingItemProvider {
null));
}
/**
* This adds a property descriptor for the Refers To DO feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addRefersToDOPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_DOI_RefersToDO_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_DOI_RefersToDO_feature", "_UI_DOI_type"),
SclPackage.eINSTANCE.getDOI_RefersToDO(),
true,
false,
true,
null,
null,
null));
}
/**
* This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
* {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
......
......@@ -61,6 +61,7 @@ public class DOItemProvider extends AbstractDataObjectItemProvider {
addTransientPropertyDescriptor(object);
addAccessControlPropertyDescriptor(object);
addReferredByDOIPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
......@@ -109,6 +110,28 @@ public class DOItemProvider extends AbstractDataObjectItemProvider {
null));
}
/**
* This adds a property descriptor for the Referred By DOI feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addReferredByDOIPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_DO_ReferredByDOI_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_DO_ReferredByDOI_feature", "_UI_DO_type"),
SclPackage.eINSTANCE.getDO_ReferredByDOI(),
true,
false,
true,
null,
null,
null));
}
/**
* This returns DO.gif.
* <!-- begin-user-doc -->
......
......@@ -423,6 +423,9 @@
eOpposite="#//LNodeType/DO"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="accessControl" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
unsettable="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="ReferredByDOI" ordered="false"
upperBound="-1" eType="#//DOI" transient="true" unsettable="true" resolveProxies="false"
eOpposite="#//DOI/RefersToDO"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="DOType" eSuperTypes="#//IDNaming">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="cdc" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
......@@ -848,6 +851,8 @@
unsettable="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
unsettable="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="RefersToDO" ordered="false"
eType="#//DO" transient="true" unsettable="true" resolveProxies="false" eOpposite="#//DO/ReferredByDOI"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="DataObjectDirectory" eSuperTypes="#//ServiceYesNo">
<eStructuralFeatures xsi:type="ecore:EReference" name="ParentServices" ordered="false"
......
......@@ -284,6 +284,7 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute SCL.ecore#//DO/transient"/>
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference SCL.ecore#//DO/ParentLNodeType"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute SCL.ecore#//DO/accessControl"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference SCL.ecore#//DO/ReferredByDOI"/>
</genClasses>
<genClasses ecoreClass="SCL.ecore#//DOType">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute SCL.ecore#//DOType/cdc"/>
......@@ -473,6 +474,7 @@
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference SCL.ecore#//DOI/SDI"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute SCL.ecore#//DOI/accessControl"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute SCL.ecore#//DOI/name"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference SCL.ecore#//DOI/RefersToDO"/>
</genClasses>
<genClasses ecoreClass="SCL.ecore#//DataObjectDirectory">
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference SCL.ecore#//DataObjectDirectory/ParentServices"/>
......
......@@ -18,6 +18,8 @@
*/
package fr.centralesupelec.edf.riseclipse.iec61850.scl;
import org.eclipse.emf.common.util.EList;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>DO</b></em>'.
......@@ -30,6 +32,7 @@ package fr.centralesupelec.edf.riseclipse.iec61850.scl;
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.DO#getTransient <em>Transient</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.DO#getParentLNodeType <em>Parent LNode Type</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.DO#getAccessControl <em>Access Control</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.DO#getReferredByDOI <em>Referred By DOI</em>}</li>
* </ul>
*
* @see fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage#getDO()
......@@ -164,4 +167,41 @@ public interface DO extends AbstractDataObject {
*/
boolean isSetAccessControl();
/**
* Returns the value of the '<em><b>Referred By DOI</b></em>' reference list.
* The list contents are of type {@link fr.centralesupelec.edf.riseclipse.iec61850.scl.DOI}.
* It is bidirectional and its opposite is '{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.DOI#getRefersToDO <em>Refers To DO</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the value of the '<em>Referred By DOI</em>' reference list.
* @see #isSetReferredByDOI()
* @see #unsetReferredByDOI()
* @see fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage#getDO_ReferredByDOI()
* @see fr.centralesupelec.edf.riseclipse.iec61850.scl.DOI#getRefersToDO
* @model opposite="RefersToDO" resolveProxies="false" unsettable="true" transient="true" ordered="false"
* @generated
*/
EList<DOI> getReferredByDOI();
/**
* Unsets the value of the '{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.DO#getReferredByDOI <em>Referred By DOI</em>}' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isSetReferredByDOI()
* @see #getReferredByDOI()
* @generated
*/
void unsetReferredByDOI();
/**
* Returns whether the value of the '{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.DO#getReferredByDOI <em>Referred By DOI</em>}' reference list is set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return whether the value of the '<em>Referred By DOI</em>' reference list is set.
* @see #unsetReferredByDOI()
* @see #getReferredByDOI()
* @generated
*/
boolean isSetReferredByDOI();
} // DO
......@@ -35,6 +35,7 @@ import org.eclipse.emf.common.util.EList;
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.DOI#getSDI <em>SDI</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.DOI#getAccessControl <em>Access Control</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.DOI#getName <em>Name</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.DOI#getRefersToDO <em>Refers To DO</em>}</li>
* </ul>
*
* @see fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage#getDOI()
......@@ -299,4 +300,55 @@ public interface DOI extends UnNaming {
*/
boolean isSetName();
/**
* Returns the value of the '<em><b>Refers To DO</b></em>' reference.
* It is bidirectional and its opposite is '{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.DO#getReferredByDOI <em>Referred By DOI</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the value of the '<em>Refers To DO</em>' reference.
* @see #isSetRefersToDO()
* @see #unsetRefersToDO()
* @see #setRefersToDO(DO)
* @see fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage#getDOI_RefersToDO()
* @see fr.centralesupelec.edf.riseclipse.iec61850.scl.DO#getReferredByDOI
* @model opposite="ReferredByDOI" resolveProxies="false" unsettable="true" transient="true" ordered="false"
* @generated
*/
DO getRefersToDO();
/**
* Sets the value of the '{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.DOI#getRefersToDO <em>Refers To DO</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Refers To DO</em>' reference.
* @see #isSetRefersToDO()
* @see #unsetRefersToDO()
* @see #getRefersToDO()
* @generated
*/
void setRefersToDO(DO value);
/**
* Unsets the value of the '{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.DOI#getRefersToDO <em>Refers To DO</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isSetRefersToDO()
* @see #getRefersToDO()
* @see #setRefersToDO(DO)
* @generated
*/
void unsetRefersToDO();
/**
* Returns whether the value of the '{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.DOI#getRefersToDO <em>Refers To DO</em>}' reference is set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return whether the value of the '<em>Refers To DO</em>' reference is set.
* @see #unsetRefersToDO()
* @see #getRefersToDO()
* @see #setRefersToDO(DO)
* @generated
*/
boolean isSetRefersToDO();
} // DOI
......@@ -5133,6 +5133,15 @@ public interface SclPackage extends EPackage {
*/
int DO__ACCESS_CONTROL = ABSTRACT_DATA_OBJECT_FEATURE_COUNT + 2;
/**
* The feature id for the '<em><b>Referred By DOI</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int DO__REFERRED_BY_DOI = ABSTRACT_DATA_OBJECT_FEATURE_COUNT + 3;
/**
* The number of structural features of the '<em>DO</em>' class.
* <!-- begin-user-doc -->
......@@ -5140,7 +5149,7 @@ public interface SclPackage extends EPackage {
* @generated
* @ordered
*/
int DO_FEATURE_COUNT = ABSTRACT_DATA_OBJECT_FEATURE_COUNT + 3;
int DO_FEATURE_COUNT = ABSTRACT_DATA_OBJECT_FEATURE_COUNT + 4;
/**
* The number of operations of the '<em>DO</em>' class.
......@@ -8407,6 +8416,15 @@ public interface SclPackage extends EPackage {
*/
int DOI__NAME = UN_NAMING_FEATURE_COUNT + 5;
/**
* The feature id for the '<em><b>Refers To DO</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int DOI__REFERS_TO_DO = UN_NAMING_FEATURE_COUNT + 6;
/**
* The number of structural features of the '<em>DOI</em>' class.
* <!-- begin-user-doc -->
......@@ -8414,7 +8432,7 @@ public interface SclPackage extends EPackage {
* @generated
* @ordered
*/
int DOI_FEATURE_COUNT = UN_NAMING_FEATURE_COUNT + 6;
int DOI_FEATURE_COUNT = UN_NAMING_FEATURE_COUNT + 7;
/**
* The number of operations of the '<em>DOI</em>' class.
......@@ -20383,6 +20401,17 @@ public interface SclPackage extends EPackage {
*/
EAttribute getDO_AccessControl();
/**
* Returns the meta object for the reference list '{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.DO#getReferredByDOI <em>Referred By DOI</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference list '<em>Referred By DOI</em>'.
* @see fr.centralesupelec.edf.riseclipse.iec61850.scl.DO#getReferredByDOI()
* @see #getDO()
* @generated
*/
EReference getDO_ReferredByDOI();
/**
* Returns the meta object for class '{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.DOType <em>DO Type</em>}'.
* <!-- begin-user-doc -->
......@@ -22832,6 +22861,17 @@ public interface SclPackage extends EPackage {
*/
EAttribute getDOI_Name();
/**
* Returns the meta object for the reference '{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.DOI#getRefersToDO <em>Refers To DO</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference '<em>Refers To DO</em>'.
* @see fr.centralesupelec.edf.riseclipse.iec61850.scl.DOI#getRefersToDO()
* @see #getDOI()
* @generated
*/
EReference getDOI_RefersToDO();
/**
* Returns the meta object for class '{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.DataObjectDirectory <em>Data Object Directory</em>}'.
* <!-- begin-user-doc -->
......
......@@ -19,6 +19,9 @@
package fr.centralesupelec.edf.riseclipse.iec61850.scl.impl;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
......@@ -31,9 +34,12 @@ import org.eclipse.emf.ecore.util.InternalEList;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.AnyLN;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.DAI;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.DO;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.DOI;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.SDI;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage;
import fr.centralesupelec.edf.riseclipse.util.AbstractRiseClipseConsole;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole;
/**
* <!-- begin-user-doc -->
......@@ -49,6 +55,7 @@ import fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage;
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.impl.DOIImpl#getSDI <em>SDI</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.impl.DOIImpl#getAccessControl <em>Access Control</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.impl.DOIImpl#getName <em>Name</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.impl.DOIImpl#getRefersToDO <em>Refers To DO</em>}</li>
* </ul>
*
* @generated
......@@ -161,6 +168,25 @@ public class DOIImpl extends UnNamingImpl implements DOI {
*/
protected boolean nameESet;
/**
* The cached value of the '{@link #getRefersToDO() <em>Refers To DO</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRefersToDO()
* @generated
* @ordered
*/
protected DO refersToDO;
/**
* This is true if the Refers To DO reference has been set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
protected boolean refersToDOESet;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
......@@ -439,6 +465,105 @@ public class DOIImpl extends UnNamingImpl implements DOI {
return nameESet;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public DO getRefersToDO() {
return refersToDO;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetRefersToDO(DO newRefersToDO, NotificationChain msgs) {
DO oldRefersToDO = refersToDO;
refersToDO = newRefersToDO;
boolean oldRefersToDOESet = refersToDOESet;
refersToDOESet = true;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SclPackage.DOI__REFERS_TO_DO, oldRefersToDO, newRefersToDO, !oldRefersToDOESet);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setRefersToDO(DO newRefersToDO) {
if (newRefersToDO != refersToDO) {
NotificationChain msgs = null;
if (refersToDO != null)
msgs = ((InternalEObject)refersToDO).eInverseRemove(this, SclPackage.DO__REFERRED_BY_DOI, DO.class, msgs);
if (newRefersToDO != null)
msgs = ((InternalEObject)newRefersToDO).eInverseAdd(this, SclPackage.DO__REFERRED_BY_DOI, DO.class, msgs);
msgs = basicSetRefersToDO(newRefersToDO, msgs);
if (msgs != null) msgs.dispatch();
}
else {
boolean oldRefersToDOESet = refersToDOESet;
refersToDOESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SclPackage.DOI__REFERS_TO_DO, newRefersToDO, newRefersToDO, !oldRefersToDOESet));
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicUnsetRefersToDO(NotificationChain msgs) {
DO oldRefersToDO = refersToDO;
refersToDO = null;
boolean oldRefersToDOESet = refersToDOESet;
refersToDOESet = false;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.UNSET, SclPackage.DOI__REFERS_TO_DO, oldRefersToDO, null, oldRefersToDOESet);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void unsetRefersToDO() {
if (refersToDO != null) {
NotificationChain msgs = null;
msgs = ((InternalEObject)refersToDO).eInverseRemove(this, SclPackage.DO__REFERRED_BY_DOI, DO.class, msgs);
msgs = basicUnsetRefersToDO(msgs);
if (msgs != null) msgs.dispatch();
}
else {
boolean oldRefersToDOESet = refersToDOESet;
refersToDOESet = false;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET, SclPackage.DOI__REFERS_TO_DO, null, null, oldRefersToDOESet));
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean isSetRefersToDO() {
return refersToDOESet;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
......@@ -456,6 +581,10 @@ public class DOIImpl extends UnNamingImpl implements DOI {
return ((InternalEList<InternalEObject>)(InternalEList<?>)getDAI()).basicAdd(otherEnd, msgs);
case SclPackage.DOI__SDI:
return ((InternalEList<InternalEObject>)(InternalEList<?>)getSDI()).basicAdd(otherEnd, msgs);
case SclPackage.DOI__REFERS_TO_DO:
if (refersToDO != null)
msgs = ((InternalEObject)refersToDO).eInverseRemove(this, SclPackage.DO__REFERRED_BY_DOI, DO.class, msgs);
return basicSetRefersToDO((DO)otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
......@@ -474,6 +603,8 @@ public class DOIImpl extends UnNamingImpl implements DOI {
return ((InternalEList<?>)getDAI()).basicRemove(otherEnd, msgs);
case SclPackage.DOI__SDI:
return ((InternalEList<?>)getSDI()).basicRemove(otherEnd, msgs);
case SclPackage.DOI__REFERS_TO_DO:
return basicUnsetRefersToDO(msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
......@@ -512,6 +643,8 @@ public class DOIImpl extends UnNamingImpl implements DOI {
return getAccessControl();
case SclPackage.DOI__NAME:
return getName();
case SclPackage.DOI__REFERS_TO_DO:
return getRefersToDO();
}
return super.eGet(featureID, resolve, coreType);
}
......@@ -545,6 +678,9 @@ public class DOIImpl extends UnNamingImpl implements DOI {
case SclPackage.DOI__NAME:
setName((String)newValue);
return;
case SclPackage.DOI__REFERS_TO_DO:
setRefersToDO((DO)newValue);
return;
}
super.eSet(featureID, newValue);
}
......@@ -575,6 +711,9 @@ public class DOIImpl extends UnNamingImpl implements DOI {
case SclPackage.DOI__NAME:
unsetName();
return;
case SclPackage.DOI__REFERS_TO_DO:
unsetRefersToDO();
return;
}
super.eUnset(featureID);
}
......@@ -599,6 +738,8 @@ public class DOIImpl extends UnNamingImpl implements DOI {
return isSetAccessControl();
case SclPackage.DOI__NAME:
return isSetName();
case SclPackage.DOI__REFERS_TO_DO:
return isSetRefersToDO();
}
return super.eIsSet(featureID);
}
......@@ -623,4 +764,35 @@ public class DOIImpl extends UnNamingImpl implements DOI {
return result.toString();
}
@Override
protected void doResolveLinks() {
// see Issue #13
super.doResolveLinks();
String messagePrefix = "while resolving link from DOI on line " + getLineNumber() + ": ";
IRiseClipseConsole console = AbstractRiseClipseConsole.getConsole();
if(( getName() == null ) || getName().isEmpty() ) return;
List< DO > res =
getParentAnyLN()
.getRefersToLNodeType()
.getDO()
.stream()
.filter( d -> getName().equals( d.getName() ))
.collect( Collectors.toList() );
String mess = "DO( name = " + getName() + " )";
if( res.isEmpty() ) {
console.error( messagePrefix + "cannot find " + mess );
return;
}
if( res.size() > 1 ) {
console.error( messagePrefix + "found several " + mess );
return;
}
setRefersToDO( res.get( 0 ) );
console.info( "DOI on line " + getLineNumber() + " refers to " + mess + " on line " + getRefersToDO().getLineNumber() );
}
} //DOIImpl
......@@ -22,6 +22,7 @@ import java.util.List;
import java.util.stream.Collectors;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.DO;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.DOI;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.DOType;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.DataTypeTemplates;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.LNodeType;
......@@ -29,12 +30,16 @@ import fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage;
import fr.centralesupelec.edf.riseclipse.util.AbstractRiseClipseConsole;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectWithInverseEList;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.util.InternalEList;
/**
* <!-- begin-user-doc -->
......@@ -47,6 +52,7 @@ import org.eclipse.emf.ecore.util.EcoreUtil;
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.impl.DOImpl#getTransient <em>Transient</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.impl.DOImpl#getParentLNodeType <em>Parent LNode Type</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.impl.DOImpl#getAccessControl <em>Access Control</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.impl.DOImpl#getReferredByDOI <em>Referred By DOI</em>}</li>
* </ul>
*
* @generated
......@@ -110,6 +116,16 @@ public class DOImpl extends AbstractDataObjectImpl implements DO {
*/
protected boolean accessControlESet;
/**
* The cached value of the '{@link #getReferredByDOI() <em>Referred By DOI</em>}' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getReferredByDOI()
* @generated
* @ordered
*/
protected EList<DOI> referredByDOI;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
......@@ -278,12 +294,48 @@ public class DOImpl extends AbstractDataObjectImpl implements DO {
* @generated
*/
@Override
public EList<DOI> getReferredByDOI() {
if (referredByDOI == null) {
referredByDOI = new EObjectWithInverseEList.Unsettable<DOI>(DOI.class, this, SclPackage.DO__REFERRED_BY_DOI, SclPackage.DOI__REFERS_TO_DO);
}
return referredByDOI;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void unsetReferredByDOI() {
if (referredByDOI != null) ((InternalEList.Unsettable<?>)referredByDOI).unset();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean isSetReferredByDOI() {
return referredByDOI != null && ((InternalEList.Unsettable<?>)referredByDOI).isSet();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public NotificationChain eInverseAdd( InternalEObject otherEnd, int featureID, NotificationChain msgs ) {<