Search in sources :

Example 11 with EObjectFilter

use of org.eclipse.emf.eef.runtime.impl.filters.EObjectFilter in project InformationSystem by ObeoNetwork.

the class FlowEventFlowEventPropertiesEditionComponent 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 FlowEvent flowEvent = (FlowEvent) elt;
        final FlowEventPropertiesEditionPart flowEventPart = (FlowEventPropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(FlowViewsRepository.FlowEvent.Properties.description))
            flowEventPart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, flowEvent.getDescription()));
        if (isAccessible(FlowViewsRepository.FlowEvent.Properties.name))
            flowEventPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, flowEvent.getName()));
        if (isAccessible(FlowViewsRepository.FlowEvent.Properties.binds)) {
            bindsSettings = new ReferencesTableSettings(flowEvent, FlowPackage.eINSTANCE.getFlowEvent_Binds());
            flowEventPart.initBinds(bindsSettings);
        }
        if (isAccessible(FlowViewsRepository.FlowEvent.Properties.binds)) {
            flowEventPart.addFilterToBinds(new EObjectFilter(ViewPackage.Literals.VIEW_EVENT));
        // Start of user code for additional businessfilters for binds
        // 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) FlowEvent(org.obeonetwork.dsl.cinematic.flow.FlowEvent) FlowEventPropertiesEditionPart(org.obeonetwork.dsl.cinematic.flow.parts.FlowEventPropertiesEditionPart) ReferencesTableSettings(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings)

Example 12 with EObjectFilter

use of org.eclipse.emf.eef.runtime.impl.filters.EObjectFilter in project InformationSystem by ObeoNetwork.

the class DtoDtoPropertiesEditionComponent 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 DTO dTO = (DTO) elt;
        final DtoPropertiesEditionPart dtoPart = (DtoPropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(EnvironmentViewsRepository.Dto.Properties.name))
            dtoPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, dTO.getName()));
        if (isAccessible(EnvironmentViewsRepository.Dto.Properties.supertype)) {
            // init part
            supertypeSettings = new EObjectFlatComboSettings(dTO, EnvironmentPackage.eINSTANCE.getStructuredType_Supertype());
            dtoPart.initSupertype(supertypeSettings);
            // set the button mode
            dtoPart.setSupertypeButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(EnvironmentViewsRepository.Dto.Properties.description))
            dtoPart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, dTO.getDescription()));
        if (isAccessible(EnvironmentViewsRepository.Dto.Properties.associatedTypes)) {
            associatedTypesSettings = new ReferencesTableSettings(dTO, EnvironmentPackage.eINSTANCE.getStructuredType_AssociatedTypes());
            dtoPart.initAssociatedTypes(associatedTypesSettings);
        }
        if (isAccessible(EnvironmentViewsRepository.Dto.Properties.supertype)) {
            dtoPart.addFilterToSupertype(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 StructuredType);
                }
            });
        // Start of user code for additional businessfilters for supertype
        // End of user code
        }
        if (isAccessible(EnvironmentViewsRepository.Dto.Properties.associatedTypes)) {
            dtoPart.addFilterToAssociatedTypes(new EObjectFilter(EnvironmentPackage.Literals.STRUCTURED_TYPE));
        // Start of user code for additional businessfilters for associatedTypes
        // 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) ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) DtoPropertiesEditionPart(org.obeonetwork.dsl.environment.parts.DtoPropertiesEditionPart) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject) EObjectFlatComboSettings(org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings) DTO(org.obeonetwork.dsl.environment.DTO) StructuredType(org.obeonetwork.dsl.environment.StructuredType)

Example 13 with EObjectFilter

use of org.eclipse.emf.eef.runtime.impl.filters.EObjectFilter 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 14 with EObjectFilter

use of org.eclipse.emf.eef.runtime.impl.filters.EObjectFilter in project InformationSystem by ObeoNetwork.

the class EntityEntityPropertiesEditionComponent 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 Entity entity = (Entity) elt;
        final EntityPropertiesEditionPart entityPart = (EntityPropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(EntityViewsRepository.Entity_.Properties.name))
            entityPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, entity.getName()));
        if (isAccessible(EntityViewsRepository.Entity_.Properties.superType)) {
            // init part
            superTypeSettings = new EObjectFlatComboSettings(entity, EnvironmentPackage.eINSTANCE.getStructuredType_Supertype());
            entityPart.initSuperType(superTypeSettings);
            // set the button mode
            entityPart.setSuperTypeButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(EntityViewsRepository.Entity_.Properties.description))
            entityPart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, entity.getDescription()));
        if (isAccessible(EntityViewsRepository.Entity_.Properties.associatedTypes)) {
            associatedTypesSettings = new ReferencesTableSettings(entity, EnvironmentPackage.eINSTANCE.getStructuredType_AssociatedTypes());
            entityPart.initAssociatedTypes(associatedTypesSettings);
        }
        if (isAccessible(EntityViewsRepository.Entity_.Properties.associatedTypes)) {
            entityPart.addFilterToAssociatedTypes(new EObjectFilter(EnvironmentPackage.Literals.STRUCTURED_TYPE));
        // Start of user code for additional businessfilters for associatedTypes
        // 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) Entity(org.obeonetwork.dsl.entity.Entity) EntityPropertiesEditionPart(org.obeonetwork.dsl.entity.parts.EntityPropertiesEditionPart) ReferencesTableSettings(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings) EObjectFlatComboSettings(org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings)

Example 15 with EObjectFilter

use of org.eclipse.emf.eef.runtime.impl.filters.EObjectFilter in project InformationSystem by ObeoNetwork.

the class CinematicRootToolkitsPropertiesEditionComponent 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 CinematicRoot cinematicRoot = (CinematicRoot) elt;
        final ToolkitsPropertiesEditionPart toolkitsPart = (ToolkitsPropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(CinematicViewsRepository.Toolkits.Properties.toolkits_)) {
            toolkitsSettings = new ReferencesTableSettings(cinematicRoot, CinematicPackage.eINSTANCE.getCinematicRoot_Toolkits());
            toolkitsPart.initToolkits(toolkitsSettings);
        }
        // init filters
        if (isAccessible(CinematicViewsRepository.Toolkits.Properties.toolkits_)) {
            toolkitsPart.addFilterToToolkits(new EObjectFilter(ToolkitsPackage.Literals.TOOLKIT));
        // Start of user code for additional businessfilters for toolkits
        // 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) CinematicRoot(org.obeonetwork.dsl.cinematic.CinematicRoot) ToolkitsPropertiesEditionPart(org.obeonetwork.dsl.cinematic.parts.ToolkitsPropertiesEditionPart)

Aggregations

EObjectFilter (org.eclipse.emf.eef.runtime.impl.filters.EObjectFilter)23 ReferencesTableSettings (org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings)23 EObject (org.eclipse.emf.ecore.EObject)6 EObjectFlatComboSettings (org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings)6 Viewer (org.eclipse.jface.viewers.Viewer)6 ViewerFilter (org.eclipse.jface.viewers.ViewerFilter)6 FlowAction (org.obeonetwork.dsl.cinematic.flow.FlowAction)2 Task (org.obeonetwork.graal.Task)2 CinematicRoot (org.obeonetwork.dsl.cinematic.CinematicRoot)1 FlowEvent (org.obeonetwork.dsl.cinematic.flow.FlowEvent)1 FlowState (org.obeonetwork.dsl.cinematic.flow.FlowState)1 Transition (org.obeonetwork.dsl.cinematic.flow.Transition)1 ViewState (org.obeonetwork.dsl.cinematic.flow.ViewState)1 FlowActionPropertiesEditionPart (org.obeonetwork.dsl.cinematic.flow.parts.FlowActionPropertiesEditionPart)1 FlowEventPropertiesEditionPart (org.obeonetwork.dsl.cinematic.flow.parts.FlowEventPropertiesEditionPart)1 TransitionPropertiesEditionPart (org.obeonetwork.dsl.cinematic.flow.parts.TransitionPropertiesEditionPart)1 ViewStatePropertiesEditionPart (org.obeonetwork.dsl.cinematic.flow.parts.ViewStatePropertiesEditionPart)1 ToolkitsPropertiesEditionPart (org.obeonetwork.dsl.cinematic.parts.ToolkitsPropertiesEditionPart)1 Entity (org.obeonetwork.dsl.entity.Entity)1 EntityPropertiesEditionPart (org.obeonetwork.dsl.entity.parts.EntityPropertiesEditionPart)1