|
|
|
@ -162,10 +162,7 @@ public class AlphaFineDialog extends UIDialog {
|
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
public static AWTEventListener listener() { |
|
|
|
|
return new AWTEventListener() { |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void eventDispatched(AWTEvent event) { |
|
|
|
|
return event -> { |
|
|
|
|
if (event instanceof KeyEvent) { |
|
|
|
|
KeyEvent e = (KeyEvent) event; |
|
|
|
|
KeyStroke keyStroke = (KeyStroke) KeyStroke.getAWTKeyStrokeForEvent(e); |
|
|
|
@ -175,7 +172,6 @@ public class AlphaFineDialog extends UIDialog {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -513,7 +509,8 @@ public class AlphaFineDialog extends UIDialog {
|
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private String getStoreText(String searchText) { |
|
|
|
|
setStoreText(searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length())); |
|
|
|
|
//这里也需要先做一个去除不需要空格的处理
|
|
|
|
|
setStoreText((searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1)).replaceAll(StringUtils.BLANK, StringUtils.EMPTY)); |
|
|
|
|
return storeText; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -616,9 +613,7 @@ public class AlphaFineDialog extends UIDialog {
|
|
|
|
|
rightSearchResultPane.removeAll(); |
|
|
|
|
try { |
|
|
|
|
rightSearchResultPane.add(new FilePreviewPane(get())); |
|
|
|
|
} catch (InterruptedException e) { |
|
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
|
} catch (ExecutionException e) { |
|
|
|
|
} catch (InterruptedException | ExecutionException e) { |
|
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
|
} |
|
|
|
|
validate(); |
|
|
|
@ -651,9 +646,7 @@ public class AlphaFineDialog extends UIDialog {
|
|
|
|
|
rightSearchResultPane.add(new FilePreviewPane(get())); |
|
|
|
|
validate(); |
|
|
|
|
repaint(); |
|
|
|
|
} catch (InterruptedException e) { |
|
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
|
} catch (ExecutionException e) { |
|
|
|
|
} catch (InterruptedException | ExecutionException e) { |
|
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -876,7 +869,7 @@ public class AlphaFineDialog extends UIDialog {
|
|
|
|
|
searchText = searchText.toLowerCase(); |
|
|
|
|
Pattern p = Pattern.compile(AlphaFineConstants.SPECIAL_CHARACTER_REGEX); |
|
|
|
|
Matcher m = p.matcher(searchText); |
|
|
|
|
searchText = m.replaceAll("").trim().replaceAll(" ", ""); |
|
|
|
|
searchText = m.replaceAll(StringUtils.EMPTY).trim().replaceAll(StringUtils.BLANK, StringUtils.EMPTY); |
|
|
|
|
if (searchText.length() == 0) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
@ -897,9 +890,7 @@ public class AlphaFineDialog extends UIDialog {
|
|
|
|
|
* 当鼠标在搜索界面边界外点击时触发 |
|
|
|
|
*/ |
|
|
|
|
private void initAWTEventListener() { |
|
|
|
|
Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() { |
|
|
|
|
@Override |
|
|
|
|
public void eventDispatched(AWTEvent event) { |
|
|
|
|
Toolkit.getDefaultToolkit().addAWTEventListener(event -> { |
|
|
|
|
if (!AlphaFineDialog.this.isVisible()) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
@ -915,7 +906,6 @@ public class AlphaFineDialog extends UIDialog {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, AWTEvent.MOUSE_EVENT_MASK | AWTEvent.KEY_EVENT_MASK); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -944,15 +934,12 @@ public class AlphaFineDialog extends UIDialog {
|
|
|
|
|
if (cellModel instanceof BottomModel) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
Thread sendThread = new Thread(new Runnable() { |
|
|
|
|
@Override |
|
|
|
|
public void run() { |
|
|
|
|
Thread sendThread = new Thread(() -> { |
|
|
|
|
if (StringUtils.isNotEmpty(storeText)) { |
|
|
|
|
RecentSearchManager searchManager = RecentSearchManager.getInstance(); |
|
|
|
|
searchManager.addModel(storeText, cellModel); |
|
|
|
|
sendDataToServer(storeText, cellModel); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
sendThread.start(); |
|
|
|
|
} |
|
|
|
@ -1178,13 +1165,10 @@ public class AlphaFineDialog extends UIDialog {
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
addListSelectionListener(new ListSelectionListener() { |
|
|
|
|
@Override |
|
|
|
|
public void valueChanged(ListSelectionEvent e) { |
|
|
|
|
addListSelectionListener(e -> { |
|
|
|
|
if (!e.getValueIsAdjusting() && getSelectedValue() != null) { |
|
|
|
|
showResult(getSelectedValue()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
addMouseMotionListener(new MouseMotionListener() { |
|
|
|
|