Search in sources :

Example 1 with EObjectFilter

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

the class FinalStateFinalStatePropertiesEditionComponent 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 FinalState finalState = (FinalState) elt;
        final FinalStatePropertiesEditionPart finalStatePart = (FinalStatePropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(StatemachineViewsRepository.FinalState.Properties.description))
            finalStatePart.setDescription(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, finalState.getDescription()));
        if (isAccessible(StatemachineViewsRepository.FinalState.Properties.keywords))
            finalStatePart.setKeywords(finalState.getKeywords());
        if (isAccessible(StatemachineViewsRepository.FinalState.Properties.incomingTransitions)) {
            incomingTransitionsSettings = new ReferencesTableSettings(finalState, StateMachinePackage.eINSTANCE.getAbstractState_IncomingTransitions());
            finalStatePart.initIncomingTransitions(incomingTransitionsSettings);
        }
        if (isAccessible(StatemachineViewsRepository.FinalState.Properties.outcomingTransitions)) {
            outcomingTransitionsSettings = new ReferencesTableSettings(finalState, StateMachinePackage.eINSTANCE.getAbstractState_OutcomingTransitions());
            finalStatePart.initOutcomingTransitions(outcomingTransitionsSettings);
        }
        if (isAccessible(StatemachineViewsRepository.FinalState.Properties.incomingTransitions)) {
            finalStatePart.addFilterToIncomingTransitions(new EObjectFilter(StateMachinePackage.Literals.TRANSITION));
        // Start of user code for additional businessfilters for incomingTransitions
        // End of user code
        }
        if (isAccessible(StatemachineViewsRepository.FinalState.Properties.outcomingTransitions)) {
            finalStatePart.addFilterToOutcomingTransitions(new EObjectFilter(StateMachinePackage.Literals.TRANSITION));
        // Start of user code for additional businessfilters for outcomingTransitions
        // 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) FinalStatePropertiesEditionPart(org.obeonetwork.dsl.statemachine.parts.FinalStatePropertiesEditionPart) FinalState(org.obeonetwork.dsl.statemachine.FinalState)

Example 2 with EObjectFilter

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

the class StateStatePropertiesEditionComponent 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 State state = (State) elt;
        final StatePropertiesEditionPart statePart = (StatePropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(StatemachineViewsRepository.State.Properties.description))
            statePart.setDescription(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, state.getDescription()));
        if (isAccessible(StatemachineViewsRepository.State.Properties.keywords))
            statePart.setKeywords(state.getKeywords());
        if (isAccessible(StatemachineViewsRepository.State.Properties.incomingTransitions)) {
            incomingTransitionsSettings = new ReferencesTableSettings(state, StateMachinePackage.eINSTANCE.getAbstractState_IncomingTransitions());
            statePart.initIncomingTransitions(incomingTransitionsSettings);
        }
        if (isAccessible(StatemachineViewsRepository.State.Properties.outcomingTransitions)) {
            outcomingTransitionsSettings = new ReferencesTableSettings(state, StateMachinePackage.eINSTANCE.getAbstractState_OutcomingTransitions());
            statePart.initOutcomingTransitions(outcomingTransitionsSettings);
        }
        if (isAccessible(StatemachineViewsRepository.State.Properties.name))
            statePart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, state.getName()));
        if (isAccessible(StatemachineViewsRepository.State.Properties.incomingTransitions)) {
            statePart.addFilterToIncomingTransitions(new EObjectFilter(StateMachinePackage.Literals.TRANSITION));
        // Start of user code for additional businessfilters for incomingTransitions
        // End of user code
        }
        if (isAccessible(StatemachineViewsRepository.State.Properties.outcomingTransitions)) {
            statePart.addFilterToOutcomingTransitions(new EObjectFilter(StateMachinePackage.Literals.TRANSITION));
        // Start of user code for additional businessfilters for outcomingTransitions
        // 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) State(org.obeonetwork.dsl.statemachine.State) StatePropertiesEditionPart(org.obeonetwork.dsl.statemachine.parts.StatePropertiesEditionPart)

Example 3 with EObjectFilter

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

the class TaskTaskPropertiesEditionComponent 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 Task task = (Task) elt;
        final TaskPropertiesEditionPart taskPart = (TaskPropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(GraalViewsRepository.Task.Properties.description))
            taskPart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, task.getDescription()));
        if (isAccessible(GraalViewsRepository.Task.Properties.subActivities)) {
            subActivitiesSettings = new ReferencesTableSettings(task, GraalPackage.eINSTANCE.getActivity_SubActivities());
            taskPart.initSubActivities(subActivitiesSettings);
        }
        if (isAccessible(GraalViewsRepository.Task.Properties.actors)) {
            actorsSettings = new ReferencesTableSettings(task, GraalPackage.eINSTANCE.getTask_Actors());
            taskPart.initActors(actorsSettings);
        }
        if (isAccessible(GraalViewsRepository.Task.Properties.id))
            taskPart.setId(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, task.getId()));
        if (isAccessible(GraalViewsRepository.Task.Properties.name))
            taskPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, task.getName()));
        if (isAccessible(GraalViewsRepository.Task.Properties.uses)) {
            usesSettings = new ReferencesTableSettings(task, GraalPackage.eINSTANCE.getTask_Uses());
            taskPart.initUses(usesSettings);
        }
        if (isAccessible(GraalViewsRepository.Task.Properties.preconditions))
            taskPart.setPreconditions(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, task.getPreconditions()));
        if (isAccessible(GraalViewsRepository.Task.Properties.postconditions))
            taskPart.setPostconditions(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, task.getPostconditions()));
        if (isAccessible(GraalViewsRepository.Task.Properties.subActivities)) {
            taskPart.addFilterToSubActivities(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 Loop);
                }
            });
        // Start of user code for additional businessfilters for subActivities
        // End of user code
        }
        if (isAccessible(GraalViewsRepository.Task.Properties.actors)) {
            taskPart.addFilterToActors(new EObjectFilter(GraalPackage.Literals.ACTOR));
        // Start of user code for additional businessfilters for actors
        // End of user code
        }
        if (isAccessible(GraalViewsRepository.Task.Properties.uses)) {
            taskPart.addFilterToUses(new EObjectFilter(GraalPackage.Literals.TASK));
        // Start of user code for additional businessfilters for uses
        // End of user code
        }
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : Loop(org.obeonetwork.graal.Loop) EObjectFilter(org.eclipse.emf.eef.runtime.impl.filters.EObjectFilter) Task(org.obeonetwork.graal.Task) ReferencesTableSettings(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings) ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject) TaskPropertiesEditionPart(org.obeonetwork.graal.parts.TaskPropertiesEditionPart)

