Search in sources :

Example 6 with ClassifierFeature

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

the class AadlElementContentProvider method hasChildren.

@Override
public boolean hasChildren(Object element) {
    if (element instanceof IFile || element instanceof ContributedAadlStorage) {
        return true;
    } else {
        EObjectURIWrapper wrapper = (EObjectURIWrapper) element;
        EObject eObject = new ResourceSetImpl().getEObject(wrapper.getUri(), true);
        if (eObject instanceof AadlPackage || eObject instanceof PropertySet || eObject instanceof ComponentInstance) {
            return eObject.eContents().stream().anyMatch(member -> !(member instanceof SystemOperationMode || member instanceof PropertyAssociation));
        } else if (eObject instanceof PackageSection) {
            return eObject.eContents().stream().anyMatch(member -> member instanceof Classifier || member instanceof AnnexLibrary);
        } else if (eObject instanceof Classifier) {
            return eObject.eContents().stream().anyMatch(member -> member instanceof ClassifierFeature || member instanceof PropertyAssociation);
        } else {
            return false;
        }
    }
}
Also used : ComponentInstance(org.osate.aadl2.instance.ComponentInstance) URI(org.eclipse.emf.common.util.URI) PackageSection(org.osate.aadl2.PackageSection) EObject(org.eclipse.emf.ecore.EObject) AadlPackage(org.osate.aadl2.AadlPackage) ResourceSetImpl(org.eclipse.emf.ecore.resource.impl.ResourceSetImpl) PropertySet(org.osate.aadl2.PropertySet) UiUtil(org.osate.ui.UiUtil) PropertyAssociation(org.osate.aadl2.PropertyAssociation) Stream(java.util.stream.Stream) Classifier(org.osate.aadl2.Classifier) SystemOperationMode(org.osate.aadl2.instance.SystemOperationMode) Resource(org.eclipse.emf.ecore.resource.Resource) IFile(org.eclipse.core.resources.IFile) ClassifierFeature(org.osate.aadl2.ClassifierFeature) ITreeContentProvider(org.eclipse.jface.viewers.ITreeContentProvider) AnnexLibrary(org.osate.aadl2.AnnexLibrary) EObjectURIWrapper(org.osate.aadl2.modelsupport.EObjectURIWrapper) ContributedAadlStorage(org.osate.xtext.aadl2.ui.resource.ContributedAadlStorage) IFile(org.eclipse.core.resources.IFile) ResourceSetImpl(org.eclipse.emf.ecore.resource.impl.ResourceSetImpl) AadlPackage(org.osate.aadl2.AadlPackage) PropertyAssociation(org.osate.aadl2.PropertyAssociation) PackageSection(org.osate.aadl2.PackageSection) SystemOperationMode(org.osate.aadl2.instance.SystemOperationMode) Classifier(org.osate.aadl2.Classifier) ClassifierFeature(org.osate.aadl2.ClassifierFeature) ContributedAadlStorage(org.osate.xtext.aadl2.ui.resource.ContributedAadlStorage) EObjectURIWrapper(org.osate.aadl2.modelsupport.EObjectURIWrapper) EObject(org.eclipse.emf.ecore.EObject) ComponentInstance(org.osate.aadl2.instance.ComponentInstance) PropertySet(org.osate.aadl2.PropertySet) AnnexLibrary(org.osate.aadl2.AnnexLibrary)

Aggregations

Classifier (org.osate.aadl2.Classifier)4 ClassifierFeature (org.osate.aadl2.ClassifierFeature)4 AadlPackage (org.osate.aadl2.AadlPackage)3 PackageSection (org.osate.aadl2.PackageSection)3 PropertyAssociation (org.osate.aadl2.PropertyAssociation)3 PropertySet (org.osate.aadl2.PropertySet)3 Stream (java.util.stream.Stream)2 IFile (org.eclipse.core.resources.IFile)2 URI (org.eclipse.emf.common.util.URI)2 EObject (org.eclipse.emf.ecore.EObject)2 EOperation (org.eclipse.emf.ecore.EOperation)2 Resource (org.eclipse.emf.ecore.resource.Resource)2 ResourceSetImpl (org.eclipse.emf.ecore.resource.impl.ResourceSetImpl)2 ITreeContentProvider (org.eclipse.jface.viewers.ITreeContentProvider)2 AnnexLibrary (org.osate.aadl2.AnnexLibrary)2 Element (org.osate.aadl2.Element)2 ComponentInstance (org.osate.aadl2.instance.ComponentInstance)2 SystemOperationMode (org.osate.aadl2.instance.SystemOperationMode)2 EObjectURIWrapper (org.osate.aadl2.modelsupport.EObjectURIWrapper)2 UiUtil (org.osate.ui.UiUtil)2