Browse Source

代码质量

master
XiaXiang 8 years ago
parent
commit
213acb8172
  1. 15
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  2. 14
      designer/src/com/fr/design/mainframe/alphafine/searchManager/RecentSearchManager.java

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

@ -595,7 +595,7 @@ public class AlphaFineDialog extends UIDialog {
httpClient.setTimeout(5000); httpClient.setTimeout(5000);
httpClient.asGet(); httpClient.asGet();
if (!httpClient.isServerAlive()) { if (!httpClient.isServerAlive()) {
FRLogger.getLogger().error("404"); FRLogger.getLogger().error("Failed to sent data to server!");
} }
} }
@ -626,10 +626,6 @@ public class AlphaFineDialog extends UIDialog {
repaint(); repaint();
} }
private void updatePopup() {
}
private SearchResult getMoreResult(MoreModel selectedValue) { private SearchResult getMoreResult(MoreModel selectedValue) {
SearchResult moreResult; SearchResult moreResult;
switch (selectedValue.getType()) { switch (selectedValue.getType()) {
@ -655,14 +651,6 @@ public class AlphaFineDialog extends UIDialog {
return (SearchListModel) searchResultList.getModel(); return (SearchListModel) searchResultList.getModel();
} }
// //测试
// public static void main(String[] args) {
// AlphaFineDialog alphaFineDialog = new AlphaFineDialog(DesignerContext.getDesignerFrame());
// alphaFineDialog.setSize(new Dimension(680,55));
// alphaFineDialog.setVisible(true);
// }
public SearchListModel setListModel(SearchListModel jListModel) { public SearchListModel setListModel(SearchListModel jListModel) {
this.searchListModel = jListModel; this.searchListModel = jListModel;
return this.searchListModel; return this.searchListModel;
@ -676,4 +664,5 @@ public class AlphaFineDialog extends UIDialog {
this.searchWorker = searchWorker; this.searchWorker = searchWorker;
} }
} }

14
designer/src/com/fr/design/mainframe/alphafine/searchManager/RecentSearchManager.java

@ -89,15 +89,19 @@ public class RecentSearchManager extends XMLFileManager implements AlphaFineSear
String nodeName = reader.getTagName(); String nodeName = reader.getTagName();
if (nodeName.equals("model")) { if (nodeName.equals("model")) {
String name = reader.getAttrAsString("cellModel", StringUtils.EMPTY); String name = reader.getAttrAsString("cellModel", StringUtils.EMPTY);
try { addModelToList(list, name);
list.add(CellModelHelper.getModelFromJson(new JSONObject(name)));
} catch (JSONException e) {
FRLogger.getLogger().error(e.getMessage());
}
} }
} }
} }
private void addModelToList(List<AlphaCellModel> list, String name) {
try {
list.add(CellModelHelper.getModelFromJson(new JSONObject(name)));
} catch (JSONException e) {
FRLogger.getLogger().error(e.getMessage());
}
}
@Override @Override
public void writeXML(XMLPrintWriter writer) { public void writeXML(XMLPrintWriter writer) {
writer.startTAG(XML_TAG); writer.startTAG(XML_TAG);

Loading…
Cancel
Save