/** * Gets the elements. * * @param inputElement the input element * @return the elements * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object) */ public Object[] getElements(Object inputElement) { if (inputElement instanceof Object[]) { List<ModelTemplateDescription> result = new ArrayList<ModelTemplateDescription>(); for (Object next : (Object[]) inputElement) { if (next instanceof String) { String diagramCategory = (String) next; for (ModelTemplateDescription template : getTemplatesDescription()) { if (diagramCategory == null || diagramCategory.equals(template.getLanguage())) { result.add(template); } } } } return result.toArray(); } return new Object[0]; }