/** * returns a flat list of InterfaceItem scopes for a {@link MessageFromIf} * * @param mfi - the message from interface * @param ref - not used * @return a list of scopes */ public IScope scope_MessageFromIf_from(MessageFromIf mfi, EReference ref) { final List<IEObjectDescription> scopes = new ArrayList<IEObjectDescription>(); ActorClass ac = getActorClass(mfi); List<InterfaceItem> items = RoomHelpers.getAllInterfaceItems(ac); for (InterfaceItem item : items) { scopes.add(EObjectDescription.create(item.getName(), item)); } return new SimpleScope(IScope.NULLSCOPE, scopes); }
/** * returns a flat list of Message scopes for a {@link MessageFromIf} * * @param mfi - the message from interface * @param ref - not used * @return a list of scopes */ public IScope scope_MessageFromIf_message(MessageFromIf mfi, EReference ref) { final List<IEObjectDescription> scopes = new ArrayList<IEObjectDescription>(); InterfaceItem item = mfi.getFrom(); if (item != null) { ProtocolClass protocol = item.getProtocol(); boolean conjugated = false; if (item instanceof Port) conjugated = ((Port) item).isConjugated(); else if (item instanceof SAPRef) conjugated = true; for (Message msg : conjugated ? protocol.getOutgoingMessages() : protocol.getIncomingMessages()) { scopes.add(EObjectDescription.create(msg.getName(), msg)); } } return new SimpleScope(IScope.NULLSCOPE, scopes); }