private String getCallLabel() { String name = null; Activity activity = (Activity) getRealModel().getCallee(); if (activity != null) { EOperation operation = activity.getOwningOperation().getOperation(); if (!activity.getOutParameters().isEmpty()) { EParameter param = activity.getOutParameters().get(0); for (ParameterBinding binding : getRealModel().getOwnedParameterBindings()) { if (binding.getParameter() == param) { name = Expr2String.toString(binding.getValueExpression()) + " := "; } } if (name == null) { name = ""; } } else { name = "void "; } name += operation.getName() + "("; for (EParameter param : operation.getEParameters()) { boolean found = false; for (ParameterBinding binding : getRealModel().getOwnedParameterBindings()) { if (binding.getParameter() == param) { name += Expr2String.toString(binding.getValueExpression()) + ","; found = true; } } if (!found) { name += "null,"; } } int lastComma = name.lastIndexOf(","); if (lastComma > -1) { name = name.substring(0, lastComma); } name += ")"; } else { name = "select activity to call"; } return name; }
@Override public Image getColumnImage(Object element, int index) { if (element instanceof EParameter) { EParameter eParameter = (EParameter) element; if (eParameter.eContainer() instanceof Activity) { Activity activity = (Activity) eParameter.eContainer(); if (isOutgoing && activity.getInParameters().contains(eParameter)) { return DiagramImages.getImage(DiagramImages.EPARAMETER_OUT_REF); } else if (!isOutgoing && activity.getOutParameters().contains(eParameter)) { return DiagramImages.getImage(DiagramImages.EPARAMETER_IN_REF); } } if (isOutgoing) { return DiagramImages.getImage(DiagramImages.EPARAMETER_OUT); } else { return DiagramImages.getImage(DiagramImages.EPARAMETER_IN); } } return null; }