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;
}
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));
}
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;
}
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);
}
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;
}
Aggregations