From 3d73fade2ddd1d5a69298a7042db6e94647aaf43 Mon Sep 17 00:00:00 2001 From: vito Date: Wed, 18 May 2016 19:21:06 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=8A=A8=E6=80=81=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E5=88=86=E7=B1=BBapi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/extra/PluginWebBridge.java | 10 ++++++ .../exe/GetPluginCategoriesExecutor.java | 35 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 designer_base/src/com/fr/design/extra/exe/GetPluginCategoriesExecutor.java diff --git a/designer_base/src/com/fr/design/extra/PluginWebBridge.java b/designer_base/src/com/fr/design/extra/PluginWebBridge.java index 25d9c20cf..5c7c2e8a3 100644 --- a/designer_base/src/com/fr/design/extra/PluginWebBridge.java +++ b/designer_base/src/com/fr/design/extra/PluginWebBridge.java @@ -243,6 +243,16 @@ public class PluginWebBridge { new Thread(task).start(); } + /** + * 在线获取插件分类 + * + * @param callback 回调函数 + */ + public void getPluginCategories(final JSObject callback) { + Task task = new PluginTask<>(webEngine, callback, new GetPluginCategoriesExecutor()); + new Thread(task).start(); + } + /** * 展示一个重启的对话框(少用,莫名其妙会有bug) * diff --git a/designer_base/src/com/fr/design/extra/exe/GetPluginCategoriesExecutor.java b/designer_base/src/com/fr/design/extra/exe/GetPluginCategoriesExecutor.java new file mode 100644 index 000000000..81bdb8f8c --- /dev/null +++ b/designer_base/src/com/fr/design/extra/exe/GetPluginCategoriesExecutor.java @@ -0,0 +1,35 @@ +package com.fr.design.extra.exe; + +import com.fr.design.extra.Process; +import com.fr.general.SiteCenter; +import com.fr.general.http.HttpClient; + +/** + * Created by vito on 16/5/16. + */ +public class GetPluginCategoriesExecutor implements Executor { + private String result = "[]"; + + @Override + public String getTaskFinishMessage() { + return result; + } + + @Override + public Command[] getCommands() { + return new Command[]{ + new Command() { + @Override + public String getExecuteMessage() { + return null; + } + + @Override + public void run(Process process) { + HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("plugin.category")); + result = httpClient.getResponseText(); + } + } + }; + } +} From a5929659051b1b0a56824d5f79c368a7802c36c6 Mon Sep 17 00:00:00 2001 From: fr_shine Date: Thu, 19 May 2016 11:50:31 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/data/table/SeriesNameUseFieldNamePane.java | 6 +++++- .../chart/gui/data/table/SeriesNameUseFieldValuePane.java | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java index f9258bc81..b8fb5ae74 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java @@ -224,6 +224,10 @@ public class SeriesNameUseFieldNamePane extends FurtherBasicBeanPane data = seriesDataPane.updateBean(); diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java index a1eed2138..2d5099db4 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java @@ -278,7 +278,7 @@ public class SeriesNameUseFieldValuePane extends FurtherBasicBeanPane Date: Thu, 19 May 2016 18:35:15 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=8A=A0=E4=B8=AA=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/design/fun/TableDataPaneProcessor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/fun/TableDataPaneProcessor.java b/designer_base/src/com/fr/design/fun/TableDataPaneProcessor.java index dd4c8068a..3ed05bdf7 100644 --- a/designer_base/src/com/fr/design/fun/TableDataPaneProcessor.java +++ b/designer_base/src/com/fr/design/fun/TableDataPaneProcessor.java @@ -25,6 +25,6 @@ public interface TableDataPaneProcessor extends Level { * 服务器数据集面板(模板数据集面板) * @return 服务器数据集面板 */ - TableDataPaneController createServerTableDataPane(); + TableDataPaneController createServerTableDataPane(DesignModelAdapter tc); } From e3a8cdd999aa1cf05db368c9c02deea0db3f23d8 Mon Sep 17 00:00:00 2001 From: zack Date: Fri, 20 May 2016 09:39:50 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=88=86=E7=BB=84=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E6=8A=8Aaction=E5=BC=80=E5=87=BA=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/data/datapane/ReportTableDataPane.java | 4 +++- .../tabledata/tabledatapane/TableDataManagerPane.java | 4 +++- .../src/com/fr/design/fun/TableDataPaneProcessor.java | 6 ++++++ .../com/fr/design/mainframe/toolbar/ToolBarMenuDock.java | 8 +++++++- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/designer_base/src/com/fr/design/data/datapane/ReportTableDataPane.java b/designer_base/src/com/fr/design/data/datapane/ReportTableDataPane.java index 339a227a4..3b968f205 100644 --- a/designer_base/src/com/fr/design/data/datapane/ReportTableDataPane.java +++ b/designer_base/src/com/fr/design/data/datapane/ReportTableDataPane.java @@ -4,6 +4,7 @@ package com.fr.design.data.datapane; import com.fr.data.TableDataSource; +import com.fr.design.DesignModelAdapter; import com.fr.design.ExtraDesignClassManager; import com.fr.design.fun.TableDataPaneProcessor; import com.fr.design.gui.controlpane.NameableCreator; @@ -29,7 +30,8 @@ public class ReportTableDataPane extends LoadingBasicPane { TableDataPaneProcessor paneProcessor = ExtraDesignClassManager.getInstance().getTableDataPaneProcessor(); TableDataPaneController pane = null; if (paneProcessor != null) { - pane = paneProcessor.createServerTableDataPane(); + pane = paneProcessor.createServerTableDataPane(DesignModelAdapter.getCurrentModelAdapter() + ); } tdPane = pane == null ? new TableDataPaneListPane() { @Override diff --git a/designer_base/src/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java b/designer_base/src/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java index b2c8427af..daf2ed1f5 100644 --- a/designer_base/src/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java +++ b/designer_base/src/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java @@ -1,6 +1,7 @@ package com.fr.design.data.tabledata.tabledatapane; import com.fr.base.FRContext; +import com.fr.design.DesignModelAdapter; import com.fr.design.ExtraDesignClassManager; import com.fr.design.data.datapane.TableDataPaneController; import com.fr.design.data.datapane.TableDataPaneListPane; @@ -42,7 +43,8 @@ public class TableDataManagerPane extends LoadingBasicPane { TableDataPaneProcessor paneProcessor = ExtraDesignClassManager.getInstance().getTableDataPaneProcessor(); TableDataPaneController pane = null; if (paneProcessor != null) { - pane = paneProcessor.createServerTableDataPane(); + pane = paneProcessor.createServerTableDataPane(DesignModelAdapter.getCurrentModelAdapter() + ); } tableDataPane = pane == null ? new TableDataPaneListPane() { public void rename(String oldName, String newName) { diff --git a/designer_base/src/com/fr/design/fun/TableDataPaneProcessor.java b/designer_base/src/com/fr/design/fun/TableDataPaneProcessor.java index 3ed05bdf7..06db5c974 100644 --- a/designer_base/src/com/fr/design/fun/TableDataPaneProcessor.java +++ b/designer_base/src/com/fr/design/fun/TableDataPaneProcessor.java @@ -3,6 +3,7 @@ package com.fr.design.fun; import com.fr.design.DesignModelAdapter; import com.fr.design.data.BasicTableDataTreePane; import com.fr.design.data.datapane.TableDataPaneController; +import com.fr.design.menu.ShortCut; import com.fr.stable.fun.Level; /** @@ -27,4 +28,9 @@ public interface TableDataPaneProcessor extends Level { */ TableDataPaneController createServerTableDataPane(DesignModelAdapter tc); + /** + * 自定义服务器数据集菜单项 + * @return + */ + ShortCut createServerTDAction(); } diff --git a/designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index d0ecec9d6..ea8dd28e3 100644 --- a/designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -28,6 +28,7 @@ import com.fr.design.actions.server.PlatformManagerAction; import com.fr.design.actions.server.PluginManagerAction; import com.fr.design.file.NewTemplatePane; import com.fr.design.fun.MenuHandler; +import com.fr.design.fun.TableDataPaneProcessor; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.imenu.UIMenu; @@ -263,7 +264,7 @@ public abstract class ToolBarMenuDock { if (!BaseUtils.isAuthorityEditing()) { menuDef.addShortCut( new ConnectionListAction(), - new GlobalTableDataAction() + createGlobalTDAction() ); } @@ -288,6 +289,11 @@ public abstract class ToolBarMenuDock { return menuDef; } + private ShortCut createGlobalTDAction() { + TableDataPaneProcessor processor = ExtraDesignClassManager.getInstance().getTableDataPaneProcessor(); + return processor == null ? new GlobalTableDataAction() : processor.createServerTDAction(); + } + private boolean shouldShowPlugin() { return FRContext.isChineseEnv() || ComparatorUtils.equals(GeneralContext.getLocale(), Locale.TAIWAN); }