/*
 * Copyright (c) 2009 Haulmont Technology Ltd. All Rights Reserved.
 * Haulmont Technology proprietary and confidential.
 * Use is subject to license terms.

 * Author: Konstantin Krivopustov
 * Created: 16.10.2009 14:36:33
 *
 * $Id$
 */
package com.haulmont.cuba.web.gui.components.filter;

import com.haulmont.cuba.web.gui.components.WebLookupField;
import com.vaadin.terminal.Sizeable;
import com.vaadin.ui.*;

public class ParamEditor extends CustomComponent implements Condition.Listener {

    private Condition condition;
    private CssLayout layout;
    private Component field;

    public ParamEditor(final Condition condition, boolean showOperation) {
        this.condition = condition;

        layout = new CssLayout();
        layout.setSizeFull();
        setCompositionRoot(layout);

        if (condition.getParam() != null) {
            if (showOperation) {
                Label opLab = new Label(condition.getOperationCaption());
                layout.addComponent(opLab);
            }
            field = condition.getParam().createEditComponent();
            field.setWidth("100%");
            layout.addComponent(field);
        }

        condition.addListener(this);
    }

    public void paramChanged() {
        if (field != null) {
            layout.removeComponent(field);
        }
        field = condition.getParam().createEditComponent();
        field.setWidth("100%");
        layout.addComponent(field);
    }

    public void captionChanged() {
    }
}

@@ -362,16 +362,74 @@
 Field;%0D%0A
+import com.vaadin.incubator.dashlayout.ui.HorDashLayout;%0D%0A
 import c
@@ -458,16 +458,16 @@
 eable;%0D%0A
-
 import c
@@ -615,19 +615,23 @@
 private 
-Css
+HorDash
 Layout l
@@ -810,18 +810,56 @@
 new 
-CssLayout(
+HorDashLayout();%0D%0A        layout.setSpacing(true
 );%0D%0A

fix checkbox bug in filter