ItEr42S17CUGravacionModelosUnidadesTraballoItEr41S20: Disabling the templates tree when the template is a line.

When a child wants to be added, the OrderLineTemplate itself cannot be
turned into a container if it's the root.
This commit is contained in:
Óscar González Fernández 2010-01-10 17:45:21 +01:00
parent e82e761dbe
commit 47b88ae9c9
4 changed files with 12 additions and 1 deletions

View file

@ -42,4 +42,6 @@ public interface IOrderTemplatesModel {
void initEdit(OrderElementTemplate template);
EntitiesTree<OrderElementTemplate> getTemplatesTreeModel();
boolean isTemplateTreeDisabled();
}

View file

@ -97,6 +97,10 @@ public class OrderTemplatesController extends GenericForwardComposer implements
materialsComponent.getController().openWindow(model.getTemplate());
}
public boolean isTemplateTreeDisabled() {
return model.isTemplateTreeDisabled();
}
private void show(Component window) {
Util.reloadBindings(window);
getVisibility().showOnly(window);

View file

@ -107,4 +107,9 @@ public class OrderTemplatesModel implements IOrderTemplatesModel {
return treeModel;
}
@Override
public boolean isTemplateTreeDisabled() {
return template != null && template.isLeaf();
}
}

View file

@ -25,7 +25,7 @@
<tabbox>
<tabs>
<tab id="tabGeneralData" label="${i18n:_('General data')}" />
<tab label="${i18n:_('Template Tree')}" />
<tab label="${i18n:_('Template Tree')}" disabled="@{templateController.templateTreeDisabled}"/>
<tab label="${i18n:_('Materials')}" />
</tabs>
<tabpanels>