Search in sources :

Example 6 with PrivatePackageSection

use of org.osate.aadl2.PrivatePackageSection in project osate2 by osate.

the class AadlPackageImpl method basicSetOwnedPrivateSection.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetOwnedPrivateSection(PrivatePackageSection newOwnedPrivateSection, NotificationChain msgs) {
    PrivatePackageSection oldOwnedPrivateSection = ownedPrivateSection;
    ownedPrivateSection = newOwnedPrivateSection;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Aadl2Package.AADL_PACKAGE__OWNED_PRIVATE_SECTION, oldOwnedPrivateSection, newOwnedPrivateSection);
        if (msgs == null) {
            msgs = notification;
        } else {
            msgs.add(notification);
        }
    }
    Resource.Internal eInternalResource = eInternalResource();
    if (eInternalResource == null || !eInternalResource.isLoading()) {
        if (newOwnedPrivateSection != null) {
            if (newOwnedPrivateSection != privateSection) {
                setPrivateSection(newOwnedPrivateSection);
            }
        }
    }
    return msgs;
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) Resource(org.eclipse.emf.ecore.resource.Resource) PrivatePackageSection(org.osate.aadl2.PrivatePackageSection)

Example 7 with PrivatePackageSection

use of org.osate.aadl2.PrivatePackageSection in project osate2 by osate.

the class AadlBaVisitors method getBaPackageSections.

/**
 * Return the package sections related to a given BehaviorAnnex. As
 * "Classifier declarations in public sections are accessible to other
 * packages, while classifiers in private sections can only be referenced
 * within the private section of the same package".<br><br>
 * table[0] always refers to public section.
 * If the given BehaviorAnnex is declared in a private section, table's
 * length equals to 2 and table[1] refers to the private section.
 *
 * @param ba The given BehaviorAnnex
 * @return the package sections related to the given BehaviorAnnex.
 */
public static PackageSection[] getBaPackageSections(BehaviorAnnex ba) {
    PackageSection[] result;
    PackageSection container = Aadl2Visitors.getContainingPackageSection(ba);
    // package's private section.
    if (container instanceof PrivatePackageSection) {
        result = new PackageSection[2];
        result[1] = container;
        result[0] = ((AadlPackage) container.eContainer()).getPublicSection();
    } else {
        result = new PackageSection[1];
        result[0] = container;
    }
    return result;
}
Also used : PackageSection(org.osate.aadl2.PackageSection) PrivatePackageSection(org.osate.aadl2.PrivatePackageSection) PrivatePackageSection(org.osate.aadl2.PrivatePackageSection)

Example 8 with PrivatePackageSection

use of org.osate.aadl2.PrivatePackageSection in project osate2 by osate.

the class AadlPackageImpl method setPrivateSection.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated NOT
 */
public void setPrivateSection(PrivatePackageSection newPrivateSection) {
    PrivatePackageSection oldPrivateSection = privateSection;
    privateSection = newPrivateSection;
    if (eNotificationRequired()) {
        eNotify(new ENotificationImpl(this, Notification.SET, Aadl2Package.AADL_PACKAGE__PRIVATE_SECTION, oldPrivateSection, privateSection));
    }
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) PrivatePackageSection(org.osate.aadl2.PrivatePackageSection)

Aggregations

PrivatePackageSection (org.osate.aadl2.PrivatePackageSection)7 PublicPackageSection (org.osate.aadl2.PublicPackageSection)3 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)2 AadlPackage (org.osate.aadl2.AadlPackage)2 ContainedNamedElement (org.osate.aadl2.ContainedNamedElement)2 EObject (org.eclipse.emf.ecore.EObject)1 EOperation (org.eclipse.emf.ecore.EOperation)1 EPackage (org.eclipse.emf.ecore.EPackage)1 Resource (org.eclipse.emf.ecore.resource.Resource)1 Action (org.eclipse.xtext.Action)1 Parameter (org.eclipse.xtext.Parameter)1 ParserRule (org.eclipse.xtext.ParserRule)1 org.osate.aadl2 (org.osate.aadl2)1 AadlBoolean (org.osate.aadl2.AadlBoolean)1 AadlInteger (org.osate.aadl2.AadlInteger)1 AadlReal (org.osate.aadl2.AadlReal)1 AadlString (org.osate.aadl2.AadlString)1 AbstractFeature (org.osate.aadl2.AbstractFeature)1 AbstractImplementation (org.osate.aadl2.AbstractImplementation)1 AbstractPrototype (org.osate.aadl2.AbstractPrototype)1