Search in sources :

Example 1 with AgreeLibrary

use of com.rockwellcollins.atc.agree.agree.AgreeLibrary in project AMASE by loonwerks.

the class SafetyAnnexContentAssist method getNestedDotIDCandidates.

private List<String> getNestedDotIDCandidates(AadlPackage aadlPackage) {
    AgreeContract contract = null;
    List<String> results = new ArrayList<>();
    for (AnnexLibrary annex : AnnexUtil.getAllActualAnnexLibraries(aadlPackage, AgreePackage.eINSTANCE.getAgreeContractLibrary())) {
        if (annex instanceof AgreeLibrary) {
            contract = (AgreeContract) ((AgreeContractLibrary) annex).getContract();
        }
    }
    if (contract != null) {
        for (SpecStatement spec : contract.getSpecs()) {
            if (spec instanceof ConstStatement) {
                results.add(((ConstStatement) spec).getName());
            }
        }
    }
    return results;
}
Also used : AgreeContract(com.rockwellcollins.atc.agree.agree.AgreeContract) ConstStatement(com.rockwellcollins.atc.agree.agree.ConstStatement) AgreeLibrary(com.rockwellcollins.atc.agree.agree.AgreeLibrary) AgreeContractLibrary(com.rockwellcollins.atc.agree.agree.AgreeContractLibrary) ArrayList(java.util.ArrayList) SpecStatement(com.rockwellcollins.atc.agree.agree.SpecStatement) DefaultAnnexLibrary(org.osate.aadl2.DefaultAnnexLibrary) AnnexLibrary(org.osate.aadl2.AnnexLibrary)

Example 2 with AgreeLibrary

use of com.rockwellcollins.atc.agree.agree.AgreeLibrary in project AGREE by loonwerks.

the class AgreeAnnexContentAssist method getNestedDotIDCandidates.

private List<String> getNestedDotIDCandidates(AadlPackage aadlPackage) {
    AgreeContract contract = null;
    List<String> results = new ArrayList<>();
    for (AnnexLibrary annex : AnnexUtil.getAllActualAnnexLibraries(aadlPackage, AgreePackage.eINSTANCE.getAgreeContractLibrary())) {
        if (annex instanceof AgreeLibrary) {
            contract = (AgreeContract) ((AgreeContractLibrary) annex).getContract();
        }
    }
    if (contract != null) {
        for (SpecStatement spec : contract.getSpecs()) {
            if (spec instanceof ConstStatement) {
                results.add(((ConstStatement) spec).getName());
            }
        }
    }
    return results;
}
Also used : AgreeContract(com.rockwellcollins.atc.agree.agree.AgreeContract) ConstStatement(com.rockwellcollins.atc.agree.agree.ConstStatement) AgreeLibrary(com.rockwellcollins.atc.agree.agree.AgreeLibrary) AgreeContractLibrary(com.rockwellcollins.atc.agree.agree.AgreeContractLibrary) ArrayList(java.util.ArrayList) SpecStatement(com.rockwellcollins.atc.agree.agree.SpecStatement) DefaultAnnexLibrary(org.osate.aadl2.DefaultAnnexLibrary) AnnexLibrary(org.osate.aadl2.AnnexLibrary)

Aggregations

AgreeContract (com.rockwellcollins.atc.agree.agree.AgreeContract)2 AgreeContractLibrary (com.rockwellcollins.atc.agree.agree.AgreeContractLibrary)2 AgreeLibrary (com.rockwellcollins.atc.agree.agree.AgreeLibrary)2 ConstStatement (com.rockwellcollins.atc.agree.agree.ConstStatement)2 SpecStatement (com.rockwellcollins.atc.agree.agree.SpecStatement)2 ArrayList (java.util.ArrayList)2 AnnexLibrary (org.osate.aadl2.AnnexLibrary)2 DefaultAnnexLibrary (org.osate.aadl2.DefaultAnnexLibrary)2