Search in sources :

Example 16 with UIConstants

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

the class VolumeListModel method newVolume.

private void newVolume() {
    if (getWindow() != null) {
        return;
    }
    VolumeModel volumeModel = new VolumeModel();
    volumeModel.setHelpTag(HelpTag.new_volume);
    // $NON-NLS-1$
    volumeModel.setHashName("new_volume");
    volumeModel.setTitle(ConstantsManager.getInstance().getConstants().newVolumeTitle());
    setWindow(volumeModel);
    AsyncDataProvider.getInstance().getDataCenterByClusterServiceList(new AsyncQuery<>(dataCenters -> {
        VolumeModel innerVolumeModel = (VolumeModel) getWindow();
        final UIConstants constants = ConstantsManager.getInstance().getConstants();
        innerVolumeModel.getDataCenter().setItems(dataCenters);
        innerVolumeModel.getDataCenter().setSelectedItem(Linq.firstOrNull(dataCenters));
        // $NON-NLS-1$
        UICommand command = UICommand.createDefaultOkUiCommand("onCreateVolume", VolumeListModel.this);
        innerVolumeModel.getCommands().add(command);
        // $NON-NLS-1$
        innerVolumeModel.getCommands().add(UICommand.createCancelUiCommand("Cancel", VolumeListModel.this));
    }), false, true);
}
Also used : SearchType(org.ovirt.engine.core.common.interfaces.SearchType) Arrays(java.util.Arrays) SearchObjects(org.ovirt.engine.core.searchbackend.SearchObjects) Inject(com.google.inject.Inject) ApplicationMode(org.ovirt.engine.core.common.mode.ApplicationMode) ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) ActionType(org.ovirt.engine.core.common.action.ActionType) GlusterVolumeActionParameters(org.ovirt.engine.core.common.action.gluster.GlusterVolumeActionParameters) GlusterBrickEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity) GetConfigurationValueParameters(org.ovirt.engine.core.common.queries.GetConfigurationValueParameters) GlusterVolumeSnapshotConfig(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig) ConstantsManager(org.ovirt.engine.ui.uicompat.ConstantsManager) GlusterVolumeParameters(org.ovirt.engine.core.common.action.gluster.GlusterVolumeParameters) TransportType(org.ovirt.engine.core.common.businessentities.gluster.TransportType) HasEntity(org.ovirt.engine.ui.uicommonweb.models.HasEntity) VolumeBrickListModel(org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeBrickListModel) VolumeRebalanceStatusModel(org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeRebalanceStatusModel) AsyncDataProvider(org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider) GlusterVolumeUtils(org.ovirt.engine.ui.frontend.utils.GlusterVolumeUtils) JobExecutionStatus(org.ovirt.engine.core.common.job.JobExecutionStatus) SearchParameters(org.ovirt.engine.core.common.queries.SearchParameters) VolumeSnapshotOptionModel(org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeSnapshotOptionModel) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) GlusterClusterSnapshotConfigModel(org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterClusterSnapshotConfigModel) GlusterVolumeEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity) GlusterStatus(org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus) List(java.util.List) GlusterAsyncTask(org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask) VolumeGeneralModel(org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeGeneralModel) VolumeGeoRepListModel(org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeGeoRepListModel) GlusterTaskType(org.ovirt.engine.core.common.asynctasks.gluster.GlusterTaskType) QueryType(org.ovirt.engine.core.common.queries.QueryType) PermissionListModel(org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel) GlusterVolumeTaskStatusEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity) Guid(org.ovirt.engine.core.compat.Guid) HelpTag(org.ovirt.engine.ui.uicommonweb.help.HelpTag) GlusterVolumeType(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType) GlusterVolumeSnapshotListModel(org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterVolumeSnapshotListModel) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) ArrayList(java.util.ArrayList) Frontend(org.ovirt.engine.ui.frontend.Frontend) GlusterVolumeSnapshotConfigModel(org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterVolumeSnapshotConfigModel) GlusterVolumeOptionEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity) CreateGlusterVolumeParameters(org.ovirt.engine.core.common.action.gluster.CreateGlusterVolumeParameters) Linq(org.ovirt.engine.ui.uicommonweb.Linq) SearchStringMapping(org.ovirt.engine.ui.uicommonweb.models.SearchStringMapping) ConfigValues(org.ovirt.engine.core.common.config.ConfigValues) VolumeEventListModel(org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeEventListModel) VolumeParameterListModel(org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeParameterListModel) VolumeProfileStatisticsModel(org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeProfileStatisticsModel) VolumeModel(org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeModel) ListWithSimpleDetailsModel(org.ovirt.engine.ui.uicommonweb.models.ListWithSimpleDetailsModel) UIConstants(org.ovirt.engine.ui.uicompat.UIConstants) GlusterVolumeOptionParameters(org.ovirt.engine.core.common.action.gluster.GlusterVolumeOptionParameters) GlusterVolumeRebalanceParameters(org.ovirt.engine.core.common.action.gluster.GlusterVolumeRebalanceParameters) WebAdminApplicationPlaces(org.ovirt.engine.ui.uicommonweb.place.WebAdminApplicationPlaces) UpdateGlusterVolumeSnapshotConfigParameters(org.ovirt.engine.core.common.action.gluster.UpdateGlusterVolumeSnapshotConfigParameters) VolumeStatus(org.ovirt.engine.ui.frontend.utils.GlusterVolumeUtils.VolumeStatus) VolumeModel(org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeModel) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) UIConstants(org.ovirt.engine.ui.uicompat.UIConstants)

