From eba4ce270b7cb03935f5d11636d6cabfa8f1845c Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 12 Oct 2021 10:59:18 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-60625=E3=80=90=E5=9B=BA=E5=AE=9A?= =?UTF-8?q?=E5=B8=83=E5=B1=80-=E5=8E=9F=E5=B8=83=E5=B1=80=E6=8E=A8?= =?UTF-8?q?=E8=8D=904.1=E3=80=91=E5=86=B3=E7=AD=96=E6=8A=A5=E8=A1=A8-?= =?UTF-8?q?=E8=87=AA=E9=80=82=E5=BA=94=E5=B8=83=E5=B1=80-=E5=8F=B3?= =?UTF-8?q?=E4=BE=A7=E6=98=BE=E7=A4=BA=E7=BB=84=E4=BB=B6=E5=BA=93=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E6=97=B6=EF=BC=8C=E9=80=89=E4=B8=AD=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=8C=89delete=E9=94=AE=E5=88=A0=E9=99=A4?= =?UTF-8?q?=EF=BC=8C=E6=98=BE=E7=A4=BA=E8=AE=BE=E7=BD=AE=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=97=B6=E5=8F=AF=E4=BB=A5delete=E5=88=A0=E9=99=A4=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/designer/beans/actions/FormDeleteAction.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormDeleteAction.java b/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormDeleteAction.java index c2fec8f39..75a744251 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormDeleteAction.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormDeleteAction.java @@ -41,6 +41,14 @@ public class FormDeleteAction extends FormWidgetEditAction { return comp; } + @Override + public JComponent createToolBarComponentByName(String componentName) { + JComponent comp = super.createToolBarComponentByName(componentName); + // 除了 BACKSPACE 之外,DELETE 键也要能删除(直接在此处添加绑定,没有按钮提示) + comp.registerKeyboardAction(this, KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), JComponent.WHEN_IN_FOCUSED_WINDOW); + return comp; + } + /** * 删除 *