ItEr33S08ValidacionEProbasFuncionaisItEr32S09: [Bug #79] Passing IDisabilityConfiguration instead of boolean parameters
This commit is contained in:
parent
1edd192e76
commit
07e186dbb5
3 changed files with 13 additions and 11 deletions
|
|
@ -22,6 +22,7 @@ package org.zkoss.ganttz;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import org.zkoss.ganttz.adapters.IDisabilityConfiguration;
|
||||
import org.zkoss.ganttz.data.GanttDiagramGraph;
|
||||
import org.zkoss.ganttz.timetracker.TimeTracker;
|
||||
import org.zkoss.ganttz.timetracker.TimeTrackerComponent;
|
||||
|
|
@ -43,14 +44,14 @@ public class GanttPanel extends XulElement implements AfterCompose {
|
|||
FunctionalityExposedForExtensions<?> context,
|
||||
List<? extends CommandOnTaskContextualized<?>> commandsOnTasksContextualized,
|
||||
CommandOnTaskContextualized<?> editTaskCommand,
|
||||
boolean addingDependenciesEnabled) {
|
||||
IDisabilityConfiguration disabilityConfiguration) {
|
||||
this.diagramGraph = context.getDiagramGraph();
|
||||
timeTrackerComponent = timeTrackerForGanttPanel(context
|
||||
.getTimeTracker());
|
||||
appendChild(timeTrackerComponent);
|
||||
dependencyList = new DependencyList(context);
|
||||
tasksLists = TaskList.createFor(context, editTaskCommand,
|
||||
commandsOnTasksContextualized, addingDependenciesEnabled);
|
||||
commandsOnTasksContextualized, disabilityConfiguration);
|
||||
appendChild(tasksLists);
|
||||
appendChild(dependencyList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import java.util.Arrays;
|
|||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import org.zkoss.ganttz.adapters.IDisabilityConfiguration;
|
||||
import org.zkoss.ganttz.adapters.PlannerConfiguration;
|
||||
import org.zkoss.ganttz.data.Dependency;
|
||||
import org.zkoss.ganttz.data.GanttDiagramGraph;
|
||||
|
|
@ -62,7 +63,7 @@ public class Planner extends HtmlMacroComponent {
|
|||
|
||||
private FunctionalityExposedForExtensions<?> context;
|
||||
|
||||
private boolean addingDependenciesEnabled;
|
||||
private IDisabilityConfiguration disabilityConfiguration;
|
||||
|
||||
public Planner() {
|
||||
registerNeededScripts();
|
||||
|
|
@ -148,6 +149,7 @@ public class Planner extends HtmlMacroComponent {
|
|||
editTaskCommand = contextualize(context, configuration
|
||||
.getEditTaskCommand());
|
||||
this.context = context;
|
||||
this.disabilityConfiguration = configuration;
|
||||
context.add(configuration.getData());
|
||||
setupComponents();
|
||||
|
||||
|
|
@ -171,9 +173,6 @@ public class Planner extends HtmlMacroComponent {
|
|||
if (chartLegend != null) {
|
||||
setAt("insertionPointChartLegend", chartLegend);
|
||||
}
|
||||
|
||||
this.addingDependenciesEnabled = configuration
|
||||
.isAddingDependenciesEnabled();
|
||||
}
|
||||
|
||||
private void setAt(String insertionPointId, Component component) {
|
||||
|
|
@ -224,7 +223,7 @@ public class Planner extends HtmlMacroComponent {
|
|||
this.leftPane = new LeftPane(this.diagramGraph.getTopLevelTasks());
|
||||
this.ganttPanel = new GanttPanel(this.context,
|
||||
commandsOnTasksContextualized, editTaskCommand,
|
||||
addingDependenciesEnabled);
|
||||
disabilityConfiguration);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.zkoss.ganttz.adapters.IDisabilityConfiguration;
|
||||
import org.zkoss.ganttz.data.Dependency;
|
||||
import org.zkoss.ganttz.data.DependencyType;
|
||||
import org.zkoss.ganttz.data.Position;
|
||||
|
|
@ -73,22 +74,23 @@ public class TaskList extends XulElement implements AfterCompose {
|
|||
CommandOnTaskContextualized<?> editTaskCommand,
|
||||
List<Task> tasks,
|
||||
List<? extends CommandOnTaskContextualized<?>> commandsOnTasksContextualized,
|
||||
boolean addingDependenciesEnabled) {
|
||||
IDisabilityConfiguration disabilityConfiguration) {
|
||||
this.context = context;
|
||||
this.editTaskCommand = editTaskCommand;
|
||||
this.originalTasks = tasks;
|
||||
this.commandsOnTasksContextualized = commandsOnTasksContextualized;
|
||||
this.addingDependenciesEnabled = addingDependenciesEnabled;
|
||||
this.addingDependenciesEnabled = disabilityConfiguration
|
||||
.isAddingDependenciesEnabled();
|
||||
}
|
||||
|
||||
public static TaskList createFor(
|
||||
FunctionalityExposedForExtensions<?> context,
|
||||
CommandOnTaskContextualized<?> editTaskCommand,
|
||||
List<? extends CommandOnTaskContextualized<?>> commandsOnTasksContextualized,
|
||||
boolean addingDependenciesEnabled) {
|
||||
IDisabilityConfiguration disabilityConfiguration) {
|
||||
TaskList result = new TaskList(context, editTaskCommand, context
|
||||
.getDiagramGraph().getTopLevelTasks(),
|
||||
commandsOnTasksContextualized, addingDependenciesEnabled);
|
||||
commandsOnTasksContextualized, disabilityConfiguration);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue