[Bug #1239] Updates text of tooltips when changing name or progress
FEA: ItEr75S04BugFixing
This commit is contained in:
parent
d49e167909
commit
c6b7704cdf
7 changed files with 42 additions and 16 deletions
|
|
@ -26,6 +26,7 @@ import java.util.List;
|
|||
import org.joda.time.LocalDate;
|
||||
import org.zkoss.ganttz.adapters.IDisabilityConfiguration;
|
||||
import org.zkoss.ganttz.data.GanttDiagramGraph;
|
||||
import org.zkoss.ganttz.data.Task;
|
||||
import org.zkoss.ganttz.timetracker.TimeTracker;
|
||||
import org.zkoss.ganttz.timetracker.TimeTrackerComponent;
|
||||
import org.zkoss.ganttz.timetracker.zoom.IZoomLevelChangedListener;
|
||||
|
|
@ -136,6 +137,13 @@ public class GanttPanel extends XulElement implements AfterCompose {
|
|||
registerZoomLevelChangedListener();
|
||||
}
|
||||
|
||||
public void updateTooltips() {
|
||||
for (Task task : this.tasksLists.getAllTasks()) {
|
||||
task.updateTooltipText();
|
||||
}
|
||||
invalidate();
|
||||
}
|
||||
|
||||
public TimeTrackerComponent getTimeTrackerComponent() {
|
||||
return timeTrackerComponent;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@ public class LeftPane extends HtmlMacroComponent {
|
|||
|
||||
private FilterAndParentExpandedPredicates predicate;
|
||||
|
||||
private Planner planner;
|
||||
|
||||
public void setGoingDownInLastArrowCommand(
|
||||
CommandContextualized<?> goingDownInLastArrowCommand) {
|
||||
this.leftTasksTree
|
||||
|
|
@ -52,18 +54,19 @@ public class LeftPane extends HtmlMacroComponent {
|
|||
}
|
||||
|
||||
public LeftPane(IDisabilityConfiguration disabilityConfiguration,
|
||||
List<Task> topLevelTasks,
|
||||
Planner planner,
|
||||
FilterAndParentExpandedPredicates predicate) {
|
||||
this.topLevelTasks = topLevelTasks;
|
||||
this.topLevelTasks = planner.getDiagramGraph().getTopLevelTasks();
|
||||
this.disabilityConfiguration = disabilityConfiguration;
|
||||
this.predicate = predicate;
|
||||
this.planner = planner;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterCompose() {
|
||||
super.afterCompose();
|
||||
leftTasksTree = new LeftTasksTree(disabilityConfiguration,
|
||||
topLevelTasks, predicate);
|
||||
leftTasksTree = new LeftTasksTree(disabilityConfiguration, planner,
|
||||
predicate);
|
||||
getContainer().appendChild(leftTasksTree);
|
||||
leftTasksTree.afterCompose();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,8 +79,8 @@ public class LeftTasksTree extends HtmlMacroComponent {
|
|||
task);
|
||||
String cssClass = "depth_" + path.length;
|
||||
LeftTasksTreeRow leftTasksTreeRow = LeftTasksTreeRow.create(
|
||||
disabilityConfiguration, task,
|
||||
new TreeNavigator(tasksTreeModel, task));
|
||||
disabilityConfiguration, task, new TreeNavigator(
|
||||
tasksTreeModel, task), planner);
|
||||
if (task.isContainer()) {
|
||||
expandWhenOpened((TaskContainer) task, item);
|
||||
}
|
||||
|
|
@ -330,12 +330,15 @@ public class LeftTasksTree extends HtmlMacroComponent {
|
|||
|
||||
private final List<Task> visibleTasks = new ArrayList<Task>();
|
||||
|
||||
private Planner planner;
|
||||
|
||||
public LeftTasksTree(IDisabilityConfiguration disabilityConfiguration,
|
||||
List<Task> tasks,
|
||||
Planner planner,
|
||||
FilterAndParentExpandedPredicates predicate) {
|
||||
this.disabilityConfiguration = disabilityConfiguration;
|
||||
this.tasks = tasks;
|
||||
this.tasks = planner.getTaskList().getAllTasks();
|
||||
this.predicate = predicate;
|
||||
this.planner = planner;
|
||||
}
|
||||
|
||||
private void fillModel(Collection<? extends Task> tasks, boolean firstTime) {
|
||||
|
|
|
|||
|
|
@ -77,25 +77,28 @@ public class LeftTasksTreeRow extends GenericForwardComposer {
|
|||
|
||||
private DateFormat dateFormat;
|
||||
|
||||
private Planner planner;
|
||||
|
||||
private final ILeftTasksTreeNavigator leftTasksTreeNavigator;
|
||||
|
||||
private final IDisabilityConfiguration disabilityConfiguration;
|
||||
|
||||
public static LeftTasksTreeRow create(
|
||||
IDisabilityConfiguration disabilityConfiguration, Task bean,
|
||||
ILeftTasksTreeNavigator taskDetailnavigator) {
|
||||
ILeftTasksTreeNavigator taskDetailnavigator, Planner planner) {
|
||||
return new LeftTasksTreeRow(disabilityConfiguration, bean,
|
||||
taskDetailnavigator);
|
||||
taskDetailnavigator, planner);
|
||||
}
|
||||
|
||||
private LeftTasksTreeRow(IDisabilityConfiguration disabilityConfiguration,
|
||||
Task task,
|
||||
ILeftTasksTreeNavigator leftTasksTreeNavigator) {
|
||||
Task task, ILeftTasksTreeNavigator leftTasksTreeNavigator,
|
||||
Planner planner) {
|
||||
this.disabilityConfiguration = disabilityConfiguration;
|
||||
this.task = task;
|
||||
this.dateFormat = DateFormat.getDateInstance(DateFormat.SHORT, Locales
|
||||
.getCurrent());
|
||||
this.leftTasksTreeNavigator = leftTasksTreeNavigator;
|
||||
this.planner = planner;
|
||||
}
|
||||
|
||||
public Task getTask() {
|
||||
|
|
@ -391,6 +394,7 @@ public class LeftTasksTreeRow extends GenericForwardComposer {
|
|||
Date newEnd = getEndDateBox().getValue();
|
||||
task.resizeTo(LocalDate.fromDateFields(newEnd));
|
||||
}
|
||||
planner.updateTooltips();
|
||||
}
|
||||
|
||||
private void updateComponents() {
|
||||
|
|
|
|||
|
|
@ -71,7 +71,6 @@ import org.zkoss.zul.Button;
|
|||
import org.zkoss.zul.ListModel;
|
||||
import org.zkoss.zul.Listbox;
|
||||
import org.zkoss.zul.Listitem;
|
||||
import org.zkoss.zul.Separator;
|
||||
import org.zkoss.zul.SimpleListModel;
|
||||
import org.zkoss.zul.South;
|
||||
|
||||
|
|
@ -468,8 +467,7 @@ public class Planner extends HtmlMacroComponent {
|
|||
return true;
|
||||
}
|
||||
};
|
||||
this.leftPane = new LeftPane(disabilityConfiguration, this.diagramGraph
|
||||
.getTopLevelTasks(), predicate);
|
||||
this.leftPane = new LeftPane(disabilityConfiguration, this, predicate);
|
||||
this.ganttPanel = new GanttPanel(this,
|
||||
commandsOnTasksContextualized, doubleClickCommand,
|
||||
disabilityConfiguration, predicate);
|
||||
|
|
@ -478,6 +476,14 @@ public class Planner extends HtmlMacroComponent {
|
|||
button.setDisabled(!context.isPrintEnabled());
|
||||
}
|
||||
|
||||
public GanttZKDiagramGraph getDiagramGraph() {
|
||||
return this.diagramGraph;
|
||||
}
|
||||
|
||||
public void updateTooltips() {
|
||||
this.ganttPanel.updateTooltips();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void insertGlobalCommands() {
|
||||
Component commontoolbar = getCommonCommandsInsertionPoint();
|
||||
|
|
|
|||
|
|
@ -639,7 +639,8 @@ public abstract class TaskElement extends BaseEntity {
|
|||
* depending on parameter
|
||||
*/
|
||||
public BigDecimal getAdvancePercentage(ProgressType progressType) {
|
||||
if (progressType.equals(ProgressType.SPREAD_PROGRESS)) {
|
||||
if (progressType != null
|
||||
&& progressType.equals(ProgressType.SPREAD_PROGRESS)) {
|
||||
return advancePercentage;
|
||||
}
|
||||
return BigDecimal.ZERO;
|
||||
|
|
|
|||
|
|
@ -151,6 +151,7 @@ public class AdvanceAssignmentPlanningController extends GenericForwardComposer
|
|||
private void updateTaskComponent(TaskComponent taskComponent) {
|
||||
taskComponent.updateCompletionIfPossible();
|
||||
taskComponent.updateTooltipText();
|
||||
taskComponent.invalidate();
|
||||
}
|
||||
|
||||
private void close() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue