Browse Source

Merge remote-tracking branch 'origin/release/9.0' into release/9.0

master
mengao 7 years ago
parent
commit
545c14955c
  1. 134
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  2. 4
      designer/src/com/fr/design/mainframe/alphafine/preview/PluginPreviewPane.java
  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. 8
      designer/src/com/fr/design/mainframe/alphafine/search/manager/PluginSearchManager.java
  7. 10
      designer/src/com/fr/start/CollectUserInformationDialog.java
  8. 5
      designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java
  9. 6
      designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

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

@ -71,6 +71,7 @@ public class AlphaFineDialog extends UIDialog {
private static final String PLUGIN_MARK_SHORT = "k:4 "; private static final String PLUGIN_MARK_SHORT = "k:4 ";
private static final String PLUGIN_MARK = "k:shop "; private static final String PLUGIN_MARK = "k:shop ";
private static final String PLACE_HOLDER = Inter.getLocText("FR-Designer_AlphaFine"); private static final String PLACE_HOLDER = Inter.getLocText("FR-Designer_AlphaFine");
private static final int MAX_SHOW_SIZE = 12;
private AlphaFineTextField searchTextField; private AlphaFineTextField searchTextField;
private UIButton closeButton; private UIButton closeButton;
@ -89,7 +90,6 @@ public class AlphaFineDialog extends UIDialog {
//是否强制打开,因为面板是否关闭绑定了全局鼠标事件,这里需要处理一下 //是否强制打开,因为面板是否关闭绑定了全局鼠标事件,这里需要处理一下
private boolean forceOpen; private boolean forceOpen;
public AlphaFineDialog(Frame parent, boolean forceOpen) { public AlphaFineDialog(Frame parent, boolean forceOpen) {
super(parent); super(parent);
this.forceOpen = forceOpen; this.forceOpen = forceOpen;
@ -161,12 +161,6 @@ public class AlphaFineDialog extends UIDialog {
}); });
topPane.add(closeButton, BorderLayout.EAST); topPane.add(closeButton, BorderLayout.EAST);
add(topPane, BorderLayout.CENTER); add(topPane, BorderLayout.CENTER);
searchTextField.getDocument().addDocumentListener(new DocumentAdapter() {
@Override
protected void textChanged(DocumentEvent e) {
doSearch(searchTextField.getText());
}
});
} }
/** /**
@ -174,7 +168,7 @@ public class AlphaFineDialog extends UIDialog {
*/ */
private void initSearchTextField() { private void initSearchTextField() {
searchTextField = new AlphaFineTextField(PLACE_HOLDER); searchTextField = new AlphaFineTextField(PLACE_HOLDER);
initTextFieldKeyListener(); initTextFieldListener();
searchTextField.setFont(AlphaFineConstants.GREATER_FONT); searchTextField.setFont(AlphaFineConstants.GREATER_FONT);
searchTextField.setBackground(Color.WHITE); searchTextField.setBackground(Color.WHITE);
searchTextField.setBorderPainted(false); searchTextField.setBorderPainted(false);
@ -228,16 +222,11 @@ public class AlphaFineDialog extends UIDialog {
* @param text * @param text
*/ */
private void doSearch(String text) { private void doSearch(String text) {
showSearchResult(text);
if (StringUtils.isBlank(text) || isNeedSearch(text)) {
removeSearchResult();
} else {
showSearchResult();
}
} }
boolean isNeedSearch(String text) { boolean isNoNeedSearch(String text) {
return ComparatorUtils.equals(PLACE_HOLDER, text) || text.contains("'"); return ComparatorUtils.equals(PLACE_HOLDER, text) || text.contains("'") || StringUtils.isBlank(text);
} }
@Override @Override
@ -272,17 +261,17 @@ public class AlphaFineDialog extends UIDialog {
searchResultPane = null; searchResultPane = null;
} }
setSize(AlphaFineConstants.FIELD_SIZE); setSize(AlphaFineConstants.FIELD_SIZE);
repaint(); refreshContainer();
} }
/** /**
* 展示搜索结果 * 展示搜索结果
*/ */
private void showSearchResult() { private void showSearchResult(String text) {
if (searchResultPane == null) { if (searchResultPane == null) {
initSearchResultComponents(); initSearchResultComponents();
} }
initSearchWorker(); initSearchWorker(text);
} }
/** /**
@ -299,8 +288,8 @@ public class AlphaFineDialog extends UIDialog {
searchResultList.setCellRenderer(new ContentCellRender()); searchResultList.setCellRenderer(new ContentCellRender());
leftSearchResultPane = new UIScrollPane(searchResultList); leftSearchResultPane = new UIScrollPane(searchResultList);
leftSearchResultPane.setBorder(null);
leftSearchResultPane.setBackground(Color.WHITE); leftSearchResultPane.setBackground(Color.WHITE);
leftSearchResultPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
leftSearchResultPane.setPreferredSize(new Dimension(AlphaFineConstants.LEFT_WIDTH, AlphaFineConstants.CONTENT_HEIGHT)); leftSearchResultPane.setPreferredSize(new Dimension(AlphaFineConstants.LEFT_WIDTH, AlphaFineConstants.CONTENT_HEIGHT));
rightSearchResultPane = new JPanel(); rightSearchResultPane = new JPanel();
rightSearchResultPane.setBackground(Color.WHITE); rightSearchResultPane.setBackground(Color.WHITE);
@ -317,7 +306,7 @@ public class AlphaFineDialog extends UIDialog {
/** /**
* 异步加载搜索结果 * 异步加载搜索结果
*/ */
private void initSearchWorker() { private void initSearchWorker(final String text) {
if (this.searchWorker != null && !this.searchWorker.isDone()) { if (this.searchWorker != null && !this.searchWorker.isDone()) {
this.searchWorker.cancel(true); this.searchWorker.cancel(true);
this.searchWorker = null; this.searchWorker = null;
@ -325,9 +314,7 @@ public class AlphaFineDialog extends UIDialog {
this.searchWorker = new SwingWorker() { this.searchWorker = new SwingWorker() {
@Override @Override
protected Object doInBackground() throws Exception { protected Object doInBackground() throws Exception {
resumeLeftPane(); rebuildList(text);
splitLabel.setIcon(new ImageIcon(getClass().getResource("/com/fr/design/mainframe/alphafine/images/bigloading.gif")));
rebuildList(searchTextField.getText().toLowerCase());
return null; return null;
} }
@ -347,11 +334,9 @@ public class AlphaFineDialog extends UIDialog {
*/ */
private void resumeLeftPane() { private void resumeLeftPane() {
if (searchResultPane != null && defaultPane != null) { if (searchResultPane != null && defaultPane != null) {
rightSearchResultPane.removeAll();
searchResultPane.remove(defaultPane); searchResultPane.remove(defaultPane);
defaultPane = null; defaultPane = null;
searchResultPane.add(leftSearchResultPane, BorderLayout.WEST); searchResultPane.add(leftSearchResultPane, BorderLayout.WEST);
refreshContainer();
} }
} }
@ -394,25 +379,26 @@ public class AlphaFineDialog extends UIDialog {
*/ */
private void rebuildList(String searchText) { private void rebuildList(String searchText) {
resetContainer(); resetContainer();
if (searchText.startsWith(ADVANCED_SEARCH_MARK)) { if (searchText.startsWith(ADVANCED_SEARCH_MARK)) {
if (searchText.startsWith(ACTION_MARK_SHORT) || searchText.startsWith(ACTION_MARK)) { if (searchText.startsWith(ACTION_MARK_SHORT) || searchText.startsWith(ACTION_MARK)) {
storeText = searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length()); storeText = searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length());
getActionList(storeText); buildActionList(storeText);
} else if (searchText.startsWith(DOCUMENT_MARK_SHORT) || searchText.startsWith(DOCUMENT_MARK)) { } else if (searchText.startsWith(DOCUMENT_MARK_SHORT) || searchText.startsWith(DOCUMENT_MARK)) {
storeText = searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length()); storeText = searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length());
getDocumentList(storeText); buildDocumentList(storeText);
} else if (searchText.startsWith(FILE_MARK_SHORT) || searchText.startsWith(FILE_MARK)) { } else if (searchText.startsWith(FILE_MARK_SHORT) || searchText.startsWith(FILE_MARK)) {
storeText = searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length()); storeText = searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length());
getFileList(storeText); buildFileList(storeText);
} else if (searchText.startsWith(CPT_MARK) || searchText.startsWith(FRM_MARK)) { } else if (searchText.startsWith(CPT_MARK) || searchText.startsWith(FRM_MARK)) {
storeText = searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length()); storeText = searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length());
getFileList(searchText); buildFileList(searchText);
} else if (searchText.startsWith(DS_MARK)) { } else if (searchText.startsWith(DS_MARK)) {
storeText = searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length()); storeText = searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length());
getFileList(DS_NAME + storeText); buildFileList(DS_NAME + storeText);
} else if (searchText.startsWith(PLUGIN_MARK_SHORT) || searchText.startsWith(PLUGIN_MARK)) { } else if (searchText.startsWith(PLUGIN_MARK_SHORT) || searchText.startsWith(PLUGIN_MARK)) {
storeText = searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length()); storeText = searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length());
getPluginList(storeText); buildPluginList(storeText);
} }
} else { } else {
storeText = searchText.trim(); storeText = searchText.trim();
@ -425,9 +411,11 @@ public class AlphaFineDialog extends UIDialog {
* 重置面板 * 重置面板
*/ */
private void resetContainer() { private void resetContainer() {
rightSearchResultPane.removeAll();
splitLabel.setIcon(new ImageIcon(getClass().getResource("/com/fr/design/mainframe/alphafine/images/bigloading.gif")));
resumeLeftPane();
searchListModel.removeAllElements(); searchListModel.removeAllElements();
searchListModel.resetSelectedState(); searchListModel.resetSelectedState();
rightSearchResultPane.removeAll();
refreshContainer(); refreshContainer();
} }
@ -437,23 +425,22 @@ public class AlphaFineDialog extends UIDialog {
* @param searchText * @param searchText
*/ */
private void doNormalSearch(String searchText) { private void doNormalSearch(String searchText) {
getRecentList(searchText); buildRecentList(searchText);
getRecommendList(searchText); buildRecommendList(searchText);
getActionList(searchText); buildActionList(searchText);
getFileList(searchText); buildFileList(searchText);
getDocumentList(searchText); buildDocumentList(searchText);
getPluginList(searchText); buildPluginList(searchText);
} }
private void getDocumentList(final String searchText) { private void buildDocumentList(final String searchText) {
SearchResult documentModelList = DocumentSearchManager.getDocumentSearchManager().getLessSearchResult(searchText); SearchResult documentModelList = DocumentSearchManager.getDocumentSearchManager().getLessSearchResult(searchText);
for (AlphaCellModel object : documentModelList) { for (AlphaCellModel object : documentModelList) {
AlphaFineHelper.checkCancel();
searchListModel.addElement(object); searchListModel.addElement(object);
} }
} }
private void getFileList(final String searchText) { private void buildFileList(final String searchText) {
SearchResult fileModelList = FileSearchManager.getFileSearchManager().getLessSearchResult(searchText); SearchResult fileModelList = FileSearchManager.getFileSearchManager().getLessSearchResult(searchText);
for (AlphaCellModel object : fileModelList) { for (AlphaCellModel object : fileModelList) {
AlphaFineHelper.checkCancel(); AlphaFineHelper.checkCancel();
@ -461,34 +448,30 @@ public class AlphaFineDialog extends UIDialog {
} }
} }
private void getActionList(final String searchText) { private void buildActionList(final String searchText) {
SearchResult actionModelList = ActionSearchManager.getActionSearchManager().getLessSearchResult(searchText); SearchResult actionModelList = ActionSearchManager.getActionSearchManager().getLessSearchResult(searchText);
for (AlphaCellModel object : actionModelList) { for (AlphaCellModel object : actionModelList) {
AlphaFineHelper.checkCancel();
searchListModel.addElement(object); searchListModel.addElement(object);
} }
} }
private void getPluginList(final String searchText) { private void buildPluginList(final String searchText) {
SearchResult pluginModelList = PluginSearchManager.getPluginSearchManager().getLessSearchResult(searchText); SearchResult pluginModelList = PluginSearchManager.getPluginSearchManager().getLessSearchResult(searchText);
for (AlphaCellModel object : pluginModelList) { for (AlphaCellModel object : pluginModelList) {
AlphaFineHelper.checkCancel();
searchListModel.addElement(object); searchListModel.addElement(object);
} }
} }
private void getRecommendList(final String searchText) { private void buildRecommendList(final String searchText) {
SearchResult recommendModelList = RecommendSearchManager.getRecommendSearchManager().getLessSearchResult(searchText); SearchResult recommendModelList = RecommendSearchManager.getRecommendSearchManager().getLessSearchResult(searchText);
for (AlphaCellModel object : recommendModelList) { for (AlphaCellModel object : recommendModelList) {
AlphaFineHelper.checkCancel();
searchListModel.addElement(object); searchListModel.addElement(object);
} }
} }
private void getRecentList(final String searchText) { private void buildRecentList(final String searchText) {
SearchResult recentModelList = RecentSearchManager.getRecentSearchManger().getLessSearchResult(searchText); SearchResult recentModelList = RecentSearchManager.getRecentSearchManger().getLessSearchResult(searchText);
for (AlphaCellModel object : recentModelList) { for (AlphaCellModel object : recentModelList) {
AlphaFineHelper.checkCancel();
searchListModel.addElement(object); searchListModel.addElement(object);
} }
@ -639,11 +622,10 @@ public class AlphaFineDialog extends UIDialog {
} }
} }
private void HandleMoreOrLessResult(int index, MoreModel selectedValue) { private void dealWithMoreOrLessResult(int index, MoreModel selectedValue) {
if (selectedValue.getContent().equals(Inter.getLocText("FR-Designer_AlphaFine_ShowAll"))) { if (ComparatorUtils.equals(Inter.getLocText("FR-Designer_AlphaFine_ShowAll"), selectedValue.getContent())) {
selectedValue.setContent(Inter.getLocText("FR-Designer_AlphaFine_ShowLess")); selectedValue.setContent(Inter.getLocText("FR-Designer_AlphaFine_ShowLess"));
rebuildShowMoreList(index, selectedValue); rebuildShowMoreList(index, selectedValue);
} else { } else {
selectedValue.setContent(Inter.getLocText("FR-Designer_AlphaFine_ShowAll")); selectedValue.setContent(Inter.getLocText("FR-Designer_AlphaFine_ShowAll"));
rebuildShowMoreList(index, selectedValue); rebuildShowMoreList(index, selectedValue);
@ -655,8 +637,7 @@ public class AlphaFineDialog extends UIDialog {
UILabel label = new UILabel(new ImageIcon(getClass().getResource("/com/fr/design/mainframe/alphafine/images/opening.gif"))); UILabel label = new UILabel(new ImageIcon(getClass().getResource("/com/fr/design/mainframe/alphafine/images/opening.gif")));
label.setBorder(BorderFactory.createEmptyBorder(120, 0, 0, 0)); label.setBorder(BorderFactory.createEmptyBorder(120, 0, 0, 0));
rightSearchResultPane.add(label, BorderLayout.CENTER); rightSearchResultPane.add(label, BorderLayout.CENTER);
validate(); refreshContainer();
repaint();
} }
/** /**
@ -667,18 +648,15 @@ public class AlphaFineDialog extends UIDialog {
} }
/** /**
* 为textfield添加键盘监听器 * 为textfield添加监听器
*/ */
private void initTextFieldKeyListener() { private void initTextFieldListener() {
searchTextField.addKeyListener(new KeyAdapter() { searchTextField.addKeyListener(new KeyAdapter() {
@Override @Override
public void keyPressed(KeyEvent e) { public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_DOWN) { if (e.getKeyCode() == KeyEvent.VK_DOWN) {
searchResultList.requestFocus(); searchResultList.requestFocus();
searchResultList.setSelectedIndex(searchResultList.getSelectedIndex() + 1); searchResultList.setSelectedIndex(searchResultList.getSelectedIndex() + 1);
} else if (e.getKeyCode() == KeyEvent.VK_ENTER) {
doNavigate();
saveHistory(searchResultList.getSelectedValue());
} }
} }
@ -690,7 +668,25 @@ public class AlphaFineDialog extends UIDialog {
AlphaFineDialog.this.setVisible(false); AlphaFineDialog.this.setVisible(false);
} else { } else {
searchTextField.setText(null); searchTextField.setText(null);
removeSearchResult();
}
}
}
});
searchTextField.getDocument().addDocumentListener(new DocumentAdapter() {
@Override
protected void textChanged(DocumentEvent e) {
if (isNoNeedSearch(searchTextField.getText())) {
removeSearchResult();
} else {
try {
Thread.sleep(10);
doSearch(searchTextField.getText());
} catch (InterruptedException e1) {
FRLogger.getLogger().error(e1.getMessage());
} }
} }
} }
}); });
@ -726,7 +722,7 @@ public class AlphaFineDialog extends UIDialog {
@Override @Override
public void checkValid() throws Exception { public void checkValid() throws Exception {
//不处理
} }
private void doNavigate() { private void doNavigate() {
@ -778,7 +774,6 @@ public class AlphaFineDialog extends UIDialog {
if (!httpClient.isServerAlive()) { if (!httpClient.isServerAlive()) {
FRLogger.getLogger().error("Failed to sent data to server!"); FRLogger.getLogger().error("Failed to sent data to server!");
} }
httpClient.setTimeout(5000);
} }
@ -935,7 +930,7 @@ public class AlphaFineDialog extends UIDialog {
saveHistory(selectedValue); saveHistory(selectedValue);
} else if (e.getClickCount() == 1) { } else if (e.getClickCount() == 1) {
if (selectedValue instanceof MoreModel && ((MoreModel) selectedValue).isNeedMore()) { if (selectedValue instanceof MoreModel && ((MoreModel) selectedValue).isNeedMore()) {
HandleMoreOrLessResult(selectedIndex, (MoreModel) selectedValue); dealWithMoreOrLessResult(selectedIndex, (MoreModel) selectedValue);
} }
} }
} }
@ -971,10 +966,23 @@ public class AlphaFineDialog extends UIDialog {
@Override @Override
public void addElement(AlphaCellModel element) { public void addElement(AlphaCellModel element) {
AlphaFineHelper.checkCancel();
int index = myDelegate.size(); int index = myDelegate.size();
myDelegate.add(element); myDelegate.add(element);
fireContentsChanged(this, index, index); fireContentsChanged(this, index, index);
fireSelectedStateChanged(element, index); fireSelectedStateChanged(element, index);
}
@Override
protected void fireContentsChanged(Object source, int index0, int index1) {
if (myDelegate.size() > MAX_SHOW_SIZE) {
leftSearchResultPane.getVerticalScrollBar().setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));
leftSearchResultPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 2));
} else {
leftSearchResultPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
}
super.fireContentsChanged(source, index0, index1);
} }
/** /**

4
designer/src/com/fr/design/mainframe/alphafine/preview/PluginPreviewPane.java

@ -49,10 +49,10 @@ public class PluginPreviewPane extends JPanel {
nameLabel.setBackground(AlphaFineConstants.BLUE); nameLabel.setBackground(AlphaFineConstants.BLUE);
nameLabel.setBorder(BorderFactory.createEmptyBorder(20, 20, 10, 20)); nameLabel.setBorder(BorderFactory.createEmptyBorder(20, 20, 10, 20));
line.setBorder(BorderFactory.createEmptyBorder(20, 0, 10, 0)); line.setBorder(BorderFactory.createEmptyBorder(20, 0, 10, 0));
String price0 = price == 0 ? Inter.getLocText("FR-Designer-Collect_Information_free") : String.valueOf(price); String price0 = price == 0 ? Inter.getLocText("FR-Designer-Collect_Information_free") : "¥" + String.valueOf(price);
UILabel priceLabel = new UILabel(price0); UILabel priceLabel = new UILabel(price0);
priceLabel.setForeground(AlphaFineConstants.RED); priceLabel.setForeground(AlphaFineConstants.RED);
priceLabel.setFont(AlphaFineConstants.SMALL_FONT); priceLabel.setFont(AlphaFineConstants.MEDIUM_FONT);
bottomPane.add(priceLabel, BorderLayout.WEST); bottomPane.add(priceLabel, BorderLayout.WEST);
panel.add(nameLabel, BorderLayout.NORTH); panel.add(nameLabel, BorderLayout.NORTH);
panel.add(line, BorderLayout.SOUTH); panel.add(line, BorderLayout.SOUTH);

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

@ -75,10 +75,9 @@ public class ActionSearchManager implements AlphaFineSearchProcessor {
result.add(object); result.add(object);
} }
} }
if (result.size() == 0) { if (result.isEmpty()) {
return lessModelList; return lessModelList;
} } else if (result.size() < AlphaFineConstants.SHOW_SIZE + 1) {
if (result.size() > 0 && result.size() < AlphaFineConstants.SHOW_SIZE + 1) {
lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Set"))); lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Set")));
lessModelList.addAll(result); lessModelList.addAll(result);
} else { } else {

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

@ -61,7 +61,6 @@ public class DocumentSearchManager implements AlphaFineSearchProcessor {
if (!httpClient.isServerAlive()) { if (!httpClient.isServerAlive()) {
return getNoConnectList(); return getNoConnectList();
} }
httpClient.setTimeout(5000);
result = httpClient.getResponseText(); result = httpClient.getResponseText();
AlphaFineHelper.checkCancel(); AlphaFineHelper.checkCancel();
try { try {
@ -76,10 +75,9 @@ public class DocumentSearchManager implements AlphaFineSearchProcessor {
searchResult.add(cellModel); searchResult.add(cellModel);
} }
} }
if (searchResult.size() == 0) { if (searchResult.isEmpty()) {
return lessModelList; return lessModelList;
} } else if (searchResult.size() < AlphaFineConstants.SHOW_SIZE + 1) {
if (searchResult.size() > 0 && searchResult.size() < AlphaFineConstants.SHOW_SIZE + 1) {
lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_COMMUNITY_HELP"))); lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_COMMUNITY_HELP")));
lessModelList.addAll(searchResult); lessModelList.addAll(searchResult);
} else { } else {
@ -90,7 +88,6 @@ public class DocumentSearchManager implements AlphaFineSearchProcessor {
} }
} catch (JSONException e) { } catch (JSONException e) {
FRLogger.getLogger().error("document search error: " + e.getMessage()); FRLogger.getLogger().error("document search error: " + e.getMessage());
return lessModelList;
} }
} }
return lessModelList; return lessModelList;

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

@ -100,10 +100,9 @@ public class FileSearchManager implements AlphaFineSearchProcessor {
} }
} }
if (result.size() == 0) { if (result.isEmpty()) {
return lessModelList; return lessModelList;
} } else if (result.size() < AlphaFineConstants.SHOW_SIZE + 1) {
if (result.size() > 0 && result.size() < AlphaFineConstants.SHOW_SIZE + 1) {
lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Templates"))); lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Templates")));
lessModelList.addAll(result); lessModelList.addAll(result);
} else { } else {

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

@ -96,7 +96,6 @@ public class PluginSearchManager implements AlphaFineSearchProcessor {
if (!httpClient.isServerAlive()) { if (!httpClient.isServerAlive()) {
return getNoConnectList(); return getNoConnectList();
} }
httpClient.setTimeout(5000);
result = httpClient.getResponseText(); result = httpClient.getResponseText();
AlphaFineHelper.checkCancel(); AlphaFineHelper.checkCancel();
JSONObject jsonObject = new JSONObject(result); JSONObject jsonObject = new JSONObject(result);
@ -109,11 +108,10 @@ public class PluginSearchManager implements AlphaFineSearchProcessor {
searchResult.add(cellModel); searchResult.add(cellModel);
} }
} }
if (searchResult.size() == 0) { if (searchResult.isEmpty()) {
return this.lessModelList; return this.lessModelList;
} } else if (searchResult.size() < AlphaFineConstants.SHOW_SIZE + 1) {
if (searchResult.size() > 0 && searchResult.size() < AlphaFineConstants.SHOW_SIZE + 1) { lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer-Plugin_Addon")));
lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Templates")));
lessModelList.addAll(searchResult); lessModelList.addAll(searchResult);
} else { } else {
lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer-Plugin_Addon"), Inter.getLocText("FR-Designer_AlphaFine_ShowAll"), true, CellType.PLUGIN)); lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer-Plugin_Addon"), Inter.getLocText("FR-Designer_AlphaFine_ShowAll"), true, CellType.PLUGIN));

10
designer/src/com/fr/start/CollectUserInformationDialog.java

@ -14,6 +14,7 @@ import com.fr.design.mainframe.ActiveKeyGenerator;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.SiteCenter;
import com.fr.stable.OperatingSystem; import com.fr.stable.OperatingSystem;
import javax.swing.*; import javax.swing.*;
@ -28,12 +29,13 @@ import java.util.Locale;
public class CollectUserInformationDialog extends UIDialog { public class CollectUserInformationDialog extends UIDialog {
private static final String CN_LOGIN_HTML = "http://www.finereport.com/products/frlogin";
private static final String EN_LOGIN_HTML = "http://www.finereport.com/en/frlogin";
private static final String TW_LOGIN_HTML = "http://www.finereport.com/tw/products/frlogin";
private static final String JP_LOGIN_HTML = "http://www.finereport.com/jp/products/frlogin";
private static final int ONLINE_VERIFY_TIMEOUT = 30 * 1000; private static final int ONLINE_VERIFY_TIMEOUT = 30 * 1000;
private static final String CN_LOGIN_HTML = SiteCenter.getInstance().acquireUrlByKind("frlogin.cn");
private static final String EN_LOGIN_HTML = SiteCenter.getInstance().acquireUrlByKind("frlogin.en");
private static final String TW_LOGIN_HTML = SiteCenter.getInstance().acquireUrlByKind("frlogin.tw");
private static final String JP_LOGIN_HTML = SiteCenter.getInstance().acquireUrlByKind("frlogin.jp");
private UITextField keyTextField; private UITextField keyTextField;
private DescriptionTextArea descriptionTextArea; private DescriptionTextArea descriptionTextArea;

5
designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java

@ -202,10 +202,7 @@ public class AlphaFineConfigManager implements XMLable {
} }
public boolean isEnabled() { public boolean isEnabled() {
if (VT4FR.isLicAvailable(FRCoreContext.getBytes()) && VT4FR.ALPHA_FINE.support()) { return isEnabled;
return isEnabled;
}
return false;
} }
public void setEnabled(boolean isEnabled) { public void setEnabled(boolean isEnabled) {

6
designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -381,10 +381,8 @@ public abstract class ToolBarMenuDock {
// shortCuts.add(new ForumAction()); // shortCuts.add(new ForumAction());
} }
shortCuts.add(SeparatorDef.DEFAULT); shortCuts.add(SeparatorDef.DEFAULT);
if (VT4FR.isLicAvailable(FRCoreContext.getBytes()) && VT4FR.ALPHA_FINE.support()) { shortCuts.add(new AlphaFineAction());
shortCuts.add(new AlphaFineAction()); shortCuts.add(SeparatorDef.DEFAULT);
shortCuts.add(SeparatorDef.DEFAULT);
}
shortCuts.add(new AboutAction()); shortCuts.add(new AboutAction());
return shortCuts.toArray(new ShortCut[shortCuts.size()]); return shortCuts.toArray(new ShortCut[shortCuts.size()]);
} }

Loading…
Cancel
Save