2025-03-04 13:33:46 +03:00
|
|
|
package _VisualDVM.GlobalData.CompilerEnvironment;
|
|
|
|
|
import Common.Database.Tables.DataSet;
|
|
|
|
|
import Common.Visual.DataSetControlForm;
|
|
|
|
|
import _VisualDVM.GlobalData.CompilerEnvironment.Json.EnvironmentsJson;
|
|
|
|
|
import _VisualDVM.GlobalData.CompilerEnvironment.Json.EnvironmentsSetJson;
|
|
|
|
|
import _VisualDVM.GlobalData.CompilerEnvironment.UI.EnvironmentsLinesForm;
|
|
|
|
|
|
|
|
|
|
import javax.swing.*;
|
|
|
|
|
public class EnvironmentsLinesSet extends DataSet<Integer, EnvironmentsLine> {
|
|
|
|
|
public int maxId = 1;
|
|
|
|
|
public EnvironmentsLinesSet() {
|
|
|
|
|
super(Integer.class, EnvironmentsLine.class);
|
|
|
|
|
}
|
|
|
|
|
public EnvironmentsLinesSet(EnvironmentsSetJson json) {
|
|
|
|
|
super(Integer.class, EnvironmentsLine.class);
|
2025-03-13 00:32:20 +03:00
|
|
|
for (EnvironmentsJson environmentsJson : json.values) {
|
|
|
|
|
EnvironmentsLine environmentsLine = new EnvironmentsLine(environmentsJson);
|
2025-03-04 13:33:46 +03:00
|
|
|
environmentsLine.id = maxId++;
|
|
|
|
|
put(environmentsLine.id, environmentsLine);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public String getSingleDescription() {
|
|
|
|
|
return "набор переменных окружения";
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public String getPluralDescription() {
|
|
|
|
|
return "наборы переменных окружения";
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
protected DataSetControlForm createUI(JPanel mountPanel) {
|
2025-03-13 00:32:20 +03:00
|
|
|
return new EnvironmentsLinesForm(this, mountPanel);
|
2025-03-04 13:33:46 +03:00
|
|
|
}
|
2025-03-13 00:32:20 +03:00
|
|
|
public EnvironmentsSetJson toJson() {
|
|
|
|
|
EnvironmentsSetJson res = new EnvironmentsSetJson();
|
|
|
|
|
for (EnvironmentsLine environmentsLine : Data.values()) {
|
2025-03-04 13:33:46 +03:00
|
|
|
res.values.add(environmentsLine.json);
|
|
|
|
|
}
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
}
|