Browse Source

隐藏功能

master
XiaXiang 8 years ago
parent
commit
230832651d
  1. 12
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  2. 5
      designer/src/com/fr/design/mainframe/alphafine/search/manager/ActionSearchManager.java
  3. 8
      designer/src/com/fr/design/mainframe/alphafine/search/manager/DocumentSearchManager.java
  4. 8
      designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java
  5. 6
      designer/src/com/fr/design/mainframe/alphafine/search/manager/PluginSearchManager.java

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

@ -268,21 +268,25 @@ public class AlphaFineDialog extends UIDialog {
private void rebuildList(String searchText) {
searchListModel.removeAllElements();
if (searchText.startsWith("k:1 ") || searchText.startsWith("k:setting ")) {
getActionList(searchText.substring(4, searchText.length()));
int index = searchText.indexOf(" ");
getActionList(searchText.substring(index + 1, searchText.length()));
return;
} else if (searchText.startsWith("k:2 ") || searchText.startsWith("k:help ")) {
getDocumentList(searchText.substring(4, searchText.length()));
int index = searchText.indexOf(" ");
getDocumentList(searchText.substring(index + 1, searchText.length()));
return;
} else if (searchText.startsWith("k:3 ") || searchText.startsWith("k:reportlets ")) {
getFileList(searchText.substring(4, searchText.length()));
int index = searchText.indexOf(" ");
getFileList(searchText.substring(index + 1, searchText.length()));
return;
} else if (searchText.startsWith("k:cpt ") || searchText.startsWith("k:frm ")) {
getFileList(searchText);
return;
} else if (searchText.startsWith("k:4 ") || searchText.startsWith("k:shop ")) {
getPluginList(searchText.substring(4, searchText.length()));
int index = searchText.indexOf(" ");
getPluginList(searchText.substring(index + 1, searchText.length()));
return;
}

5
designer/src/com/fr/design/mainframe/alphafine/search/manager/ActionSearchManager.java

@ -39,6 +39,11 @@ public class ActionSearchManager implements AlphaFineSearchProcessor {
filterModelList = new SearchResult();
lessModelList = new SearchResult();
moreModelList = new SearchResult();
if (StringUtils.isBlank(searchText)) {
lessModelList.add(TITLE_MODEL);
lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL);
return lessModelList;
}
if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainAction()) {
List<UpdateActionModel> updateActions = UpdateActionManager.getUpdateActionManager().getUpdateActions();
for (UpdateActionModel updateActionModel : updateActions) {

8
designer/src/com/fr/design/mainframe/alphafine/search/manager/DocumentSearchManager.java

@ -6,6 +6,7 @@ import com.fr.design.mainframe.alphafine.AlphaFineHelper;
import com.fr.design.mainframe.alphafine.CellType;
import com.fr.design.mainframe.alphafine.cell.model.DocumentModel;
import com.fr.design.mainframe.alphafine.cell.model.MoreModel;
import com.fr.design.mainframe.alphafine.cell.model.NoResultModel;
import com.fr.design.mainframe.alphafine.model.SearchResult;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
@ -13,6 +14,7 @@ import com.fr.general.http.HttpClient;
import com.fr.json.JSONArray;
import com.fr.json.JSONException;
import com.fr.json.JSONObject;
import com.fr.stable.StringUtils;
/**
* Created by XiaXiang on 2017/3/27.
@ -36,6 +38,11 @@ public class DocumentSearchManager implements AlphaFineSearchProcessor {
public synchronized SearchResult getLessSearchResult(String searchText) {
lessModelList = new SearchResult();
moreModelList = new SearchResult();
if (StringUtils.isBlank(searchText)) {
lessModelList.add(TITLE_MODEL);
lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL);
return lessModelList;
}
if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainDocument()) {
String result;
String url = AlphaFineConstants.DOCUMENT_SEARCH_URL + searchText + "-1";
@ -75,6 +82,7 @@ public class DocumentSearchManager implements AlphaFineSearchProcessor {
} catch (JSONException e) {
FRLogger.getLogger().error("document search error: " + e.getMessage());
return lessModelList;
}
}

8
designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java

@ -13,6 +13,7 @@ import com.fr.file.filetree.FileNode;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
import java.io.*;
@ -58,10 +59,17 @@ public class FileSearchManager implements AlphaFineSearchProcessor {
isContainFrm = false;
searchText = searchText.substring(MARK_LENGTH, searchText.length());
}
if (StringUtils.isBlank(searchText)) {
lessModelList.add(TITLE_MODEL);
lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL);
return lessModelList;
}
if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainTemplate()) {
Env env = FRContext.getCurrentEnv();
fileNodes = new ArrayList<>();
fileNodes = listTpl(env, ProjectConstants.REPORTLETS_NAME, true);
isContainCpt = true;
isContainFrm = true;
for (FileNode node : fileNodes) {
boolean isAlreadyContain = false;
String fileEnvPath = node.getEnvPath();

6
designer/src/com/fr/design/mainframe/alphafine/search/manager/PluginSearchManager.java

@ -14,6 +14,7 @@ import com.fr.general.http.HttpClient;
import com.fr.json.JSONArray;
import com.fr.json.JSONException;
import com.fr.json.JSONObject;
import com.fr.stable.StringUtils;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
@ -43,6 +44,11 @@ public class PluginSearchManager implements AlphaFineSearchProcessor {
public synchronized SearchResult getLessSearchResult(String searchText) {
this.lessModelList = new SearchResult();
this.moreModelList = new SearchResult();
if (StringUtils.isBlank(searchText)) {
lessModelList.add(TITLE_MODEL);
lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL);
return lessModelList;
}
if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainPlugin()) {
String result;
try {

Loading…
Cancel
Save