Browse Source

enter键问题

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

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

@ -676,7 +676,7 @@ public class AlphaFineDialog extends UIDialog {
searchResultList.setSelectedIndex(searchResultList.getSelectedIndex() + 1);
} else if (e.getKeyCode() == KeyEvent.VK_UP) {
searchResultList.setSelectedIndex(searchResultList.getSelectedIndex() - 1);
} else escAlphaFine(e);
} else escAlphaFineDialog(e);
}
});
@ -888,7 +888,7 @@ public class AlphaFineDialog extends UIDialog {
*
* @param e
*/
private void escAlphaFine(KeyEvent e) {
private void escAlphaFineDialog(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
if (StringUtils.isBlank(searchTextField.getText()) || ComparatorUtils.equals(searchTextField.getText(), searchTextField.getPlaceHolder())) {
AlphaFineDialog.this.setVisible(false);
@ -896,6 +896,10 @@ public class AlphaFineDialog extends UIDialog {
searchTextField.setText(null);
removeSearchResult();
}
} else if (e.getKeyCode() == KeyEvent.VK_ENTER) {
if (searchResultList.getModel().getSize() > 1) {
dealWithSearchResult(searchResultList.getSelectedValue());
}
}
}
@ -969,7 +973,7 @@ public class AlphaFineDialog extends UIDialog {
addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
escAlphaFine(e);
escAlphaFineDialog(e);
}
});

Loading…
Cancel
Save