Browse Source

Merge branch 'release/10.0' of https://cloud.finedevelop.com/scm/~bjorn/design into release/10.0

feature/big-screen
白岳 4 years ago
parent
commit
10e3e4e013
  1. 3
      designer-base/src/main/java/com/fr/design/extra/exe/GetPluginCategoriesExecutor.java
  2. 4
      designer-base/src/main/java/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java
  3. 10
      designer-base/src/main/java/com/fr/design/extra/exe/SearchOnlineExecutor.java
  4. 28
      designer-base/src/main/java/com/fr/design/formula/JavaEditorPane.java
  5. 10
      designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java

3
designer-base/src/main/java/com/fr/design/extra/exe/GetPluginCategoriesExecutor.java

@ -4,6 +4,7 @@ import com.fr.design.extra.PluginConstants;
import com.fr.design.extra.Process;
import com.fr.general.CloudCenter;
import com.fr.general.http.HttpClient;
import com.fr.stable.StringUtils;
/**
* Created by vito on 16/5/16.
@ -28,7 +29,7 @@ public class GetPluginCategoriesExecutor implements Executor {
@Override
public void run(Process<String> process) {
String url = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.category");
if (url != null) {
if (StringUtils.isNotEmpty(url)) {
HttpClient httpClient = new HttpClient(url);
result = httpClient.getResponseText();
} else {

4
designer-base/src/main/java/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java

@ -52,7 +52,7 @@ public class GetPluginFromStoreExecutor implements Executor {
@Override
public void run(Process<String> process) {
String plistUrl = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.plist") + "?";
String plistUrl = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.plist");
boolean getRecommend = StringUtils.isEmpty(category) && StringUtils.isEmpty(seller) && StringUtils.isEmpty(fee) && StringUtils.isEmpty(scope);
if (getRecommend) {
result = PluginOperateUtils.getRecommendPlugins();
@ -61,7 +61,7 @@ public class GetPluginFromStoreExecutor implements Executor {
if (StringUtils.isNotBlank(plistUrl)) {
StringBuilder url = new StringBuilder();
url.append(plistUrl);
url.append(plistUrl).append("?");
PluginOperateUtils.dealParams(url, category, seller, fee, scope);
try {
HttpClient httpClient = new HttpClient(url.toString());

10
designer-base/src/main/java/com/fr/design/extra/exe/SearchOnlineExecutor.java

@ -14,8 +14,8 @@ import com.fr.stable.StringUtils;
* Created by vito on 16/4/18.
*/
public class SearchOnlineExecutor implements Executor {
private String result = StringUtils.EMPTY;
private String keyword;
private String result = JSONArray.create().toString();
private final String keyword;
public SearchOnlineExecutor(String keyword) {
this.keyword = keyword;
@ -42,7 +42,11 @@ public class SearchOnlineExecutor implements Executor {
result = PluginOperateUtils.getRecommendPlugins();
return;
}
HttpClient httpClient = new HttpClient(CloudCenter.getInstance().acquireUrlByKind("shop.plugin.store") + "&keyword=" + keyword);
String url = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.store");
if (StringUtils.isEmpty(url)) {
return;
}
HttpClient httpClient = new HttpClient(url + "&keyword=" + keyword);
httpClient.asGet();
String responseText = httpClient.getResponseText();
JSONObject jsonObject = new JSONObject(responseText);

28
designer-base/src/main/java/com/fr/design/formula/JavaEditorPane.java

@ -220,8 +220,8 @@ public class JavaEditorPane extends BasicPane {
" }\n" +
"\n" +
" /**\n" +
" * 获取数据集的列数\n" +
" * @return 数据集的列\n" +
" * Get the number of columns in a dataset\n" +
" * @return Dataset columns\n" +
" * @throws TableDataException\n" +
" */\n" +
" public int getColumnCount() throws TableDataException {\n" +
@ -229,9 +229,9 @@ public class JavaEditorPane extends BasicPane {
" }\n" +
"\n" +
" /**\n" +
" * 获取数据集指定列的列名\n" +
" * @param columnIndex 指定列的索引\n" +
" * @return 指定列的列名\n" +
" * Get the column name of the specified column of the dataset\n" +
" * @param columnIndex The index of the specified column\n" +
" * @return The column name of the specified column\n" +
" * @throws TableDataException\n" +
" */\n" +
" public String getColumnName(int columnIndex) throws TableDataException {\n" +
@ -239,8 +239,8 @@ public class JavaEditorPane extends BasicPane {
" }\n" +
"\n" +
" /**\n" +
" * 获取数据集的行数\n" +
" * @return 数据集数据行数\n" +
" * Get the number of rows in the dataset\n" +
" * @return Dataset rows\n" +
" * @throws TableDataException\n" +
" */\n" +
" public int getRowCount() throws TableDataException {\n" +
@ -248,10 +248,10 @@ public class JavaEditorPane extends BasicPane {
" }\n" +
"\n" +
" /**\n" +
" * 获取数据集指定位置上的值\n" +
" * @param rowIndex 指定的行索引\n" +
" * @param columnIndex 指定的列索引\n" +
" * @return 指定位置的值\n" +
" * Get the value at the specified position in the dataset\n" +
" * @param rowIndex The specified row index\n" +
" * @param columnIndex The specified column index\n" +
" * @return The value of the specified location\n" +
" */\n" +
" public Object getValueAt(int rowIndex, int columnIndex) {\n" +
" return null;\n" +
@ -263,12 +263,12 @@ public class JavaEditorPane extends BasicPane {
"import com.fr.script.AbstractFunction;\n" +
"\n" +
"/**\n" +
" * 自定义函数\n" +
" * Custom function\n" +
" */\n" +
"public class CustomFun extends AbstractFunction {\n" +
" /**\n" +
" * @param args 函数的参数,是经过了算子处理了其中特殊参数的\n" +
" * @return 经过函数处理的值,用于参与最终计算\n" +
" * @param args The parameters of the function are processed by calculator with special parameters\n" +
" * @return The value processed by the function is used to participate in the final calculation\n" +
" */\n" +
" public Object run(Object[] args) {\n" +
" return null;\n" +

10
designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java

@ -91,10 +91,10 @@ public class TableViewList extends UIList {
if (refreshList != null) {
refreshList.cancel(true);
}
refreshList = new SwingWorker<Void, Void>() {
refreshList = new SwingWorker<DefaultListModel, Void>() {
@Override
protected Void doInBackground() throws Exception {
protected DefaultListModel doInBackground() throws Exception {
Connection datasource = ConnectionConfig.getInstance().getConnection(databaseName);
boolean status = false;
int count = 3;
@ -106,13 +106,13 @@ public class TableViewList extends UIList {
if (!status) {
throw new Exception(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed"));
}
TableViewList.this.setModel(processDataInAnotherThread(databaseName, searchFilter, typesFilter));
return null;
return processDataInAnotherThread(databaseName, searchFilter, typesFilter);
}
@Override
public void done() {
try {
get();
TableViewList.this.setModel(get());
} catch (Exception e) {
if (!(e instanceof InterruptedException) && !(e instanceof CancellationException)) {
TableViewList.this.setModel(failed);

Loading…
Cancel
Save