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/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(); + } + } + }; + } +} diff --git a/designer_base/src/com/fr/design/fun/TableDataPaneProcessor.java b/designer_base/src/com/fr/design/fun/TableDataPaneProcessor.java index dd4c8068a..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; /** @@ -25,6 +26,11 @@ public interface TableDataPaneProcessor extends Level { * 服务器数据集面板(模板数据集面板) * @return 服务器数据集面板 */ - TableDataPaneController createServerTableDataPane(); + 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); } 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