удаление объектов в таблицах по клавише DELETE
This commit is contained in:
@@ -2,6 +2,7 @@ package Common.Database.Tables;
|
||||
import Common.Current_;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.MainModule_;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Utils.TextLog;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.DataSetFilter;
|
||||
@@ -327,4 +328,5 @@ public class DataSet<K, D extends DBObject> extends DataSetAnchestor {
|
||||
}
|
||||
}
|
||||
//-------------------------------------------------------------------------------------
|
||||
public PassCode_ getDeletePassCode(){return null;}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@ import Common.Visual.Tables.Grid.GridAnchestor;
|
||||
import javax.swing.*;
|
||||
import javax.swing.table.TableColumn;
|
||||
import java.awt.*;
|
||||
import java.awt.event.KeyAdapter;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.util.Arrays;
|
||||
@@ -39,8 +41,6 @@ public class DataSetControlForm extends ControlWithCurrentForm<DataTable> {
|
||||
dataSource = dataSource_in;
|
||||
//---
|
||||
dataPanel = new JPanel(new BorderLayout());
|
||||
|
||||
|
||||
content.add(dataPanel, BorderLayout.CENTER);
|
||||
}
|
||||
public JPanel getDataPanel() {
|
||||
@@ -252,6 +252,26 @@ public class DataSetControlForm extends ControlWithCurrentForm<DataTable> {
|
||||
}
|
||||
}
|
||||
});
|
||||
control.addKeyListener(new KeyAdapter() {
|
||||
@Override
|
||||
public void keyPressed(KeyEvent e) {
|
||||
switch (e.getKeyCode()) {
|
||||
case KeyEvent.VK_DELETE:
|
||||
if (dataSource.getDeletePassCode() != null) {
|
||||
MainModule_.instance.getPass(dataSource.getDeletePassCode()).Do();
|
||||
}
|
||||
break;
|
||||
case KeyEvent.VK_ENTER:
|
||||
try {
|
||||
MouseAction2();
|
||||
} catch (Exception ex) {
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
//----------------------------------------------------------------------------
|
||||
//при переотображении таблицы скидываем текущий объект!!
|
||||
getDataSource().dropCurrent();
|
||||
|
||||
@@ -4,6 +4,7 @@ import Common.Database.Tables.FKBehaviour;
|
||||
import Common.Database.Tables.FKCurrentObjectBehaviuor;
|
||||
import Common.Database.Tables.FKDataBehaviour;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
@@ -170,4 +171,8 @@ public class CompilersDBTable extends iDBTable<Compiler> {
|
||||
PassCode.ShowCompilerVersion,
|
||||
PassCode.ShowCompilerHelp);
|
||||
}
|
||||
@Override
|
||||
public PassCode_ getDeletePassCode() {
|
||||
return PassCode.DeleteCompiler;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package _VisualDVM.GlobalData.DVMParameter;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
@@ -104,4 +105,8 @@ public class DVMParameterDBTable extends iDBTable<DVMParameter> {
|
||||
PassCode.EditDVMParameter,
|
||||
PassCode.DeleteDVMParameter);
|
||||
}
|
||||
@Override
|
||||
public PassCode_ getDeletePassCode() {
|
||||
return PassCode.DeleteDVMParameter;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package _VisualDVM.GlobalData.EnvironmentValue;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
@@ -105,4 +106,8 @@ public class EnvironmentValuesDBTable extends iDBTable<EnvironmentValue> {
|
||||
PassCode.DeleteEnvironmentValue,
|
||||
PassCode.PickCompilerEnvironments);
|
||||
}
|
||||
@Override
|
||||
public PassCode_ getDeletePassCode() {
|
||||
return PassCode.DeleteEnvironmentValue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import Common.Database.Tables.FKBehaviour;
|
||||
import Common.Database.Tables.FKCurrentObjectBehaviuor;
|
||||
import Common.Database.Tables.FKDataBehaviour;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Visual.Controls.MenuBarButton;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
@@ -153,4 +154,8 @@ public class MachinesDBTable extends iDBTable<Machine> {
|
||||
}
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public PassCode_ getDeletePassCode() {
|
||||
return PassCode.DeleteMachine;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import Common.Database.Tables.FKBehaviour;
|
||||
import Common.Database.Tables.FKCurrentObjectBehaviuor;
|
||||
import Common.Database.Tables.FKDataBehaviour;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
@@ -88,4 +89,8 @@ public class MakefilesDBTable extends iDBTable<Makefile> {
|
||||
}
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public PassCode_ getDeletePassCode() {
|
||||
return PassCode.DeleteMakefile;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import Common.Database.Tables.FKBehaviour;
|
||||
import Common.Database.Tables.FKCurrentObjectBehaviuor;
|
||||
import Common.Database.Tables.FKDataBehaviour;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.UI;
|
||||
@@ -181,4 +182,8 @@ public class RunConfigurationsDBTable extends iDBTable<RunConfiguration> {
|
||||
}
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public PassCode_ getDeletePassCode() {
|
||||
return PassCode.DeleteRunConfiguration;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import Common.Database.Tables.FKBehaviour;
|
||||
import Common.Database.Tables.FKCurrentObjectBehaviuor;
|
||||
import Common.Database.Tables.FKDataBehaviour;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
@@ -88,4 +89,8 @@ public class SapforProfilesDBTable extends iDBTable<SapforProfile> {
|
||||
PassCode.ApplyProfile,
|
||||
PassCode.DeleteProfile);
|
||||
}
|
||||
@Override
|
||||
public PassCode_ getDeletePassCode() {
|
||||
return PassCode.DeleteProfile;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import Common.Database.Tables.FKBehaviour;
|
||||
import Common.Database.Tables.FKCurrentObjectBehaviuor;
|
||||
import Common.Database.Tables.FKDataBehaviour;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.Tables.RendererDate;
|
||||
@@ -115,4 +116,8 @@ public class CompilationTasksDBTable extends iDBTable<CompilationTask> {
|
||||
public DataMenuBar createMenuBar() {
|
||||
return new DataMenuBar(getPluralDescription(), PassCode.DeleteCompilationTasks);
|
||||
}
|
||||
@Override
|
||||
public PassCode_ getDeletePassCode() {
|
||||
return PassCode.DeleteCompilationTasks;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package _VisualDVM.GlobalData.Tasks.RunTask;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.Tables.RendererDate;
|
||||
@@ -80,4 +81,8 @@ public class RunTasksDBTable extends iDBTable<RunTask> {
|
||||
public DataMenuBar createMenuBar() {
|
||||
return new DataMenuBar(getPluralDescription(), PassCode.DeleteRunTasks);
|
||||
}
|
||||
@Override
|
||||
public PassCode_ getDeletePassCode() {
|
||||
return PassCode.DeleteRunTasks;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import Common.Database.Tables.FKBehaviour;
|
||||
import Common.Database.Tables.FKCurrentObjectBehaviuor;
|
||||
import Common.Database.Tables.FKDataBehaviour;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.Tables.RendererStatusEnum;
|
||||
@@ -124,4 +125,8 @@ public class UsersDBTable extends iDBTable<User> {
|
||||
PassCode.InitialiseUser,
|
||||
PassCode.DeleteUser);
|
||||
}
|
||||
@Override
|
||||
public PassCode_ getDeletePassCode() {
|
||||
return PassCode.DeleteUser;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package _VisualDVM.Repository.BugReport;
|
||||
import Common.Database.Tables.DBTable;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.Tables.RendererDate;
|
||||
@@ -126,4 +127,8 @@ public class BugReportsDBTable extends DBTable<String, BugReport> {
|
||||
PassCode.CloseBugReport,
|
||||
PassCode.DeleteBugReport);
|
||||
}
|
||||
@Override
|
||||
public PassCode_ getDeletePassCode() {
|
||||
return PassCode.DeleteBugReport;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package _VisualDVM.Repository.SubscriberWorkspace;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import _VisualDVM.Current;
|
||||
@@ -52,4 +53,8 @@ public class SubscriberWorkspaceDBTable extends iDBTable<SubscriberWorkspace> {
|
||||
public DataMenuBar createMenuBar() {
|
||||
return new DataMenuBar(getPluralDescription(), PassCode.DeleteSubscriberWorkspace);
|
||||
}
|
||||
@Override
|
||||
public PassCode_ getDeletePassCode() {
|
||||
return PassCode.DeleteSubscriberWorkspace;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import Common.Database.Tables.DBTable;
|
||||
import Common.Database.Tables.FKBehaviour;
|
||||
import Common.Database.Tables.FKCurrentObjectBehaviuor;
|
||||
import Common.Database.Tables.FKDataBehaviour;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
@@ -85,4 +86,8 @@ public class SubsribersDBTable extends DBTable<String, Subscriber> {
|
||||
PassCode.EditSubscriber,
|
||||
PassCode.DeleteSubscriber);
|
||||
}
|
||||
@Override
|
||||
public PassCode_ getDeletePassCode() {
|
||||
return PassCode.DeleteSubscriber;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import Common.Database.Tables.FKBehaviour;
|
||||
import Common.Database.Tables.FKCurrentObjectBehaviuor;
|
||||
import Common.Database.Tables.FKDataBehaviour;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.Controls.MenuBarButton;
|
||||
import Common.Visual.DBObjectFilter;
|
||||
@@ -180,4 +181,8 @@ public class GroupsDBTable extends iDBTable<Group> {
|
||||
}
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public PassCode_ getDeletePassCode() {
|
||||
return PassCode.DeleteGroup;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package _VisualDVM.TestingSystem.Common.Test;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
@@ -137,4 +138,8 @@ public class TestDBTable extends iDBTable<Test> {
|
||||
}
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public PassCode_ getDeletePassCode() {
|
||||
return PassCode.DeleteTest;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package _VisualDVM.TestingSystem.DVM.DVMConfiguration;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.Tables.RendererMultiline;
|
||||
@@ -126,4 +127,8 @@ public class DVMConfigurationDBTable extends iDBTable<DVMConfiguration> {
|
||||
PassCode.DeleteConfiguration,
|
||||
PassCode.StartSelectedDVMConfigurations );
|
||||
}
|
||||
@Override
|
||||
public PassCode_ getDeletePassCode() {
|
||||
return PassCode.DeleteConfiguration;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package _VisualDVM.TestingSystem.DVM.DVMPackage;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.Controls.MenuBarButton;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
@@ -171,4 +172,8 @@ public class DVMPackageDBTable extends iDBTable<DVMPackage> {
|
||||
}
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public PassCode_ getDeletePassCode() {
|
||||
return PassCode.DeleteDVMPackage;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package _VisualDVM.TestingSystem.DVM.DVMSettings;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
@@ -154,4 +155,8 @@ public class DVMSettingsDBTable extends iDBTable<DVMSettings> {
|
||||
PassCode.EditDVMSettings,
|
||||
PassCode.DeleteDVMSettings);
|
||||
}
|
||||
@Override
|
||||
public PassCode_ getDeletePassCode() {
|
||||
return PassCode.DeleteDVMSettings;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.SapforConfiguration;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Utils.Vector_;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
@@ -140,4 +141,8 @@ public class SapforConfigurationDBTable extends iDBTable<SapforConfiguration> {
|
||||
PassCode.DeleteSapforConfiguration,
|
||||
PassCode.StartSelectedSAPFORConfigurations);
|
||||
}
|
||||
@Override
|
||||
public PassCode_ getDeletePassCode() {
|
||||
return PassCode.DeleteSapforConfiguration;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.SapforPackage;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.Controls.MenuBarButton;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
@@ -150,4 +151,8 @@ public class SapforPackageDBTable extends iDBTable<SapforPackage> {
|
||||
}
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public PassCode_ getDeletePassCode() {
|
||||
return PassCode.DeleteSapforPackage;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import Common.Database.Tables.FKBehaviour;
|
||||
import Common.Database.Tables.FKCurrentObjectBehaviuor;
|
||||
import Common.Database.Tables.FKDataBehaviour;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
@@ -125,4 +126,8 @@ public class SapforSettingsDBTable extends iDBTable<SapforSettings> {
|
||||
PassCode.EditSapforSettings,
|
||||
PassCode.DeleteSapforSettings);
|
||||
}
|
||||
@Override
|
||||
public PassCode_ getDeletePassCode() {
|
||||
return PassCode.DeleteSapforSettings;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.SapforSettingsCommand;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.UI;
|
||||
@@ -89,4 +90,8 @@ public class SapforSettingsCommandsDBTable extends iDBTable<SapforSettingsComman
|
||||
PassCode.EditSapforSettingsCommand,
|
||||
PassCode.DeleteSapforSettingsCommand);
|
||||
}
|
||||
@Override
|
||||
public PassCode_ getDeletePassCode() {
|
||||
return PassCode.DeleteSapforSettingsCommand;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.ServerSapfor;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.Tables.RendererDate;
|
||||
@@ -86,4 +87,8 @@ public class ServerSapforsDBTable extends iDBTable<ServerSapfor> {
|
||||
PassCode.ShowSapforCompilationErr,
|
||||
PassCode.DeleteServerSapfor);
|
||||
}
|
||||
@Override
|
||||
public PassCode_ getDeletePassCode() {
|
||||
return PassCode.DeleteServerSapfor;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user