use of org.palladiosimulator.pcm.core.composition.RequiredInfrastructureDelegationConnector 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
}
Aggregations