boolean isDateTypeField(Field field) {
   if (fieldManager.isCustomField(field)) {
     final CustomFieldType customFieldType = ((CustomField) field).getCustomFieldType();
     return customFieldType instanceof DateField;
   } else {
     return field instanceof DateField;
   }
 }
Exemple #2
0
  public List<Field> getDisplayFields() {
    FieldManager fieldManager = getFieldManager();
    Set<NavigableField> fieldSet;
    try {
      fieldSet = fieldManager.getAllAvailableNavigableFields();
    } catch (FieldException e) {
      return Collections.emptyList();
    }

    final List<Field> fields = new ArrayList<Field>();
    for (Field field : fieldSet) {
      if (fieldManager.isCustomField(field)) {
        final CustomFieldType<?, ?> type = ((CustomField) field).getCustomFieldType();
        if (type instanceof UserCFType || type instanceof MultiUserCFType) {
          fields.add(field);
        }
      }
    }
    return fields;
  }