public AbstractSystemFieldMapper(Field field, DefaultFieldValuesManager defaultFieldValuesManager) { this.defaultFieldValuesManager = defaultFieldValuesManager; this.nameKey = field.getNameKey(); this.id = field.getId(); }
public String getFieldName(final Field field) { if (field instanceof CustomField) { return field.getName(); } else { return getText(field.getNameKey()); } }
public void addField(Field field, FieldJsonRepresentation data, boolean includeRenderedVersion) { addField(field.getName(), field, data, includeRenderedVersion); }
@Override public int compare(Field field1, Field field2) { if (field1 == null) throw new IllegalArgumentException("The first parameter is null"); if (field2 == null) throw new IllegalArgumentException("The second parameter is null"); String name1 = i18nHelper.getText(field1.getNameKey()); String name2 = i18nHelper.getText(field2.getNameKey()); return name1.compareTo(name2); } }
public MockFieldManager addField(Field field) { fields.put(field.getId(), field); return this; }
public String getFieldName(final Field field, final I18nHelper i18nHelper) { if (field instanceof CustomField) { return field.getName(); } else { return i18nHelper.getText(field.getNameKey()); } }
public int compareTo(Object o) { // NOTE: If this is being chnaged, chances are the compareTo method of the CustomFieldImpl object also needs to chnage. if (o == null) return 1; else if (o instanceof Field) { Field field = (Field) o; if (getName() == null) { if (field.getName() == null) return 0; else return -1; } else { if (field.getName() == null) return 1; else return getName().compareTo(field.getName()); } } else { throw new IllegalArgumentException("Can only compare Field objects."); } } }
public int compare(Object o1, Object o2) { if (o1 == null) throw new IllegalArgumentException("The first parameter is null"); if (!(o1 instanceof Field)) throw new IllegalArgumentException("The first parameter " + o1 + " is not an instance of Field"); if (o2 == null) throw new IllegalArgumentException("The second parameter is null"); if (!(o2 instanceof Field)) throw new IllegalArgumentException("The second parameter " + o2 + " is not an instance of Field"); String name1 = i18nHelper.getText(((Field) o1).getNameKey()); String name2 = i18nHelper.getText(((Field) o2).getNameKey()); return name1.compareTo(name2); } }
protected void getVelocityParamsForInput(Map<String,Object> velocityParams) { List<Field> fields = groupSelectorUtils.getCustomFieldsSpecifyingGroups(); Map<String,String> groupcf = Maps.newHashMapWithExpectedSize(fields.size()); for (Field customField : fields) { groupcf.put(customField.getId(), customField.getName()); } velocityParams.put("groupcfs", groupcf); }
public AbstractFieldMapper(Field field, DefaultFieldValuesManager defaultFieldValuesManager) { this.defaultFieldValuesManager = defaultFieldValuesManager; this.nameKey = field.getNameKey(); this.id = field.getId(); }
public String getFieldName(Field field) { if (field instanceof CustomField) { return field.getName(); } else { return getText(field.getNameKey()); } }
/** Returns Internationalized human-readable name of a field, or the key (usually also readable) if none was found. */ public String getFieldName(final String fieldKey, final I18nHelper i18n) { final Field field = fieldManager.getField(fieldKey); if (field == null) { return fieldKey; } return i18n.getText(field.getNameKey()); }
private void populateAllAvailableFields(ListOrderedMap values) throws FieldException { Set fields = ComponentAccessor.getFieldManager().getAvailableNavigableFields(authenticationContext.getUser()); for (Object field1 : fields) { Field field = (Field) field1; values.put(field.getId(), field.getName()); } }
public boolean isForceResolution(final Field field) { return IssueFieldConstants.RESOLUTION.equals(field.getId()); }
public String getFieldName(Field field) { if (getFieldManager().isCustomField(field)) { CustomField customField = fieldManager.getCustomField(field.getId()); return customField.getName(); } else { return getText(field.getNameKey()); } }
/** * Utility method used by convertissuetosubtask-confirm.jsp * * @param field filed * @return field name */ public String getFieldName(Field field) { if (field instanceof CustomField) { return field.getName(); } else { return getText(field.getNameKey()); } }