ItEr24S08CUAsignacionGrupoRecursosAPlanificacionItEr23S10: [FixBug] Added Cancel operation

This commit is contained in:
Diego Pino Garcia 2009-09-07 01:06:18 +02:00 committed by Óscar González Fernández
parent e62f1f51bd
commit c4acadced6
5 changed files with 26 additions and 2 deletions

View file

@ -79,6 +79,10 @@ public class Task extends TaskElement {
resourceAllocations.remove(resourceAllocation);
}
public void clearResourceAllocations() {
resourceAllocations.clear();
}
public Boolean getFixedDuration() {
return fixedDuration;
}

View file

@ -137,4 +137,9 @@ public interface IResourceAllocationModel {
*/
void updateGenericPercentages(BigDecimal totalPercentage);
/**
* Cancel operation
*/
void cancel();
}

View file

@ -63,8 +63,8 @@ public class ResourceAllocationController extends GenericForwardComposer {
@Override
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
messagesForUser = new MessagesForUser(messagesContainer);
this.window = (Window) comp;
messagesForUser = new MessagesForUser(messagesContainer);
}
/**
@ -216,6 +216,16 @@ public class ResourceAllocationController extends GenericForwardComposer {
return resourceAllocationRenderer;
}
public void cancel() {
clear();
self.setVisible(false);
resourceAllocationModel.cancel();
}
private void clear() {
genericResourceAllocationPercentage.setValue(null);
}
/**
*
* Renders a {@link SpecificResourceAllocation} item

View file

@ -301,4 +301,9 @@ public class ResourceAllocationModel implements IResourceAllocationModel {
ganttTask.setEndDate(task.getEndDate());
}
@Override
public void cancel() {
task.clearResourceAllocations();
}
}

View file

@ -107,7 +107,7 @@
<hbox>
<button label="${i18n:_('Save')}" />
<button label="${i18n:_('Cancel')}" />
<button label="${i18n:_('Cancel')}" onClick="allocationController.cancel()" />
<button label="${i18n:_('Search resources...')}"
onClick="allocationController.showSearchResources()" />
<button label="${i18n:_('Advance allocation')}" />