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:
parent
e82e761dbe
commit
47b88ae9c9
4 changed files with 12 additions and 1 deletions
|
|
@ -42,4 +42,6 @@ public interface IOrderTemplatesModel {
|
|||
void initEdit(OrderElementTemplate template);
|
||||
|
||||
EntitiesTree<OrderElementTemplate> getTemplatesTreeModel();
|
||||
|
||||
boolean isTemplateTreeDisabled();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -107,4 +107,9 @@ public class OrderTemplatesModel implements IOrderTemplatesModel {
|
|||
return treeModel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTemplateTreeDisabled() {
|
||||
return template != null && template.isLeaf();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue