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