Browse Source

Merge pull request #1198 in BA/design from ~XIAOXIA/design:release/9.0 to release/9.0

* commit '5711d43fb1a2a06679c234a200c3d00ab0f6a77a':
  换张图
  快捷键响应
  rt
master
superman 7 years ago
parent
commit
b33adf186b
  1. 28
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  2. BIN
      designer/src/com/fr/design/mainframe/alphafine/images/bigloading.gif
  3. 2
      designer/src/com/fr/design/mainframe/alphafine/search/manager/RecommendSearchManager.java

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

@ -670,6 +670,8 @@ public class AlphaFineDialog extends UIDialog {
searchTextField.setText(null); searchTextField.setText(null);
removeSearchResult(); removeSearchResult();
} }
} else if (e.getKeyCode() == KeyEvent.VK_ENTER) {
dealWithSearchResult(searchResultList.getSelectedValue());
} }
} }
}); });
@ -694,6 +696,15 @@ public class AlphaFineDialog extends UIDialog {
} }
/**
* 处理搜索结果
* @param selectedValue
*/
private void dealWithSearchResult(AlphaCellModel selectedValue) {
doNavigate();
saveLocalHistory(selectedValue);
}
/** /**
* 当鼠标在搜索界面边界外点击时触发 * 当鼠标在搜索界面边界外点击时触发
*/ */
@ -725,6 +736,9 @@ public class AlphaFineDialog extends UIDialog {
//不处理 //不处理
} }
/**
* 导航到结果页面
*/
private void doNavigate() { private void doNavigate() {
AlphaFineDialog.this.dispose(); AlphaFineDialog.this.dispose();
final AlphaCellModel model = searchResultList.getSelectedValue(); final AlphaCellModel model = searchResultList.getSelectedValue();
@ -732,15 +746,15 @@ public class AlphaFineDialog extends UIDialog {
} }
/** /**
* 保存本地本地常用 * 保存结果到本地本地常用
* *
* @param cellModel * @param cellModel
*/ */
private void saveHistory(AlphaCellModel cellModel) { private void saveLocalHistory(AlphaCellModel cellModel) {
RecentSearchManager recentSearchManager = RecentSearchManager.getRecentSearchManger(); RecentSearchManager recentSearchManager = RecentSearchManager.getRecentSearchManger();
recentSearchManager.addRecentModel(storeText, cellModel); recentSearchManager.addRecentModel(storeText, cellModel);
recentSearchManager.saveXMLFile(); recentSearchManager.saveXMLFile();
sendToServer(storeText, cellModel); sendDataToServer(storeText, cellModel);
} }
@ -750,7 +764,7 @@ public class AlphaFineDialog extends UIDialog {
* @param searchKey * @param searchKey
* @param cellModel * @param cellModel
*/ */
private void sendToServer(String searchKey, AlphaCellModel cellModel) { private void sendDataToServer(String searchKey, AlphaCellModel cellModel) {
if (cellModel.isNeedToSendToServer()) { if (cellModel.isNeedToSendToServer()) {
String username = ConfigManager.getProviderInstance().getBbsUsername(); String username = ConfigManager.getProviderInstance().getBbsUsername();
String uuid = DesignerEnvManager.getEnvManager().getUUID(); String uuid = DesignerEnvManager.getEnvManager().getUUID();
@ -908,8 +922,7 @@ public class AlphaFineDialog extends UIDialog {
@Override @Override
public void keyPressed(KeyEvent e) { public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) { if (e.getKeyCode() == KeyEvent.VK_ENTER) {
doNavigate(); dealWithSearchResult(getSelectedValue());
saveHistory(getSelectedValue());
} else if (e.getKeyCode() == KeyEvent.VK_UP) { } else if (e.getKeyCode() == KeyEvent.VK_UP) {
if (getSelectedIndex() == 1) { if (getSelectedIndex() == 1) {
searchTextField.requestFocus(); searchTextField.requestFocus();
@ -926,8 +939,7 @@ public class AlphaFineDialog extends UIDialog {
int selectedIndex = getSelectedIndex(); int selectedIndex = getSelectedIndex();
AlphaCellModel selectedValue = getSelectedValue(); AlphaCellModel selectedValue = getSelectedValue();
if (e.getClickCount() == 2 && selectedValue.hasAction()) { if (e.getClickCount() == 2 && selectedValue.hasAction()) {
doNavigate(); dealWithSearchResult(selectedValue);
saveHistory(selectedValue);
} else if (e.getClickCount() == 1) { } else if (e.getClickCount() == 1) {
if (selectedValue instanceof MoreModel && ((MoreModel) selectedValue).isNeedMore()) { if (selectedValue instanceof MoreModel && ((MoreModel) selectedValue).isNeedMore()) {
dealWithMoreOrLessResult(selectedIndex, (MoreModel) selectedValue); dealWithMoreOrLessResult(selectedIndex, (MoreModel) selectedValue);

BIN
designer/src/com/fr/design/mainframe/alphafine/images/bigloading.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 19 KiB

2
designer/src/com/fr/design/mainframe/alphafine/search/manager/RecommendSearchManager.java

@ -16,6 +16,7 @@ import com.fr.json.JSONArray;
import com.fr.json.JSONException; import com.fr.json.JSONException;
import com.fr.json.JSONObject; import com.fr.json.JSONObject;
import com.fr.stable.CodeUtils; import com.fr.stable.CodeUtils;
import com.fr.stable.StringUtils;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
@ -37,6 +38,7 @@ public class RecommendSearchManager implements AlphaFineSearchProcessor {
@Override @Override
public synchronized SearchResult getLessSearchResult(String searchText) { public synchronized SearchResult getLessSearchResult(String searchText) {
searchText = searchText.replaceAll(StringUtils.BLANK, StringUtils.EMPTY);
this.modelList = new SearchResult(); this.modelList = new SearchResult();
this.recommendModelList = new SearchResult(); this.recommendModelList = new SearchResult();
if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainRecommend()) { if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainRecommend()) {

Loading…
Cancel
Save