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);
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() {
AlphaFineDialog.this.dispose();
final AlphaCellModel model = searchResultList.getSelectedValue();
@ -732,15 +746,15 @@ public class AlphaFineDialog extends UIDialog {
}
/**
* 保存本地本地常用
* 保存结果到本地本地常用
*
* @param cellModel
*/
private void saveHistory(AlphaCellModel cellModel) {
private void saveLocalHistory(AlphaCellModel cellModel) {
RecentSearchManager recentSearchManager = RecentSearchManager.getRecentSearchManger();
recentSearchManager.addRecentModel(storeText, cellModel);
recentSearchManager.saveXMLFile();
sendToServer(storeText, cellModel);
sendDataToServer(storeText, cellModel);
}
@ -750,7 +764,7 @@ public class AlphaFineDialog extends UIDialog {
* @param searchKey
* @param cellModel
*/
private void sendToServer(String searchKey, AlphaCellModel cellModel) {
private void sendDataToServer(String searchKey, AlphaCellModel cellModel) {
if (cellModel.isNeedToSendToServer()) {
String username = ConfigManager.getProviderInstance().getBbsUsername();
String uuid = DesignerEnvManager.getEnvManager().getUUID();
@ -908,8 +922,7 @@ public class AlphaFineDialog extends UIDialog {
@Override
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
doNavigate();
saveHistory(getSelectedValue());
dealWithSearchResult(getSelectedValue());
} else if (e.getKeyCode() == KeyEvent.VK_UP) {
if (getSelectedIndex() == 1) {
searchTextField.requestFocus();
@ -926,8 +939,7 @@ public class AlphaFineDialog extends UIDialog {
int selectedIndex = getSelectedIndex();
AlphaCellModel selectedValue = getSelectedValue();
if (e.getClickCount() == 2 && selectedValue.hasAction()) {
doNavigate();
saveHistory(selectedValue);
dealWithSearchResult(selectedValue);
} else if (e.getClickCount() == 1) {
if (selectedValue instanceof MoreModel && ((MoreModel) selectedValue).isNeedMore()) {
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.JSONObject;
import com.fr.stable.CodeUtils;
import com.fr.stable.StringUtils;
import java.util.Iterator;
import java.util.List;
@ -37,6 +38,7 @@ public class RecommendSearchManager implements AlphaFineSearchProcessor {
@Override
public synchronized SearchResult getLessSearchResult(String searchText) {
searchText = searchText.replaceAll(StringUtils.BLANK, StringUtils.EMPTY);
this.modelList = new SearchResult();
this.recommendModelList = new SearchResult();
if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainRecommend()) {

Loading…
Cancel
Save