Fix Filter layout height if used filter without parameters #PL-1809

This commit is contained in:
Yuriy Artamonov 2013-06-14 14:43:54 +00:00
parent 67f41f6678
commit 86b394066b
4 changed files with 29 additions and 13 deletions

View File

@ -229,7 +229,8 @@ public class WebFilter extends WebAbstractComponent<CubaVerticalActionsLayout> i
component.addComponent(topLayout);
createParamsLayout(false);
component.addComponent(paramsLayout);
if (paramsLayout.getComponentCount() > 0)
component.addComponent(paramsLayout);
updateControls();
}
@ -1131,7 +1132,8 @@ public class WebFilter extends WebAbstractComponent<CubaVerticalActionsLayout> i
updateControls();
component.removeComponent(editLayout);
createParamsLayout(true);
component.addComponent(paramsLayout);
if (paramsLayout.getComponentCount() > 0)
component.addComponent(paramsLayout);
}
private void switchToEdit() {
@ -1152,8 +1154,6 @@ public class WebFilter extends WebAbstractComponent<CubaVerticalActionsLayout> i
select.setEnabled(!editing);
applyBtn.setVisible(!editing);
actionsButton.setVisible(editable && isEditFiltersPermitted());
paramsLayout.setVisible(paramsLayout.getComponentCount() > 0);
}
private boolean checkGlobalAppFolderPermission() {
@ -1598,7 +1598,9 @@ public class WebFilter extends WebAbstractComponent<CubaVerticalActionsLayout> i
updateControls();
component.removeComponent(paramsLayout);
createParamsLayout(true);
component.addComponent(paramsLayout);
if (paramsLayout.getComponentCount() > 0)
component.addComponent(paramsLayout);
if (!applyingDefault) {
Window window = ComponentsHelper.getWindow(WebFilter.this);

View File

@ -79,8 +79,7 @@ public class WebTreeTable
@Override
public void expandAll() {
for (Object id : component.getItemIds())
component.setCollapsed(id, false);
component.expandAll();
}
@Override
@ -95,8 +94,7 @@ public class WebTreeTable
@Override
public void collapseAll() {
for (Object id : component.getItemIds())
component.setCollapsed(id, true);
component.collapseAll();
}
@Override

View File

@ -331,8 +331,7 @@ public class FilterEditor extends AbstractFilterEditor {
table.setColumnWidth(ConditionsContainer.CONTROL_PROP_ID, 30);
table.setColumnHeader(ConditionsContainer.CONTROL_PROP_ID, cntrCol);
// vaadin7
// table.expandAll();
table.expandAll();
final Action showNameAction = new Action(AppBeans.get(Messages.class)
.getMessage(MESSAGES_PACK, "FilterEditor.showNameAction"));
@ -372,8 +371,7 @@ public class FilterEditor extends AbstractFilterEditor {
}
}
container.addItem(node);
// vaadin7
// table.setExpanded(node);
table.setExpanded(node);
if (node.getData().isGroup()) {
// Select the added node if it is a group

View File

@ -34,4 +34,22 @@ public class CubaTreeTable extends com.vaadin.ui.TreeTable {
super.setContainerDataSource(new TreeTableContainerWrapper(newDataSource));
}
public void expandAll() {
for (Object id : getItemIds())
setCollapsed(id, false);
}
public void collapseAll() {
for (Object id : getItemIds())
setCollapsed(id, true);
}
public void setExpanded(Object itemId) {
setCollapsed(itemId, false);
}
public boolean isExpanded(Object itemId) {
return !isCollapsed(itemId);
}
}