package _VisualDVM.Passes.All;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Machine.Machine;
import _VisualDVM.GlobalData.User.User;
import _VisualDVM.Passes.SSH.CurrentConnectionPass;
public class SelectRemoteFile extends CurrentConnectionPass {
    boolean dialogOK;
    boolean needs_directory = false;
    @Override
    protected boolean canStart(Object... args) {
        if (Global.mainModule.getDb().CheckCurrent(Log, Machine.class, User.class)) {
            needs_directory = (boolean) args[0];
            Global.mainModule.set(Current.RemoteFile, null);
            return true;
        }
        return false;
    }
    protected void ServerAction() throws Exception {
        dialogOK = (Global.mainModule.getUI().getRemoteFileChooser().ShowDialog("Выбор " + (needs_directory ? "папки" : "файла"), this, needs_directory));
    }
    @Override
    protected boolean validate() {
        return dialogOK;
    }
}
