ItEr29S06CUAsignacionGrupoRecursosAPlanificacionItEr28S06: [Refactoring] Embebed WorkerSearch form into ResourceAllocation form as accordeon panel

This commit is contained in:
Diego Pino Garcia 2009-10-06 20:14:55 +02:00 committed by Javier Moran Rua
parent c193fd4e46
commit 5ce6017dde
3 changed files with 94 additions and 72 deletions

View file

@ -187,7 +187,7 @@ public class WorkerSearchController extends GenericForwardComposer {
criterionsTree.setModel(getCriterions());
}
public void onAccept(Event event) {
public void onSelect(Event event) {
self.setVisible(false);
((WorkerSearch) self.getParent()).setWorkers(getSelectedWorkers());
clearAll();

View file

@ -85,74 +85,95 @@
apply="${allocationController}"
title="${i18n:_('Resource allocation')}" width="600px" visible="false">
<panel title="${i18n:_('Calculation type')}" >
<panelchildren>
<radiogroup id="calculationTypeSelector"
onCheck="allocationController.calculationTypeSelected = self.selectedItem.value;">
<grid>
<rows>
<row forEach="${allocationController.calculationTypes}">
<radio label="${each.name}" value="${each}"/>
</row>
</rows>
</grid>
</radiogroup>
</panelchildren>
</panel>
<panel title="${i18n:_('Duration')}" >
<panelchildren>
<hbox>
<label value="${i18n:_('Start')}:"
style="font-weight:bold" />
<datebox id="taskStartDateBox" />
<label value="${i18n:_('Elapsed Days')}:"
style="font-weight:bold" />
<intbox id="taskElapsedDays" />
</hbox>
</panelchildren>
</panel>
<panel title="${i18n:_('Allocation')}" border="normal" style="margin-bottom: 5px">
<panelchildren>
<hbox>
<label value="${i18n:_('Criterions')}:"
style="font-weight:bold" />
<label
value="@{allocationController.taskCriterions}" />
</hbox>
<hbox>
<label value="${i18n:_('Order Hours')}:"
style="font-weight:bold" />
<label value="@{allocationController.orderHours}" />
</hbox>
<hbox>
<label value="${i18n:_('Assigned Hours')}:"
style="font-weight:bold" />
<intbox id="assignedHoursComponent" />
</hbox>
</panelchildren>
</panel>
<tabbox mold="accordion">
<tabs>
<tab label="${i18n:_('Resource allocation')}" />
<tab label="${i18n:_('Worker search')}" />
</tabs>
<tabpanels>
<tabpanel>
<panel title="${i18n:_('Calculation type')}">
<panelchildren>
<radiogroup id="calculationTypeSelector"
onCheck="allocationController.calculationTypeSelected = self.selectedItem.value;">
<grid>
<rows>
<row
forEach="${allocationController.calculationTypes}">
<radio label="${each.name}"
value="${each}" />
</row>
</rows>
</grid>
</radiogroup>
</panelchildren>
</panel>
<panel title="${i18n:_('Duration')}">
<panelchildren>
<hbox>
<label value="${i18n:_('Start')}:"
style="font-weight:bold" />
<datebox id="taskStartDateBox" />
<label value="${i18n:_('Elapsed Days')}:"
style="font-weight:bold" />
<intbox id="taskElapsedDays" />
</hbox>
</panelchildren>
</panel>
<panel title="${i18n:_('Allocation')}" border="normal"
style="margin-bottom: 5px">
<panelchildren>
<hbox>
<label value="${i18n:_('Criterions')}:"
style="font-weight:bold" />
<label
value="@{allocationController.taskCriterions}" />
</hbox>
<hbox>
<label value="${i18n:_('Order Hours')}:"
style="font-weight:bold" />
<label
value="@{allocationController.orderHours}" />
</hbox>
<hbox>
<label value="${i18n:_('Assigned Hours')}:"
style="font-weight:bold" />
<intbox id="assignedHoursComponent" />
</hbox>
</panelchildren>
</panel>
<vbox id="messagesContainer"></vbox>
<vbox id="messagesContainer"></vbox>
<listbox id="allocationsList"
model="@{allocationController.resourceAllocations}"
itemRenderer="@{allocationController.resourceAllocationRenderer}"
style="margin-bottom: 5px">
<listhead>
<listheader label="${i18n:_('Name')}" />
<listheader label="${i18n:_('Resources Per Day')}" />
<listheader label="" />
</listhead>
</listbox>
<listbox id="allocationsList"
model="@{allocationController.resourceAllocations}"
itemRenderer="@{allocationController.resourceAllocationRenderer}"
style="margin-bottom: 5px">
<listhead>
<listheader label="${i18n:_('Name')}" />
<listheader
label="${i18n:_('Resources Per Day')}" />
<listheader label="" />
</listhead>
</listbox>
</tabpanel>
<workerSearch />
<tabpanel>
<workerSearch />
</tabpanel>
</tabpanels>
</tabbox>
<hbox>
<button label="${i18n:_('Accept')}" onClick="allocationController.accept()" />
<button label="${i18n:_('Apply')}" id="applyButton"/>
<button label="${i18n:_('Cancel')}" onClick="allocationController.cancel()" />
<button label="${i18n:_('Advance allocation')}" onClick="allocationController.advanceAllocation();"/>
</hbox>
<!-- Control buttons -->
<hbox>
<button label="${i18n:_('Accept')}"
onClick="allocationController.accept()" />
<button label="${i18n:_('Apply')}" id="applyButton" />
<button label="${i18n:_('Cancel')}"
onClick="allocationController.cancel()" />
<button label="${i18n:_('Advance allocation')}"
onClick="allocationController.advanceAllocation();" />
</hbox>
</window>
<window id="splittingWindow" visible="false" apply="${splittingTaskController}" minwidth="${400}" >

View file

@ -21,15 +21,16 @@
<vbox apply="org.navalplanner.web.resources.search.WorkerSearchController">
<hbox>
<vbox>
<vbox style="margin-right: 3px">
<!-- Name -->
<label value="${i18n:_('Name/ID')}" />
<label value="${i18n:_('Name/NIF')}" />
<textbox id="txtName"
onChanging="controller.searchWorkers(event)" />
<!--Matchings -->
<listbox id="listBoxWorkers" width="200px" mold="paging"
pageSize="10" rows="10" multiple="true"
<label value="${i18n:_('Found workers')}" />
<listbox id="listBoxWorkers" width="200px"
rows="10" vflex="true" multiple="true"
itemRenderer="@{controller.listitemRenderer}">
<listhead>
<listheader label="${i18n:_('Name')}" sort="auto" />
@ -42,8 +43,8 @@
<!-- Criterions -->
<label value="${i18n:_('Criterions')}" />
<tree id="criterionsTree" width="280px"
model="@{controller.criterions}"
multiple="true">
rows="10" vflex="true" multiple="true"
model="@{controller.criterions}">
<treecols>
<treecol label="Name" />
</treecols>
@ -52,7 +53,7 @@
</hbox>
<hbox>
<button label="${i18n:_('Accept')}"
<button label="${i18n:_('Select')}"
onClick="controller.onAccept(event)" />
</hbox>
</vbox>