Search in sources :

Example 1 with NewHostModel

use of org.ovirt.engine.ui.uicommonweb.models.hosts.NewHostModel in project ovirt-engine by oVirt.

the class ClusterGuideModel method addHost.

public void addHost() {
    HostModel model = new NewHostModel();
    setWindow(model);
    model.setTitle(ConstantsManager.getInstance().getConstants().newHostTitle());
    model.setHelpTag(HelpTag.new_host);
    // $NON-NLS-1$
    model.setHashName("new_host");
    model.getPort().setEntity(54321);
    model.getOverrideIpTables().setEntity(true);
    model.setSpmPriorityValue(null);
    model.getCluster().setSelectedItem(getEntity());
    model.getCluster().setIsChangeable(false);
    AsyncDataProvider.getInstance().getDataCenterList(new AsyncQuery<>(dataCenters -> {
        HostModel model1 = (HostModel) getWindow();
        model1.getDataCenter().setItems(dataCenters);
        if (getEntity().getStoragePoolId() != null) {
            model1.getDataCenter().setSelectedItem(Linq.firstOrNull(dataCenters, new Linq.IdPredicate<>(getEntity().getStoragePoolId())));
        }
        model1.getDataCenter().setIsChangeable(false);
        // $NON-NLS-1$
        UICommand tempVar = UICommand.createDefaultOkUiCommand("OnConfirmPMHost", ClusterGuideModel.this);
        model1.getCommands().add(tempVar);
        // $NON-NLS-1$
        UICommand tempVar2 = UICommand.createCancelUiCommand("Cancel", ClusterGuideModel.this);
        model1.getCommands().add(tempVar2);
    }));
}
Also used : HostModel(org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel) NewHostModel(org.ovirt.engine.ui.uicommonweb.models.hosts.NewHostModel) StoragePool(org.ovirt.engine.core.common.businessentities.StoragePool) HostModel(org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel) HelpTag(org.ovirt.engine.ui.uicommonweb.help.HelpTag) ApplicationMode(org.ovirt.engine.core.common.mode.ApplicationMode) ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue) NewHostModel(org.ovirt.engine.ui.uicommonweb.models.hosts.NewHostModel) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) GuideModel(org.ovirt.engine.ui.uicommonweb.models.GuideModel) ArrayList(java.util.ArrayList) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) ActionType(org.ovirt.engine.core.common.action.ActionType) Frontend(org.ovirt.engine.ui.frontend.Frontend) ManagementNetworkOnClusterOperationParameters(org.ovirt.engine.core.common.action.ManagementNetworkOnClusterOperationParameters) ChangeVDSClusterParameters(org.ovirt.engine.core.common.action.ChangeVDSClusterParameters) ConstantsManager(org.ovirt.engine.ui.uicompat.ConstantsManager) AsyncDataProvider(org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider) VdsActionParameters(org.ovirt.engine.core.common.action.VdsActionParameters) MoveHostData(org.ovirt.engine.ui.uicommonweb.models.hosts.MoveHostData) Linq(org.ovirt.engine.ui.uicommonweb.Linq) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) ListModel(org.ovirt.engine.ui.uicommonweb.models.ListModel) ApproveVdsParameters(org.ovirt.engine.core.common.action.hostdeploy.ApproveVdsParameters) ApplicationModeHelper(org.ovirt.engine.ui.uicommonweb.models.ApplicationModeHelper) MoveHost(org.ovirt.engine.ui.uicommonweb.models.hosts.MoveHost) List(java.util.List) VDSStatus(org.ovirt.engine.core.common.businessentities.VDSStatus) Cluster(org.ovirt.engine.core.common.businessentities.Cluster) VDS(org.ovirt.engine.core.common.businessentities.VDS) Timer(com.google.gwt.user.client.Timer) AddVdsActionParameters(org.ovirt.engine.core.common.action.hostdeploy.AddVdsActionParameters) Linq(org.ovirt.engine.ui.uicommonweb.Linq) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) NewHostModel(org.ovirt.engine.ui.uicommonweb.models.hosts.NewHostModel)

Example 2 with NewHostModel

use of org.ovirt.engine.ui.uicommonweb.models.hosts.NewHostModel in project ovirt-engine by oVirt.

the class DataCenterGuideModel method addHost.

public void addHost() {
    final HostModel model = new NewHostModel();
    setWindow(model);
    model.setTitle(ConstantsManager.getInstance().getConstants().newHostTitle());
    model.setHelpTag(HelpTag.new_host_guide_me);
    // $NON-NLS-1$
    model.setHashName("new_host_guide_me");
    model.getPort().setEntity(54321);
    model.getOverrideIpTables().setEntity(true);
    model.setSpmPriorityValue(null);
    model.getDataCenter().setItems(Collections.singletonList(getEntity()), getEntity());
    model.getDataCenter().setIsChangeable(false);
    // $NON-NLS-1$
    UICommand tempVar = UICommand.createDefaultOkUiCommand("OnConfirmPMHost", this);
    tempVar.setTitle(ConstantsManager.getInstance().getConstants().ok());
    tempVar.setIsDefault(true);
    model.getCommands().add(tempVar);
    // $NON-NLS-1$
    UICommand tempVar2 = UICommand.createCancelUiCommand("Cancel", this);
    model.getCommands().add(tempVar2);
}
Also used : NewHostModel(org.ovirt.engine.ui.uicommonweb.models.hosts.NewHostModel) HostModel(org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) NewHostModel(org.ovirt.engine.ui.uicommonweb.models.hosts.NewHostModel)

Aggregations

UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)2 HostModel (org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel)2 NewHostModel (org.ovirt.engine.ui.uicommonweb.models.hosts.NewHostModel)2 Timer (com.google.gwt.user.client.Timer)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)1 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)1 ActionType (org.ovirt.engine.core.common.action.ActionType)1 ChangeVDSClusterParameters (org.ovirt.engine.core.common.action.ChangeVDSClusterParameters)1 ManagementNetworkOnClusterOperationParameters (org.ovirt.engine.core.common.action.ManagementNetworkOnClusterOperationParameters)1 VdsActionParameters (org.ovirt.engine.core.common.action.VdsActionParameters)1 AddVdsActionParameters (org.ovirt.engine.core.common.action.hostdeploy.AddVdsActionParameters)1 ApproveVdsParameters (org.ovirt.engine.core.common.action.hostdeploy.ApproveVdsParameters)1 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)1 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)1 VDS (org.ovirt.engine.core.common.businessentities.VDS)1 VDSStatus (org.ovirt.engine.core.common.businessentities.VDSStatus)1 ApplicationMode (org.ovirt.engine.core.common.mode.ApplicationMode)1 Frontend (org.ovirt.engine.ui.frontend.Frontend)1