From 7993ac4c05d882ce165cc4dcec4cf6c9403fe385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=2EYing-=E5=BA=94=E5=BF=97=E6=B5=A9?= Date: Thu, 4 May 2023 10:01:54 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-94476=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E4=B8=AD=E6=8C=89=E4=B8=8A=E6=96=B9=E5=90=91=E9=94=AE=E5=90=8E?= =?UTF-8?q?=E4=B8=8A=E9=9D=A2=E7=9A=84=E5=8D=95=E5=85=83=E6=A0=BC=E8=A2=AB?= =?UTF-8?q?=E6=B8=85=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/grid/GridKeyAction.java | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/grid/GridKeyAction.java b/designer-realize/src/main/java/com/fr/grid/GridKeyAction.java index 12e8ac597a..c69c2e11db 100644 --- a/designer-realize/src/main/java/com/fr/grid/GridKeyAction.java +++ b/designer-realize/src/main/java/com/fr/grid/GridKeyAction.java @@ -69,28 +69,21 @@ public class GridKeyAction extends AbstractAction { } else if ("right".equals(actionKey)) { selectionMove(ReportConstants.MOVE_DIRECTION_RIGHT); } else if ("up".equals(actionKey)) { - selectionMove(ReportConstants.MOVE_DIRECTION_UP); + directKeyPressed(ReportConstants.MOVE_DIRECTION_UP); } else if ("down".equals(actionKey)) { - selectionMove(ReportConstants.MOVE_DIRECTION_DOWN); + directKeyPressed(ReportConstants.MOVE_DIRECTION_DOWN); } else if ("enter".equals(actionKey)) { - enterKeyPressed(); + directKeyPressed(ReportConstants.MOVE_DIRECTION_DOWN); } else if ("tab".equals(actionKey)) { - tabKeyPressed(); + directKeyPressed(ReportConstants.MOVE_DIRECTION_RIGHT); } } - private void enterKeyPressed() { + private void directKeyPressed(int direction) { if (grid.isCellEditing()) { grid.stopEditing(); } - selectionMove(ReportConstants.MOVE_DIRECTION_DOWN); - } - - private void tabKeyPressed() { - if (grid.isCellEditing()) { - grid.stopEditing(); - } - selectionMove(ReportConstants.MOVE_DIRECTION_RIGHT); + selectionMove(direction); } /**