Search in sources :

Example 1 with EventChannelSinkConnector

use of org.palladiosimulator.pcm.core.composition.EventChannelSinkConnector in project Palladio-Editors-Sirius by PalladioSimulator.

the class DeleteAsemblyContext method execute.

@Override
public void execute(Collection<? extends EObject> selection, Map<String, Object> parameters) {
    AssemblyContext element = (AssemblyContext) parameters.get("element");
    Iterator<Connector> iter = element.getParentStructure__AssemblyContext().getConnectors__ComposedStructure().iterator();
    Connector connector;
    while (iter.hasNext()) {
        connector = iter.next();
        // necessary
        if (connector instanceof AssemblyInfrastructureConnector) {
            AssemblyInfrastructureConnector tmpConnector = (AssemblyInfrastructureConnector) connector;
            // Remove if element is part of connector
            if (tmpConnector.getProvidingAssemblyContext__AssemblyInfrastructureConnector().equals(element) || tmpConnector.getRequiringAssemblyContext__AssemblyInfrastructureConnector().equals(element)) {
                iter.remove();
            }
        } else if (connector instanceof AssemblyConnector) {
            AssemblyConnector tmpConnector = (AssemblyConnector) connector;
            // Remove if element is part of connector
            if (tmpConnector.getProvidingAssemblyContext_AssemblyConnector().equals(element) || tmpConnector.getRequiringAssemblyContext_AssemblyConnector().equals(element)) {
                iter.remove();
            }
        } else if (connector instanceof AssemblyEventConnector) {
            AssemblyEventConnector tmpConnector = (AssemblyEventConnector) connector;
            // Remove if element is part of connector
            if (tmpConnector.getSinkAssemblyContext__AssemblyEventConnector().equals(element) || tmpConnector.getSourceAssemblyContext__AssemblyEventConnector().equals(element)) {
                iter.remove();
            }
        } else if (connector instanceof EventChannelSourceConnector) {
            EventChannelSourceConnector tmpConnector = (EventChannelSourceConnector) connector;
            // Remove if element is part of connector
            if (tmpConnector.getAssemblyContext__EventChannelSourceConnector().equals(element)) {
                iter.remove();
            }
        } else if (connector instanceof EventChannelSinkConnector) {
            EventChannelSinkConnector tmpConnector = (EventChannelSinkConnector) connector;
            // Remove if element is part of connector
            if (tmpConnector.getAssemblyContext__EventChannelSinkConnector().equals(element)) {
                iter.remove();
            }
        } else if (connector instanceof SinkDelegationConnector) {
            SinkDelegationConnector tmpConnector = (SinkDelegationConnector) connector;
            // Remove if element is part of connector
            if (tmpConnector.getAssemblyContext__SinkDelegationConnector().equals(element)) {
                iter.remove();
            }
        } else if (connector instanceof SourceDelegationConnector) {
            SourceDelegationConnector tmpConnector = (SourceDelegationConnector) connector;
            // Remove if element is part of connector
            if (tmpConnector.getAssemblyContext__SourceDelegationConnector().equals(element)) {
                iter.remove();
            }
        } else if (connector instanceof ProvidedDelegationConnector) {
            ProvidedDelegationConnector tmpConnector = (ProvidedDelegationConnector) connector;
            // Remove if element is part of connector
            if (tmpConnector.getAssemblyContext_ProvidedDelegationConnector().equals(element)) {
                iter.remove();
            }
        } else if (connector instanceof ProvidedInfrastructureDelegationConnector) {
            ProvidedInfrastructureDelegationConnector tmpConnector = (ProvidedInfrastructureDelegationConnector) connector;
            // Remove if element is part of connector
            if (tmpConnector.getAssemblyContext__ProvidedInfrastructureDelegationConnector().equals(element)) {
                iter.remove();
            }
        } else if (connector instanceof RequiredInfrastructureDelegationConnector) {
            RequiredInfrastructureDelegationConnector tmpConnector = (RequiredInfrastructureDelegationConnector) connector;
            // Remove if element is part of connector
            if (tmpConnector.getAssemblyContext__RequiredInfrastructureDelegationConnector().equals(element)) {
                iter.remove();
            }
        } else if (connector instanceof RequiredDelegationConnector) {
            RequiredDelegationConnector tmpConnector = (RequiredDelegationConnector) connector;
            // Remove if element is part of connector
            if (tmpConnector.getAssemblyContext_RequiredDelegationConnector().equals(element)) {
                iter.remove();
            }
        }
    }
// TODO DelegationConnector
}
Also used : ProvidedDelegationConnector(org.palladiosimulator.pcm.core.composition.ProvidedDelegationConnector) RequiredDelegationConnector(org.palladiosimulator.pcm.core.composition.RequiredDelegationConnector) SinkDelegationConnector(org.palladiosimulator.pcm.core.composition.SinkDelegationConnector) RequiredInfrastructureDelegationConnector(org.palladiosimulator.pcm.core.composition.RequiredInfrastructureDelegationConnector) AssemblyConnector(org.palladiosimulator.pcm.core.composition.AssemblyConnector) Connector(org.palladiosimulator.pcm.core.composition.Connector) AssemblyEventConnector(org.palladiosimulator.pcm.core.composition.AssemblyEventConnector) SourceDelegationConnector(org.palladiosimulator.pcm.core.composition.SourceDelegationConnector) EventChannelSourceConnector(org.palladiosimulator.pcm.core.composition.EventChannelSourceConnector) EventChannelSinkConnector(org.palladiosimulator.pcm.core.composition.EventChannelSinkConnector) ProvidedInfrastructureDelegationConnector(org.palladiosimulator.pcm.core.composition.ProvidedInfrastructureDelegationConnector) AssemblyInfrastructureConnector(org.palladiosimulator.pcm.core.composition.AssemblyInfrastructureConnector) ProvidedDelegationConnector(org.palladiosimulator.pcm.core.composition.ProvidedDelegationConnector) ProvidedInfrastructureDelegationConnector(org.palladiosimulator.pcm.core.composition.ProvidedInfrastructureDelegationConnector) AssemblyConnector(org.palladiosimulator.pcm.core.composition.AssemblyConnector) EventChannelSinkConnector(org.palladiosimulator.pcm.core.composition.EventChannelSinkConnector) AssemblyContext(org.palladiosimulator.pcm.core.composition.AssemblyContext) SourceDelegationConnector(org.palladiosimulator.pcm.core.composition.SourceDelegationConnector) RequiredDelegationConnector(org.palladiosimulator.pcm.core.composition.RequiredDelegationConnector) AssemblyEventConnector(org.palladiosimulator.pcm.core.composition.AssemblyEventConnector) EventChannelSourceConnector(org.palladiosimulator.pcm.core.composition.EventChannelSourceConnector) SinkDelegationConnector(org.palladiosimulator.pcm.core.composition.SinkDelegationConnector) AssemblyInfrastructureConnector(org.palladiosimulator.pcm.core.composition.AssemblyInfrastructureConnector) RequiredInfrastructureDelegationConnector(org.palladiosimulator.pcm.core.composition.RequiredInfrastructureDelegationConnector)

