рефакторин методов связанных с компонентами.

This commit is contained in:
2024-10-22 20:16:57 +03:00
parent bf5d5442d4
commit c160a20d06
17 changed files with 98 additions and 88 deletions

View File

@@ -22,18 +22,18 @@ public class UpdateSelectedComponents extends Pass<Vector<Component>> {
protected boolean canStart(Object... args) throws Exception {
target = new Vector<>();
//------------------------
if (Global.Components.getUI().getSelectedCount() == 0) {
if (Global.components.getUI().getSelectedCount() == 0) {
Log.Writeln_("Не отмечено ни одного компонента!");
return false;
}
target = Global.Components.getUI().getSelectedItems();
target = Global.components.getUI().getSelectedItems();
return true;
}
@Override
public String getStartDescription() {
Vector<String> question = new Vector<>();
question.add("Обновить компоненты");
for (Component component : Global.Components.getUI().getSelectedItems()) {
for (Component component : Global.components.getUI().getSelectedItems()) {
question.add(component.getComponentType().getDescription());
}
return String.join("\n", question);
@@ -41,7 +41,7 @@ public class UpdateSelectedComponents extends Pass<Vector<Component>> {
@Override
protected void body() throws Exception {
for (Component component : target) {
Global.Components.getUI().SetCurrentByPK(component.getPK());
Global.components.getUI().SetCurrentByPK(component.getPK());
Global.mainModule.getPass(PassCode.UpdateComponent).Do();
}
}