Logic.unlockReading();
}
}
private void updateLocked() {
Employee employee = (Employee) dataObject;
lblFirstname.setText(employee.getFirstname());
lblLastname.setText(employee.getLastname());
lblEmail.setText(employee.getEmail());
lblPhone.setText(employee.getPhone());
taComment.setText(employee.getComment());
Project[] projects = employee.getProjects().toArray(new Project[employee.getProjects().size()]);
StringBuilder proj = new StringBuilder();
for (int i = 0; i < projects.length - 1; i++) {
proj.append(projects[i].getName()).append(", ");
}
if (proj.length() > 0) {
proj.append(projects[projects.length - 1].getName());
}
lblProjects.setText(proj.toString());
lblDepartment.setText(employee.getDepartment().getName());
if (employee.isCompanyManager()) {
lblRole.setText(lang.getString("CompanyManager"));
} else if (employee.isDepartmentManager(employee.getDepartment())) {
lblRole.setText(String.format(lang.getString("DepartmentManagerOf"),
employee.getDepartment().getName()));
} else {
StringBuilder role = new StringBuilder();
if (projects.length >= 1) {
for (int i = 0; i < projects.length - 1; i++) {
role.append(getProjectRole(employee, projects[i])).append(", ");