36 lines
1.2 KiB
Java
36 lines
1.2 KiB
Java
|
|
package _VisualDVM.ComponentsServer.Recipient;
|
||
|
|
import Common.Database.Tables.DataSet;
|
||
|
|
import Common.Utils.Utils_;
|
||
|
|
import Common.Visual.DataSetControlForm;
|
||
|
|
import _VisualDVM.ComponentsServer.Recipient.Json.RecipientJson;
|
||
|
|
import _VisualDVM.ComponentsServer.Recipient.Json.RecipientsJson;
|
||
|
|
import _VisualDVM.ComponentsServer.Recipient.UI.RecipientsForm;
|
||
|
|
import _VisualDVM.Global;
|
||
|
|
|
||
|
|
import javax.swing.*;
|
||
|
|
public class RecipientsDataSet extends DataSet<String, Recipient> {
|
||
|
|
public RecipientsDataSet() {
|
||
|
|
super(String.class, Recipient.class);
|
||
|
|
}
|
||
|
|
public void Unpack(String packed){
|
||
|
|
System.out.println(Utils_.Brackets(packed));
|
||
|
|
clear();
|
||
|
|
RecipientsJson jsons = Utils_.gson.fromJson(packed, RecipientsJson.class);
|
||
|
|
for (RecipientJson json: jsons.values){
|
||
|
|
Global.componentsServer.db.recipients.put(json.email, new Recipient(json));
|
||
|
|
}
|
||
|
|
}
|
||
|
|
@Override
|
||
|
|
protected DataSetControlForm createUI(JPanel mountPanel) {
|
||
|
|
return new RecipientsForm(this,mountPanel);
|
||
|
|
}
|
||
|
|
@Override
|
||
|
|
public String getPluralDescription() {
|
||
|
|
return "адресаты";
|
||
|
|
}
|
||
|
|
@Override
|
||
|
|
public String getSingleDescription() {
|
||
|
|
return "адресат";
|
||
|
|
}
|
||
|
|
}
|