package _VisualDVM.Passes.Sapfor;
import _VisualDVM.ComponentsServer.Component.Sapfor.Sapfor;
import _VisualDVM.Global;
import _VisualDVM.Passes.Project.CurrentProjectPass;
public class SilentSapforPass extends CurrentProjectPass {
    protected Sapfor sapfor;
    @Override
    protected boolean needsAnimation() {
        return true;
    }
    @Override
    public boolean needsConfirmations() {
        return true;
    }
    protected String getSapforPassName() {
        return getName();
    }
    @Override
    protected boolean canStart(Object... args) throws Exception {
        return super.canStart(args) && ((sapfor = Global.mainModule.getSapfor()) != null);
    }
    @Override
    protected void performPreparation() throws Exception {
        target.CleanInterruptFile();
    }
    @Override
    protected boolean validate() {
        switch (sapfor.getErrorCode()) {
            case Sapfor.empty_code:
            case Sapfor.canceled_code:
                return false;
            default:
                return isGoodCode();
        }
    }
    @Override
    protected void performFail() throws Exception {
        Log.Writeln_("Код возврата " + sapfor.getErrorCode());
        sapfor.ResetAllAnalyses();
    }
    protected boolean isGoodCode() {
        return true;
    }
}
