Package com.dci.intellij.dbn.common.load

Source Code of com.dci.intellij.dbn.common.load.ProgressMonitor

package com.dci.intellij.dbn.common.load;

import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.progress.ProgressManager;

public class ProgressMonitor {
    public static String getTaskDescription() {
        ProgressIndicator progressIndicator = ProgressManager.getInstance().getProgressIndicator();
        if (progressIndicator != null) {
            return progressIndicator.getText();
        }
        return null;
    }

    public static void setTaskDescription(String description) {
        ProgressIndicator progressIndicator = ProgressManager.getInstance().getProgressIndicator();
        if (progressIndicator != null) {
            progressIndicator.setText(description);
        }
    }

    public static void setSubtaskDescription(String subtaskDescription) {
        ProgressIndicator progressIndicator = ProgressManager.getInstance().getProgressIndicator();
        if (progressIndicator != null) {
            progressIndicator.setText2(subtaskDescription);
        }
    }

    public static boolean isCancelled() {
        ProgressIndicator progressIndicator = ProgressManager.getInstance().getProgressIndicator();
        return progressIndicator != null && progressIndicator.isCanceled();
    }



}
TOP

Related Classes of com.dci.intellij.dbn.common.load.ProgressMonitor

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.