ItEr22S12CUVistaRecursosTempoPorProxectoItEr21S07: Passing context to DependencyComponent.
This commit is contained in:
parent
5865453227
commit
4d49e4c662
3 changed files with 8 additions and 9 deletions
|
|
@ -23,14 +23,12 @@ public class DependencyComponent extends XulElement implements AfterCompose {
|
|||
|
||||
private DependencyType type;
|
||||
|
||||
public DependencyComponent() {
|
||||
private FunctionalityExposedForExtensions<?> context;
|
||||
|
||||
public DependencyComponent(FunctionalityExposedForExtensions<?> context,
|
||||
TaskComponent source, TaskComponent destination) {
|
||||
this.type = DependencyType.END_START;
|
||||
|
||||
}
|
||||
|
||||
public DependencyComponent(TaskComponent source, TaskComponent destination) {
|
||||
this();
|
||||
this.context = context;
|
||||
if (source == null)
|
||||
throw new IllegalArgumentException("source cannot be null");
|
||||
if (destination == null)
|
||||
|
|
|
|||
|
|
@ -139,8 +139,8 @@ public class FunctionalityExposedForExtensions<T> implements IContext<T> {
|
|||
* @return
|
||||
*/
|
||||
private Task extractTask(Integer topInsertionPosition,
|
||||
List<DomainDependency<T>> accumulatedDependencies,
|
||||
T data, TaskContainer parent) {
|
||||
List<DomainDependency<T>> accumulatedDependencies, T data,
|
||||
TaskContainer parent) {
|
||||
ITaskFundamentalProperties adapted = adapter.adapt(data);
|
||||
accumulatedDependencies.addAll(adapter.getOutcomingDependencies(data));
|
||||
accumulatedDependencies.addAll(adapter.getIncomingDependencies(data));
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ public class TaskList extends XulElement implements AfterCompose {
|
|||
}
|
||||
List<DependencyComponent> result = new ArrayList<DependencyComponent>();
|
||||
for (Dependency dependency : dependencies) {
|
||||
result.add(new DependencyComponent(taskComponentByTask
|
||||
result.add(new DependencyComponent(context, taskComponentByTask
|
||||
.get(dependency.getSource()), taskComponentByTask
|
||||
.get(dependency.getDestination())));
|
||||
}
|
||||
|
|
@ -291,6 +291,7 @@ public class TaskList extends XulElement implements AfterCompose {
|
|||
|
||||
public void addDependency(TaskComponent source, TaskComponent destination) {
|
||||
DependencyComponent dependencyComponent = new DependencyComponent(
|
||||
context,
|
||||
source, destination);
|
||||
context.addDependency(dependencyComponent);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue