Browse Source

设置加载动画

master
XiaXiang 7 years ago
parent
commit
aac41bc58a
  1. 23
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  2. BIN
      designer/src/com/fr/design/mainframe/alphafine/images/loading.gif
  3. 5
      designer/src/com/fr/design/mainframe/alphafine/search/manager/ActionSearchManager.java
  4. 7
      designer/src/com/fr/design/mainframe/alphafine/search/manager/DocumentSearchManager.java
  5. 5
      designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java
  6. 7
      designer/src/com/fr/design/mainframe/alphafine/search/manager/PluginSearchManager.java
  7. 4
      designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java
  8. 2
      designer/src/com/fr/design/mainframe/alphafine/search/manager/RecommendSearchManager.java

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

@ -14,7 +14,6 @@ import com.fr.design.mainframe.alphafine.cell.model.FileModel;
import com.fr.design.mainframe.alphafine.cell.model.MoreModel; import com.fr.design.mainframe.alphafine.cell.model.MoreModel;
import com.fr.design.mainframe.alphafine.cell.model.PluginModel; import com.fr.design.mainframe.alphafine.cell.model.PluginModel;
import com.fr.design.mainframe.alphafine.cell.render.ContentCellRender; import com.fr.design.mainframe.alphafine.cell.render.ContentCellRender;
import com.fr.design.mainframe.alphafine.listener.ComponentHandler;
import com.fr.design.mainframe.alphafine.listener.DocumentAdapter; import com.fr.design.mainframe.alphafine.listener.DocumentAdapter;
import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.design.mainframe.alphafine.model.SearchResult;
import com.fr.design.mainframe.alphafine.preview.ActionPreviewPane; import com.fr.design.mainframe.alphafine.preview.ActionPreviewPane;
@ -325,10 +324,24 @@ public class AlphaFineDialog extends UIDialog {
rebuildList(searchTextField.getText().toLowerCase()); rebuildList(searchTextField.getText().toLowerCase());
return null; return null;
} }
@Override
protected void done() {
if (!isCancelled()) {
fireStopLoading();
}
}
}; };
this.searchWorker.execute(); this.searchWorker.execute();
} }
/**
* 停止加载状态
*/
private void fireStopLoading() {
searchListModel.resetState();
}
/** /**
* 重新构建搜索结果列表 * 重新构建搜索结果列表
* 先根据输入判断是不是隐藏的搜索功能 * 先根据输入判断是不是隐藏的搜索功能
@ -979,7 +992,7 @@ public class AlphaFineDialog extends UIDialog {
public AlphaCellModel remove(int index) { public AlphaCellModel remove(int index) {
AlphaCellModel object = myDelegate.get(index); AlphaCellModel object = myDelegate.get(index);
myDelegate.remove(object); myDelegate.remove(object);
fireIntervalRemoved(this, index, index); fireContentsChanged(this, index, index);
return object; return object;
} }
@ -1007,6 +1020,12 @@ public class AlphaFineDialog extends UIDialog {
private void setValidSelected(boolean selected) { private void setValidSelected(boolean selected) {
isValidSelected = selected; isValidSelected = selected;
} }
public void resetState() {
for (int i = 0; i< getSize(); i++) {
getElementAt(i).resetState();
}
}
} }
} }

BIN
designer/src/com/fr/design/mainframe/alphafine/images/loading.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 10 KiB

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

@ -21,7 +21,6 @@ import java.util.List;
* Created by XiaXiang on 2017/3/27. * Created by XiaXiang on 2017/3/27.
*/ */
public class ActionSearchManager implements AlphaFineSearchProcessor { public class ActionSearchManager implements AlphaFineSearchProcessor {
private static final MoreModel TITLE_MODEL = new MoreModel(Inter.getLocText("FR-Designer_Set"));
private static ActionSearchManager actionSearchManager = null; private static ActionSearchManager actionSearchManager = null;
private SearchResult filterModelList; private SearchResult filterModelList;
private SearchResult lessModelList; private SearchResult lessModelList;
@ -58,7 +57,7 @@ public class ActionSearchManager implements AlphaFineSearchProcessor {
lessModelList = new SearchResult(); lessModelList = new SearchResult();
moreModelList = new SearchResult(); moreModelList = new SearchResult();
if (StringUtils.isBlank(searchText)) { if (StringUtils.isBlank(searchText)) {
lessModelList.add(TITLE_MODEL); lessModelList.add(new MoreModel(Inter.getLocText("FR-Designer_Set")));
return lessModelList; return lessModelList;
} }
if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainAction()) { if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainAction()) {
@ -78,7 +77,7 @@ public class ActionSearchManager implements AlphaFineSearchProcessor {
} }
if (result.size() < AlphaFineConstants.SHOW_SIZE + 1) { if (result.size() < AlphaFineConstants.SHOW_SIZE + 1) {
lessModelList.add(0, TITLE_MODEL); lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Set")));
if (result.size() == 0) { if (result.size() == 0) {
lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL); lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL);
} else { } else {

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

@ -19,7 +19,6 @@ import com.fr.stable.StringUtils;
* Created by XiaXiang on 2017/3/27. * Created by XiaXiang on 2017/3/27.
*/ */
public class DocumentSearchManager implements AlphaFineSearchProcessor { public class DocumentSearchManager implements AlphaFineSearchProcessor {
private static final MoreModel TITLE_MODEL = new MoreModel(Inter.getLocText("FR-Designer_COMMUNITY_HELP"));
private static DocumentSearchManager documentSearchManager = null; private static DocumentSearchManager documentSearchManager = null;
private SearchResult lessModelList; private SearchResult lessModelList;
private SearchResult moreModelList; private SearchResult moreModelList;
@ -51,7 +50,7 @@ public class DocumentSearchManager implements AlphaFineSearchProcessor {
lessModelList = new SearchResult(); lessModelList = new SearchResult();
moreModelList = new SearchResult(); moreModelList = new SearchResult();
if (StringUtils.isBlank(searchText)) { if (StringUtils.isBlank(searchText)) {
lessModelList.add(TITLE_MODEL); lessModelList.add(new MoreModel(Inter.getLocText("FR-Designer_COMMUNITY_HELP")));
return lessModelList; return lessModelList;
} }
if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainDocument()) { if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainDocument()) {
@ -78,7 +77,7 @@ public class DocumentSearchManager implements AlphaFineSearchProcessor {
} }
} }
if (searchResult.size() < AlphaFineConstants.SHOW_SIZE + 1) { if (searchResult.size() < AlphaFineConstants.SHOW_SIZE + 1) {
lessModelList.add(0, TITLE_MODEL); lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_COMMUNITY_HELP")));
if (searchResult.size() == 0) { if (searchResult.size() == 0) {
lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL); lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL);
} else { } else {
@ -105,7 +104,7 @@ public class DocumentSearchManager implements AlphaFineSearchProcessor {
*/ */
private SearchResult getNoConnectList() { private SearchResult getNoConnectList() {
SearchResult result = new SearchResult(); SearchResult result = new SearchResult();
result.add(0, TITLE_MODEL); result.add(0, new MoreModel(Inter.getLocText("FR-Designer_COMMUNITY_HELP")));
result.add(AlphaFineHelper.NO_CONNECTION_MODEL); result.add(AlphaFineHelper.NO_CONNECTION_MODEL);
return result; return result;
} }

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

@ -31,7 +31,6 @@ public class FileSearchManager implements AlphaFineSearchProcessor {
private static final String DS_NAME = "dsname=\""; private static final String DS_NAME = "dsname=\"";
private static final String FRM_PREFIX = "k:frm "; private static final String FRM_PREFIX = "k:frm ";
private static final String CPT_PREFIX = "k:cpt "; private static final String CPT_PREFIX = "k:cpt ";
private static final MoreModel TITLE_MODEL = new MoreModel(Inter.getLocText("FR-Designer_Templates"));
private static FileSearchManager fileSearchManager = null; private static FileSearchManager fileSearchManager = null;
private SearchResult filterModelList; private SearchResult filterModelList;
private SearchResult lessModelList; private SearchResult lessModelList;
@ -77,7 +76,7 @@ public class FileSearchManager implements AlphaFineSearchProcessor {
searchText = searchText.substring(MARK_LENGTH, searchText.length()); searchText = searchText.substring(MARK_LENGTH, searchText.length());
} }
if (StringUtils.isBlank(searchText) || ComparatorUtils.equals(searchText, DS_NAME)) { if (StringUtils.isBlank(searchText) || ComparatorUtils.equals(searchText, DS_NAME)) {
lessModelList.add(TITLE_MODEL); lessModelList.add(new MoreModel(Inter.getLocText("FR-Designer_Templates")));
return lessModelList; return lessModelList;
} }
@ -102,7 +101,7 @@ public class FileSearchManager implements AlphaFineSearchProcessor {
} }
if (result.size() < AlphaFineConstants.SHOW_SIZE + 1) { if (result.size() < AlphaFineConstants.SHOW_SIZE + 1) {
lessModelList.add(0, TITLE_MODEL); lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Templates")));
if (result.size() == 0) { if (result.size() == 0) {
lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL); lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL);
} else { } else {

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

@ -23,7 +23,6 @@ import java.net.URLEncoder;
* Created by XiaXiang on 2017/3/27. * Created by XiaXiang on 2017/3/27.
*/ */
public class PluginSearchManager implements AlphaFineSearchProcessor { public class PluginSearchManager implements AlphaFineSearchProcessor {
private static final MoreModel TITLE_MODEL = new MoreModel(Inter.getLocText("FR-Designer-Plugin_Addon"));
private static PluginSearchManager pluginSearchManager = null; private static PluginSearchManager pluginSearchManager = null;
private SearchResult lessModelList; private SearchResult lessModelList;
private SearchResult moreModelList; private SearchResult moreModelList;
@ -84,7 +83,7 @@ public class PluginSearchManager implements AlphaFineSearchProcessor {
this.lessModelList = new SearchResult(); this.lessModelList = new SearchResult();
this.moreModelList = new SearchResult(); this.moreModelList = new SearchResult();
if (StringUtils.isBlank(searchText)) { if (StringUtils.isBlank(searchText)) {
lessModelList.add(TITLE_MODEL); lessModelList.add(new MoreModel(Inter.getLocText("FR-Designer-Plugin_Addon")));
return lessModelList; return lessModelList;
} }
if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainPlugin()) { if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainPlugin()) {
@ -111,7 +110,7 @@ public class PluginSearchManager implements AlphaFineSearchProcessor {
} }
} }
if (searchResult.size() < AlphaFineConstants.SHOW_SIZE + 1) { if (searchResult.size() < AlphaFineConstants.SHOW_SIZE + 1) {
lessModelList.add(0, TITLE_MODEL); lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer-Plugin_Addon")));
if (searchResult.size() == 0) { if (searchResult.size() == 0) {
lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL); lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL);
} else { } else {
@ -134,7 +133,7 @@ public class PluginSearchManager implements AlphaFineSearchProcessor {
private SearchResult getNoConnectList() { private SearchResult getNoConnectList() {
SearchResult result = new SearchResult(); SearchResult result = new SearchResult();
result.add(0, TITLE_MODEL); result.add(0, new MoreModel(Inter.getLocText("FR-Designer-Plugin_Addon")));
result.add(AlphaFineHelper.NO_CONNECTION_MODEL); result.add(AlphaFineHelper.NO_CONNECTION_MODEL);
return result; return result;
} }

4
designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java

@ -272,11 +272,11 @@ public class RecentSearchManager extends XMLFileManager implements AlphaFineSear
@Override @Override
public SearchResult getLessSearchResult(String searchText) { public synchronized SearchResult getLessSearchResult(String searchText) {
this.modelList = new SearchResult(); this.modelList = new SearchResult();
recentModelList = getRecentModelList(searchText); recentModelList = getRecentModelList(searchText);
if (recentModelList != null && recentModelList.size() > 0) { if (recentModelList != null && recentModelList.size() > 0) {
modelList.add(new MoreModel(Inter.getLocText("FR-Designer_AlphaFine_Latest"), false)); modelList.add(new MoreModel(Inter.getLocText("FR-Designer_AlphaFine_Latest")));
} }
modelList.addAll(recentModelList); modelList.addAll(recentModelList);
return modelList; return modelList;

2
designer/src/com/fr/design/mainframe/alphafine/search/manager/RecommendSearchManager.java

@ -93,7 +93,7 @@ public class RecommendSearchManager implements AlphaFineSearchProcessor {
private SearchResult getNoConnectList() { private SearchResult getNoConnectList() {
SearchResult result = new SearchResult(); SearchResult result = new SearchResult();
result.add(0, new MoreModel(Inter.getLocText("FR-Designer_AlphaFine_Recommend"), false)); result.add(0, new MoreModel(Inter.getLocText("FR-Designer_AlphaFine_Recommend")));
result.add(AlphaFineHelper.NO_CONNECTION_MODEL); result.add(AlphaFineHelper.NO_CONNECTION_MODEL);
return result; return result;
} }

Loading…
Cancel
Save