ItEr30S15RFVisualizacionMultiplesProxectosItEr29S18: Adding up button from Order's tree

This commit is contained in:
Óscar González Fernández 2009-10-14 01:41:48 +02:00
parent 4563840602
commit 12742e2a39
3 changed files with 21 additions and 0 deletions

View file

@ -143,6 +143,14 @@ public class OrderCRUDController extends GenericForwardComposer {
goToList();
}
public void up() {
if (onUp == null) {
throw new IllegalStateException(
"in order to call up onUp action should have been set");
}
onUp.run();
}
public void confirmRemove(Order order) {
orderModel.prepareForRemove(order);
showConfirmingWindow();
@ -197,6 +205,8 @@ public class OrderCRUDController extends GenericForwardComposer {
private boolean confirmingRemove = false;
private Runnable onUp;
public boolean isConfirmingRemove() {
return confirmingRemove;
}
@ -269,4 +279,8 @@ public class OrderCRUDController extends GenericForwardComposer {
this.planningControllerEntryPoints = planningControllerEntryPoints;
}
public void setActionOnUp(Runnable onUp) {
this.onUp = onUp;
}
}

View file

@ -274,6 +274,12 @@ public class MultipleTabsPlannerController implements Composer {
getTabsRegistry().show(planningTab);
}
});
orderCRUDController.setActionOnUp(new Runnable() {
public void run() {
mode.up();
orderCRUDController.goToList();
}
});
return orderCRUDController;
}

View file

@ -20,6 +20,7 @@
<?component name="orderElementTree" inline="true" macroURI="_orderElementTree.zul"?>
<window id="${arg.top_id}" title="${arg.title}">
<button label="${i18n:_('Up')}" onClick="controller.up();" />
<tabbox>
<tabs>
<tab label="${i18n:_('General data')}"></tab>