Search in sources :

Example 1 with ReversibleFlow

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

the class HostListModel method onConfigureLocalStorage.

private void onConfigureLocalStorage() {
    ConfigureLocalStorageModel model = (ConfigureLocalStorageModel) getWindow();
    if (model.getProgress() != null) {
        return;
    }
    if (!model.validate()) {
        return;
    }
    model.startProgress(ConstantsManager.getInstance().getConstants().configuringLocalStorageHost());
    ReversibleFlow flow = new ReversibleFlow();
    flow.getCompleteEvent().addListener((ev, sender, args) -> {
        ConfigureLocalStorageModel model1 = (ConfigureLocalStorageModel) ev.getContext();
        model1.stopProgress();
        cancel();
    }, model);
    // $NON-NLS-1$
    String correlationId = TaskListModel.createCorrelationId("Configure Local Storage");
    flow.enlist(new AddDataCenterRM(correlationId));
    flow.enlist(new AddClusterRM(correlationId));
    flow.enlist(new ChangeHostClusterRM(correlationId));
    flow.enlist(new AddStorageDomainRM(correlationId));
    flow.run(new EnlistmentContext(this));
}
Also used : ReversibleFlow(org.ovirt.engine.ui.uicompat.ReversibleFlow)

Aggregations

ReversibleFlow (org.ovirt.engine.ui.uicompat.ReversibleFlow)1