Example 17 with UIConstants

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

the class VolumeListModel method optimizeForVirtStore.

private void optimizeForVirtStore() {
    UIConstants constants = ConstantsManager.getInstance().getConstants();
    if (getSelectedItems() == null || getSelectedItems().size() == 0) {
        return;
    }
    ArrayList<GlusterVolumeEntity> volumesForOptimiseForVirtStore = new ArrayList<>();
    Boolean isDiscouragedVolumePresent = false;
    StringBuilder discouragedConfigVolumeNamesBuilder = new StringBuilder();
    discouragedConfigVolumeNamesBuilder.append(constants.optimiseForVirtStoreWarning());
    for (Object item : getSelectedItems()) {
        GlusterVolumeEntity volume = (GlusterVolumeEntity) item;
        volumesForOptimiseForVirtStore.add(volume);
        if (volume.getReplicaCount() != 3) {
            // $NON-NLS-1$
            discouragedConfigVolumeNamesBuilder.append(volume.getName() + "\n");
            isDiscouragedVolumePresent = true;
        }
    }
    discouragedConfigVolumeNamesBuilder.append(constants.optimiseForVirtStoreContinueMessage());
    if (isDiscouragedVolumePresent) {
        ConfirmationModel cModel = new ConfirmationModel();
        cModel.setMessage(discouragedConfigVolumeNamesBuilder.toString());
        cModel.setTitle(ConstantsManager.getInstance().getConstants().optimiseForVirtStoreTitle());
        // $NON-NLS-1$
        UICommand cancelOptimiseVirtStoreCommand = new UICommand("CancelOptimizeForVirtStore", this);
        cancelOptimiseVirtStoreCommand.setTitle(constants.doNotOptimiseForVirtStore());
        cancelOptimiseVirtStoreCommand.setIsCancel(true);
        cModel.getCommands().add(cancelOptimiseVirtStoreCommand);
        // $NON-NLS-1$
        UICommand confirmOptimiseForVirtStoreCommand = new UICommand("ConfirmOptimiseForVirtStore", this);
        confirmOptimiseForVirtStoreCommand.setTitle(constants.continueOptimiseForVirtStore());
        confirmOptimiseForVirtStoreCommand.setIsDefault(true);
        cModel.getCommands().add(confirmOptimiseForVirtStoreCommand);
        setConfirmWindow(cModel);
    } else {
        optimizeVolumesForVirtStore(volumesForOptimiseForVirtStore);
    }
}
Also used : GlusterVolumeEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity) ArrayList(java.util.ArrayList) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) UIConstants(org.ovirt.engine.ui.uicompat.UIConstants)

Example 18 with UIConstants

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

the class LatestVmTemplate method setNaming.

