2023-11-19 02:12:44 +03:00
|
|
|
package Visual_DVM_2021.Passes.Server;
|
2024-10-07 00:58:29 +03:00
|
|
|
import Common.Database.Objects.DBObject;
|
2024-10-08 23:45:06 +03:00
|
|
|
import _VisualDVM.ServerObjectsCache.VisualCaches;
|
2024-10-09 22:21:57 +03:00
|
|
|
import _VisualDVM.Repository.RepositoryServer;
|
2023-11-20 00:15:22 +03:00
|
|
|
public class EditServerObject<S extends RepositoryServer, D extends DBObject> extends ServerObjectPass<S, D> {
|
2023-11-16 21:19:26 +03:00
|
|
|
//--
|
|
|
|
|
@Override
|
|
|
|
|
public String getIconPath() {
|
|
|
|
|
return "/icons/Edit.png";
|
|
|
|
|
}
|
|
|
|
|
//--
|
|
|
|
|
@Override
|
|
|
|
|
protected boolean canStart(Object... args) throws Exception {
|
|
|
|
|
target = (D) getDb().tables.get(d).getCurrent();
|
|
|
|
|
return getDb().tables.get(d).CheckCurrent(Log) && getDb().tables.get(d).ShowEditObjectDialog(target);
|
|
|
|
|
}
|
|
|
|
|
//--
|
|
|
|
|
public EditServerObject(S server_in, Class<D> d_in) {
|
|
|
|
|
super(server_in, d_in);
|
|
|
|
|
}
|
|
|
|
|
//--
|
|
|
|
|
@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);
|
2023-11-17 00:58:58 +03:00
|
|
|
getDb().tables.get(d).ui_.Show(target.getPK());
|
|
|
|
|
}
|
2023-11-16 21:19:26 +03:00
|
|
|
}
|