Search in sources :

Example 11 with Interaction

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

the class InteractionServices method getAllInteractionsInSession.

public List<Interaction> getAllInteractionsInSession(EObject context) {
    List<Interaction> allInteractions = new ArrayList<Interaction>();
    List<EObject> roots = getAllRootsInSession(context);
    for (EObject root : roots) {
        for (Iterator<EObject> i = root.eAllContents(); i.hasNext(); ) {
            EObject object = i.next();
            if (object instanceof Interaction) {
                allInteractions.add((Interaction) object);
            }
        }
    }
    return allInteractions;
}
Also used : Interaction(org.obeonetwork.dsl.interaction.Interaction) EObject(org.eclipse.emf.ecore.EObject) ArrayList(java.util.ArrayList)

Example 12 with Interaction

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

the class InteractionServices method getPrecedingEnds.

private List<End> getPrecedingEnds(End end) {
    List<End> result = new ArrayList<End>();
    Interaction interaction = (Interaction) end.eContainer();
    for (End siblingEnd : interaction.getEnds()) {
        if (!end.equals(siblingEnd)) {
            result.add(siblingEnd);
        } else {
            return result;
        }
    }
    return result;
}
Also used : Interaction(org.obeonetwork.dsl.interaction.Interaction) ArrayList(java.util.ArrayList) End(org.obeonetwork.dsl.interaction.End)

Example 13 with Interaction

use of org.obeonetwork.dsl.interaction.Interaction 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

Interaction (org.obeonetwork.dsl.interaction.Interaction)13 ArrayList (java.util.ArrayList)9 EObject (org.eclipse.emf.ecore.EObject)4 Message (org.obeonetwork.dsl.interaction.Message)3 RecordingCommand (org.eclipse.emf.transaction.RecordingCommand)2 TransactionalEditingDomain (org.eclipse.emf.transaction.TransactionalEditingDomain)2 Session (org.eclipse.sirius.business.api.session.Session)2 DestroyParticipantMessage (org.obeonetwork.dsl.interaction.DestroyParticipantMessage)2 End (org.obeonetwork.dsl.interaction.End)2 InteractionUse (org.obeonetwork.dsl.interaction.InteractionUse)2 Collection (java.util.Collection)1 Stack (java.util.Stack)1 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1 ECrossReferenceAdapter (org.eclipse.emf.ecore.util.ECrossReferenceAdapter)1 EObjectFlatComboSettings (org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings)1 InputDialog (org.eclipse.jface.dialogs.InputDialog)1 Viewer (org.eclipse.jface.viewers.Viewer)1 ViewerFilter (org.eclipse.jface.viewers.ViewerFilter)1 ModelAccessor (org.eclipse.sirius.ecore.extender.business.api.accessor.ModelAccessor)1 IEditingSession (org.eclipse.sirius.ui.business.api.session.IEditingSession)1