package org.ovirt.engine.ui.uicommonweb.models.storage;

import org.ovirt.engine.ui.uicommonweb.models.EntityModel;
import org.ovirt.engine.ui.uicommonweb.models.ListModel;
import org.ovirt.engine.ui.uicommonweb.models.Model;

@SuppressWarnings("unused")
public class RemoveStorageModel extends Model
{

    private ListModel privateHostList;

    public ListModel getHostList()
    {
        return privateHostList;
    }

    private void setHostList(ListModel value)
    {
        privateHostList = value;
    }

    private EntityModel privateFormat;

    public EntityModel getFormat()
    {
        return privateFormat;
    }

    private void setFormat(EntityModel value)
    {
        privateFormat = value;
    }

    public RemoveStorageModel()
    {
        setHostList(new ListModel());

        setFormat(new EntityModel());
        getFormat().setEntity(false);
    }

    public boolean validate()
    {
        getHostList().setIsValid(getHostList().getSelectedItem() != null);

        return getHostList().getIsValid();
    }
}

@@ -218,16 +218,106 @@
 s.Model;
+%0Aimport org.ovirt.engine.ui.uicompat.Event;%0Aimport org.ovirt.engine.ui.uicompat.EventArgs;
 %0A%0A@Suppr
@@ -946,23 +946,571 @@
 t().
-setEntity(false
+getEntityChangedEvent().addListener(this);%0A        getFormat().getPropertyChangedEvent().addListener(this);%0A        getFormat().setEntity(false);%0A    %7D%0A%0A    @Override%0A    public void eventRaised(Event ev, Object sender, EventArgs args)%0A    %7B%0A        super.eventRaised(ev, sender, args);%0A%0A        if (sender == getFormat()) %7B%0A            format_Changed(sender, args);%0A        %7D%0A    %7D%0A%0A    private void format_Changed(Object sender, EventArgs args) %7B%0A        getHostList().setIsChangable(!getFormat().getIsAvailable() %7C%7C Boolean.TRUE.equals(getFormat().getEntity())
 );%0A 

remove storage - gray out hosts list