Aggregations

AssemblyConnector (org.palladiosimulator.pcm.core.composition.AssemblyConnector)1 AssemblyContext (org.palladiosimulator.pcm.core.composition.AssemblyContext)1 AssemblyEventConnector (org.palladiosimulator.pcm.core.composition.AssemblyEventConnector)1 AssemblyInfrastructureConnector (org.palladiosimulator.pcm.core.composition.AssemblyInfrastructureConnector)1 Connector (org.palladiosimulator.pcm.core.composition.Connector)1 EventChannelSinkConnector (org.palladiosimulator.pcm.core.composition.EventChannelSinkConnector)1 EventChannelSourceConnector (org.palladiosimulator.pcm.core.composition.EventChannelSourceConnector)1 ProvidedDelegationConnector (org.palladiosimulator.pcm.core.composition.ProvidedDelegationConnector)1 ProvidedInfrastructureDelegationConnector (org.palladiosimulator.pcm.core.composition.ProvidedInfrastructureDelegationConnector)1 RequiredDelegationConnector (org.palladiosimulator.pcm.core.composition.RequiredDelegationConnector)1 RequiredInfrastructureDelegationConnector (org.palladiosimulator.pcm.core.composition.RequiredInfrastructureDelegationConnector)1 SinkDelegationConnector (org.palladiosimulator.pcm.core.composition.SinkDelegationConnector)1 SourceDelegationConnector (org.palladiosimulator.pcm.core.composition.SourceDelegationConnector)1