2024-10-14 12:14:01 +03:00
|
|
|
package _VisualDVM.Passes.All;
|
2024-10-09 22:01:19 +03:00
|
|
|
import _VisualDVM.Current;
|
2024-10-13 22:08:13 +03:00
|
|
|
import _VisualDVM.Global;
|
2024-10-14 12:14:01 +03:00
|
|
|
import _VisualDVM.Passes.SSH.CurrentConnectionPass;
|
2023-09-17 22:13:42 +03:00
|
|
|
public class SelectRemoteFile extends CurrentConnectionPass {
|
|
|
|
|
boolean dialogOK;
|
|
|
|
|
boolean needs_directory = false;
|
|
|
|
|
@Override
|
|
|
|
|
protected boolean canStart(Object... args) {
|
2024-10-13 22:08:13 +03:00
|
|
|
if (Global.mainModule.Check(Log, Current.Machine, Current.User)) {
|
2023-09-17 22:13:42 +03:00
|
|
|
needs_directory = (boolean) args[0];
|
2024-10-13 22:08:13 +03:00
|
|
|
Global.mainModule.set(Current.RemoteFile, null);
|
2023-09-17 22:13:42 +03:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
protected void ServerAction() throws Exception {
|
2024-10-15 02:32:52 +03:00
|
|
|
dialogOK = (Global.mainModule.getUI().getRemoteFileChooser().ShowDialog("Выбор " + (needs_directory ? "папки" : "файла"), this, needs_directory));
|
2023-09-17 22:13:42 +03:00
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
protected boolean validate() {
|
|
|
|
|
return dialogOK;
|
|
|
|
|
}
|
|
|
|
|
}
|