From 2556a97285093cd4ba16b4168fae43e182ba7f52 Mon Sep 17 00:00:00 2001 From: loy Date: Wed, 20 Jan 2021 15:57:21 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-46916=20=E6=96=B0=E5=BC=95=E6=93=8E?= =?UTF-8?q?=E5=86=85=E7=BD=AE=EF=BC=8C=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=BB=93=E6=9E=84=EF=BC=8C=E9=80=82=E9=85=8D=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/file}/BatchCompileAction.java | 2 +- .../actions/server}/LocalAnalyzerAction.java | 2 +- .../gui/itree/filetree/FileTreeIcon.java | 12 ++++ .../com/fr/design/mainframe/JTemplate.java | 22 +++++- .../fr/design}/preview/PagePlusPreview.java | 4 +- .../java/com/fr/file/FILEChooserPane.java | 1 + .../designer/cell/CellTreeAttrPanel.java | 0 .../cell/CellTreeAttrPanelProvider.java | 0 .../cptx/io/DesignReadWritableProvider.java | 0 .../monitor/DesignerMetricRecorder.java | 0 .../designer/toolbar/CompileAction.java | 0 .../designer/toolbar/TemplateTransformer.java | 0 .../designer/toolbar/TransformResult.java | 0 .../designer/toolbar/TransformResultInfo.java | 0 .../transform/BatchTransformProgress.java | 0 .../transform/BatchTransformUtil.java | 0 .../designer/transform/BatchTransformer.java | 0 .../designer/transform/UpdateCallBack.java | 0 .../transform/ui/BatchTransformDialog.java | 0 .../transform/ui/BatchTransformPane.java | 0 .../ui/PrepareTransformFileList.java | 0 .../transform/ui/TransformFileTree.java | 0 .../transform/ui/TransformPreparePane.java | 0 .../transform/ui/TransformResultList.java | 0 .../transform/ui/TransformResultPane.java | 0 .../ui/UIListControlCellRenderer.java | 0 .../transform/ui/UpdateProgressDialog.java | 0 .../transform/ui/UpdateProgressPane.java | 0 .../designer/utils/CompileTransformUtil.java | 0 .../designer/utils/DesignerCptxFileUtils.java | 0 .../toolbar/TemplateTransformerDebugTest.java | 0 .../toolbar/TemplateTransformerTest.java | 0 .../toolbar/TransformResultInfoTest.java | 0 .../transform/BatchTransformProgressTest.java | 0 .../transform/BatchTransformUtilTest.java | 0 .../transform/BatchTransformerTest.java | 0 .../utils/CompileTransformUtilTest.java | 0 .../com/fr/design/mainframe/JWorkBook.java | 4 +- .../mainframe/app/DesignerAppActivator.java | 3 +- .../java/com/fr/plugin/designer/CptxApp.java | 6 -- .../designer/EnginexSupportedFileUIImpl.java | 51 -------------- .../com/fr/plugin/designer/JStreamBook.java | 8 +++ .../com/fr/plugin/designer/StartupAssist.java | 20 ------ .../com/fr/plugin/designer/WritableCptx.java | 29 -------- .../designer/menu/BatchCompileMenu.java | 36 ---------- .../designer/menu/CalculateAttrMenu.java | 69 ------------------- .../designer/menu/LocalAnalyzerMenu.java | 37 ---------- .../toolbar/TemplateTransformerUIButton.java | 20 ------ .../main/java/com/fr/start/MainDesigner.java | 2 + .../EnginexSupportedFileUIImplTest.java | 26 ------- .../clean/CompileCleanManagerTest.java | 42 ----------- .../designer/menu/BatchCompileMenuTest.java | 16 ----- 52 files changed, 51 insertions(+), 361 deletions(-) rename {designer-realize/src/main/java/com/fr/plugin/designer/menu => designer-base/src/main/java/com/fr/design/actions/file}/BatchCompileAction.java (97%) rename {designer-realize/src/main/java/com/fr/plugin/designer/menu => designer-base/src/main/java/com/fr/design/actions/server}/LocalAnalyzerAction.java (97%) rename {designer-realize/src/main/java/com/fr/plugin/designer => designer-base/src/main/java/com/fr/design}/preview/PagePlusPreview.java (91%) rename {designer-realize => designer-base}/src/main/java/com/fr/plugin/designer/cell/CellTreeAttrPanel.java (100%) rename {designer-realize => designer-base}/src/main/java/com/fr/plugin/designer/cell/CellTreeAttrPanelProvider.java (100%) rename {designer-realize => designer-base}/src/main/java/com/fr/plugin/designer/cptx/io/DesignReadWritableProvider.java (100%) rename {designer-realize => designer-base}/src/main/java/com/fr/plugin/designer/monitor/DesignerMetricRecorder.java (100%) rename {designer-realize => designer-base}/src/main/java/com/fr/plugin/designer/toolbar/CompileAction.java (100%) rename {designer-realize => designer-base}/src/main/java/com/fr/plugin/designer/toolbar/TemplateTransformer.java (100%) rename {designer-realize => designer-base}/src/main/java/com/fr/plugin/designer/toolbar/TransformResult.java (100%) rename {designer-realize => designer-base}/src/main/java/com/fr/plugin/designer/toolbar/TransformResultInfo.java (100%) rename {designer-realize => designer-base}/src/main/java/com/fr/plugin/designer/transform/BatchTransformProgress.java (100%) rename {designer-realize => designer-base}/src/main/java/com/fr/plugin/designer/transform/BatchTransformUtil.java (100%) rename {designer-realize => designer-base}/src/main/java/com/fr/plugin/designer/transform/BatchTransformer.java (100%) rename {designer-realize => designer-base}/src/main/java/com/fr/plugin/designer/transform/UpdateCallBack.java (100%) rename {designer-realize => designer-base}/src/main/java/com/fr/plugin/designer/transform/ui/BatchTransformDialog.java (100%) rename {designer-realize => designer-base}/src/main/java/com/fr/plugin/designer/transform/ui/BatchTransformPane.java (100%) rename {designer-realize => designer-base}/src/main/java/com/fr/plugin/designer/transform/ui/PrepareTransformFileList.java (100%) rename {designer-realize => designer-base}/src/main/java/com/fr/plugin/designer/transform/ui/TransformFileTree.java (100%) rename {designer-realize => designer-base}/src/main/java/com/fr/plugin/designer/transform/ui/TransformPreparePane.java (100%) rename {designer-realize => designer-base}/src/main/java/com/fr/plugin/designer/transform/ui/TransformResultList.java (100%) rename {designer-realize => designer-base}/src/main/java/com/fr/plugin/designer/transform/ui/TransformResultPane.java (100%) rename {designer-realize => designer-base}/src/main/java/com/fr/plugin/designer/transform/ui/UIListControlCellRenderer.java (100%) rename {designer-realize => designer-base}/src/main/java/com/fr/plugin/designer/transform/ui/UpdateProgressDialog.java (100%) rename {designer-realize => designer-base}/src/main/java/com/fr/plugin/designer/transform/ui/UpdateProgressPane.java (100%) rename {designer-realize => designer-base}/src/main/java/com/fr/plugin/designer/utils/CompileTransformUtil.java (100%) rename {designer-realize => designer-base}/src/main/java/com/fr/plugin/designer/utils/DesignerCptxFileUtils.java (100%) rename {designer-realize => designer-base}/src/test/java/com/fr/plugin/designer/toolbar/TemplateTransformerDebugTest.java (100%) rename {designer-realize => designer-base}/src/test/java/com/fr/plugin/designer/toolbar/TemplateTransformerTest.java (100%) rename {designer-realize => designer-base}/src/test/java/com/fr/plugin/designer/toolbar/TransformResultInfoTest.java (100%) rename {designer-realize => designer-base}/src/test/java/com/fr/plugin/designer/transform/BatchTransformProgressTest.java (100%) rename {designer-realize => designer-base}/src/test/java/com/fr/plugin/designer/transform/BatchTransformUtilTest.java (100%) rename {designer-realize => designer-base}/src/test/java/com/fr/plugin/designer/transform/BatchTransformerTest.java (100%) rename {designer-realize => designer-base}/src/test/java/com/fr/plugin/designer/utils/CompileTransformUtilTest.java (100%) delete mode 100644 designer-realize/src/main/java/com/fr/plugin/designer/EnginexSupportedFileUIImpl.java delete mode 100644 designer-realize/src/main/java/com/fr/plugin/designer/WritableCptx.java delete mode 100644 designer-realize/src/main/java/com/fr/plugin/designer/menu/BatchCompileMenu.java delete mode 100644 designer-realize/src/main/java/com/fr/plugin/designer/menu/CalculateAttrMenu.java delete mode 100644 designer-realize/src/main/java/com/fr/plugin/designer/menu/LocalAnalyzerMenu.java delete mode 100644 designer-realize/src/main/java/com/fr/plugin/designer/toolbar/TemplateTransformerUIButton.java delete mode 100644 designer-realize/src/test/java/com/fr/plugin/designer/EnginexSupportedFileUIImplTest.java delete mode 100644 designer-realize/src/test/java/com/fr/plugin/designer/clean/CompileCleanManagerTest.java delete mode 100644 designer-realize/src/test/java/com/fr/plugin/designer/menu/BatchCompileMenuTest.java diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/menu/BatchCompileAction.java b/designer-base/src/main/java/com/fr/design/actions/file/BatchCompileAction.java similarity index 97% rename from designer-realize/src/main/java/com/fr/plugin/designer/menu/BatchCompileAction.java rename to designer-base/src/main/java/com/fr/design/actions/file/BatchCompileAction.java index 8488090897..9fd4926284 100644 --- a/designer-realize/src/main/java/com/fr/plugin/designer/menu/BatchCompileAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/BatchCompileAction.java @@ -1,4 +1,4 @@ -package com.fr.plugin.designer.menu; +package com.fr.design.actions.file; import com.fr.base.BaseUtils; import com.fr.design.actions.UpdateAction; diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/menu/LocalAnalyzerAction.java b/designer-base/src/main/java/com/fr/design/actions/server/LocalAnalyzerAction.java similarity index 97% rename from designer-realize/src/main/java/com/fr/plugin/designer/menu/LocalAnalyzerAction.java rename to designer-base/src/main/java/com/fr/design/actions/server/LocalAnalyzerAction.java index 20881fa09c..9f5ad1f0e6 100644 --- a/designer-realize/src/main/java/com/fr/plugin/designer/menu/LocalAnalyzerAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/server/LocalAnalyzerAction.java @@ -1,4 +1,4 @@ -package com.fr.plugin.designer.menu; +package com.fr.design.actions.server; import com.fr.base.BaseUtils; import com.fr.design.actions.UpdateAction; diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java index b418c1db4c..53fe504415 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java @@ -48,6 +48,9 @@ public class FileTreeIcon { public static final Icon MODERN_CHT_FILE_IMAGE_ICON = BaseUtils.readIcon("/com/fr/design/images/gui/modern_style_cht_file_icon_16x16.png"); + public static final Icon CPTX_ICON = BaseUtils.readIcon("/com/fr/plugin/designer/cptx_file_icon.png"); + public static final Icon CPTX_LOCKED_ICON = BaseUtils.readIcon("/com/fr/plugin/designer/cptx_file_icon_locked.png"); + public static final LockIcon FOLDER_LOCK_ICON = new LockIcon(BaseUtils.readImage("/com/fr/design/images/gui/fold.png")); public static final LockIcon FILE_LOCK_ICON = @@ -108,6 +111,7 @@ public class FileTreeIcon { public final static int CPT_FILE = 11; //.cpt public final static int FRM_FILE = 12; //.form .frm public final static int CHT_FILE = 13; //.chart .cht + public final static int CPTX_FILE = 14; //.cptx public static Icon getIcon(File file) { return FileTreeIcon.getIcon(file, false); @@ -252,6 +256,12 @@ public class FileTreeIcon { } else { return FileTreeIcon.MODERN_CPT_FILE_IMAGE_ICON; } + } else if (fileType == CPTX_FILE) { + if (isLocked) { + return FileTreeIcon.CPTX_LOCKED_ICON; + } else { + return FileTreeIcon.CPTX_ICON; + } } else if (fileType == FRM_FILE) { //form frm if (isLocked) { return FileTreeIcon.FRM_FILE_LOCK_ICON; @@ -314,6 +324,8 @@ public class FileTreeIcon { return BMP_FILE; } else if (fileName.endsWith(".cpt")) { return CPT_FILE; + } else if (fileName.endsWith(".cptx")) { + return CPTX_FILE; } else if (fileName.endsWith(".frm") || fileName.endsWith(".form")) { return FRM_FILE; } else if (fileName.endsWith(".cht") || fileName.endsWith(".chart")) { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 483e74d9d7..3bddf0f489 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -3,6 +3,7 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; import com.fr.base.FRContext; import com.fr.base.Parameter; +import com.fr.base.extension.FileExtension; import com.fr.base.io.BaseBook; import com.fr.base.iofile.attr.DesignBanCopyAttrMark; import com.fr.base.iofile.attr.TemplateIdAttrMark; @@ -14,6 +15,7 @@ import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.TableDataSourceAction; import com.fr.design.actions.edit.RedoAction; import com.fr.design.actions.edit.UndoAction; +import com.fr.design.actions.file.BatchCompileAction; import com.fr.design.actions.file.SaveAsTemplateAction; import com.fr.design.actions.file.SaveTemplateAction; import com.fr.design.actions.file.WebPreviewUtils; @@ -60,6 +62,8 @@ import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import com.fr.plugin.context.PluginContext; import com.fr.plugin.context.PluginRuntime; +import com.fr.plugin.designer.toolbar.CompileAction; +import com.fr.plugin.designer.toolbar.TemplateTransformer; import com.fr.plugin.injectable.PluginModule; import com.fr.plugin.manage.PluginFilter; import com.fr.plugin.observer.PluginEvent; @@ -781,10 +785,12 @@ public abstract class JTemplate> protected boolean saveToNewFile(String oldName) { boolean result = false; + String path = this.editingFILE.getPath(); Set providers = ExtraDesignClassManager.getInstance().getArray(ReportSupportedFileUIProvider.XML_TAG); for (ReportSupportedFileUIProvider provider : providers) { - result = result || provider.saveToNewFile(this.editingFILE.getPath(), this); + result = result || provider.saveToNewFile(path, this); } + result = result || saveToNewFile4Cptx(path); if (!result) { result = result || this.saveFile(); //更换最近打开 @@ -794,6 +800,14 @@ public abstract class JTemplate> return result; } + private boolean saveToNewFile4Cptx(String targetPath) { + if (FileExtension.CPTX.matchExtension(targetPath)) { + TemplateTransformer.TO_CPTX.transform(this); + return true; + } + return false; + } + protected void mkNewFile(FILE file) { try { file.mkfile(); @@ -887,7 +901,7 @@ public abstract class JTemplate> } else if (DesignerMode.isAuthorityEditing()) { return new ShortCut[]{new SaveTemplateAction(this), new UndoAction(this), new RedoAction(this)}; } else { - return new ShortCut[]{new SaveTemplateAction(this), new SaveAsTemplateAction(this), new UndoAction(this), new RedoAction(this)}; + return new ShortCut[]{new SaveTemplateAction(this), new SaveAsTemplateAction(this), new BatchCompileAction(), new UndoAction(this), new RedoAction(this)}; } } @@ -1323,8 +1337,10 @@ public abstract class JTemplate> * @return 按钮组 */ public UIButton[] createExtraButtons() { + UIButton[] uiButtons = new UIButton[] { + (UIButton) new CompileAction().createToolBarComponent() + }; Set providers = ExtraDesignClassManager.getInstance().getArray(DesignerFrameUpButtonProvider.XML_TAG); - UIButton[] uiButtons = new UIButton[0]; for (DesignerFrameUpButtonProvider provider : providers) { uiButtons = ArrayUtils.addAll(uiButtons, provider.getUpButtons(getMenuState())); } diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/preview/PagePlusPreview.java b/designer-base/src/main/java/com/fr/design/preview/PagePlusPreview.java similarity index 91% rename from designer-realize/src/main/java/com/fr/plugin/designer/preview/PagePlusPreview.java rename to designer-base/src/main/java/com/fr/design/preview/PagePlusPreview.java index dbc8387195..b06ec1b276 100644 --- a/designer-realize/src/main/java/com/fr/plugin/designer/preview/PagePlusPreview.java +++ b/designer-base/src/main/java/com/fr/design/preview/PagePlusPreview.java @@ -1,4 +1,4 @@ -package com.fr.plugin.designer.preview; +package com.fr.design.preview; import com.fr.design.fun.impl.AbstractPreviewProvider; import com.fr.general.web.ParameterConstants; @@ -7,7 +7,7 @@ import com.fr.locale.InterProviderFactory; import java.util.HashMap; import java.util.Map; -import static com.fr.plugin.v9.web.PagePlusActor.TYPE; +import static com.fr.plugin.web.v9.PagePlusActor.TYPE; public class PagePlusPreview extends AbstractPreviewProvider { private static final int CODE = 100; diff --git a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java index 43c3f43ad8..a97b7db9d2 100644 --- a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java +++ b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java @@ -770,6 +770,7 @@ public class FILEChooserPane extends BasicPane { // ben:filefilter设置初值为cpt过滤 this.addChooseFILEFilter(new ChooseFileFilter(FileExtension.CPT, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); + this.addChooseFILEFilter(new ChooseFileFilter(FileExtension.CPTX, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); // richer:form文件 daniel 改成三个字 this.addChooseFILEFilter(new ChooseFileFilter(FileExtension.FRM, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/cell/CellTreeAttrPanel.java b/designer-base/src/main/java/com/fr/plugin/designer/cell/CellTreeAttrPanel.java similarity index 100% rename from designer-realize/src/main/java/com/fr/plugin/designer/cell/CellTreeAttrPanel.java rename to designer-base/src/main/java/com/fr/plugin/designer/cell/CellTreeAttrPanel.java diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/cell/CellTreeAttrPanelProvider.java b/designer-base/src/main/java/com/fr/plugin/designer/cell/CellTreeAttrPanelProvider.java similarity index 100% rename from designer-realize/src/main/java/com/fr/plugin/designer/cell/CellTreeAttrPanelProvider.java rename to designer-base/src/main/java/com/fr/plugin/designer/cell/CellTreeAttrPanelProvider.java diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/cptx/io/DesignReadWritableProvider.java b/designer-base/src/main/java/com/fr/plugin/designer/cptx/io/DesignReadWritableProvider.java similarity index 100% rename from designer-realize/src/main/java/com/fr/plugin/designer/cptx/io/DesignReadWritableProvider.java rename to designer-base/src/main/java/com/fr/plugin/designer/cptx/io/DesignReadWritableProvider.java diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/monitor/DesignerMetricRecorder.java b/designer-base/src/main/java/com/fr/plugin/designer/monitor/DesignerMetricRecorder.java similarity index 100% rename from designer-realize/src/main/java/com/fr/plugin/designer/monitor/DesignerMetricRecorder.java rename to designer-base/src/main/java/com/fr/plugin/designer/monitor/DesignerMetricRecorder.java diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/toolbar/CompileAction.java b/designer-base/src/main/java/com/fr/plugin/designer/toolbar/CompileAction.java similarity index 100% rename from designer-realize/src/main/java/com/fr/plugin/designer/toolbar/CompileAction.java rename to designer-base/src/main/java/com/fr/plugin/designer/toolbar/CompileAction.java diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/toolbar/TemplateTransformer.java b/designer-base/src/main/java/com/fr/plugin/designer/toolbar/TemplateTransformer.java similarity index 100% rename from designer-realize/src/main/java/com/fr/plugin/designer/toolbar/TemplateTransformer.java rename to designer-base/src/main/java/com/fr/plugin/designer/toolbar/TemplateTransformer.java diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/toolbar/TransformResult.java b/designer-base/src/main/java/com/fr/plugin/designer/toolbar/TransformResult.java similarity index 100% rename from designer-realize/src/main/java/com/fr/plugin/designer/toolbar/TransformResult.java rename to designer-base/src/main/java/com/fr/plugin/designer/toolbar/TransformResult.java diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/toolbar/TransformResultInfo.java b/designer-base/src/main/java/com/fr/plugin/designer/toolbar/TransformResultInfo.java similarity index 100% rename from designer-realize/src/main/java/com/fr/plugin/designer/toolbar/TransformResultInfo.java rename to designer-base/src/main/java/com/fr/plugin/designer/toolbar/TransformResultInfo.java diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/transform/BatchTransformProgress.java b/designer-base/src/main/java/com/fr/plugin/designer/transform/BatchTransformProgress.java similarity index 100% rename from designer-realize/src/main/java/com/fr/plugin/designer/transform/BatchTransformProgress.java rename to designer-base/src/main/java/com/fr/plugin/designer/transform/BatchTransformProgress.java diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/transform/BatchTransformUtil.java b/designer-base/src/main/java/com/fr/plugin/designer/transform/BatchTransformUtil.java similarity index 100% rename from designer-realize/src/main/java/com/fr/plugin/designer/transform/BatchTransformUtil.java rename to designer-base/src/main/java/com/fr/plugin/designer/transform/BatchTransformUtil.java diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/transform/BatchTransformer.java b/designer-base/src/main/java/com/fr/plugin/designer/transform/BatchTransformer.java similarity index 100% rename from designer-realize/src/main/java/com/fr/plugin/designer/transform/BatchTransformer.java rename to designer-base/src/main/java/com/fr/plugin/designer/transform/BatchTransformer.java diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/transform/UpdateCallBack.java b/designer-base/src/main/java/com/fr/plugin/designer/transform/UpdateCallBack.java similarity index 100% rename from designer-realize/src/main/java/com/fr/plugin/designer/transform/UpdateCallBack.java rename to designer-base/src/main/java/com/fr/plugin/designer/transform/UpdateCallBack.java diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/transform/ui/BatchTransformDialog.java b/designer-base/src/main/java/com/fr/plugin/designer/transform/ui/BatchTransformDialog.java similarity index 100% rename from designer-realize/src/main/java/com/fr/plugin/designer/transform/ui/BatchTransformDialog.java rename to designer-base/src/main/java/com/fr/plugin/designer/transform/ui/BatchTransformDialog.java diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/transform/ui/BatchTransformPane.java b/designer-base/src/main/java/com/fr/plugin/designer/transform/ui/BatchTransformPane.java similarity index 100% rename from designer-realize/src/main/java/com/fr/plugin/designer/transform/ui/BatchTransformPane.java rename to designer-base/src/main/java/com/fr/plugin/designer/transform/ui/BatchTransformPane.java diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/transform/ui/PrepareTransformFileList.java b/designer-base/src/main/java/com/fr/plugin/designer/transform/ui/PrepareTransformFileList.java similarity index 100% rename from designer-realize/src/main/java/com/fr/plugin/designer/transform/ui/PrepareTransformFileList.java rename to designer-base/src/main/java/com/fr/plugin/designer/transform/ui/PrepareTransformFileList.java diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/transform/ui/TransformFileTree.java b/designer-base/src/main/java/com/fr/plugin/designer/transform/ui/TransformFileTree.java similarity index 100% rename from designer-realize/src/main/java/com/fr/plugin/designer/transform/ui/TransformFileTree.java rename to designer-base/src/main/java/com/fr/plugin/designer/transform/ui/TransformFileTree.java diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/transform/ui/TransformPreparePane.java b/designer-base/src/main/java/com/fr/plugin/designer/transform/ui/TransformPreparePane.java similarity index 100% rename from designer-realize/src/main/java/com/fr/plugin/designer/transform/ui/TransformPreparePane.java rename to designer-base/src/main/java/com/fr/plugin/designer/transform/ui/TransformPreparePane.java diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/transform/ui/TransformResultList.java b/designer-base/src/main/java/com/fr/plugin/designer/transform/ui/TransformResultList.java similarity index 100% rename from designer-realize/src/main/java/com/fr/plugin/designer/transform/ui/TransformResultList.java rename to designer-base/src/main/java/com/fr/plugin/designer/transform/ui/TransformResultList.java diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/transform/ui/TransformResultPane.java b/designer-base/src/main/java/com/fr/plugin/designer/transform/ui/TransformResultPane.java similarity index 100% rename from designer-realize/src/main/java/com/fr/plugin/designer/transform/ui/TransformResultPane.java rename to designer-base/src/main/java/com/fr/plugin/designer/transform/ui/TransformResultPane.java diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/transform/ui/UIListControlCellRenderer.java b/designer-base/src/main/java/com/fr/plugin/designer/transform/ui/UIListControlCellRenderer.java similarity index 100% rename from designer-realize/src/main/java/com/fr/plugin/designer/transform/ui/UIListControlCellRenderer.java rename to designer-base/src/main/java/com/fr/plugin/designer/transform/ui/UIListControlCellRenderer.java diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/transform/ui/UpdateProgressDialog.java b/designer-base/src/main/java/com/fr/plugin/designer/transform/ui/UpdateProgressDialog.java similarity index 100% rename from designer-realize/src/main/java/com/fr/plugin/designer/transform/ui/UpdateProgressDialog.java rename to designer-base/src/main/java/com/fr/plugin/designer/transform/ui/UpdateProgressDialog.java diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/transform/ui/UpdateProgressPane.java b/designer-base/src/main/java/com/fr/plugin/designer/transform/ui/UpdateProgressPane.java similarity index 100% rename from designer-realize/src/main/java/com/fr/plugin/designer/transform/ui/UpdateProgressPane.java rename to designer-base/src/main/java/com/fr/plugin/designer/transform/ui/UpdateProgressPane.java diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/utils/CompileTransformUtil.java b/designer-base/src/main/java/com/fr/plugin/designer/utils/CompileTransformUtil.java similarity index 100% rename from designer-realize/src/main/java/com/fr/plugin/designer/utils/CompileTransformUtil.java rename to designer-base/src/main/java/com/fr/plugin/designer/utils/CompileTransformUtil.java diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/utils/DesignerCptxFileUtils.java b/designer-base/src/main/java/com/fr/plugin/designer/utils/DesignerCptxFileUtils.java similarity index 100% rename from designer-realize/src/main/java/com/fr/plugin/designer/utils/DesignerCptxFileUtils.java rename to designer-base/src/main/java/com/fr/plugin/designer/utils/DesignerCptxFileUtils.java diff --git a/designer-realize/src/test/java/com/fr/plugin/designer/toolbar/TemplateTransformerDebugTest.java b/designer-base/src/test/java/com/fr/plugin/designer/toolbar/TemplateTransformerDebugTest.java similarity index 100% rename from designer-realize/src/test/java/com/fr/plugin/designer/toolbar/TemplateTransformerDebugTest.java rename to designer-base/src/test/java/com/fr/plugin/designer/toolbar/TemplateTransformerDebugTest.java diff --git a/designer-realize/src/test/java/com/fr/plugin/designer/toolbar/TemplateTransformerTest.java b/designer-base/src/test/java/com/fr/plugin/designer/toolbar/TemplateTransformerTest.java similarity index 100% rename from designer-realize/src/test/java/com/fr/plugin/designer/toolbar/TemplateTransformerTest.java rename to designer-base/src/test/java/com/fr/plugin/designer/toolbar/TemplateTransformerTest.java diff --git a/designer-realize/src/test/java/com/fr/plugin/designer/toolbar/TransformResultInfoTest.java b/designer-base/src/test/java/com/fr/plugin/designer/toolbar/TransformResultInfoTest.java similarity index 100% rename from designer-realize/src/test/java/com/fr/plugin/designer/toolbar/TransformResultInfoTest.java rename to designer-base/src/test/java/com/fr/plugin/designer/toolbar/TransformResultInfoTest.java diff --git a/designer-realize/src/test/java/com/fr/plugin/designer/transform/BatchTransformProgressTest.java b/designer-base/src/test/java/com/fr/plugin/designer/transform/BatchTransformProgressTest.java similarity index 100% rename from designer-realize/src/test/java/com/fr/plugin/designer/transform/BatchTransformProgressTest.java rename to designer-base/src/test/java/com/fr/plugin/designer/transform/BatchTransformProgressTest.java diff --git a/designer-realize/src/test/java/com/fr/plugin/designer/transform/BatchTransformUtilTest.java b/designer-base/src/test/java/com/fr/plugin/designer/transform/BatchTransformUtilTest.java similarity index 100% rename from designer-realize/src/test/java/com/fr/plugin/designer/transform/BatchTransformUtilTest.java rename to designer-base/src/test/java/com/fr/plugin/designer/transform/BatchTransformUtilTest.java diff --git a/designer-realize/src/test/java/com/fr/plugin/designer/transform/BatchTransformerTest.java b/designer-base/src/test/java/com/fr/plugin/designer/transform/BatchTransformerTest.java similarity index 100% rename from designer-realize/src/test/java/com/fr/plugin/designer/transform/BatchTransformerTest.java rename to designer-base/src/test/java/com/fr/plugin/designer/transform/BatchTransformerTest.java diff --git a/designer-realize/src/test/java/com/fr/plugin/designer/utils/CompileTransformUtilTest.java b/designer-base/src/test/java/com/fr/plugin/designer/utils/CompileTransformUtilTest.java similarity index 100% rename from designer-realize/src/test/java/com/fr/plugin/designer/utils/CompileTransformUtilTest.java rename to designer-base/src/test/java/com/fr/plugin/designer/utils/CompileTransformUtilTest.java diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java index ff14d54f40..fa1fe93cd2 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java @@ -55,6 +55,7 @@ import com.fr.design.module.DesignModuleFactory; import com.fr.design.parameter.ParameterDefinitePane; import com.fr.design.parameter.ParameterInputPane; import com.fr.design.preview.MobilePreview; +import com.fr.design.preview.PagePlusPreview; import com.fr.design.preview.PagePreview; import com.fr.design.preview.ViewPreview; import com.fr.design.preview.WriteEnhancePreview; @@ -918,7 +919,7 @@ public class JWorkBook extends JTemplate { public PreviewProvider[] supportPreview() { PreviewProvider[] templatePreviews = super.supportPreview(); return ArrayUtils.addAll(new PreviewProvider[]{ - new PagePreview(), new WritePreview(), new ViewPreview(), new WriteEnhancePreview(), new MobilePreview() + new PagePreview(), new WritePreview(), new ViewPreview(), new WriteEnhancePreview(), new MobilePreview(), new PagePlusPreview() }, templatePreviews); } @@ -1194,6 +1195,7 @@ public class JWorkBook extends JTemplate { protected void addChooseFILEFilter(FILEChooserPane fileChooser) { String appName = ProductConstants.APP_NAME; fileChooser.addChooseFILEFilter(new ChooseFileFilter(FileExtension.CPT, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); + fileChooser.addChooseFILEFilter(new ChooseFileFilter(FileExtension.CPTX, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); addExtraChooseFILEFilter(fileChooser); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppActivator.java b/designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppActivator.java index ec425847dc..7cc912518d 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppActivator.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppActivator.java @@ -4,6 +4,7 @@ import com.fr.design.mainframe.App; import com.fr.design.mainframe.JTemplateFactory; import com.fr.module.Activator; import com.fr.module.extension.Prepare; +import com.fr.plugin.designer.CptxApp; import java.util.List; @@ -33,7 +34,7 @@ public class DesignerAppActivator extends Activator implements Prepare { @Override public void prepare() { - addMutable(App.KEY, new CptApp(), new FormApp(), new XlsApp(), new XlsxApp()); + addMutable(App.KEY, new CptApp(), new CptxApp(), new FormApp(), new XlsApp(), new XlsxApp()); } } diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/CptxApp.java b/designer-realize/src/main/java/com/fr/plugin/designer/CptxApp.java index cdad02a786..df1d672a37 100644 --- a/designer-realize/src/main/java/com/fr/plugin/designer/CptxApp.java +++ b/designer-realize/src/main/java/com/fr/plugin/designer/CptxApp.java @@ -12,12 +12,6 @@ import com.fr.plugin.designer.utils.DesignerCptxFileUtils; */ public class CptxApp extends AbstractAppProvider { - static { - // 保证设计器默认 cptx 启动正常 - StartupAssist.init(); - } - - public CptxApp() { StartupAssist.initDesignModule(); } diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/EnginexSupportedFileUIImpl.java b/designer-realize/src/main/java/com/fr/plugin/designer/EnginexSupportedFileUIImpl.java deleted file mode 100644 index ae9ec9796a..0000000000 --- a/designer-realize/src/main/java/com/fr/plugin/designer/EnginexSupportedFileUIImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.fr.plugin.designer; - -import com.fr.base.BaseUtils; -import com.fr.base.extension.FileExtension; -import com.fr.design.i18n.Toolkit; -import com.fr.design.fun.impl.AbstractReportSupportedFileUIProvider; -import com.fr.design.mainframe.JTemplate; -import com.fr.file.FILEChooserPane; -import com.fr.file.filter.ChooseFileFilter; -import com.fr.plugin.designer.toolbar.TemplateTransformer; -import com.fr.stable.ProductConstants; - -import javax.swing.Icon; - - -/** - * Created by kerry on 2019-10-14 - */ -public class EnginexSupportedFileUIImpl extends AbstractReportSupportedFileUIProvider { - public static final Icon CPTX_ICON = BaseUtils.readIcon("/com/fr/plugin/designer/cptx_file_icon.png"); - public static final Icon CPTX_LOCKED_ICON = BaseUtils.readIcon("/com/fr/plugin/designer/cptx_file_icon_locked.png"); - - @Override - public void addChooseFileFilter(FILEChooserPane fileChooser, String suffix) { - String filterDescription = ProductConstants.APP_NAME + Toolkit.i18nText("Fine-Design_Report_Template_File"); - ChooseFileFilter cptxChooserFilter = new ChooseFileFilter(FileExtension.CPTX, filterDescription); - fileChooser.addChooseFILEFilter(cptxChooserFilter); - } - - @Override - public Icon getFileIcon(String path, boolean isShowLock) { - if (!FileExtension.CPTX.matchExtension(path)) { - return null; - } - if (isShowLock) { - return CPTX_LOCKED_ICON; - } - return CPTX_ICON; - } - - - @Override - public boolean saveToNewFile(String targetPath, JTemplate jTemplate) { - if (FileExtension.CPTX.matchExtension(targetPath)) { - TemplateTransformer.TO_CPTX.transform(jTemplate); - return true; - } - return false; - } - -} diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/JStreamBook.java b/designer-realize/src/main/java/com/fr/plugin/designer/JStreamBook.java index d525685417..abb413c889 100644 --- a/designer-realize/src/main/java/com/fr/plugin/designer/JStreamBook.java +++ b/designer-realize/src/main/java/com/fr/plugin/designer/JStreamBook.java @@ -8,18 +8,21 @@ import com.fr.design.actions.file.export.TextExportAction; import com.fr.design.actions.file.export.WordExportAction; import com.fr.design.mainframe.JWorkBook; import com.fr.design.menu.MenuDef; +import com.fr.design.menu.ShortCut; import com.fr.file.FILE; import com.fr.general.ComparatorUtils; import com.fr.locale.InterProviderFactory; import com.fr.log.FineLoggerFactory; import com.fr.main.impl.WorkBook; import com.fr.nx.cptx.entry.metadata.CptxMetadata; +import com.fr.plugin.designer.menu.CalculateAttrAction; import com.fr.plugin.designer.toolbar.TemplateTransformer; import com.fr.plugin.designer.toolbar.TransformResult; import com.fr.plugin.designer.toolbar.TransformResultInfo; import com.fr.plugin.designer.utils.DesignerCptxFileUtils; import com.fr.stable.StringUtils; import com.fr.stable.project.ProjectConstants; +import com.fr.third.jodd.util.ArraysUtil; import java.io.File; import java.io.FileOutputStream; @@ -106,4 +109,9 @@ public class JStreamBook extends JWorkBook { } return StringUtils.EMPTY; } + + @Override + public ShortCut[] shortcut4TemplateMenu() { + return ArraysUtil.insert(super.shortcut4TemplateMenu(), new CalculateAttrAction(this), 5); + } } diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/StartupAssist.java b/designer-realize/src/main/java/com/fr/plugin/designer/StartupAssist.java index 5f27952446..83e499d1dd 100644 --- a/designer-realize/src/main/java/com/fr/plugin/designer/StartupAssist.java +++ b/designer-realize/src/main/java/com/fr/plugin/designer/StartupAssist.java @@ -10,15 +10,10 @@ import com.fr.design.mainframe.JTemplateFactory; import com.fr.design.module.DesignModuleFactory; import com.fr.design.parameter.AbstractParameterReader; import com.fr.design.ui.util.UIUtil; -import com.fr.event.Event; -import com.fr.event.EventDispatcher; -import com.fr.event.Listener; import com.fr.log.FineLoggerFactory; import com.fr.main.impl.WorkBook; import com.fr.nx.cptx.CptxIOManager; import com.fr.nx.cptx.io.handle.CptxTemplateHandle; -import com.fr.plugin.context.PluginContext; -import com.fr.plugin.observer.PluginEventType; /** * 保证设计器默认 cptx 启动正常 @@ -28,11 +23,6 @@ import com.fr.plugin.observer.PluginEventType; */ public class StartupAssist { - public static void init() { - listenInitDesignModule(); - } - - public static void initDesignModule() { DesignModuleFactory.registerParameterReader(new AbstractParameterReader() { @Override @@ -82,14 +72,4 @@ public class StartupAssist { (path = jTemplate.getPath()) != null && path.endsWith(FileExtension.CPTX.getExtension()); } - - private static void listenInitDesignModule() { - EventDispatcher.listen(PluginEventType.AfterRun, new Listener() { - @SuppressWarnings("rawtypes") - @Override - public void on(Event event, PluginContext param) { - initDesignModule(); - } - }); - } } diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/WritableCptx.java b/designer-realize/src/main/java/com/fr/plugin/designer/WritableCptx.java deleted file mode 100644 index db22499155..0000000000 --- a/designer-realize/src/main/java/com/fr/plugin/designer/WritableCptx.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.fr.plugin.designer; - -import com.fr.file.FILE; -import com.fr.nx.cptx.io.handle.impl.AbstractCptxIOProvider; - -import java.io.InputStream; -import java.io.OutputStream; - -/** - * 读写型模板, 用于设计器端增删改模板 - */ -public class WritableCptx extends AbstractCptxIOProvider { - - private FILE file; - - public WritableCptx(FILE file) { - this.file = file; - } - - @Override - public InputStream open() throws Exception { - return file.asInputStream(); - } - - @Override - public OutputStream createTemp() throws Exception { - return file.asOutputStream(); - } -} diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/menu/BatchCompileMenu.java b/designer-realize/src/main/java/com/fr/plugin/designer/menu/BatchCompileMenu.java deleted file mode 100644 index 6625d247c1..0000000000 --- a/designer-realize/src/main/java/com/fr/plugin/designer/menu/BatchCompileMenu.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.fr.plugin.designer.menu; - -import com.fr.design.fun.impl.AbstractMenuHandler; -import com.fr.design.menu.ShortCut; - -/** - * Created by kerry on 2019-12-10 - */ -public class BatchCompileMenu extends AbstractMenuHandler { - private static final int DEFAULT_INSERT_POSITION = 9; - - @Override - public int insertPosition(int total) { - return DEFAULT_INSERT_POSITION; - } - - @Override - public boolean insertSeparatorBefore() { - return false; - } - - @Override - public boolean insertSeparatorAfter() { - return false; - } - - @Override - public String category() { - return FILE; - } - - @Override - public ShortCut shortcut() { - return new BatchCompileAction(); - } -} diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/menu/CalculateAttrMenu.java b/designer-realize/src/main/java/com/fr/plugin/designer/menu/CalculateAttrMenu.java deleted file mode 100644 index 06a3f493d9..0000000000 --- a/designer-realize/src/main/java/com/fr/plugin/designer/menu/CalculateAttrMenu.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.fr.plugin.designer.menu; - -import com.fr.design.fun.impl.AbstractMenuHandler; -import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; -import com.fr.design.menu.ShortCut; -import com.fr.plugin.designer.JStreamBook; - -public class CalculateAttrMenu extends AbstractMenuHandler { - - private static final int DEFAULT_INSERT_POSITION = 7; - - /** - * 插入位置 - * @param total 插入点 - * - * @return 插入位置 - * - */ - public int insertPosition(int total) { - return DEFAULT_INSERT_POSITION; - } - - /** - * 在分隔符前插入 - * - * @return 是否在分隔符前插入 - * - */ - public boolean insertSeparatorBefore() { - return false; - } - - /** - * 在分隔符后插入 - * - * @return 是否在分隔符后插入 - * - */ - public boolean insertSeparatorAfter() { - return false; - } - - /** - * 分类 - * - * @return 菜单分类 - * - */ - public String category() { - return TEMPLATE; - } - - /** - * 获取当前菜单的Action - * - * @param plus 当前操作对象 - * - * @return 菜单Action - * - */ - public ShortCut shortcut(ToolBarMenuDockPlus plus) { - //往ToolBarMenuDockPlus里塞感觉也很糟. - if (!(plus instanceof JStreamBook)){ - return null; - } - - return new CalculateAttrAction((JStreamBook) plus); - } -} \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/menu/LocalAnalyzerMenu.java b/designer-realize/src/main/java/com/fr/plugin/designer/menu/LocalAnalyzerMenu.java deleted file mode 100644 index 8e270010a0..0000000000 --- a/designer-realize/src/main/java/com/fr/plugin/designer/menu/LocalAnalyzerMenu.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.fr.plugin.designer.menu; - -import com.fr.design.fun.impl.AbstractMenuHandler; -import com.fr.design.menu.ShortCut; - -/** - * @author Maksim - * Created in 2020/11/5 11:44 上午 - */ -public class LocalAnalyzerMenu extends AbstractMenuHandler { - private static final int DEFAULT_INSERT_POSITION = 13; - - @Override - public int insertPosition(int i) { - return DEFAULT_INSERT_POSITION; - } - - @Override - public boolean insertSeparatorBefore() { - return false; - } - - @Override - public boolean insertSeparatorAfter() { - return false; - } - - @Override - public String category() { - return SERVER; - } - - @Override - public ShortCut shortcut() { - return new LocalAnalyzerAction(); - } -} diff --git a/designer-realize/src/main/java/com/fr/plugin/designer/toolbar/TemplateTransformerUIButton.java b/designer-realize/src/main/java/com/fr/plugin/designer/toolbar/TemplateTransformerUIButton.java deleted file mode 100644 index a6b3668369..0000000000 --- a/designer-realize/src/main/java/com/fr/plugin/designer/toolbar/TemplateTransformerUIButton.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.fr.plugin.designer.toolbar; - -import com.fr.design.fun.impl.AbstractDsinFrameUpButtonProvider; -import com.fr.design.gui.ibutton.UIButton; - - -public class TemplateTransformerUIButton extends AbstractDsinFrameUpButtonProvider { - @Override - public UIButton[] getUpButtons(int menuState) { - CompileAction compileAction = new CompileAction(); - UIButton transBtn = (UIButton) compileAction.createToolBarComponent(); - return new UIButton[]{transBtn}; - } - - - @Override - public int currentAPILevel() { - return CURRENT_LEVEL; - } -} diff --git a/designer-realize/src/main/java/com/fr/start/MainDesigner.java b/designer-realize/src/main/java/com/fr/start/MainDesigner.java index 162a2044f4..4bcf4387fc 100644 --- a/designer-realize/src/main/java/com/fr/start/MainDesigner.java +++ b/designer-realize/src/main/java/com/fr/start/MainDesigner.java @@ -6,6 +6,7 @@ import com.fr.design.DesignerEnvManager; import com.fr.design.actions.file.WebPreviewUtils; import com.fr.design.actions.file.newReport.NewPolyReportAction; import com.fr.design.actions.file.newReport.NewWorkBookAction; +import com.fr.design.actions.server.LocalAnalyzerAction; import com.fr.design.actions.server.ServerConfigManagerAction; import com.fr.design.actions.server.StyleListAction; import com.fr.design.actions.server.WidgetManagerAction; @@ -165,6 +166,7 @@ public class MainDesigner extends BaseDesigner { if (WorkContext.getCurrent().isRoot()) { menuDef.addShortCut(new ServerConfigManagerAction(), new StyleListAction(), new WidgetManagerAction()); menuDef.addShortCut(new ChartPreStyleAction(), new ChartEmptyDataStyleAction(),new ChartMapEditorAction()); + menuDef.addShortCut(new LocalAnalyzerAction()); } insertMenu(menuDef, MenuHandler.SERVER); diff --git a/designer-realize/src/test/java/com/fr/plugin/designer/EnginexSupportedFileUIImplTest.java b/designer-realize/src/test/java/com/fr/plugin/designer/EnginexSupportedFileUIImplTest.java deleted file mode 100644 index cd8e57890a..0000000000 --- a/designer-realize/src/test/java/com/fr/plugin/designer/EnginexSupportedFileUIImplTest.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.fr.plugin.designer; - -import org.junit.Assert; -import org.junit.Test; - -import javax.swing.Icon; - -/** - * Created by kerry on 2019-10-15 - */ -public class EnginexSupportedFileUIImplTest { - - @Test - public void testGetFileIcon() { - EnginexSupportedFileUIImpl newFileType = new EnginexSupportedFileUIImpl(); - Icon icon1 = newFileType.getFileIcon("WorkBook.cpt", false); - Assert.assertNull(icon1); - Icon icon2 = newFileType.getFileIcon("WorkBook.cptx", false); - Assert.assertEquals(EnginexSupportedFileUIImpl.CPTX_ICON, icon2); - Icon icon3 = newFileType.getFileIcon("WorkBook.cpt", true); - Assert.assertNull(icon3); - Icon icon4 = newFileType.getFileIcon("WorkBook.cptx", true); - Assert.assertEquals(EnginexSupportedFileUIImpl.CPTX_LOCKED_ICON, icon4); - } - -} diff --git a/designer-realize/src/test/java/com/fr/plugin/designer/clean/CompileCleanManagerTest.java b/designer-realize/src/test/java/com/fr/plugin/designer/clean/CompileCleanManagerTest.java deleted file mode 100644 index 17159bbdee..0000000000 --- a/designer-realize/src/test/java/com/fr/plugin/designer/clean/CompileCleanManagerTest.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.fr.plugin.designer.clean; - -import com.fr.config.dao.DaoContext; -import com.fr.config.dao.impl.LocalClassHelperDao; -import com.fr.config.dao.impl.LocalEntityDao; -import com.fr.config.dao.impl.LocalXmlEntityDao; -import com.fr.nx.cptx.clean.CompileCleanManager; -import com.fr.transaction.Configurations; -import com.fr.transaction.LocalConfigurationHelper; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -/** - * @author: Maksim - * @Date: Created in 2020/4/23 - * @Description: - */ -public class CompileCleanManagerTest { - - @Before - public void before() { - DaoContext.setEntityDao(new LocalEntityDao()); - DaoContext.setClassHelperDao(new LocalClassHelperDao()); - DaoContext.setXmlEntityDao(new LocalXmlEntityDao()); - Configurations.setHelper(new LocalConfigurationHelper()); - } - - @Test - public void clearTest() { - - CompileCleanManager manager = CompileCleanManager.getInstance(); - manager.addRecord("com.cptx"); - manager.addRecord("abc/com.cptx"); - manager.addRecord("merge.cptx", "2020-01-01"); - manager.addRecord("merge.cptx", "2020-02-01"); - Assert.assertEquals(3, manager.getRecords().size()); - - manager.clear(); - Assert.assertEquals(2, manager.getRecords().size()); - } -} \ No newline at end of file diff --git a/designer-realize/src/test/java/com/fr/plugin/designer/menu/BatchCompileMenuTest.java b/designer-realize/src/test/java/com/fr/plugin/designer/menu/BatchCompileMenuTest.java deleted file mode 100644 index 99e409ff8a..0000000000 --- a/designer-realize/src/test/java/com/fr/plugin/designer/menu/BatchCompileMenuTest.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.fr.plugin.designer.menu; - -import org.junit.Assert; -import org.junit.Test; - -/** - * Created by kerry on 2020-01-15 - */ -public class BatchCompileMenuTest { - - @Test - public void testBatchCompileMenuIndex(){ - BatchCompileMenu menu = new BatchCompileMenu(); - Assert.assertEquals(9, menu.insertPosition(20)); - } -}