From 698b6c4319dd8f990a7597d003ab5c50263a2368 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 28 Jun 2017 14:19:54 +0800 Subject: [PATCH 1/3] bug fix --- .../alphafine/search/manager/RecentSearchManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java b/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java index 16de73fc0..1b6b2b658 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java +++ b/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java @@ -230,7 +230,9 @@ public class RecentSearchManager extends XMLFileManager implements AlphaFineSear Collections.sort(resultModelList); int size = resultModelList.size(); if (size > MAX_SIZE) { - return (SearchResult) resultModelList.subList(0, MAX_SIZE); + SearchResult result = new SearchResult(); + result.addAll(resultModelList.subList(0, MAX_SIZE)); + return result; } return resultModelList; } From fd6cdfe4f75bb02b78801f5d481bc5c742a8d14f Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 28 Jun 2017 15:44:26 +0800 Subject: [PATCH 2/3] =?UTF-8?q?bug=20fix=20=E6=96=B9=E5=90=91=E9=94=AE?= =?UTF-8?q?=E9=80=89=E6=8B=A9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/alphafine/component/AlphaFineDialog.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index daab6961f..978576a66 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -587,9 +587,8 @@ public class AlphaFineDialog extends UIDialog { searchTextField.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { - if (e.getKeyCode() == KeyEvent.VK_DOWN && searchTextField.hasFocus()) { + if (e.getKeyCode() == KeyEvent.VK_DOWN) { searchResultList.requestFocus(); - searchResultList.setSelectedIndex(searchResultList.getSelectedIndex() + 1); } } }); @@ -885,6 +884,13 @@ public class AlphaFineDialog extends UIDialog { } } }); + + addFocusListener(new FocusAdapter() { + @Override + public void focusGained(FocusEvent e) { + setSelectedIndex(searchResultList.getSelectedIndex() + 1); + } + }); } From 886bc4ef7ad01f2914cd03ea78fcbcbc74d58296 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 28 Jun 2017 16:09:58 +0800 Subject: [PATCH 3/3] bug fix PMD --- .../alphafine/component/AlphaFineDialog.java | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index 978576a66..90911640a 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -835,10 +835,6 @@ public class AlphaFineDialog extends UIDialog { } private void initListListener() { - - /** - * 为list添加键盘监听器 - */ addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { @@ -853,9 +849,6 @@ public class AlphaFineDialog extends UIDialog { } }); - /** - * 为list添加鼠标监听器 - */ addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { @@ -872,15 +865,11 @@ public class AlphaFineDialog extends UIDialog { } }); - /** - *单击时触发右侧面板展示搜索结果 - */ addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { if (!e.getValueIsAdjusting() && getSelectedValue() != null) { showResult(getSelectedValue()); - } } }); @@ -892,8 +881,6 @@ public class AlphaFineDialog extends UIDialog { } }); } - - } /**