Search in sources :

Example 1 with System

use of org.obeonetwork.graal.System in project InformationSystem by ObeoNetwork.

the class GraalModelWizard method createInitialModel.

/**
 * Create a new model.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated NOT
 */
protected EObject createInitialModel(String systemName) {
    System rootObject = graalFactory.createSystem();
    rootObject.setName(systemName);
    rootObject.setCreatedOn(new Date());
    return rootObject;
}
Also used : System(org.obeonetwork.graal.System) Date(java.util.Date)

Example 2 with System

use of org.obeonetwork.graal.System in project InformationSystem by ObeoNetwork.

the class TaskImpl method getUsedBy.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated NOT
 */
public EList<Task> getUsedBy() {
    Collection<Setting> usingTasksSettings = new GraalUsageCrossReferencer() {

        @Override
        protected boolean crossReference(EObject eObject, EReference eReference, EObject crossReferencedEObject) {
            return eReference == GraalPackage.Literals.TASK__USES;
        }

        @Override
        protected boolean containment(EObject eObject) {
            // (We use Resource instead of CDOResource to avoid dependency on CDO)
            return (eObject instanceof Resource) || (eObject instanceof System) || (eObject instanceof TasksGroup) || (eObject instanceof Task);
        }
    }.findUsage(this);
    List<Task> foundTasks = new ArrayList<Task>();
    for (Setting setting : usingTasksSettings) {
        foundTasks.add((Task) setting.getEObject());
    }
    return ECollections.unmodifiableEList(new BasicEList<Task>(foundTasks));
}
Also used : AbstractTask(org.obeonetwork.graal.AbstractTask) Task(org.obeonetwork.graal.Task) Setting(org.eclipse.emf.ecore.EStructuralFeature.Setting) GraalUsageCrossReferencer(org.obeonetwork.graal.util.GraalUsageCrossReferencer) Resource(org.eclipse.emf.ecore.resource.Resource) ArrayList(java.util.ArrayList) System(org.obeonetwork.graal.System) TasksGroup(org.obeonetwork.graal.TasksGroup) EObject(org.eclipse.emf.ecore.EObject) EReference(org.eclipse.emf.ecore.EReference)

Example 3 with System

use of org.obeonetwork.graal.System in project InformationSystem by ObeoNetwork.

the class AbstractTaskImpl method getUseCase.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated NOT
 */
public UseCase getUseCase() {
    Collection<Setting> useCaseReferences = new GraalUsageCrossReferencer() {

        @Override
        protected boolean crossReference(EObject eObject, EReference eReference, EObject crossReferencedEObject) {
            return eReference == GraalPackage.Literals.USE_CASE__TASKS;
        }

        @Override
        protected boolean containment(EObject eObject) {
            // (We use Resource instead of CDOResource to avoid dependency on CDO)
            return (eObject instanceof Resource) || (eObject instanceof System) || (eObject instanceof UseCase);
        }
    }.findUsage(this);
    UseCase useCase = null;
    for (Setting setting : useCaseReferences) {
        useCase = (UseCase) setting.getEObject();
        break;
    }
    return useCase;
}
Also used : Setting(org.eclipse.emf.ecore.EStructuralFeature.Setting) EObject(org.eclipse.emf.ecore.EObject) GraalUsageCrossReferencer(org.obeonetwork.graal.util.GraalUsageCrossReferencer) Resource(org.eclipse.emf.ecore.resource.Resource) UseCase(org.obeonetwork.graal.UseCase) EReference(org.eclipse.emf.ecore.EReference) System(org.obeonetwork.graal.System)

Example 4 with System

use of org.obeonetwork.graal.System in project InformationSystem by ObeoNetwork.

the class SystemSystemPropertiesEditionComponent method initPart.

/**
 * {@inheritDoc}
 *
 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
 *      org.eclipse.emf.ecore.resource.ResourceSet)
 */
public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
    setInitializing(true);
    if (editingPart != null && key == partKey) {
        editingPart.setContext(elt, allResource);
        final System system = (System) elt;
        final SystemPropertiesEditionPart systemPart = (SystemPropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(GraalViewsRepository.System.Properties.description))
            systemPart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, system.getDescription()));
        if (isAccessible(GraalViewsRepository.System.Properties.name))
            systemPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, system.getName()));
    // init filters
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : System(org.obeonetwork.graal.System) SystemPropertiesEditionPart(org.obeonetwork.graal.parts.SystemPropertiesEditionPart)

Example 5 with System

use of org.obeonetwork.graal.System in project InformationSystem by ObeoNetwork.

the class UserStoriesContentProvider method availableStories.

/**
 * @param eObject
 * @return
 */
private List<UserStory> availableStories(Collection<?> eObjects) {
    List<EObject> treatedRoots = new ArrayList<EObject>();
    List<UserStory> result = new ArrayList<UserStory>();
    for (Object next : eObjects) {
        if (next instanceof EObject) {
            EObject eObject = (EObject) next;
            EObject rootContainer = EcoreUtil.getRootContainer(eObject);
            if (!treatedRoots.contains(rootContainer)) {
                if (rootContainer instanceof System) {
                    result.addAll(((System) rootContainer).getUserStories());
                }
                treatedRoots.add(rootContainer);
            }
        }
    }
    return result;
}
Also used : EObject(org.eclipse.emf.ecore.EObject) ArrayList(java.util.ArrayList) EObject(org.eclipse.emf.ecore.EObject) System(org.obeonetwork.graal.System) UserStory(org.obeonetwork.graal.UserStory)

Aggregations

System (org.obeonetwork.graal.System)25 Test (org.junit.Test)14 UseCase (org.obeonetwork.graal.UseCase)12 EObject (org.eclipse.emf.ecore.EObject)6 DomainClass (org.obeonetwork.graal.DomainClass)5 ArrayList (java.util.ArrayList)4 EReference (org.eclipse.emf.ecore.EReference)4 Setting (org.eclipse.emf.ecore.EStructuralFeature.Setting)4 Resource (org.eclipse.emf.ecore.resource.Resource)4 AbstractTask (org.obeonetwork.graal.AbstractTask)4 GraalUsageCrossReferencer (org.obeonetwork.graal.util.GraalUsageCrossReferencer)4 Date (java.util.Date)3 TasksGroup (org.obeonetwork.graal.TasksGroup)3 InputDialog (org.eclipse.jface.dialogs.InputDialog)2 Task (org.obeonetwork.graal.Task)2 Entity (org.obeonetwork.dsl.entity.Entity)1 Loop (org.obeonetwork.graal.Loop)1 TaskReference (org.obeonetwork.graal.TaskReference)1 TasksContainer (org.obeonetwork.graal.TasksContainer)1 UserStory (org.obeonetwork.graal.UserStory)1