Browse Source

提升alphafine代码质量

research/10.0
alex.sung 6 years ago
parent
commit
f948fa32f0
  1. 36
      designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java
  2. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/ContentCellRender.java
  3. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ActionSearchManager.java
  4. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java
  5. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java
  6. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java
  7. 6
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java
  8. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java
  9. 3
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java
  10. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java
  11. 4
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java

36
designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java

@ -94,18 +94,18 @@ public class AlphaFineConfigManager implements XMLable {
@Override
public void readXML(XMLableReader reader) {
if (reader.isAttr()) {
this.setEnabled(reader.getAttrAsBoolean("enabled", true));
this.setSearchOnLine(reader.getAttrAsBoolean("searchOnline", true));
this.setContainPlugin(reader.getAttrAsBoolean("containDocument", true));
this.setContainDocument(reader.getAttrAsBoolean("containDocument", true));
this.setContainRecommend(reader.getAttrAsBoolean("containRecommend", true));
this.setContainAction(reader.getAttrAsBoolean("containAction", true));
this.setContainTemplate(reader.getAttrAsBoolean("containTemplate", true));
this.setContainFileContent(reader.getAttrAsBoolean("containFileContent", false));
this.setEnabled(reader.getAttrAsBoolean("isEnabled", true));
this.setSearchOnLine(reader.getAttrAsBoolean("isSearchOnline", true));
this.setContainPlugin(reader.getAttrAsBoolean("isContainDocument", true));
this.setContainDocument(reader.getAttrAsBoolean("isContainDocument", true));
this.setContainRecommend(reader.getAttrAsBoolean("isContainRecommend", true));
this.setContainAction(reader.getAttrAsBoolean("isContainAction", true));
this.setContainTemplate(reader.getAttrAsBoolean("isContainTemplate", true));
this.setContainFileContent(reader.getAttrAsBoolean("isContainFileContent", false));
this.setNeedSegmentationCheckbox(reader.getAttrAsBoolean("needSegmentationCheckbox", true));
this.setNeedIntelligentCustomerService(reader.getAttrAsBoolean("needIntelligentCustomerService", true));
this.setShortcuts(reader.getAttrAsString("shortcuts", getDefaultShortCuts()));
this.setNeedRemind(reader.getAttrAsBoolean("needRemind", true));
this.setNeedRemind(reader.getAttrAsBoolean("isNeedRemind", true));
this.setOperateCount(reader.getAttrAsInt("operateCount", 0));
}
@ -115,16 +115,16 @@ public class AlphaFineConfigManager implements XMLable {
@Override
public void writeXML(XMLPrintWriter writer) {
writer.startTAG("AlphaFineConfigManager");
writer.attr("enabled", this.isEnabled())
.attr("searchOnline", this.isSearchOnLine())
writer.attr("isEnabled", this.isEnabled())
.attr("isSearchOnline", this.isSearchOnLine())
.attr("shortcuts", this.getShortcuts())
.attr("containRecommend", this.isContainRecommend())
.attr("containAction", this.isContainAction())
.attr("containDocument", this.isContainDocument())
.attr("containTemplate", this.isContainTemplate())
.attr("containPlugin", this.isContainPlugin())
.attr("containFileContent", this.isContainFileContent())
.attr("needRemind", this.isNeedRemind())
.attr("isContainRecommend", this.isContainRecommend())
.attr("isContainAction", this.isContainAction())
.attr("isContainDocument", this.isContainDocument())
.attr("isContainTemplate", this.isContainTemplate())
.attr("isContainPlugin", this.isContainPlugin())
.attr("isContainFileContent", this.isContainFileContent())
.attr("isNeedRemind", this.isNeedRemind())
.attr("operateCount", this.getOperateCount())
.attr("needSegmentationCheckbox", this.isNeedSegmentationCheckbox())
.attr("needIntelligentCustomerService", this.isNeedIntelligentCustomerService());

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/ContentCellRender.java

@ -122,7 +122,7 @@ public class ContentCellRender implements ListCellRenderer<Object> {
private String getReplacedString(String modelName, String string) {
int index = modelName.toLowerCase().indexOf(string.toLowerCase());
if (index == -1) {
return "";
return StringUtils.EMPTY;
}
return modelName.substring(index, index + string.length());

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ActionSearchManager.java

@ -58,7 +58,7 @@ public class ActionSearchManager implements AlphaFineSearchProvider {
}
@Override
public synchronized SearchResult getLessSearchResult(String[] searchText) {
public SearchResult getLessSearchResult(String[] searchText) {
filterModelList = new SearchResult();
lessModelList = new SearchResult();
moreModelList = new SearchResult();

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java

@ -22,7 +22,7 @@ import com.fr.third.org.apache.commons.codec.digest.DigestUtils;
public class ComplementAdviceManager {
private static volatile ComplementAdviceManager instance;
private volatile SearchResult allModelList;
private SearchResult allModelList;
public static ComplementAdviceManager getInstance() {
if (instance == null) {

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java

@ -51,7 +51,7 @@ public class DocumentSearchManager implements AlphaFineSearchProvider {
}
@Override
public synchronized SearchResult getLessSearchResult(String[] searchText) {
public SearchResult getLessSearchResult(String[] searchText) {
lessModelList = new SearchResult();
moreModelList = new SearchResult();
if (ArrayUtils.isEmpty(searchText)) {

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java

@ -62,7 +62,7 @@ public class FileSearchManager implements AlphaFineSearchProvider {
return new FileModel(name, filePath, searchCount);
}
public synchronized SearchResult getLessSearchResult(String[] searchText) {
public SearchResult getLessSearchResult(String[] searchText) {
this.filterModelList = new SearchResult();
this.lessModelList = new SearchResult();
this.moreModelList = new SearchResult();

6
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java

@ -139,11 +139,7 @@ public class HotIssuesManager {
private String[] getSubTitleFromCloud(JSONObject data) {
ArrayList<String> list = new ArrayList<>();
for (int i = 0; i < HOT_SUB_ITEM_NUM; i++) {
String temp = null;
try {
temp = data.getString(HOT_ITEM + (i + 1));
} catch (JSONException e) {
}
String temp = data.optString(HOT_ITEM + (i + 1));
if (!StringUtils.isEmpty(temp)) {
list.add(temp);
}

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java

@ -96,7 +96,7 @@ public class PluginSearchManager implements AlphaFineSearchProvider {
}
@Override
public synchronized SearchResult getLessSearchResult(String[] searchText) {
public SearchResult getLessSearchResult(String[] searchText) {
if (ArrayUtils.isEmpty(searchText)) {
return new SearchResult();
}

3
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java

@ -134,6 +134,9 @@ public class RecentSearchManager implements AlphaFineSearchProvider {
* @param cellModel
*/
public void addModel(String searchKey, AlphaCellModel cellModel) {
if(cellModel == null){
return;
}
try {
initWriter();
Document doc = new Document();

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java

@ -47,7 +47,7 @@ public class RecommendSearchManager implements AlphaFineSearchProvider {
}
@Override
public synchronized SearchResult getLessSearchResult(String[] searchText) {
public SearchResult getLessSearchResult(String[] searchText) {
if (ArrayUtils.isEmpty(searchText)) {
return new SearchResult();

4
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java

@ -22,8 +22,8 @@ import com.fr.third.org.apache.commons.codec.digest.DigestUtils;
*/
public class SimilarSearchManeger implements AlphaFineSearchProvider {
private static volatile SimilarSearchManeger instance;
private volatile SearchResult lessModelList;
private volatile SearchResult moreModelList = new SearchResult();
private SearchResult lessModelList;
private SearchResult moreModelList = new SearchResult();
public static SimilarSearchManeger getInstance() {
if (instance == null) {

Loading…
Cancel
Save