Search in sources :

Example 16 with PropertyChangedEventArgs

use of org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs in project ovirt-engine by oVirt.

the class Model method setMessage.

public void setMessage(String value) {
    if (!Objects.equals(message, value)) {
        message = value;
        // $NON-NLS-1$
        onPropertyChanged(new PropertyChangedEventArgs("Message"));
    }
}
Also used : PropertyChangedEventArgs(org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs)

Example 17 with PropertyChangedEventArgs

use of org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs in project ovirt-engine by oVirt.

the class Model method setWidgetModel.

public void setWidgetModel(Model value) {
    if (widgetModel != value) {
        widgetModel = value;
        // $NON-NLS-1$
        onPropertyChanged(new PropertyChangedEventArgs("WidgetModel"));
    }
}
Also used : PropertyChangedEventArgs(org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs)

Example 18 with PropertyChangedEventArgs

use of org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs in project ovirt-engine by oVirt.

the class Model method setIsSelected.

public void setIsSelected(boolean value) {
    if (isSelected != value) {
        isSelected = value;
        // $NON-NLS-1$
        onPropertyChanged(new PropertyChangedEventArgs("IsSelected"));
    }
}
Also used : PropertyChangedEventArgs(org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs)

Example 19 with PropertyChangedEventArgs

use of org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs in project ovirt-engine by oVirt.

the class SearchableListModel method setItems.

@Override
public void setItems(Collection<T> value) {
    if (items != value) {
        T lastSelectedItem = getSelectedItem();
        List<T> lastSelectedItems = new ArrayList<>();
        if (getSelectedItems() != null) {
            for (T item : getSelectedItems()) {
                lastSelectedItems.add(item);
            }
        }
        if (comparator == null || ((value instanceof SortedSet) && Objects.equals(((SortedSet<?>) value).comparator(), comparator))) {
            itemsChanging(value, items);
            items = value;
        } else {
            Collection<T> sortedItems = sortItems(value);
            itemsChanging(sortedItems, items);
            items = sortedItems;
        }
        updatePagingAvailability();
        getItemsChangedEvent().raise(this, EventArgs.EMPTY);
        // $NON-NLS-1$
        onPropertyChanged(new PropertyChangedEventArgs("Items"));
        selectedItem = null;
        if (getSelectedItems() != null) {
            getSelectedItems().clear();
        }
        if (lastSelectedItem != null && items != null) {
            T newSelectedItem = null;
            List<T> newItems = new ArrayList<>();
            for (T item : items) {
                newItems.add(item);
            }
            if (newItems != null) {
                newSelectedItem = determineSelectedItems(newItems, lastSelectedItem, lastSelectedItems);
            }
            if (newSelectedItem != null) {
                selectedItem = newSelectedItem;
                if (selectedItems != null) {
                    selectedItems.add(newSelectedItem);
                }
            }
        }
        onSelectedItemChanged();
    }
}
Also used : PropertyChangedEventArgs(org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs) ArrayList(java.util.ArrayList) SortedSet(java.util.SortedSet)

Example 20 with PropertyChangedEventArgs

use of org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs in project ovirt-engine by oVirt.

the class PoolGeneralModel method setTemplate.

public void setTemplate(String value) {
    if (!Objects.equals(template, value)) {
        template = value;
        // $NON-NLS-1$
        onPropertyChanged(new PropertyChangedEventArgs("Template"));
    }
}
Also used : PropertyChangedEventArgs(org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs)

Aggregations

PropertyChangedEventArgs (org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs)374 ArrayList (java.util.ArrayList)3 DiskImage (org.ovirt.engine.core.common.businessentities.storage.DiskImage)3 Collections (java.util.Collections)2 Comparator (java.util.Comparator)2 HashMap (java.util.HashMap)2 List (java.util.List)2 Map (java.util.Map)2 StorageDomain (org.ovirt.engine.core.common.businessentities.StorageDomain)2 StatsInfo (org.ovirt.engine.core.common.businessentities.gluster.StatsInfo)2 IdQueryParameters (org.ovirt.engine.core.common.queries.IdQueryParameters)2 QueryType (org.ovirt.engine.core.common.queries.QueryType)2 Guid (org.ovirt.engine.core.compat.Guid)2 Frontend (org.ovirt.engine.ui.frontend.Frontend)2 UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)2 AsyncDataProvider (org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider)2 DiskModel (org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel)2 ConstantsManager (org.ovirt.engine.ui.uicompat.ConstantsManager)2 EventArgs (org.ovirt.engine.ui.uicompat.EventArgs)2 Collection (java.util.Collection)1