2024-10-14 12:14:01 +03:00
|
|
|
package _VisualDVM.Passes.Server;
|
2024-10-07 00:58:29 +03:00
|
|
|
import Common.Database.Objects.DBObject;
|
2024-10-09 22:21:57 +03:00
|
|
|
import _VisualDVM.Repository.RepositoryServer;
|
2024-10-14 15:19:13 +03:00
|
|
|
import _VisualDVM.ServerObjectsCache.VisualCaches;
|
2023-11-20 00:15:22 +03:00
|
|
|
public class EditServerObject<S extends RepositoryServer, D extends DBObject> extends ServerObjectPass<S, D> {
|
2024-10-14 15:19:13 +03:00
|
|
|
//--
|
|
|
|
|
public EditServerObject(S server_in, Class<D> d_in) {
|
|
|
|
|
super(server_in, d_in);
|
|
|
|
|
}
|
2023-11-16 21:19:26 +03:00
|
|
|
//--
|
|
|
|
|
@Override
|
|
|
|
|
public String getIconPath() {
|
2024-10-15 16:58:20 +03:00
|
|
|
return "/Common/icons/Edit.png";
|
2023-11-16 21:19:26 +03:00
|
|
|
}
|
2024-10-22 19:53:38 +03:00
|
|
|
public String getDescription_(){
|
|
|
|
|
return "редактирование";
|
|
|
|
|
}
|
2023-11-16 21:19:26 +03:00
|
|
|
//--
|
|
|
|
|
@Override
|
|
|
|
|
protected boolean canStart(Object... args) throws Exception {
|
2024-10-22 15:25:06 +03:00
|
|
|
target = (D) getDb().getTable(d).getUI().getCurrent();
|
2024-10-22 16:44:13 +03:00
|
|
|
return getDb().getTable(d).getUI().CheckCurrent(Log) && getDb().getTable(d).getUI().ShowEditObjectDialog(target);
|
2023-11-16 21:19:26 +03:00
|
|
|
}
|
|
|
|
|
//--
|
|
|
|
|
@Override
|
|
|
|
|
protected void ServerAction() throws Exception {
|
2023-11-16 22:11:58 +03:00
|
|
|
EditObject(target);
|
2023-11-16 21:19:26 +03:00
|
|
|
}
|
2023-11-17 00:58:58 +03:00
|
|
|
@Override
|
|
|
|
|
protected void showDone() throws Exception {
|
2024-09-19 00:24:36 +03:00
|
|
|
VisualCaches.RefreshCache(target);
|
2024-10-17 20:44:11 +03:00
|
|
|
getDb().getTable(d).getUI().Show(target.getPK());
|
2023-11-17 00:58:58 +03:00
|
|
|
}
|
2023-11-16 21:19:26 +03:00
|
|
|
}
|