From fdfeb3c026c5c98cd1e3af0c1029f9b34541dc8b Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Tue, 22 Aug 2017 23:53:13 +0800 Subject: [PATCH] bug fix --- .../alphafine/component/AlphaFineDialog.java | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 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 0ca1fb664..8246056ec 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -73,6 +73,7 @@ public class AlphaFineDialog extends UIDialog { private UIButton closeButton; private JPanel searchResultPane; private UIScrollPane leftSearchResultPane; + private JPanel defaultPane; //分割线 private UILabel splitLabel; @@ -342,8 +343,7 @@ public class AlphaFineDialog extends UIDialog { */ private void fireStopLoading() { searchListModel.resetState(); - refreshContainer(); - //replaceLeftPane(); + replaceLeftPane(); } /** @@ -359,16 +359,14 @@ public class AlphaFineDialog extends UIDialog { * 重置结果面板 */ private void replaceLeftPane() { - if (searchListModel.getSize() == 0 && searchResultPane != null) { - defaultPane = new NoResultPane(Inter.getLocText("FR-Designer-AlphaFine_NO_Result"), IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/no_result.png")); - searchResultPane.remove(leftSearchResultPane); - searchResultPane.add(defaultPane, BorderLayout.WEST); - } else if (searchResultPane != null && searchListModel.getSize() > 0 && defaultPane != null) { - searchResultPane.remove(defaultPane); - defaultPane = null; - searchResultPane.add(leftSearchResultPane, BorderLayout.WEST); + if (searchResultPane != null) { + if (searchListModel.isEmpty() && defaultPane == null) { + defaultPane = new NoResultPane(Inter.getLocText("FR-Designer-AlphaFine_NO_Result"), IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/no_result.png")); + searchResultPane.remove(leftSearchResultPane); + searchResultPane.add(defaultPane, BorderLayout.WEST); + refreshContainer(); + } } - refreshContainer(); } /** @@ -971,6 +969,12 @@ public class AlphaFineDialog extends UIDialog { */ private void fireSelectedStateChanged(AlphaCellModel element, int index) { if (element.hasAction() && !isValidSelected()) { + if (defaultPane != null) { + searchResultPane.remove(defaultPane); + defaultPane = null; + searchResultPane.add(leftSearchResultPane, BorderLayout.WEST); + refreshContainer(); + } searchResultList.setSelectedIndex(index); setValidSelected(true); } @@ -1020,6 +1024,11 @@ public class AlphaFineDialog extends UIDialog { isValidSelected = selected; } + @Override + public boolean isEmpty() { + return myDelegate.isEmpty(); + } + public void resetState() { for (int i = 0; i< getSize(); i++) { getElementAt(i).resetState();