Search in sources :

Example 6 with IEventListener

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

the class HostNetworkProviderWidget method edit.

@Override
public void edit(HostNetworkProviderModel model) {
    driver.edit(model);
    final NeutronAgentModel neutronAgentModel = model.getNeutronAgentModel();
    neutronAgentWidget.edit(neutronAgentModel);
    neutronAgentWidget.setVisible(neutronAgentModel.isPluginConfigurationAvailable().getEntity());
    IEventListener<EventArgs> providerPluginTypeListener = (ev, sender, args) -> neutronAgentWidget.setVisible(model.getNetworkProviderType().getSelectedItem() == OPENSTACK_NETWORK && model.providerPluginTypeIsOpenstack());
    model.getNetworkProviderType().getSelectedItemChangedEvent().addListener(providerPluginTypeListener);
    model.getProviderPluginType().getSelectedItemChangedEvent().addListener(providerPluginTypeListener);
}
Also used : NeutronAgentModel(org.ovirt.engine.ui.uicommonweb.models.providers.NeutronAgentModel) EnumRenderer(org.ovirt.engine.ui.common.widget.renderer.EnumRenderer) AssetProvider(org.ovirt.engine.ui.webadmin.gin.AssetProvider) HostNetworkProviderModel(org.ovirt.engine.ui.uicommonweb.models.providers.HostNetworkProviderModel) Inject(com.google.inject.Inject) IEventListener(org.ovirt.engine.ui.uicompat.IEventListener) Provider(org.ovirt.engine.core.common.businessentities.Provider) Align(org.ovirt.engine.ui.common.widget.Align) GWT(com.google.gwt.core.client.GWT) ListModelListBoxEditor(org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor) EnableableFormLabel(org.ovirt.engine.ui.common.widget.label.EnableableFormLabel) UiBinder(com.google.gwt.uibinder.client.UiBinder) ApplicationConstants(org.ovirt.engine.ui.webadmin.ApplicationConstants) ListModelListBoxOnlyEditor(org.ovirt.engine.ui.common.widget.editor.ListModelListBoxOnlyEditor) EventArgs(org.ovirt.engine.ui.uicompat.EventArgs) EntityModelCheckBoxEditor(org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor) OpenstackNetworkProviderProperties(org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties) NeutronAgentModel(org.ovirt.engine.ui.uicommonweb.models.providers.NeutronAgentModel) ElementIdHandler(org.ovirt.engine.ui.common.idhandler.ElementIdHandler) AbstractModelBoundPopupWidget(org.ovirt.engine.ui.common.widget.uicommon.popup.AbstractModelBoundPopupWidget) UiCommonEditorDriver(org.ovirt.engine.ui.common.editor.UiCommonEditorDriver) PatternFlyCompatible(org.ovirt.engine.ui.common.widget.PatternFlyCompatible) NameRenderer(org.ovirt.engine.ui.common.widget.renderer.NameRenderer) WithElementId(org.ovirt.engine.ui.common.idhandler.WithElementId) ListModelSuggestBoxEditor(org.ovirt.engine.ui.common.widget.editor.generic.ListModelSuggestBoxEditor) ApplicationTemplates(org.ovirt.engine.ui.webadmin.ApplicationTemplates) Widget(com.google.gwt.user.client.ui.Widget) OPENSTACK_NETWORK(org.ovirt.engine.core.common.businessentities.ProviderType.OPENSTACK_NETWORK) EntityModelWidgetWithInfo(org.ovirt.engine.ui.common.widget.EntityModelWidgetWithInfo) UiField(com.google.gwt.uibinder.client.UiField) ProviderType(org.ovirt.engine.core.common.businessentities.ProviderType) EventArgs(org.ovirt.engine.ui.uicompat.EventArgs)

Example 7 with IEventListener

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

the class RegisterVmModel method postClustersInit.

private void postClustersInit() {
    validateAllMacs();
    for (final RegisterVmData registerVmData : getEntities().getItems()) {
        final IEventListener<EventArgs> validateMacsListener = (ev, sender, args) -> validateVmMacs(Collections.singletonList(registerVmData));
        registerVmData.getReassignMacs().getEntityChangedEvent().addListener(validateMacsListener);
        registerVmData.getCluster().getSelectedItemChangedEvent().addListener(validateMacsListener);
    }
}
Also used : ImportVmFromConfParameters(org.ovirt.engine.core.common.action.ImportVmFromConfParameters) VmNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface) Predicate(java.util.function.Predicate) Guid(org.ovirt.engine.core.compat.Guid) Collection(java.util.Collection) IEventListener(org.ovirt.engine.ui.uicompat.IEventListener) HashMap(java.util.HashMap) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase) Quota(org.ovirt.engine.core.common.businessentities.Quota) ArrayList(java.util.ArrayList) ActionType(org.ovirt.engine.core.common.action.ActionType) Frontend(org.ovirt.engine.ui.frontend.Frontend) List(java.util.List) VM(org.ovirt.engine.core.common.businessentities.VM) Cluster(org.ovirt.engine.core.common.businessentities.Cluster) Map(java.util.Map) ErrorTranslator(org.ovirt.engine.ui.frontend.ErrorTranslator) Linq.where(org.ovirt.engine.ui.uicommonweb.Linq.where) EventArgs(org.ovirt.engine.ui.uicompat.EventArgs) Collections(java.util.Collections) AsyncDataProvider(org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider) RegisterVmData(org.ovirt.engine.ui.uicommonweb.models.vms.register.RegisterVmData) RegisterVmData(org.ovirt.engine.ui.uicommonweb.models.vms.register.RegisterVmData) EventArgs(org.ovirt.engine.ui.uicompat.EventArgs)

Aggregations

EventArgs (org.ovirt.engine.ui.uicompat.EventArgs)7 IEventListener (org.ovirt.engine.ui.uicompat.IEventListener)7 Inject (com.google.inject.Inject)5 Collection (java.util.Collection)4 List (java.util.List)4 Provider (org.ovirt.engine.core.common.businessentities.Provider)4 Event (org.ovirt.engine.ui.uicompat.Event)4 ArrayList (java.util.ArrayList)3 Arrays (java.util.Arrays)3 Collections (java.util.Collections)3 ActionType (org.ovirt.engine.core.common.action.ActionType)3 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)3 OpenstackNetworkProviderProperties (org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties)3 Guid (org.ovirt.engine.core.compat.Guid)3 UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)3 EntityModel (org.ovirt.engine.ui.uicommonweb.models.EntityModel)3 ConstantsManager (org.ovirt.engine.ui.uicompat.ConstantsManager)3 ApplicationConstants (org.ovirt.engine.ui.webadmin.ApplicationConstants)3 AssetProvider (org.ovirt.engine.ui.webadmin.gin.AssetProvider)3 GWT (com.google.gwt.core.client.GWT)2