Search in sources :

Example 1 with ProjectReference

use of org.eclipse.n4js.n4mf.ProjectReference in project n4js by eclipse.

the class N4JSModel method getExtendedRuntimeEnvironment.

public Optional<IN4JSProject> getExtendedRuntimeEnvironment(N4JSProject project) {
    final URI location = project.getLocation();
    final ProjectDescription description = getProjectDescription(location);
    if (null == description) {
        return absent();
    }
    final ExtendedRuntimeEnvironment re = description.getExtendedRuntimeEnvironment();
    if (null == re) {
        return absent();
    }
    final ProjectReference ref = re.getExtendedRuntimeEnvironment();
    return resolveProjectReference(project, ref);
}
Also used : ExtendedRuntimeEnvironment(org.eclipse.n4js.n4mf.ExtendedRuntimeEnvironment) ProjectReference(org.eclipse.n4js.n4mf.ProjectReference) URI(org.eclipse.emf.common.util.URI) ProjectDescription(org.eclipse.n4js.n4mf.ProjectDescription) SimpleProjectDescription(org.eclipse.n4js.n4mf.SimpleProjectDescription)

Example 2 with ProjectReference

use of org.eclipse.n4js.n4mf.ProjectReference in project n4js by eclipse.

the class N4JSModel method getExtendedRuntimeEnvironmentName.

public Optional<String> getExtendedRuntimeEnvironmentName(URI location) {
    if (null == location) {
        return absent();
    }
    final ProjectDescription description = getProjectDescription(location);
    if (null == description) {
        return absent();
    }
    final ExtendedRuntimeEnvironment extendedRe = description.getExtendedRuntimeEnvironment();
    if (null == extendedRe) {
        return absent();
    }
    final ProjectReference reRef = extendedRe.getExtendedRuntimeEnvironment();
    if (null == reRef) {
        return absent();
    }
    final SimpleProjectDescription project = reRef.getProject();
    if (null == project) {
        return absent();
    }
    return fromNullable(project.getProjectId());
}
Also used : ExtendedRuntimeEnvironment(org.eclipse.n4js.n4mf.ExtendedRuntimeEnvironment) ProjectReference(org.eclipse.n4js.n4mf.ProjectReference) SimpleProjectDescription(org.eclipse.n4js.n4mf.SimpleProjectDescription) ProjectDescription(org.eclipse.n4js.n4mf.ProjectDescription) SimpleProjectDescription(org.eclipse.n4js.n4mf.SimpleProjectDescription)

Example 3 with ProjectReference

use of org.eclipse.n4js.n4mf.ProjectReference in project n4js by eclipse.

the class N4MFSemanticSequencer method sequence.

