/** * Returns the image to be displayed for the applied stereotypes. * * @return the image that represents the first applied stereotype or <code>null</code> if no image * has to be displayed */ public Collection<Image> stereotypeIconsToDisplay(GraphicalEditPart editPart) { String stereotypespresentationKind = AppliedStereotypeHelper.getAppliedStereotypePresentationKind((View) editPart.getModel()); if (stereotypespresentationKind == null) { return null; } if (stereotypespresentationKind.equals( UMLVisualInformationPapyrusConstant.ICON_STEREOTYPE_PRESENTATION) || stereotypespresentationKind.equals( UMLVisualInformationPapyrusConstant.TEXT_ICON_STEREOTYPE_PRESENTATION)) { // retrieve the first stereotype in the list of displayed stereotype String stereotypesToDisplay = AppliedStereotypeHelper.getStereotypesToDisplay((View) editPart.getModel()); Collection<Stereotype> stereotypes = new ArrayList<Stereotype>(); StringTokenizer tokenizer = new StringTokenizer(stereotypesToDisplay, ","); while (tokenizer.hasMoreTokens()) { String firstStereotypeName = tokenizer.nextToken(); stereotypes.add(getUMLElement(editPart).getAppliedStereotype(firstStereotypeName)); } return Activator.getIconElements(getUMLElement(editPart), stereotypes, false); } return new ArrayList<Image>(); }