ItEr28S06CUAsignacionGrupoRecursosAPlanificacionItEr27S06: It can go back from advanced allocation to basic allocation

This commit is contained in:
Óscar González Fernández 2009-10-03 17:52:38 +02:00
parent 2230ef4344
commit 0ec4a52b78
3 changed files with 35 additions and 19 deletions

View file

@ -43,7 +43,8 @@ import org.zkoss.zul.Grid;
import org.zkoss.zul.Label;
import org.zkoss.zul.api.Column;
public class AdvancedAllocationController extends GenericForwardComposer {
public abstract class AdvancedAllocationController extends
GenericForwardComposer {
private Div insertionPointTimetracker;
private Div insertionPointLeftPanel;
@ -83,6 +84,12 @@ public class AdvancedAllocationController extends GenericForwardComposer {
insertionPointTimetracker.appendChild(timeTrackerComponent);
}
public void onClick$acceptButton() {
backToPreviousButton();
}
protected abstract void backToPreviousButton();
public void onClick$zoomIncrease() {
timeTracker.zoomIncrease();
}

View file

@ -41,6 +41,7 @@ import org.navalplanner.business.resources.entities.Criterion;
import org.navalplanner.business.resources.entities.Resource;
import org.navalplanner.business.resources.entities.Worker;
import org.navalplanner.web.common.ComponentsReplacer;
import org.navalplanner.web.common.IChildrenSnapshot;
import org.navalplanner.web.common.IMessagesForUser;
import org.navalplanner.web.common.Level;
import org.navalplanner.web.common.MessagesForUser;
@ -103,6 +104,8 @@ public class ResourceAllocationController extends GenericForwardComposer {
private Button applyButton;
private IChildrenSnapshot previousSnapshot;
@Override
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
@ -290,6 +293,7 @@ public class ResourceAllocationController extends GenericForwardComposer {
resourceAllocationModel.cancel();
}
private void close() {
self.setVisible(false);
clear();
@ -305,16 +309,37 @@ public class ResourceAllocationController extends GenericForwardComposer {
}
public void advanceAllocation() {
ComponentsReplacer.replaceAllChildren(window, "advance_allocation.zul",
IChildrenSnapshot snapshot = ComponentsReplacer
.replaceAllChildren(window, "advance_allocation.zul",
new HashMap<String, Object>() {
{
put("advancedAllocationController",
new AdvancedAllocationController());
new AdvancedAllocationController() {
@Override
protected void backToPreviousButton() {
previousSnapshot.restore();
}
});
}
});
previousSnapshot = withWidth(snapshot, window.getWidth());
window.setWidth("1200px");
}
private IChildrenSnapshot withWidth(final IChildrenSnapshot snapshot,
final String currentWidth) {
return new IChildrenSnapshot() {
@Override
public IChildrenSnapshot restore() {
IChildrenSnapshot result = snapshot.restore();
window.setWidth(currentWidth);
return result;
}
};
}
/**
* Renders a {@link SpecificResourceAllocation} item
* @author Diego Pino Garcia <dpino@igalia.com>

View file

@ -35,22 +35,6 @@
<button label="+" id="zoomIncrease"/>
<button label="-" id="zoomDecrease"/>
From: <datebox /> to: <datebox />
<separator/>
Filter:
<combobox>
<comboitem label="Orders"
description="Show full orders and company view" />
<comboitem label="Tasks"
description="Tasks inside orders or filtered" />
</combobox>
<combobox>
<comboitem label="Filter by Label" />
<comboitem label="Filter by criterion" />
<comboitem label="Filter by resources" />
<comboitem label="Critical way" />
</combobox>
<textbox/>
</hbox>
</north>