2023-11-19 02:12:44 +03:00
|
|
|
|
package Visual_DVM_2021.Passes.All;
|
2024-10-09 23:37:58 +03:00
|
|
|
|
import Common.Current_;
|
2024-10-11 00:00:30 +03:00
|
|
|
|
import Common.Utils.Utils_;
|
2024-10-09 22:01:19 +03:00
|
|
|
|
import _VisualDVM.Current;
|
|
|
|
|
|
import _VisualDVM.Visual.UI;
|
2024-10-08 22:33:49 +03:00
|
|
|
|
import Common.Visual.Windows.Dialog.Text.ComboTextDialog;
|
2024-10-09 22:21:57 +03:00
|
|
|
|
import _VisualDVM.ProjectData.SapforData.Functions.FuncInfo;
|
2024-10-09 23:37:58 +03:00
|
|
|
|
import Visual_DVM_2021.Passes.PassCode;
|
2024-10-10 23:57:36 +03:00
|
|
|
|
import Common.Passes.Pass;
|
2023-09-17 22:13:42 +03:00
|
|
|
|
|
|
|
|
|
|
import java.util.Comparator;
|
|
|
|
|
|
import java.util.Vector;
|
2024-10-09 23:37:58 +03:00
|
|
|
|
public class ApplyCurrentFunction extends Pass {
|
2023-09-17 22:13:42 +03:00
|
|
|
|
@Override
|
|
|
|
|
|
public String getIconPath() {
|
|
|
|
|
|
return "/icons/Apply.png";
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public String getButtonText() {
|
|
|
|
|
|
return "";
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
protected boolean canStart(Object... args) throws Exception {
|
2024-10-09 23:37:58 +03:00
|
|
|
|
if (passes.get(PassCode.SPF_GetGraphFunctions).isDone()) {
|
2023-09-17 22:13:42 +03:00
|
|
|
|
ComboTextDialog ff = new ComboTextDialog();
|
|
|
|
|
|
Vector<String> names = new Vector<>(Current.getProject().allFunctions.keySet());
|
|
|
|
|
|
names.sort(Comparator.naturalOrder());
|
|
|
|
|
|
if (ff.ShowDialog("Выберите имя текущей процедуры", names)) {
|
|
|
|
|
|
String func_name = ff.Result;
|
|
|
|
|
|
if (Current.getProject().allFunctions.containsKey(func_name)) {
|
|
|
|
|
|
FuncInfo fi = Current.getProject().allFunctions.get(func_name);
|
2024-10-09 23:37:58 +03:00
|
|
|
|
Current_.set(Current.Function, fi);
|
2023-09-17 22:13:42 +03:00
|
|
|
|
return true;
|
|
|
|
|
|
} else {
|
2024-10-11 00:00:30 +03:00
|
|
|
|
Log.Writeln_("Проект не содержит процедуры с именем " + Utils_.Brackets(func_name));
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
protected void showDone() throws Exception {
|
|
|
|
|
|
UI.getMainWindow().getProjectWindow().getFunctionsWindow().ShowCurrentFunction();
|
|
|
|
|
|
if (SPF_GetGraphFunctionPositions.showByCurrentFunction) {
|
2024-10-09 23:37:58 +03:00
|
|
|
|
Pass.passes.get(PassCode.SPF_GetGraphFunctionPositions).Do();
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|