package _VisualDVM.Passes.All;
import Common.MainModule_;
import Common.Passes.Pass;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Makefile.Makefile;
import _VisualDVM.GlobalData.Makefile.UI.MakefilePreviewForm;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.ProjectData.LanguageName;
import _VisualDVM.ProjectData.Project.db_project_info;
public class ShowMakefilePreview extends Pass<db_project_info> {
    @Override
    public String getIconPath() {
        return "/icons/ShowPassword.png";
    }
    @Override
    public String getButtonText() {
        return "";
    }
    @Override
    protected boolean canStart(Object... args) {
        if (Global.mainModule.Check(Log, Current.Project) && MainModule_.instance.getDb().getTable(Makefile.class).getUI().CheckCurrent(Log)) {
            target = Global.mainModule.getProject();
            return !target.languageName.equals(LanguageName.fortran) || Global.mainModule.getPass(PassCode.SPF_ParseFilesWithOrder).Do();
        }
        return false;
    }
    @Override
    protected void body() throws Exception {
        new MakefilePreviewForm().ShowDialog("Предпросмотр мейкфайла для текущего проекта",
                MainModule_.instance.getDb().getTable(Makefile.class).getUI().getCurrent().Generate(target));
    }
}
