|
|
|
@ -367,7 +367,6 @@ public class AlphaFineDialog extends UIDialog {
|
|
|
|
|
* 停止加载状态 |
|
|
|
|
*/ |
|
|
|
|
private void fireStopLoading() { |
|
|
|
|
searchListModel.resetState(); |
|
|
|
|
if (searchResultPane != null) { |
|
|
|
|
removeLeftPane(); |
|
|
|
|
} |
|
|
|
@ -665,25 +664,18 @@ public class AlphaFineDialog extends UIDialog {
|
|
|
|
|
searchTextField.addKeyListener(new KeyAdapter() { |
|
|
|
|
@Override |
|
|
|
|
public void keyPressed(KeyEvent e) { |
|
|
|
|
if (e.getKeyCode() == KeyEvent.VK_DOWN) { |
|
|
|
|
searchResultList.requestFocus(); |
|
|
|
|
searchResultList.setSelectedIndex(searchResultList.getSelectedIndex() + 1); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void keyReleased(KeyEvent e) { |
|
|
|
|
int keyCode = e.getKeyCode(); |
|
|
|
|
if (keyCode == KeyEvent.VK_ESCAPE) { |
|
|
|
|
if (StringUtils.isBlank(searchTextField.getText()) || ComparatorUtils.equals(searchTextField.getText(), searchTextField.getPlaceHolder())) { |
|
|
|
|
AlphaFineDialog.this.setVisible(false); |
|
|
|
|
} else { |
|
|
|
|
searchTextField.setText(null); |
|
|
|
|
removeSearchResult(); |
|
|
|
|
} |
|
|
|
|
} else if (e.getKeyCode() == KeyEvent.VK_ENTER) { |
|
|
|
|
if (e.getKeyCode() == KeyEvent.VK_ENTER) { |
|
|
|
|
if (searchResultList.getModel().getSize() > 1) { |
|
|
|
|
dealWithSearchResult(searchResultList.getSelectedValue()); |
|
|
|
|
} |
|
|
|
|
} else if (e.getKeyCode() == KeyEvent.VK_DOWN) { |
|
|
|
|
if (searchResultList.getSelectedIndex() == searchResultList.getModel().getSize() - 1) { |
|
|
|
|
searchResultList.setSelectedIndex(0); |
|
|
|
|
} |
|
|
|
|
searchResultList.setSelectedIndex(searchResultList.getSelectedIndex() + 1); |
|
|
|
|
} else if (e.getKeyCode() == KeyEvent.VK_UP) { |
|
|
|
|
searchResultList.setSelectedIndex(searchResultList.getSelectedIndex() - 1); |
|
|
|
|
} else escAlphaFine(e); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
@ -754,8 +746,10 @@ public class AlphaFineDialog extends UIDialog {
|
|
|
|
|
private void doNavigate() { |
|
|
|
|
AlphaFineDialog.this.dispose(); |
|
|
|
|
final AlphaCellModel model = searchResultList.getSelectedValue(); |
|
|
|
|
if (model != null) { |
|
|
|
|
model.doAction(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 保存结果到本地(本地常用) |
|
|
|
@ -888,6 +882,21 @@ public class AlphaFineDialog extends UIDialog {
|
|
|
|
|
this.splitLabel = splitLabel; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 键盘退出AlphaFine |
|
|
|
|
* |
|
|
|
|
* @param e |
|
|
|
|
*/ |
|
|
|
|
private void escAlphaFine(KeyEvent e) { |
|
|
|
|
if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { |
|
|
|
|
if (StringUtils.isBlank(searchTextField.getText()) || ComparatorUtils.equals(searchTextField.getText(), searchTextField.getPlaceHolder())) { |
|
|
|
|
AlphaFineDialog.this.setVisible(false); |
|
|
|
|
} else { |
|
|
|
|
searchTextField.setText(null); |
|
|
|
|
removeSearchResult(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* +-------------------------------------+ |
|
|
|
@ -907,7 +916,9 @@ public class AlphaFineDialog extends UIDialog {
|
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public void setSelectedIndex(int index) { |
|
|
|
|
if (index > 0 && checkSelectedIndex(index)) { |
|
|
|
|
if (index == 0 && getModel().getSize() > 1) { |
|
|
|
|
super.setSelectedIndex(1); |
|
|
|
|
} else if (index > 0 && checkSelectedIndex(index)) { |
|
|
|
|
int previousIndex = getSelectedIndex(); |
|
|
|
|
super.setSelectedIndex(index); |
|
|
|
|
AlphaCellModel cellModel = getSelectedValue(); |
|
|
|
@ -930,21 +941,6 @@ public class AlphaFineDialog extends UIDialog {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void initListListener() { |
|
|
|
|
addKeyListener(new KeyAdapter() { |
|
|
|
|
@Override |
|
|
|
|
public void keyPressed(KeyEvent e) { |
|
|
|
|
if (e.getKeyCode() == KeyEvent.VK_ENTER) { |
|
|
|
|
dealWithSearchResult(getSelectedValue()); |
|
|
|
|
} else if (e.getKeyCode() == KeyEvent.VK_UP) { |
|
|
|
|
if (getSelectedIndex() == 1) { |
|
|
|
|
searchTextField.requestFocus(); |
|
|
|
|
} |
|
|
|
|
} else if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { |
|
|
|
|
searchTextField.requestFocus(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
addMouseListener(new MouseAdapter() { |
|
|
|
|
@Override |
|
|
|
|
public void mouseClicked(MouseEvent e) { |
|
|
|
@ -968,6 +964,14 @@ public class AlphaFineDialog extends UIDialog {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
addKeyListener(new KeyAdapter() { |
|
|
|
|
@Override |
|
|
|
|
public void keyPressed(KeyEvent e) { |
|
|
|
|
escAlphaFine(e); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|