Commit 847e41d0 authored by Thomas Huster's avatar Thomas Huster
Browse files

[17711] added method to get salutation string for person based on gender

parent 0dc66910
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -39,15 +39,7 @@ public class AddressFormatUtil {
	public static String getSingleLine(IPerson person){
		StringBuilder ret = new StringBuilder();
		
		String salutation;
		if (person.getGender().equals(Gender.MALE)) {
			salutation = Messages.KontakteView_SalutationM;
		} else if (person.getGender().equals(Gender.FEMALE)) {
			salutation = Messages.KontakteView_SalutationF;
		} else {
			salutation = ""; //$NON-NLS-1$
		}
		ret.append(salutation);
		ret.append(PersonFormatUtil.getSalutation(person));
		ret.append(StringTool.space);
		
		// name with title
+11 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ import java.time.format.DateTimeFormatter;

import org.apache.commons.lang3.StringUtils;

import ch.elexis.core.l10n.Messages;
import ch.elexis.core.model.IPerson;
import ch.elexis.core.types.Gender;

@@ -80,4 +81,14 @@ public class PersonFormatUtil {
		}
		return sb.toString();
	}
	
	public static String getSalutation(IPerson person){
		if (person.getGender().equals(Gender.MALE)) {
			return Messages.KontakteView_SalutationM;
		} else if (person.getGender().equals(Gender.FEMALE)) {
			return Messages.KontakteView_SalutationF;
		} else {
			return ""; //$NON-NLS-1$
		}
	}
}