Search in sources :

Example 1 with InteractionUse

use of org.obeonetwork.dsl.interaction.InteractionUse in project InformationSystem by ObeoNetwork.

the class InteractionServices method computePredecessorForInteractionUse.

public InteractionUse computePredecessorForInteractionUse(InteractionUse interactionUse) {
    // Get the preceding end
    List<End> precedingEnds = getPrecedingEnds(interactionUse.getStartingEnd());
    // The predecessor is the last InteractionUse found amongst the preceding interaction uses
    InteractionUse predecessor = null;
    for (End end : precedingEnds) {
        if (end.isInteractionUseEnd() && end.isStartingEnd()) {
            predecessor = end.getInteractionUse();
        }
    }
    return predecessor;
}
Also used : End(org.obeonetwork.dsl.interaction.End) InteractionUse(org.obeonetwork.dsl.interaction.InteractionUse)

Example 2 with InteractionUse

use of org.obeonetwork.dsl.interaction.InteractionUse in project InformationSystem by ObeoNetwork.

the class DeleteServices method getInteractionUsesForParticipant.

private List<InteractionUse> getInteractionUsesForParticipant(Participant participant) {
    Interaction interaction = (Interaction) participant.eContainer();
    List<InteractionUse> result = new ArrayList<InteractionUse>();
    for (InteractionUse interactionUse : interaction.getInteractionUses()) {
        if (interactionUse.getCoveredParticipants().size() == 1 && interactionUse.getCoveredParticipants().contains(participant)) {
            result.add(interactionUse);
        }
    }
    return result;
}
Also used : Interaction(org.obeonetwork.dsl.interaction.Interaction) ArrayList(java.util.ArrayList) InteractionUse(org.obeonetwork.dsl.interaction.InteractionUse)

Example 3 with InteractionUse

use of org.obeonetwork.dsl.interaction.InteractionUse in project InformationSystem by ObeoNetwork.

the class InteractionUseInteractionUsePropertiesEditionComponent 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 InteractionUse interactionUse = (InteractionUse) elt;
        final InteractionUsePropertiesEditionPart interactionUsePart = (InteractionUsePropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(InteractionViewsRepository.InteractionUse.Properties.name))
            interactionUsePart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, interactionUse.getName()));
        if (isAccessible(InteractionViewsRepository.InteractionUse.Properties.type))
            interactionUsePart.setType(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, interactionUse.getType()));
        if (isAccessible(InteractionViewsRepository.InteractionUse.Properties.interaction_)) {
            // init part
            interactionSettings = new EObjectFlatComboSettings(interactionUse, InteractionPackage.eINSTANCE.getInteractionUse_Interaction());
            interactionUsePart.initInteraction(interactionSettings);
            // set the button mode
            interactionUsePart.setInteractionButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(InteractionViewsRepository.InteractionUse.Properties.description))
            interactionUsePart.setDescription(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, interactionUse.getDescription()));
        if (isAccessible(InteractionViewsRepository.InteractionUse.Properties.interaction_)) {
            interactionUsePart.addFilterToInteraction(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) {
                    return (element instanceof Interaction);
                }
            });
        // Start of user code for additional businessfilters for interaction
        // End of user code
        }
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) Interaction(org.obeonetwork.dsl.interaction.Interaction) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject) EObjectFlatComboSettings(org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings) InteractionUsePropertiesEditionPart(org.obeonetwork.dsl.interaction.parts.InteractionUsePropertiesEditionPart) InteractionUse(org.obeonetwork.dsl.interaction.InteractionUse)

Aggregations

InteractionUse (org.obeonetwork.dsl.interaction.InteractionUse)3 Interaction (org.obeonetwork.dsl.interaction.Interaction)2 ArrayList (java.util.ArrayList)1 EObject (org.eclipse.emf.ecore.EObject)1 EObjectFlatComboSettings (org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings)1 Viewer (org.eclipse.jface.viewers.Viewer)1 ViewerFilter (org.eclipse.jface.viewers.ViewerFilter)1 End (org.obeonetwork.dsl.interaction.End)1 InteractionUsePropertiesEditionPart (org.obeonetwork.dsl.interaction.parts.InteractionUsePropertiesEditionPart)1