ItEr47S04ValidacionEProbasFuncionaisItEr46S04: [Bug #276] Adding prefixes with the name of the topmost task.
This commit is contained in:
parent
62a7eeaae6
commit
150eacae86
2 changed files with 16 additions and 2 deletions
|
|
@ -398,4 +398,12 @@ public abstract class TaskElement extends BaseEntity {
|
|||
return false;
|
||||
}
|
||||
|
||||
public TaskElement getTopMost() {
|
||||
TaskElement result = this;
|
||||
while (result.getParent() != null) {
|
||||
result = result.getParent();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -262,8 +262,8 @@ public class ResourceLoadModel implements IResourceLoadModel {
|
|||
.byTask(sortedByStartDate);
|
||||
List<LoadTimeLine> secondLevel = new ArrayList<LoadTimeLine>();
|
||||
for (Entry<Task, List<ResourceAllocation<?>>> entry : byTask.entrySet()) {
|
||||
LoadTimeLine timeLine = buildTimeLine(resource, entry.getKey()
|
||||
.getName(),
|
||||
Task task = entry.getKey();
|
||||
LoadTimeLine timeLine = buildTimeLine(resource, getTaskName(task),
|
||||
entry.getValue());
|
||||
if (!timeLine.isEmpty()) {
|
||||
secondLevel.add(timeLine);
|
||||
|
|
@ -272,6 +272,12 @@ public class ResourceLoadModel implements IResourceLoadModel {
|
|||
return secondLevel;
|
||||
}
|
||||
|
||||
private String getTaskName(Task task) {
|
||||
TaskElement topMost = task.getTopMost();
|
||||
String prefix = topMost != task ? (topMost.getName() + " :: ") : "";
|
||||
return prefix + task.getName();
|
||||
}
|
||||
|
||||
private LoadTimeLine buildTimeLine(Collection<Criterion> criterions,
|
||||
Resource resource,
|
||||
List<GenericResourceAllocation> allocationsSortedByStartDate) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue