|
|
|
@ -22,7 +22,7 @@ public class TemplateResourceSearchWorkerManager implements SearchManager {
|
|
|
|
|
|
|
|
|
|
private AlphaFineFrame alphaFineFrame; |
|
|
|
|
|
|
|
|
|
private volatile boolean hasSearchResult = true; |
|
|
|
|
private volatile boolean searchResult = true; |
|
|
|
|
|
|
|
|
|
private volatile boolean searchOver = false; |
|
|
|
|
|
|
|
|
@ -58,37 +58,36 @@ public class TemplateResourceSearchWorkerManager implements SearchManager {
|
|
|
|
|
if (!isCancelled()) { |
|
|
|
|
try { |
|
|
|
|
List<TemplateResource> list = get(); |
|
|
|
|
hasSearchResult = !list.isEmpty(); |
|
|
|
|
searchResult = !list.isEmpty(); |
|
|
|
|
showResult(list); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
this.searchWorker.execute(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void showResult(List<TemplateResource> list) { |
|
|
|
|
if (networkError && !hasSearchResult) { |
|
|
|
|
alphaFineFrame.showResult(AlphaFineConstants.NETWORK_ERROR); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
void showResult(List<TemplateResource> list) { |
|
|
|
|
if (networkError && !searchResult) { |
|
|
|
|
alphaFineFrame.showResult(AlphaFineConstants.NETWORK_ERROR); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (alphaFineFrame.getSelectedType() == cellType) { |
|
|
|
|
if (!hasSearchResult) { |
|
|
|
|
alphaFineFrame.showResult(CellType.NO_RESULT.getFlagStr4None()); |
|
|
|
|
} else { |
|
|
|
|
TemplateShopPane.getInstance().refreshPagePane(list); |
|
|
|
|
AlphaFineHelper.getAlphaFineDialog().showResult(cellType.getFlagStr4None()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (alphaFineFrame.getSelectedType() == cellType) { |
|
|
|
|
if (!searchResult) { |
|
|
|
|
alphaFineFrame.showResult(CellType.NO_RESULT.getFlagStr4None()); |
|
|
|
|
} else { |
|
|
|
|
TemplateShopPane.getInstance().refreshPagePane(list); |
|
|
|
|
AlphaFineHelper.getAlphaFineDialog().showResult(cellType.getFlagStr4None()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
this.searchWorker.execute(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public boolean hasSearchResult() { |
|
|
|
|
return hasSearchResult; |
|
|
|
|
return searchResult; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|