рефакторин методов связанных с компонентами.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user