private void setNaming() {
    final UIConstants constants = ConstantsManager.getInstance().getConstants();
    this.setTemplateVersionName(constants.latestTemplateVersionName());
    this.setDescription(constants.latestTemplateVersionDescription());
}
Also used : UIConstants(org.ovirt.engine.ui.uicompat.UIConstants)

Example 19 with UIConstants

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

the class VolumeGeoRepListModel method populateStatus.

private void populateStatus(final List<GlusterGeoRepSessionDetails> details) {
    final VolumeGeoRepSessionDetailsModel windowModel = new VolumeGeoRepSessionDetailsModel();
    windowModel.setHelpTag(HelpTag.geo_replication_status_detail);
    // $NON-NLS-1$
    windowModel.setHashName("geo_replication_status_detail");
    final UIConstants constants = ConstantsManager.getInstance().getConstants();
    windowModel.setTitle(constants.geoReplicationSessionDetailsTitle());
    // $NON-NLS-1$
    UICommand okCommand = new UICommand("closeWindow", this);
    okCommand.setIsCancel(true);
    okCommand.setTitle(constants.ok());
    windowModel.getCommands().add(okCommand);
    setWindow(windowModel);
    final List<EntityModel<GlusterGeoRepSessionDetails>> detailRows = new ArrayList<>();
    for (GlusterGeoRepSessionDetails detail : details) {
        detailRows.add(new EntityModel<>(detail));
    }
    windowModel.getGeoRepSessionSummary().setItems(detailRows, detailRows.get(0));
}
Also used : EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) ArrayList(java.util.ArrayList) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) GlusterGeoRepSessionDetails(org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionDetails) UIConstants(org.ovirt.engine.ui.uicompat.UIConstants)

Example 20 with UIConstants

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

the class VolumeGeoRepListModel method createGeoRepSession.

private void createGeoRepSession() {
    if (getWindow() != null || getEntity() == null) {
        return;
    }
    final UIConstants constants = ConstantsManager.getInstance().getConstants();
    GlusterVolumeEntity selectedMasterVolume = getEntity();
    final GlusterVolumeGeoRepCreateModel geoRepCreateModel = new GlusterVolumeGeoRepCreateModel(selectedMasterVolume);
    setWindow(geoRepCreateModel);
    geoRepCreateModel.getSlaveUserName().setEntity(constants.rootUser());
    geoRepCreateModel.getShowEligibleVolumes().setEntity(true);
    // $NON-NLS-1$
    UICommand ok = new UICommand("onCreateSession", this);
    ok.setTitle(constants.ok());
    ok.setIsDefault(true);
    geoRepCreateModel.getCommands().add(ok);
    // $NON-NLS-1$
    UICommand close = new UICommand("closeWindow", this);
    close.setTitle(constants.cancel());
    close.setIsCancel(true);
    geoRepCreateModel.getCommands().add(close);
}
Also used : GlusterVolumeEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) UIConstants(org.ovirt.engine.ui.uicompat.UIConstants)

Aggregations

UIConstants (org.ovirt.engine.ui.uicompat.UIConstants)21 UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)11 ArrayList (java.util.ArrayList)10 ConfirmationModel (org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)7 List (java.util.List)6 GlusterVolumeEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity)6 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)4 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)4 ActionType (org.ovirt.engine.core.common.action.ActionType)4 GlusterVolumeParameters (org.ovirt.engine.core.common.action.gluster.GlusterVolumeParameters)4 GlusterStatus (org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus)4 SearchParameters (org.ovirt.engine.core.common.queries.SearchParameters)4 Guid (org.ovirt.engine.core.compat.Guid)4 Frontend (org.ovirt.engine.ui.frontend.Frontend)4 Inject (com.google.inject.Inject)3 Arrays (java.util.Arrays)3 CreateGlusterVolumeParameters (org.ovirt.engine.core.common.action.gluster.CreateGlusterVolumeParameters)3 GlusterVolumeActionParameters (org.ovirt.engine.core.common.action.gluster.GlusterVolumeActionParameters)3 GlusterVolumeOptionParameters (org.ovirt.engine.core.common.action.gluster.GlusterVolumeOptionParameters)3 GlusterVolumeRebalanceParameters (org.ovirt.engine.core.common.action.gluster.GlusterVolumeRebalanceParameters)3