Package com.dci.intellij.dbn.object.common.list.action

Source Code of com.dci.intellij.dbn.object.common.list.action.ReloadObjectsAction

package com.dci.intellij.dbn.object.common.list.action;

import com.dci.intellij.dbn.common.Icons;
import com.dci.intellij.dbn.common.thread.BackgroundTask;
import com.dci.intellij.dbn.object.common.list.DBObjectList;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.progress.ProgressIndicator;
import org.jetbrains.annotations.NotNull;

public class ReloadObjectsAction extends AnAction {

    private DBObjectList objectList;

    public ReloadObjectsAction(DBObjectList objectList) {
        super("Reload", null, Icons.ACTION_REFRESH);
        this.objectList = objectList;
    }

    public void actionPerformed(AnActionEvent anActionEvent) {
        new BackgroundTask(objectList.getProject(), "Reloading " + objectList.getContentDescription() + ".", false) {
            @Override
            public void execute(@NotNull final ProgressIndicator progressIndicator) throws InterruptedException {
                initProgressIndicator(progressIndicator, true);
                objectList.reload();
            }
        }.start();

    }
}
TOP

Related Classes of com.dci.intellij.dbn.object.common.list.action.ReloadObjectsAction

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.