Browse Source

bug fix

master
XiaXiang 7 years ago
parent
commit
fdfeb3c026
  1. 25
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java

25
designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java

@ -73,6 +73,7 @@ public class AlphaFineDialog extends UIDialog {
private UIButton closeButton; private UIButton closeButton;
private JPanel searchResultPane; private JPanel searchResultPane;
private UIScrollPane leftSearchResultPane; private UIScrollPane leftSearchResultPane;
private JPanel defaultPane; private JPanel defaultPane;
//分割线 //分割线
private UILabel splitLabel; private UILabel splitLabel;
@ -342,8 +343,7 @@ public class AlphaFineDialog extends UIDialog {
*/ */
private void fireStopLoading() { private void fireStopLoading() {
searchListModel.resetState(); searchListModel.resetState();
refreshContainer(); replaceLeftPane();
//replaceLeftPane();
} }
/** /**
@ -359,17 +359,15 @@ public class AlphaFineDialog extends UIDialog {
* 重置结果面板 * 重置结果面板
*/ */
private void replaceLeftPane() { private void replaceLeftPane() {
if (searchListModel.getSize() == 0 && searchResultPane != null) { 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")); 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.remove(leftSearchResultPane);
searchResultPane.add(defaultPane, BorderLayout.WEST); searchResultPane.add(defaultPane, BorderLayout.WEST);
} else if (searchResultPane != null && searchListModel.getSize() > 0 && defaultPane != null) {
searchResultPane.remove(defaultPane);
defaultPane = null;
searchResultPane.add(leftSearchResultPane, BorderLayout.WEST);
}
refreshContainer(); refreshContainer();
} }
}
}
/** /**
* 重新构建搜索结果列表 * 重新构建搜索结果列表
@ -971,6 +969,12 @@ public class AlphaFineDialog extends UIDialog {
*/ */
private void fireSelectedStateChanged(AlphaCellModel element, int index) { private void fireSelectedStateChanged(AlphaCellModel element, int index) {
if (element.hasAction() && !isValidSelected()) { if (element.hasAction() && !isValidSelected()) {
if (defaultPane != null) {
searchResultPane.remove(defaultPane);
defaultPane = null;
searchResultPane.add(leftSearchResultPane, BorderLayout.WEST);
refreshContainer();
}
searchResultList.setSelectedIndex(index); searchResultList.setSelectedIndex(index);
setValidSelected(true); setValidSelected(true);
} }
@ -1020,6 +1024,11 @@ public class AlphaFineDialog extends UIDialog {
isValidSelected = selected; isValidSelected = selected;
} }
@Override
public boolean isEmpty() {
return myDelegate.isEmpty();
}
public void resetState() { public void resetState() {
for (int i = 0; i< getSize(); i++) { for (int i = 0; i< getSize(); i++) {
getElementAt(i).resetState(); getElementAt(i).resetState();

Loading…
Cancel
Save