forked from fanruan/design
Browse Source
* commit '4fbe80e858c8d084c838fd8bebeda1ba59668ab5': fix pmd bug fix 国际化 代码质量 alphafine bug fix 去重 alphafine bug fix alphafine bug fix bug fix bug fix alphafine alphafine bug fix 改了几个类的类名 alphafine bug fix bug fix alphafine 异步搜索优化 中断 alphafine bug fix bug fix bug fix alphafine bug fixmaster
superman
8 years ago
33 changed files with 510 additions and 389 deletions
@ -0,0 +1,24 @@ |
|||||||
|
package com.fr.design.mainframe.alphafine.cell.model; |
||||||
|
|
||||||
|
import com.fr.design.mainframe.alphafine.CellType; |
||||||
|
import com.fr.json.JSONException; |
||||||
|
import com.fr.json.JSONObject; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by XiaXiang on 2017/6/8. |
||||||
|
*/ |
||||||
|
public class NoResultModel extends AlphaCellModel { |
||||||
|
public NoResultModel(String name) { |
||||||
|
super(name, null, CellType.NO_RESULT); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public JSONObject ModelToJson() throws JSONException { |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String getStoreInformation() { |
||||||
|
return null; |
||||||
|
} |
||||||
|
} |
@ -1,69 +0,0 @@ |
|||||||
package com.fr.design.mainframe.alphafine.search.manager; |
|
||||||
|
|
||||||
import com.fr.design.mainframe.alphafine.cell.model.MoreModel; |
|
||||||
import com.fr.design.mainframe.alphafine.model.SearchResult; |
|
||||||
import com.fr.general.Inter; |
|
||||||
|
|
||||||
/** |
|
||||||
* Created by XiaXiang on 2017/3/28. |
|
||||||
*/ |
|
||||||
public class AlphaSearchManager implements AlphaFineSearchProcessor { |
|
||||||
private static AlphaSearchManager searchManager; |
|
||||||
private static PluginSearchManager pluginSearchManager; |
|
||||||
private static DocumentSearchManager documentSearchManager; |
|
||||||
private static FileSearchManager fileSearchManager; |
|
||||||
private static ActionSearchManager actionSearchManager; |
|
||||||
private static RecommendSearchManager recommendSearchManager; |
|
||||||
private static RecentSearchManager recentSearchManager; |
|
||||||
|
|
||||||
public synchronized static AlphaSearchManager getSearchManager() { |
|
||||||
init(); |
|
||||||
return searchManager; |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
private synchronized static void init() { |
|
||||||
if (searchManager == null) { |
|
||||||
searchManager = new AlphaSearchManager(); |
|
||||||
pluginSearchManager = PluginSearchManager.getPluginSearchManager(); |
|
||||||
documentSearchManager = DocumentSearchManager.getDocumentSearchManager(); |
|
||||||
fileSearchManager = FileSearchManager.getFileSearchManager(); |
|
||||||
actionSearchManager = ActionSearchManager.getActionSearchManager(); |
|
||||||
recommendSearchManager = RecommendSearchManager.getRecommendSearchManager(); |
|
||||||
recentSearchManager = RecentSearchManager.getRecentSearchManger(); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public synchronized SearchResult getLessSearchResult(String searchText) { |
|
||||||
SearchResult recentModelList = recentSearchManager.getLessSearchResult(searchText); |
|
||||||
SearchResult recommendModelList = recommendSearchManager.getLessSearchResult(searchText); |
|
||||||
SearchResult actionModelList = actionSearchManager.getLessSearchResult(searchText); |
|
||||||
SearchResult fileModelList = fileSearchManager.getLessSearchResult(searchText); |
|
||||||
SearchResult documentModelList = documentSearchManager.getLessSearchResult(searchText); |
|
||||||
SearchResult pluginModelList = pluginSearchManager.getLessSearchResult(searchText); |
|
||||||
recentModelList.addAll(recommendModelList); |
|
||||||
recentModelList.addAll(actionModelList); |
|
||||||
recentModelList.addAll(fileModelList); |
|
||||||
recentModelList.addAll(documentModelList); |
|
||||||
recentModelList.addAll(pluginModelList); |
|
||||||
return recentModelList; |
|
||||||
} |
|
||||||
|
|
||||||
public SearchResult showDefaultSearchResult() { |
|
||||||
SearchResult searchResult = new SearchResult(); |
|
||||||
searchResult.add(new MoreModel(Inter.getLocText("FR-Designer_AlphaFine_Latest"))); |
|
||||||
searchResult.add(new MoreModel(Inter.getLocText("FR-Designer_AlphaFine_Conclude"))); |
|
||||||
searchResult.add(new MoreModel(Inter.getLocText("FR-Designer_Set"))); |
|
||||||
searchResult.add(new MoreModel(Inter.getLocText("FR-Designer_Templates"))); |
|
||||||
searchResult.add(new MoreModel(Inter.getLocText("FR-Designer_COMMUNITY_HELP"))); |
|
||||||
searchResult.add(new MoreModel(Inter.getLocText("FR-Designer-Plugin_Addon"))); |
|
||||||
return searchResult; |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public SearchResult getMoreSearchResult() { |
|
||||||
return null; |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
@ -0,0 +1,40 @@ |
|||||||
|
package com.fr.design.actions.help.alphafine; |
||||||
|
|
||||||
|
import java.util.ArrayList; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by XiaXiang on 2017/5/27. |
||||||
|
*/ |
||||||
|
public class AlphaFineContext { |
||||||
|
private static List<AlphaFineListener> fireAlphaFineListener = new ArrayList<AlphaFineListener>(); |
||||||
|
|
||||||
|
/** |
||||||
|
* 触发AlphaFine弹窗 |
||||||
|
*/ |
||||||
|
public static void fireAlphaFineShowDialog() { |
||||||
|
for (AlphaFineListener l : fireAlphaFineListener) { |
||||||
|
l.showDialog(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 触发开启或关闭AlphaFine功能 |
||||||
|
* @param isEnable |
||||||
|
*/ |
||||||
|
public static void fireAlphaFineEnable(boolean isEnable) { |
||||||
|
for (AlphaFineListener l : fireAlphaFineListener) { |
||||||
|
l.setEnable(isEnable); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 添加一个AlphaFine的监听事件 |
||||||
|
* |
||||||
|
* @param l AlphaFine监听事件 |
||||||
|
*/ |
||||||
|
public static void addAlphaFineListener(AlphaFineListener l) { |
||||||
|
fireAlphaFineListener.add(l); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,18 @@ |
|||||||
|
package com.fr.design.actions.help.alphafine; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by XiaXiang on 2017/5/27. |
||||||
|
* AlphaFine监听器 |
||||||
|
*/ |
||||||
|
public interface AlphaFineListener { |
||||||
|
/** |
||||||
|
* 显示dialog |
||||||
|
*/ |
||||||
|
void showDialog(); |
||||||
|
|
||||||
|
/** |
||||||
|
* 设置可用性 |
||||||
|
* @param isEnable |
||||||
|
*/ |
||||||
|
void setEnable(boolean isEnable); |
||||||
|
} |
@ -1,29 +0,0 @@ |
|||||||
package com.fr.design.actions.help.alphafine; |
|
||||||
|
|
||||||
import java.util.ArrayList; |
|
||||||
import java.util.List; |
|
||||||
|
|
||||||
/** |
|
||||||
* Created by XiaXiang on 2017/5/27. |
|
||||||
*/ |
|
||||||
public class AlphafineContext { |
|
||||||
private static List<AlphafineListener> fireLoginContextListener = new ArrayList<AlphafineListener>(); |
|
||||||
|
|
||||||
/** |
|
||||||
* 触发AlphaFine弹窗 |
|
||||||
*/ |
|
||||||
public static void fireAlphaFineContextListener() { |
|
||||||
for (AlphafineListener l : fireLoginContextListener) { |
|
||||||
l.showDialog(); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 添加一个弹出AlphaFine的监听事件 |
|
||||||
* |
|
||||||
* @param l AlphaFine框弹出监听事件 |
|
||||||
*/ |
|
||||||
public static void addAlphafineContextListener(AlphafineListener l) { |
|
||||||
fireLoginContextListener.add(l); |
|
||||||
} |
|
||||||
} |
|
@ -1,8 +0,0 @@ |
|||||||
package com.fr.design.actions.help.alphafine; |
|
||||||
|
|
||||||
/** |
|
||||||
* Created by XiaXiang on 2017/5/27. |
|
||||||
*/ |
|
||||||
public interface AlphafineListener { |
|
||||||
void showDialog(); |
|
||||||
} |
|
Loading…
Reference in new issue