ItEr22S12CUVistaRecursosTempoPorProxectoItEr21S07: Making the timetracker available to ResourcesLoadPanel
This commit is contained in:
parent
f731d206d0
commit
84e87a43cc
6 changed files with 25 additions and 3 deletions
|
|
@ -288,6 +288,7 @@ public class FunctionalityExposedForExtensions<T> implements IContext<T> {
|
|||
addDependency(dependency.createWithType(type));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TimeTracker getTimeTracker() {
|
||||
return timeTracker;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ public class ResourcesLoadPanel extends XulElement implements AfterCompose {
|
|||
|
||||
private TimeTrackerComponent timeTrackerComponent;
|
||||
|
||||
public ResourcesLoadPanel() {
|
||||
public ResourcesLoadPanel(TimeTracker timeTracker) {
|
||||
ResourceLoadComponent rlc1 = new ResourceLoadComponent(
|
||||
new ResourceLoad("ResourceLoad 1"));
|
||||
ResourceLoadComponent rlc2 = new ResourceLoadComponent(
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package org.zkoss.ganttz.extensions;
|
||||
|
||||
import org.zkoss.ganttz.TimeTracker;
|
||||
import org.zkoss.ganttz.adapters.PlannerConfiguration;
|
||||
import org.zkoss.ganttz.data.Position;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
|
|
@ -51,6 +52,11 @@ public class ContextRelativeToOtherComponent<T> implements IContext<T> {
|
|||
|
||||
public void replace(T oldDomainObject, T newDomainObject) {
|
||||
context.replace(oldDomainObject, newDomainObject);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TimeTracker getTimeTracker() {
|
||||
return context.getTimeTracker();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package org.zkoss.ganttz.extensions;
|
||||
|
||||
import org.zkoss.ganttz.TimeTracker;
|
||||
import org.zkoss.ganttz.adapters.PlannerConfiguration;
|
||||
import org.zkoss.ganttz.data.Position;
|
||||
import org.zkoss.ganttz.data.Task;
|
||||
|
|
@ -58,4 +59,9 @@ public class ContextWithPlannerTask<T> implements IContextWithPlannerTask<T> {
|
|||
return task;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TimeTracker getTimeTracker() {
|
||||
return context.getTimeTracker();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package org.zkoss.ganttz.extensions;
|
|||
|
||||
import org.zkoss.ganttz.Planner;
|
||||
import org.zkoss.ganttz.TaskComponent;
|
||||
import org.zkoss.ganttz.TimeTracker;
|
||||
import org.zkoss.ganttz.adapters.IAdapterToTaskFundamentalProperties;
|
||||
import org.zkoss.ganttz.adapters.IStructureNavigator;
|
||||
import org.zkoss.ganttz.adapters.PlannerConfiguration;
|
||||
|
|
@ -69,4 +70,10 @@ public interface IContext<T> {
|
|||
*/
|
||||
void add(Position position, T domainObject);
|
||||
|
||||
/**
|
||||
* Makes the time tracker available.
|
||||
* @return the in use {@link TimeTracker Time Tracker}
|
||||
*/
|
||||
TimeTracker getTimeTracker();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,8 @@ public class DataForPlanner {
|
|||
configuration.addTab(new ITabFactory<ITaskFundamentalProperties>() {
|
||||
|
||||
@Override
|
||||
public ITab create(IContext<ITaskFundamentalProperties> context) {
|
||||
public ITab create(
|
||||
final IContext<ITaskFundamentalProperties> context) {
|
||||
return new ITab() {
|
||||
|
||||
private Component parent;
|
||||
|
|
@ -64,7 +65,8 @@ public class DataForPlanner {
|
|||
|
||||
@Override
|
||||
public void show() {
|
||||
loadPanel = new ResourcesLoadPanel();
|
||||
loadPanel = new ResourcesLoadPanel(context
|
||||
.getTimeTracker());
|
||||
parent.appendChild(loadPanel);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue