Search in sources :

Example 26 with ReferencesTableSettings

use of org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings in project InformationSystem by ObeoNetwork.

the class NativeTypesLibraryPropertiesEditionComponent 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 NativeTypesLibrary nativeTypesLibrary = (NativeTypesLibrary) elt;
        final NativeTypesLibraryPropertiesEditionPart nativeTypesLibraryPart = (NativeTypesLibraryPropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(TypeslibraryViewsRepository.NativeTypesLibrary.Properties.name))
            nativeTypesLibraryPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, nativeTypesLibrary.getName()));
        if (isAccessible(TypeslibraryViewsRepository.NativeTypesLibrary.Properties.nativeTypes)) {
            nativeTypesSettings = new ReferencesTableSettings(nativeTypesLibrary, TypesLibraryPackage.eINSTANCE.getNativeTypesLibrary_NativeTypes());
            nativeTypesLibraryPart.initNativeTypes(nativeTypesSettings);
        }
        if (isAccessible(TypeslibraryViewsRepository.NativeTypesLibrary.Properties.nativeTypes)) {
            nativeTypesLibraryPart.addFilterToNativeTypes(new ViewerFilter() {

                /**
                 * {@inheritDoc}
                 *
                 * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
                 */
                public boolean select(Viewer viewer, Object parentElement, Object element) {
                    // $NON-NLS-1$
                    return (element instanceof String && element.equals("")) || (element instanceof NativeType);
                }
            });
        // Start of user code for additional businessfilters for nativeTypes
        // End of user code
        }
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : ReferencesTableSettings(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings) ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) NativeTypesLibrary(org.obeonetwork.dsl.typeslibrary.NativeTypesLibrary) NativeTypesLibraryPropertiesEditionPart(org.obeonetwork.dsl.typeslibrary.parts.NativeTypesLibraryPropertiesEditionPart) NativeType(org.obeonetwork.dsl.typeslibrary.NativeType) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject)

Example 27 with ReferencesTableSettings

use of org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings in project InformationSystem by ObeoNetwork.

the class ComplexNamedTypePropertiesEditionComponent 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 ComplexNamedType complexNamedType = (ComplexNamedType) elt;
        final ComplexNamedTypePropertiesEditionPart complexNamedTypePart = (ComplexNamedTypePropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(TypeslibraryViewsRepository.ComplexNamedType.Properties.name))
            complexNamedTypePart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, complexNamedType.getName()));
        if (isAccessible(TypeslibraryViewsRepository.ComplexNamedType.Properties.types)) {
            typesSettings = new ReferencesTableSettings(complexNamedType, TypesLibraryPackage.eINSTANCE.getComplexNamedType_Types());
            complexNamedTypePart.initTypes(typesSettings);
        }
        if (isAccessible(TypeslibraryViewsRepository.ComplexNamedType.Properties.types)) {
            complexNamedTypePart.addFilterToTypes(new ViewerFilter() {

                /**
                 * {@inheritDoc}
                 *
                 * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
                 */
                public boolean select(Viewer viewer, Object parentElement, Object element) {
                    // $NON-NLS-1$
                    return (element instanceof String && element.equals("")) || (element instanceof UserDefinedType);
                }
            });
        // Start of user code for additional businessfilters for types
        // End of user code
        }
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : ComplexNamedType(org.obeonetwork.dsl.typeslibrary.ComplexNamedType) ReferencesTableSettings(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings) ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) UserDefinedType(org.obeonetwork.dsl.typeslibrary.UserDefinedType) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject) ComplexNamedTypePropertiesEditionPart(org.obeonetwork.dsl.typeslibrary.parts.ComplexNamedTypePropertiesEditionPart)

Example 28 with ReferencesTableSettings

use of org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings in project InformationSystem by ObeoNetwork.

the class AbortNodeAbortNodePropertiesEditionComponent 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 AbortNode abortNode = (AbortNode) elt;
        final AbortNodePropertiesEditionPart abortNodePart = (AbortNodePropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(GraalViewsRepository.AbortNode.Properties.description))
            abortNodePart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, abortNode.getDescription()));
        if (isAccessible(GraalViewsRepository.AbortNode.Properties.outgoingTransitions)) {
            outgoingTransitionsSettings = new ReferencesTableSettings(abortNode, GraalPackage.eINSTANCE.getNode_OutgoingTransitions());
            abortNodePart.initOutgoingTransitions(outgoingTransitionsSettings);
        }
        if (isAccessible(GraalViewsRepository.AbortNode.Properties.incomingTransitions)) {
            incomingTransitionsSettings = new ReferencesTableSettings(abortNode, GraalPackage.eINSTANCE.getNode_IncomingTransitions());
            abortNodePart.initIncomingTransitions(incomingTransitionsSettings);
        }
        if (isAccessible(GraalViewsRepository.AbortNode.Properties.outgoingTransitions)) {
            abortNodePart.addFilterToOutgoingTransitions(new EObjectFilter(GraalPackage.Literals.TRANSITION));
        // Start of user code for additional businessfilters for outgoingTransitions
        // End of user code
        }
        if (isAccessible(GraalViewsRepository.AbortNode.Properties.incomingTransitions)) {
            abortNodePart.addFilterToIncomingTransitions(new EObjectFilter(GraalPackage.Literals.TRANSITION));
        // Start of user code for additional businessfilters for incomingTransitions
        // 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) AbortNode(org.obeonetwork.graal.AbortNode) AbortNodePropertiesEditionPart(org.obeonetwork.graal.parts.AbortNodePropertiesEditionPart)

Example 29 with ReferencesTableSettings

use of org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings in project InformationSystem by ObeoNetwork.

the class CategoryPropertiesEditionComponent 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 Category category = (Category) elt;
        final CategoryPropertiesEditionPart categoryPart = (CategoryPropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(RequirementViewsRepository.Category.Category_.id))
            categoryPart.setId(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, category.getId()));
        if (isAccessible(RequirementViewsRepository.Category.Category_.name))
            categoryPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, category.getName()));
        if (isAccessible(RequirementViewsRepository.Category.Category_.requirements)) {
            requirementsSettings = new ReferencesTableSettings(category, RequirementPackage.eINSTANCE.getCategory_Requirements());
            categoryPart.initRequirements(requirementsSettings);
        }
        if (isAccessible(RequirementViewsRepository.Category.Category_.subCategories)) {
            subCategoriesSettings = new ReferencesTableSettings(category, RequirementPackage.eINSTANCE.getCategory_SubCategories());
            categoryPart.initSubCategories(subCategoriesSettings);
        }
        if (isAccessible(RequirementViewsRepository.Category.Category_.requirements)) {
            categoryPart.addFilterToRequirements(new ViewerFilter() {

                /**
                 * {@inheritDoc}
                 *
                 * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
                 */
                public boolean select(Viewer viewer, Object parentElement, Object element) {
                    // $NON-NLS-1$
                    return (element instanceof String && element.equals("")) || (element instanceof Requirement);
                }
            });
        // Start of user code for additional businessfilters for requirements
        // End of user code
        }
        if (isAccessible(RequirementViewsRepository.Category.Category_.subCategories)) {
            categoryPart.addFilterToSubCategories(new ViewerFilter() {

                /**
                 * {@inheritDoc}
                 *
                 * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
                 */
                public boolean select(Viewer viewer, Object parentElement, Object element) {
                    // $NON-NLS-1$
                    return (element instanceof String && element.equals("")) || (element instanceof Category);
                }
            });
        // Start of user code for additional businessfilters for subCategories
        // End of user code
        }
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : Requirement(org.obeonetwork.dsl.requirement.Requirement) Category(org.obeonetwork.dsl.requirement.Category) ReferencesTableSettings(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings) ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) CategoryPropertiesEditionPart(org.obeonetwork.dsl.requirement.parts.CategoryPropertiesEditionPart) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject)

Example 30 with ReferencesTableSettings

use of org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings in project InformationSystem by ObeoNetwork.

the class RequirementAdvancedPropertiesEditionComponent 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 Requirement requirement = (Requirement) elt;
        final AdvancedPropertiesEditionPart advancedPart = (AdvancedPropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(RequirementViewsRepository.Advanced.rationale))
            advancedPart.setRationale(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, requirement.getRationale()));
        if (isAccessible(RequirementViewsRepository.Advanced.acceptanceCriteria))
            advancedPart.setAcceptanceCriteria(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, requirement.getAcceptanceCriteria()));
        if (isAccessible(RequirementViewsRepository.Advanced.referencedObject)) {
            referencedObjectSettings = new ReferencesTableSettings(requirement, RequirementPackage.eINSTANCE.getRequirement_ReferencedObject());
            advancedPart.initReferencedObject(referencedObjectSettings);
        }
        if (isAccessible(RequirementViewsRepository.Advanced.referencedObject)) {
            advancedPart.addFilterToReferencedObject(new ViewerFilter() {

                /**
                 * {@inheritDoc}
                 *
                 * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
                 */
                public boolean select(Viewer viewer, Object parentElement, Object element) {
                    if (element instanceof EObject)
                        return (!advancedPart.isContainedInReferencedObjectTable((EObject) element));
                    return element instanceof String && element.equals("");
                }
            });
            advancedPart.addFilterToReferencedObject(new EObjectStrictFilter(EcorePackage.Literals.EOBJECT));
        // Start of user code for additional businessfilters for referencedObject
        // End of user code
        }
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : Requirement(org.obeonetwork.dsl.requirement.Requirement) EObjectStrictFilter(org.eclipse.emf.eef.runtime.impl.filters.EObjectStrictFilter) ReferencesTableSettings(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings) ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) EObject(org.eclipse.emf.ecore.EObject) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject) AdvancedPropertiesEditionPart(org.obeonetwork.dsl.requirement.parts.AdvancedPropertiesEditionPart)

Aggregations

ReferencesTableSettings (org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings)56 EObject (org.eclipse.emf.ecore.EObject)38 Viewer (org.eclipse.jface.viewers.Viewer)38 ViewerFilter (org.eclipse.jface.viewers.ViewerFilter)38 EObjectFilter (org.eclipse.emf.eef.runtime.impl.filters.EObjectFilter)23 EObjectFlatComboSettings (org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings)11 FlowAction (org.obeonetwork.dsl.cinematic.flow.FlowAction)9 Table (org.obeonetwork.dsl.database.Table)6 EObjectStrictFilter (org.eclipse.emf.eef.runtime.impl.filters.EObjectStrictFilter)5 Flow (org.obeonetwork.dsl.cinematic.flow.Flow)4 ViewContainer (org.obeonetwork.dsl.cinematic.view.ViewContainer)4 Widget (org.obeonetwork.dsl.cinematic.toolkits.Widget)3 ViewAction (org.obeonetwork.dsl.cinematic.view.ViewAction)3 ViewEvent (org.obeonetwork.dsl.cinematic.view.ViewEvent)3 EcorePackage (org.eclipse.emf.ecore.EcorePackage)2 CompositePropertiesEditionPart (org.eclipse.emf.eef.runtime.impl.parts.CompositePropertiesEditionPart)2 CinematicPackage (org.obeonetwork.dsl.cinematic.CinematicPackage)2 CinematicRoot (org.obeonetwork.dsl.cinematic.CinematicRoot)2 Package (org.obeonetwork.dsl.cinematic.Package)2 FlowEvent (org.obeonetwork.dsl.cinematic.flow.FlowEvent)2