@Override
public void sequence(ISerializationContext context, EObject semanticObject) {
    EPackage epackage = semanticObject.eClass().getEPackage();
    ParserRule rule = context.getParserRule();
    Action action = context.getAssignedAction();
    Set<Parameter> parameters = context.getEnabledBooleanParameters();
    if (epackage == N4mfPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case N4mfPackage.BOOTSTRAP_MODULE:
                sequence_BootstrapModule(context, (BootstrapModule) semanticObject);
                return;
            case N4mfPackage.DECLARED_VERSION:
                sequence_DeclaredVersion(context, (DeclaredVersion) semanticObject);
                return;
            case N4mfPackage.EXEC_MODULE:
                sequence_ExecModule(context, (ExecModule) semanticObject);
                return;
            case N4mfPackage.EXTENDED_RUNTIME_ENVIRONMENT:
                sequence_ExtendedRuntimeEnvironment(context, (ExtendedRuntimeEnvironment) semanticObject);
                return;
            case N4mfPackage.IMPLEMENTED_PROJECTS:
                sequence_ImplementedProjects(context, (ImplementedProjects) semanticObject);
                return;
            case N4mfPackage.INIT_MODULES:
                sequence_InitModules(context, (InitModules) semanticObject);
                return;
            case N4mfPackage.MODULE_FILTER:
                sequence_ModuleFilter(context, (ModuleFilter) semanticObject);
                return;
            case N4mfPackage.MODULE_FILTER_SPECIFIER:
                sequence_ModuleFilterSpecifier(context, (ModuleFilterSpecifier) semanticObject);
                return;
            case N4mfPackage.PROJECT_DEPENDENCIES:
                sequence_ProjectDependencies(context, (ProjectDependencies) semanticObject);
                return;
            case N4mfPackage.PROJECT_DEPENDENCY:
                sequence_ProjectDependency(context, (ProjectDependency) semanticObject);
                return;
            case N4mfPackage.PROJECT_DESCRIPTION:
                sequence_ProjectDescription(context, (ProjectDescription) semanticObject);
                return;
            case N4mfPackage.PROJECT_REFERENCE:
                sequence_ProjectReference(context, (ProjectReference) semanticObject);
                return;
            case N4mfPackage.PROVIDED_RUNTIME_LIBRARIES:
                sequence_ProvidedRuntimeLibraries(context, (ProvidedRuntimeLibraries) semanticObject);
                return;
            case N4mfPackage.PROVIDED_RUNTIME_LIBRARY_DEPENDENCY:
                sequence_ProvidedRuntimeLibraryDependency(context, (ProvidedRuntimeLibraryDependency) semanticObject);
                return;
            case N4mfPackage.REQUIRED_RUNTIME_LIBRARIES:
                sequence_RequiredRuntimeLibraries(context, (RequiredRuntimeLibraries) semanticObject);
                return;
            case N4mfPackage.REQUIRED_RUNTIME_LIBRARY_DEPENDENCY:
                sequence_RequiredRuntimeLibraryDependency(context, (RequiredRuntimeLibraryDependency) semanticObject);
                return;
            case N4mfPackage.SIMPLE_PROJECT_DESCRIPTION:
                sequence_SimpleProjectDescription(context, (SimpleProjectDescription) semanticObject);
                return;
            case N4mfPackage.SOURCE_FRAGMENT:
                sequence_SourceFragment(context, (SourceFragment) semanticObject);
                return;
            case N4mfPackage.TESTED_PROJECT:
                sequence_TestedProject(context, (TestedProject) semanticObject);
                return;
            case N4mfPackage.TESTED_PROJECTS:
                sequence_TestedProjects(context, (TestedProjects) semanticObject);
                return;
            case N4mfPackage.VERSION_CONSTRAINT:
                sequence_VersionConstraint(context, (VersionConstraint) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ModuleFilterSpecifier(org.eclipse.n4js.n4mf.ModuleFilterSpecifier) ParserRule(org.eclipse.xtext.ParserRule) ImplementedProjects(org.eclipse.n4js.n4mf.ImplementedProjects) Action(org.eclipse.xtext.Action) ProjectReference(org.eclipse.n4js.n4mf.ProjectReference) VersionConstraint(org.eclipse.n4js.n4mf.VersionConstraint) TestedProjects(org.eclipse.n4js.n4mf.TestedProjects) SimpleProjectDescription(org.eclipse.n4js.n4mf.SimpleProjectDescription) ProjectDependencies(org.eclipse.n4js.n4mf.ProjectDependencies) RequiredRuntimeLibraryDependency(org.eclipse.n4js.n4mf.RequiredRuntimeLibraryDependency) EPackage(org.eclipse.emf.ecore.EPackage) SourceFragment(org.eclipse.n4js.n4mf.SourceFragment) ExecModule(org.eclipse.n4js.n4mf.ExecModule) ProjectDescription(org.eclipse.n4js.n4mf.ProjectDescription) SimpleProjectDescription(org.eclipse.n4js.n4mf.SimpleProjectDescription) BootstrapModule(org.eclipse.n4js.n4mf.BootstrapModule) TestedProject(org.eclipse.n4js.n4mf.TestedProject) ExtendedRuntimeEnvironment(org.eclipse.n4js.n4mf.ExtendedRuntimeEnvironment) ProvidedRuntimeLibraries(org.eclipse.n4js.n4mf.ProvidedRuntimeLibraries) ProvidedRuntimeLibraryDependency(org.eclipse.n4js.n4mf.ProvidedRuntimeLibraryDependency) ProjectDependency(org.eclipse.n4js.n4mf.ProjectDependency) RequiredRuntimeLibraries(org.eclipse.n4js.n4mf.RequiredRuntimeLibraries) ModuleFilter(org.eclipse.n4js.n4mf.ModuleFilter) InitModules(org.eclipse.n4js.n4mf.InitModules) Parameter(org.eclipse.xtext.Parameter) DeclaredVersion(org.eclipse.n4js.n4mf.DeclaredVersion)

Example 4 with ProjectReference

use of org.eclipse.n4js.n4mf.ProjectReference in project n4js by eclipse.

the class ProjectDescriptionImpl method getAllImplementedProjects.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public EList<ProjectReference> getAllImplementedProjects() {
    EList<ProjectReference> _xifexpression = null;
    ImplementedProjects _implementedProjects = this.getImplementedProjects();
    boolean _tripleEquals = (null == _implementedProjects);
    if (_tripleEquals) {
        _xifexpression = XcoreCollectionLiterals.<ProjectReference>emptyEList();
    } else {
        _xifexpression = this.getImplementedProjects().getImplementedProjects();
    }
    return _xifexpression;
}
Also used : ImplementedProjects(org.eclipse.n4js.n4mf.ImplementedProjects) ProjectReference(org.eclipse.n4js.n4mf.ProjectReference)

Example 5 with ProjectReference

use of org.eclipse.n4js.n4mf.ProjectReference in project n4js by eclipse.

the class ExtendedRuntimeEnvironmentImpl method basicSetExtendedRuntimeEnvironment.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetExtendedRuntimeEnvironment(ProjectReference newExtendedRuntimeEnvironment, NotificationChain msgs) {
    ProjectReference oldExtendedRuntimeEnvironment = extendedRuntimeEnvironment;
    extendedRuntimeEnvironment = newExtendedRuntimeEnvironment;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, N4mfPackage.EXTENDED_RUNTIME_ENVIRONMENT__EXTENDED_RUNTIME_ENVIRONMENT, oldExtendedRuntimeEnvironment, newExtendedRuntimeEnvironment);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : ProjectReference(org.eclipse.n4js.n4mf.ProjectReference) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Aggregations

ProjectReference (org.eclipse.n4js.n4mf.ProjectReference)5 ExtendedRuntimeEnvironment (org.eclipse.n4js.n4mf.ExtendedRuntimeEnvironment)3 ProjectDescription (org.eclipse.n4js.n4mf.ProjectDescription)3 SimpleProjectDescription (org.eclipse.n4js.n4mf.SimpleProjectDescription)3 ImplementedProjects (org.eclipse.n4js.n4mf.ImplementedProjects)2 URI (org.eclipse.emf.common.util.URI)1 EPackage (org.eclipse.emf.ecore.EPackage)1 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)1 BootstrapModule (org.eclipse.n4js.n4mf.BootstrapModule)1 DeclaredVersion (org.eclipse.n4js.n4mf.DeclaredVersion)1 ExecModule (org.eclipse.n4js.n4mf.ExecModule)1 InitModules (org.eclipse.n4js.n4mf.InitModules)1 ModuleFilter (org.eclipse.n4js.n4mf.ModuleFilter)1 ModuleFilterSpecifier (org.eclipse.n4js.n4mf.ModuleFilterSpecifier)1 ProjectDependencies (org.eclipse.n4js.n4mf.ProjectDependencies)1 ProjectDependency (org.eclipse.n4js.n4mf.ProjectDependency)1 ProvidedRuntimeLibraries (org.eclipse.n4js.n4mf.ProvidedRuntimeLibraries)1 ProvidedRuntimeLibraryDependency (org.eclipse.n4js.n4mf.ProvidedRuntimeLibraryDependency)1 RequiredRuntimeLibraries (org.eclipse.n4js.n4mf.RequiredRuntimeLibraries)1 RequiredRuntimeLibraryDependency (org.eclipse.n4js.n4mf.RequiredRuntimeLibraryDependency)1