Example 4 with EObjectFilter

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

Example 5 with EObjectFilter

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

the class AppliActionAppliActionPropertiesEditionComponent 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 AppliAction appliAction = (AppliAction) elt;
        final AppliActionPropertiesEditionPart appliActionPart = (AppliActionPropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(GraalViewsRepository.AppliAction.Properties.description))
            appliActionPart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, appliAction.getDescription()));
        if (isAccessible(GraalViewsRepository.AppliAction.Properties.name))
            appliActionPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, appliAction.getName()));
        if (isAccessible(GraalViewsRepository.AppliAction.Properties.outgoingTransitions)) {
            outgoingTransitionsSettings = new ReferencesTableSettings(appliAction, GraalPackage.eINSTANCE.getNode_OutgoingTransitions());
            appliActionPart.initOutgoingTransitions(outgoingTransitionsSettings);
        }
        if (isAccessible(GraalViewsRepository.AppliAction.Properties.incomingTransitions)) {
            incomingTransitionsSettings = new ReferencesTableSettings(appliAction, GraalPackage.eINSTANCE.getNode_IncomingTransitions());
            appliActionPart.initIncomingTransitions(incomingTransitionsSettings);
        }
        if (isAccessible(GraalViewsRepository.AppliAction.Properties.outgoingTransitions)) {
            appliActionPart.addFilterToOutgoingTransitions(new EObjectFilter(GraalPackage.Literals.TRANSITION));
        // Start of user code for additional businessfilters for outgoingTransitions
        // End of user code
        }
        if (isAccessible(GraalViewsRepository.AppliAction.Properties.incomingTransitions)) {
            appliActionPart.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) AppliAction(org.obeonetwork.graal.AppliAction) AppliActionPropertiesEditionPart(org.obeonetwork.graal.parts.AppliActionPropertiesEditionPart) ReferencesTableSettings(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings)

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