2025-02-19 22:47:56 +03:00
|
|
|
package _VisualDVM.ComponentsServer.Recipient.UI;
|
|
|
|
|
import Common.Database.Tables.DataSet;
|
|
|
|
|
import Common.Visual.DataSetControlForm;
|
2025-02-20 00:49:30 +03:00
|
|
|
import Common.Visual.Menus.DataMenuBar;
|
2025-02-19 22:47:56 +03:00
|
|
|
import Common.Visual.Tables.ColumnInfo;
|
|
|
|
|
import _VisualDVM.ComponentsServer.Recipient.Recipient;
|
2025-02-20 13:47:50 +03:00
|
|
|
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
|
|
|
|
import _VisualDVM.Global;
|
2025-02-20 00:49:30 +03:00
|
|
|
import _VisualDVM.Passes.PassCode;
|
2025-02-19 22:47:56 +03:00
|
|
|
|
|
|
|
|
import javax.swing.*;
|
|
|
|
|
public class RecipientsForm extends DataSetControlForm<Recipient> {
|
|
|
|
|
public RecipientsForm(DataSet<?, Recipient> dataSource_in, JPanel mountPanel_in) {
|
|
|
|
|
super(dataSource_in, mountPanel_in);
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
protected void createColumns() {
|
|
|
|
|
AddColumns(
|
|
|
|
|
new ColumnInfo<Recipient>("Имя") {
|
|
|
|
|
@Override
|
|
|
|
|
public Object getFieldAt(Recipient object) {
|
|
|
|
|
return object.name;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
2025-02-20 00:49:30 +03:00
|
|
|
@Override
|
|
|
|
|
protected DataMenuBar createMenuBar() {
|
2025-03-13 00:32:20 +03:00
|
|
|
return new DataMenuBar(dataSource.getPluralDescription(), PassCode.SaveBugReportExecutor, PassCode.SaveBugReportRecipients);
|
2025-02-20 00:49:30 +03:00
|
|
|
}
|
2025-02-20 13:47:50 +03:00
|
|
|
@Override
|
|
|
|
|
protected ColumnInfo<Recipient> createPKColumn() {
|
|
|
|
|
return new ColumnInfo<Recipient>(dataSource.getPKName()) {
|
|
|
|
|
@Override
|
|
|
|
|
public Object getFieldAt(Recipient object) {
|
|
|
|
|
return object.getPK();
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public boolean isVisible() {
|
|
|
|
|
return Global.mainModule.getAccount().role.equals(AccountRole.Admin);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
2025-02-19 22:47:56 +03:00
|
|
|
}
|