Search in sources :

Example 1 with UseCasePropertiesEditionPart

use of org.obeonetwork.graal.parts.UseCasePropertiesEditionPart in project InformationSystem by ObeoNetwork.

the class UseCaseUseCasePropertiesEditionComponent 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 UseCase useCase = (UseCase) elt;
        final UseCasePropertiesEditionPart useCasePart = (UseCasePropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(GraalViewsRepository.UseCase.Properties.description))
            useCasePart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, useCase.getDescription()));
        if (isAccessible(GraalViewsRepository.UseCase.Properties.tasks)) {
            tasksSettings = new ReferencesTableSettings(useCase, GraalPackage.eINSTANCE.getUseCase_Tasks());
            useCasePart.initTasks(tasksSettings);
        }
        if (isAccessible(GraalViewsRepository.UseCase.Properties.name))
            useCasePart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, useCase.getName()));
        if (isAccessible(GraalViewsRepository.UseCase.Properties.namespaces)) {
            namespacesSettings = new ReferencesTableSettings(useCase, GraalPackage.eINSTANCE.getDomainModelRegistry_Namespaces());
            useCasePart.initNamespaces(namespacesSettings);
        }
        if (isAccessible(GraalViewsRepository.UseCase.Properties.domainClasses)) {
            domainClassesSettings = new ReferencesTableSettings(useCase, GraalPackage.eINSTANCE.getUseCase_DomainClasses());
            useCasePart.initDomainClasses(domainClassesSettings);
        }
        if (isAccessible(GraalViewsRepository.UseCase.Properties.tasks)) {
            useCasePart.addFilterToTasks(new EObjectFilter(GraalPackage.Literals.ABSTRACT_TASK));
        // Start of user code for additional businessfilters for tasks
        // End of user code
        }
        if (isAccessible(GraalViewsRepository.UseCase.Properties.namespaces)) {
            useCasePart.addFilterToNamespaces(new EObjectFilter(EnvironmentPackage.Literals.NAMESPACE));
        // Start of user code for additional businessfilters for namespaces
        // End of user code
        }
        if (isAccessible(GraalViewsRepository.UseCase.Properties.domainClasses)) {
            useCasePart.addFilterToDomainClasses(new EObjectFilter(GraalPackage.Literals.DOMAIN_CLASS));
        // Start of user code for additional businessfilters for domainClasses
        // End of user code
        }
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : EObjectFilter(org.eclipse.emf.eef.runtime.impl.filters.EObjectFilter) ReferencesTableSettings(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings) UseCase(org.obeonetwork.graal.UseCase) UseCasePropertiesEditionPart(org.obeonetwork.graal.parts.UseCasePropertiesEditionPart)

Aggregations

EObjectFilter (org.eclipse.emf.eef.runtime.impl.filters.EObjectFilter)1 ReferencesTableSettings (org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings)1 UseCase (org.obeonetwork.graal.UseCase)1 UseCasePropertiesEditionPart (org.obeonetwork.graal.parts.UseCasePropertiesEditionPart)1