аналогичная запаковка и распаковка окружения. осталось формирование задач и отображение в таблице
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
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 _VisualDVM.GlobalData.CompilerOption.OptionsLine;
|
||||
|
||||
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);
|
||||
for (EnvironmentsJson environmentsJson: json.values) {
|
||||
EnvironmentsLine environmentsLine =new EnvironmentsLine(environmentsJson);
|
||||
environmentsLine.id = maxId++;
|
||||
put(environmentsLine.id, environmentsLine);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String getSingleDescription() {
|
||||
return "набор переменных окружения";
|
||||
}
|
||||
@Override
|
||||
public String getPluralDescription() {
|
||||
return "наборы переменных окружения";
|
||||
}
|
||||
@Override
|
||||
protected DataSetControlForm createUI(JPanel mountPanel) {
|
||||
return new EnvironmentsLinesForm(this,mountPanel);
|
||||
}
|
||||
public EnvironmentsSetJson toJson(){
|
||||
EnvironmentsSetJson res= new EnvironmentsSetJson();
|
||||
for (EnvironmentsLine environmentsLine: Data.values()){
|
||||
res.values.add(environmentsLine.json);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user