From b0c5c6660bfc9a5a72f33e08dc81c450ce34566f Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 23 Sep 2022 13:49:45 +0800 Subject: [PATCH 001/310] =?UTF-8?q?REPORT-80745=20FR11=E6=96=B0=E8=87=AA?= =?UTF-8?q?=E9=80=82=E5=BA=94-=E5=9C=A8=E7=95=8C=E9=9D=A2=E6=9C=89?= =?UTF-8?q?=E7=BC=A9=E6=94=BE=E6=AF=94=E4=BE=8B=E6=97=B6=EF=BC=8C=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E5=9D=97=E5=8D=95=E5=85=83=E6=A0=BC=E5=AE=BD=E5=BA=A6?= =?UTF-8?q?=E4=BC=9A=E6=98=BE=E7=A4=BA=E7=BC=A9=E6=94=BE=E7=9A=84=E5=83=8F?= =?UTF-8?q?=E7=B4=A0=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/grid/AbstractGridHeaderMouseHandler.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java b/designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java index d9d5cbe53b..97e95a34f4 100644 --- a/designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java +++ b/designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java @@ -305,11 +305,14 @@ public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter { StringBuilder sb = new StringBuilder(); sb.append(String.format("%.2f", new Double(len))) .append('/').append(String.format("%.2f", new Double(tlen))) - .append(unit).append('(') - .append((int)(unitValue.toPixD(resolution))).append('/') - .append((int)(totalUnitValue.toPixD(resolution))) - .append(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Px")) - .append(')'); + .append(unit); + if(!DesignerUIModeConfig.getInstance().simulateWebUIMode()){ + sb.append('(') + .append((int)(unitValue.toPixD(resolution))).append('/') + .append((int)(totalUnitValue.toPixD(resolution))) + .append(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Px")) + .append(')'); + } return sb.toString(); } From b854a4ada2932c2f894a72ab8ebb81e06920ccd9 Mon Sep 17 00:00:00 2001 From: "Jimmy.Zheng" Date: Fri, 23 Sep 2022 13:50:48 +0800 Subject: [PATCH 002/310] =?UTF-8?q?Revert=20"Revert=20"REPORT-70593=20?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=8E=A7=E4=BB=B6=E5=90=88=E5=B9=B6=E4=B8=BB?= =?UTF-8?q?=E4=BB=A3=E7=A0=81""?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 911ca18f --- .../com/fr/design/gui/core/WidgetOption.java | 7 +- .../HyperlinkGroupPaneActionProvider.java | 2 + .../com/fr/design/report/SelectImagePane.java | 67 ++++++----- .../buttonicon/widget/picture_widget_16.png | Bin 0 -> 1061 bytes .../widget/picture_widget_designer_bg.png | Bin 0 -> 4933 bytes .../designer/creator/XCreatorUtils.java | 2 + .../fr/design/designer/creator/XPicture.java | 74 ++++++++++++ .../com/fr/design/designer/ui/ImgPanel.java | 111 ++++++++++++++++++ .../AccessiblePictureModelEditor.java | 77 ++++++++++++ .../AccessibleUrlLinkModelEditor.java | 57 +++++++++ .../widget/editors/PictureEditor.java | 17 +++ .../widget/editors/UrlLinkEditor.java | 17 +++ .../widget/renderer/PictureRenderer.java | 15 +++ .../widget/renderer/UrlLinkRenderer.java | 16 +++ .../widget/wrappers/PictureModelWrapper.java | 34 ++++++ .../widget/wrappers/UrlLinkModelWrapper.java | 33 ++++++ .../fr/start/module/DesignerActivator.java | 6 +- .../com/fr/start/preload/ImagePreLoader.java | 1 + 18 files changed, 499 insertions(+), 37 deletions(-) rename {designer-realize => designer-base}/src/main/java/com/fr/design/report/SelectImagePane.java (96%) create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/picture_widget_16.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/form/designer/widget/picture_widget_designer_bg.png create mode 100644 designer-form/src/main/java/com/fr/design/designer/creator/XPicture.java create mode 100644 designer-form/src/main/java/com/fr/design/designer/ui/ImgPanel.java create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessiblePictureModelEditor.java create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleUrlLinkModelEditor.java create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/widget/editors/PictureEditor.java create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/widget/editors/UrlLinkEditor.java create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/widget/renderer/PictureRenderer.java create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/widget/renderer/UrlLinkRenderer.java create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/widget/wrappers/PictureModelWrapper.java create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/widget/wrappers/UrlLinkModelWrapper.java diff --git a/designer-base/src/main/java/com/fr/design/gui/core/WidgetOption.java b/designer-base/src/main/java/com/fr/design/gui/core/WidgetOption.java index 258f558a71..4c9db5a6a0 100644 --- a/designer-base/src/main/java/com/fr/design/gui/core/WidgetOption.java +++ b/designer-base/src/main/java/com/fr/design/gui/core/WidgetOption.java @@ -1,6 +1,7 @@ package com.fr.design.gui.core; import com.fr.base.BaseUtils; +import com.fr.base.svg.IconUtils; import com.fr.form.ui.Button; import com.fr.form.ui.CheckBox; import com.fr.form.ui.CheckBoxGroup; @@ -14,6 +15,7 @@ import com.fr.form.ui.ListEditor; import com.fr.form.ui.MultiFileEditor; import com.fr.form.ui.NumberEditor; import com.fr.form.ui.Password; +import com.fr.form.ui.PictureWidget; import com.fr.form.ui.RadioGroup; import com.fr.form.ui.TextArea; import com.fr.form.ui.TextEditor; @@ -142,7 +144,7 @@ public abstract class WidgetOption implements Serializable { */ public static WidgetOption[] getFormWidgetIntance() { return new WidgetOption[]{TEXTEDITOR, LABEL, FREEBUTTON, COMBOBOX, COMBOCHECKBOX, DATEEDITOR, - NUMBEREDITOR, TREECOMBOBOX, RADIOGROUP, CHECKBOXGROUP, TEXTAREA, PASSWORD, CHECKBOX, TREE, MULTI_FILEEDITOR}; + NUMBEREDITOR, TREECOMBOBOX, RADIOGROUP, CHECKBOXGROUP, TEXTAREA, PASSWORD, CHECKBOX, TREE, MULTI_FILEEDITOR,PICTURE}; } public static final WidgetOption DATEEDITOR = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Date"), @@ -214,4 +216,7 @@ public abstract class WidgetOption implements Serializable { public static final WidgetOption IFRAMEDITOR = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Form_Iframe"), BaseUtils.readIcon("/com/fr/web/images/form/resources/iframe_16.png"), IframeEditor.class); + public static final WidgetOption PICTURE = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Image"), IconUtils.readIcon("/com/fr/web/images/form/resources/picture_widget_16.png"), + PictureWidget.class); + } diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/HyperlinkGroupPaneActionProvider.java b/designer-base/src/main/java/com/fr/design/gui/frpane/HyperlinkGroupPaneActionProvider.java index 525bb5b792..be0d8e8523 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/HyperlinkGroupPaneActionProvider.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/HyperlinkGroupPaneActionProvider.java @@ -8,6 +8,8 @@ import com.fr.design.designer.TargetComponent; */ public interface HyperlinkGroupPaneActionProvider { + String XML_TAG = "HyperlinkGroupPane"; + /** * 刷新面板展示 * diff --git a/designer-realize/src/main/java/com/fr/design/report/SelectImagePane.java b/designer-base/src/main/java/com/fr/design/report/SelectImagePane.java similarity index 96% rename from designer-realize/src/main/java/com/fr/design/report/SelectImagePane.java rename to designer-base/src/main/java/com/fr/design/report/SelectImagePane.java index bcad15c76c..7781233aac 100644 --- a/designer-realize/src/main/java/com/fr/design/report/SelectImagePane.java +++ b/designer-base/src/main/java/com/fr/design/report/SelectImagePane.java @@ -13,22 +13,24 @@ import com.fr.report.cell.Elem; import com.fr.report.cell.cellattr.CellImage; import com.fr.report.cell.painter.CellImagePainter; import com.fr.stable.Constants; - -import javax.swing.BorderFactory; -import javax.swing.ButtonGroup; -import javax.swing.JFileChooser; -import javax.swing.JPanel; -import javax.swing.JScrollPane; import java.awt.BorderLayout; import java.awt.GridLayout; import java.awt.Image; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; +import javax.swing.BorderFactory; +import javax.swing.ButtonGroup; +import javax.swing.JFileChooser; +import javax.swing.JPanel; +import javax.swing.JScrollPane; /** - * 这个类主要用于插入图片时的设置 - */ + *

这个类主要用于插入图片时的设置

+ *

这个类原本在designer-realize包下面,现在表单也可选择图片,所以应该抽为公用的base包。包名不变,应该不影响插件使用

+ * + * @author Jimmy.Zheng created on 2022/8/11 21:22 + **/ public class SelectImagePane extends BasicPane { private ImagePreviewPane previewPane = null; @@ -39,8 +41,31 @@ public class SelectImagePane extends BasicPane { private UIRadioButton adjustRadioButton = null; private Style imageStyle = null; + ActionListener layoutActionListener = new ActionListener() { + @Override + public void actionPerformed(ActionEvent evt) { + setImageStyle(); + changeImageStyle(); + } + }; private File imageFile; + /** + * Select picture. + */ + ActionListener selectPictureActionListener = new ActionListener() { + + @Override + public void actionPerformed(ActionEvent evt) { + int returnVal = imageFileChooser + .showOpenDialog(SelectImagePane.this); + if (returnVal != JFileChooser.CANCEL_OPTION) { + File selectedFile = imageFileChooser.getSelectedFile(); + imageFile = selectedFile; + ImgChooseWrapper.getInstance(previewPane, imageFileChooser, imageStyle, null).dealWithImageFile(returnVal); + } + } + }; public SelectImagePane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); @@ -102,23 +127,6 @@ public class SelectImagePane extends BasicPane { imageFileChooser.setMultiSelectionEnabled(false); } - /** - * Select picture. - */ - ActionListener selectPictureActionListener = new ActionListener() { - - @Override - public void actionPerformed(ActionEvent evt) { - int returnVal = imageFileChooser - .showOpenDialog(SelectImagePane.this); - if (returnVal != JFileChooser.CANCEL_OPTION) { - File selectedFile = imageFileChooser.getSelectedFile(); - imageFile = selectedFile; - ImgChooseWrapper.getInstance(previewPane, imageFileChooser, imageStyle, null).dealWithImageFile(returnVal); - } - } - }; - // 调整图片样式,只有水平和垂直对齐以及拉伸。相对于背景,平铺不予考虑。 private void changeImageStyle() { previewPane.setImageStyle(this.imageStyle); @@ -137,15 +145,6 @@ public class SelectImagePane extends BasicPane { } } - ActionListener layoutActionListener = new ActionListener() { - - @Override - public void actionPerformed(ActionEvent evt) { - setImageStyle(); - changeImageStyle(); - } - }; - @Override protected String title4PopupWindow() { return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Image"); diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/picture_widget_16.png b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/picture_widget_16.png new file mode 100644 index 0000000000000000000000000000000000000000..fbf334ad22a2e3a9985830d225959a6ea40379b0 GIT binary patch literal 1061 zcmXw%drVUY6vj_`Z{LOD#Mvv1!WaS)2ZL>*!Ic`+!Nd_BgDhZeMr2t8N zlU$Kp{GO~qQLd2HpFa7Aq5uH7SzIKkR6me!P?Q)+gJb{+Xem_xmmUP01i<7nfg%Y& z5EQtq7&h*A#jS4yMZvH?#lP-Owgs1WVzDXHn>g6#1Q`LHwG}9y8|Y6kfnWd_Y_!1S zGVL+j4JkH{IR*DSMQZ^wW^tH!Zif|(FmW)2jGz!VX1={k-8=30nlSk9!1Mf<|HoJ? z7BE_kwVl^H8$zTLn7lANCnCUUMqwRcz($Y&7ubPL0W7X8zTnMqZT`nIWTk*)15i&f zh{0%p%#2LY%!0lI;ou+?asW56AmCwvFF=AbUZKsXFQk|ZlNlRr1_zmdqGXt8XR z;eHYdF_}zsyVbEZYj;wOFJhoMOenb4=&()(!EUz!n@0eR4&V&{Y)eNWHqrMiKH%_#yf^hOl=^;M}Vop`2+HQmg=fr(Ke6C zj&6zEhC{LZ0WG~X!p{hY#5uKXxnJZHo#U0kt(UqdCo05Zsn%`zvzXZd^0QXT7oM=G zO0l>2S1lpotI~q06Jc9vSM~^s)u+V^m3OPKxxP6p-gFs@Uu9rq+hBLZkL%^k0|7D6 z(7a{Wmz&=lmhN$P8-kx^@ssvZ!p4vLgdXL0*!8M6g!$;4Fn{6J?4%p_Hg#E47pBOz z9c8TT4~HHPcNlK}cqRQRaUybDwtR;O;>xapo+CMf&F{;X&oo~&;FcG=zUrx=9*us0 zJHD-GI8yt|Nmo4@Bs~`YU%}?G9)c|UMw?y8ccKQGRh2>!U_~udP_>AeTx}BqgcYJu+yPIDy zdlN{!t?J^jNAI3lb1dY0$ot`?ouT5RM2@I|ws8Rv6BA=@ZVrz>={x-B(#}PPpiGKx z24VVy62LPV+;8K&sq@7mc=BP#4uY)W-_3GI`wq{mbO?=_Q>_+BBusJsKYv?S?Ne`f z{jg*5=?#7zRd-0|15n{Z{W-h@psLnBB#(OX3mj=>XEYkAbUL)mT3@GKzVrI^>y8T1 z&TSBW#xmdKN0u1|sKe_P?N3cfDX3fs96Z_7#1=O}5FVAskHyNY=i^r@FYWwFZuD?- zbIbXMIsv^v;3JilOINM3+lP_q0Fg8P$GURC$aU@V(s%FP8HmK@NtorfV#NxDj4)J| zks6vmH3JP};8-kf7SPnu6uA(z9QL{1Jp`L!J?iVS4SRbZS{7J z1DD-T@dO&(6&naYx4{Gsx`mQ!il&85Ns$sIGUK`h?RH&6tyXKWA_&{mCplfk85)_v znH0TMG^qa0G1l$`AX_{@0q_jPE%*iSBpFI>3cfp9Q^T`=Z-^jBibSa*KizA>iaf&x z^M|vDjX&K#x0w*F;2k`8@P{LdaE`UP+eOUmNIdr~BD3~1cXe|E88fgd$bPjUlUmi3 zUjU+@B+&5G>Ya$7tgw=u8_1&CPjj{I#H6~VzQoKS%%Y^dJ;?KWU~&t}wHVUGDq&}5 zqT7A7hlirPXE|^zium&%&-?_eX;O{82vPjbmK_3?S?C{6z8$|(Krw@VFxMv)G@tEC zftS+2vI^`O4D zY8pe%AJ~~$9ApZMw(B&ouSs3R$&=V6JweLtN~tJA67?^8^v*OS~BLR9qGd`g-0knK02=x7{&`I50wInE~wGH4*E0_+*SxlmKwGOdrBex z25i3%>bOZ?M8E;KX)R-knta3wouOB@y?Gd1w^p%Mo4ylpK|Wat^fXfZ5kN|lD6ulK zd;yqhYj`n9j=Nk!GZAxlBnfz=A_>1!TXQ=DLd3aHW6RF3UvSaU6SX>bY~n{0<><+U z6$!_!BaKmkv3+$Tv6a(Hd+MzWEAJrOjIfd4P&tJg`b!iAZkZ*%L55IhfK;=T7AM8S1H3R_Nhx>(Bl%b}Ame zYL2P~>Laq;!!rKMJdthAPJnRSn2?%bgUqUp|Mk@>$-D%N2}Q1`mvKrs5GhN*91 zq1L@h1E3^Xv_)Y}J_!oK$)b1+ zwmf|RT+U zBKzRybzm@(5`<@RWeOvf7KTHqJ9aN{WtMuvwc(AA&{%bmhF(FzTv>kGO%go5i$Pf*1 z2rtz(Fn>UytqcGoapR&$E3O18Uf5UB-wH$QGfhF93j1qCfG$>Z%d)SpuX~s4gpv}P zNswiGd3hnl{~2{+h#KG$1JEbH*dCapZ7DZD|I6_OrJ^8{ds{H*@Wxy5a`}M+2h>kE zL2*d0`RxQTTExUj8o_cdLdyMf_A^?e%r@=xi5NGsmrmDMX&BXed*+KF511AmXJ~_( zb?~BG$Js)xSEzVJwylE>1&e$|mTE_1(JRz~9kQ3%{7n4=5B=xOqfkY%A7;}L%f$Jt(xgg~B-*f#JUp|Y zIZJ!A0C3Z&qlvC0i7k3BP_dtSNs6YWh<~G`E0Dl##_ll6=MlFAli>B!7$M2p2h5U; zGf5rv>L4;V$gsku)5YA=3w+zbRH zZU*>861=|A(r0$TA-RSew)HD`9=+r15X#kM`It@Sd0;ks0b= zT;64qW5Lb*x<$#As&GmaXT?z~(mxfG+UN|~AyN4(?D0}XH8GllTGNevVd!Q~r%wi8 zyNj}-6)l?IK*M{8;!Ry)A)4^SME)`mCjt4&-fg6?-a$c@w~-_hkv%U1{H0F%Sutc& zD>Rl6I~IDuGKt;!yApmbV1#IV;XHSaj1NU)s@bt6D2l3u_X?PjiblQ`&yKt}J6GG*Am|1;h@v@k`#Ylif+(i5VE%xn z)oAY4ym-D~{iQHo+_h`hM3+%tHdA~*LbDny^=N3IO|5 zH?2^X6}3l`Wkpx7U4ux1^&5R^c#)=iVh2VjCT*HW)2o#$GMCpPQl%^c%Q^? z0iO}@)9Rgt*eZLaFF29+J?3!_<*~kYQj8ne`3?^69=l^}rP%X1YhT~yk(Prv=Uj{V z>bh|ET%FO8;MSH5Pu+SOC5swZZZnMxIhvS#C$O%f7SEu)1xD z^U&ZdRP;N}n`f4`sQb*BqUM^v-;PuC|Ln=TWj;~I#*&nnp$FHs%@2OjRR0X$6^Uxr zHb@uhO`$cr6aDHncu(~RiK)k(TYQe4Iqcc)Lv?V=dHa||$N`}|J^h9RmkutMTlex0 zb_+-Wz=;2XGEB)hUBiIjvw|rx3A<^Fae^kgwqZt>Sn%}!&I(@eqK>>O0P#_3i3N8e z!c`omdC);_9xc5W&aCz+)-e?bNg_el(oUF%IGRam0kg<|_Pp$0?kmP?QF_U}kl7GE zG9t2QZJ{Tf9qT6v>v7Ae^@ax*82`qddo$4)&_x% z9^yakTI#~=vvS`*w+>21_E}{PAc=QEtTw;p2jJ;Caa51mgd)5|)Ng_3NyP6ua6b|I zn1Jk?sl3b5akP&fPy({dx34C|K7aq>E-L*rwq<|6CqBDJoGm1+nIfKtZCiJe^Ur%s z@SLzMKjL$=cD8V$Kr?zHOPopx5X{V6URVqT9rT3{ zXA=56q*7_nEY?K5If4&_e%Qsiihh#UhU~bv90KM9*@!S^w#$-RAPYa zBT{@|bEy1}1x$q_yR?blL-O`+74Yw^y za-s(~totjXcY3RuNxI<3K@Ai0QW>ns0SD;=6uV6^yIoCrScP1>dX?s8sMUbFLxpzo z%RtgbU)}>Jyno>wJnRx~!POn3RtKz8v+BP<1^pZcfr-iOx6LkMmhxQW1Hs!c_p$wd z7TZhl-&L7g37L;FtSTh<)=qC*-%3Rk{F9^s@uaK3={EWQ|D?$im~5W&*A!s!8h;K3 NL`TL%oDNfH{|_#1j literal 0 HcmV?d00001 diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java index 5e7807698a..10a8fbfb1f 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java @@ -47,6 +47,7 @@ import com.fr.form.ui.MultiFileEditor; import com.fr.form.ui.NameWidget; import com.fr.form.ui.NumberEditor; import com.fr.form.ui.Password; +import com.fr.form.ui.PictureWidget; import com.fr.form.ui.Radio; import com.fr.form.ui.RadioGroup; import com.fr.form.ui.TextArea; @@ -183,6 +184,7 @@ public class XCreatorUtils { objectMap.put(CardSwitchButton.class, XCardSwitchButton.class); objectMap.put(CardAddButton.class, XCardAddButton.class); objectMap.put(WidgetErrorMarker.class, ErrorCreator.class); + objectMap.put(PictureWidget.class, XPicture.class); } private static void reInitExtra() { diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XPicture.java b/designer-form/src/main/java/com/fr/design/designer/creator/XPicture.java new file mode 100644 index 0000000000..7dd23bd4ce --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XPicture.java @@ -0,0 +1,74 @@ +package com.fr.design.designer.creator; + +import com.fr.design.designer.ui.ImgPanel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.widget.editors.PictureEditor; +import com.fr.design.mainframe.widget.editors.UrlLinkEditor; +import com.fr.design.mainframe.widget.renderer.PictureRenderer; +import com.fr.design.mainframe.widget.renderer.UrlLinkRenderer; +import com.fr.form.ui.PictureWidget; +import com.fr.general.IOUtils; +import com.fr.stable.ArrayUtils; +import java.awt.Dimension; +import java.awt.Image; +import java.beans.IntrospectionException; +import javax.swing.JComponent; + +/** +* +*

图片控件的creator

+* +* @author Jimmy.Zheng created on 2022/8/11 21:16 +**/ +public class XPicture extends XWidgetCreator { + + public XPicture(PictureWidget widget, Dimension dimension) { + super(widget, dimension); + } + + @Override + protected String getIconName() { + return "picture_widget_16.png"; + } + + @Override + public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { + return (CRPropertyDescriptor[]) ArrayUtils.addAll(super.supportedDescriptor(), new CRPropertyDescriptor[]{ + new CRPropertyDescriptor("picUrl", toData().getClass()) + .setI18NName(Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Image")) + .setEditorClass(PictureEditor.class) + .setRendererClass(PictureRenderer.class) + .putKeyValue("category", "Fine-Design_Basic_Advanced"), + new CRPropertyDescriptor("urlLink", toData().getClass()) + .setI18NName(Toolkit.i18nText("Fine-Design_Basic_Hyperlink")) + .setEditorClass(UrlLinkEditor.class) + .setRendererClass(UrlLinkRenderer.class) + .putKeyValue( + "category", "Fine-Design_Basic_Advanced")}); + } + + @Override + protected JComponent initEditor() { + PictureWidget pictureWidget = (PictureWidget) this.data; + if (this.editor == null) { + this.editor = FRGUIPaneFactory.createBorderLayout_S_Pane(); + Object value = pictureWidget.getPicUrl().getValue(); + ImgPanel imgPanel = new ImgPanel(); + if (value instanceof Image) { + imgPanel.setBackgroundImage((Image) value); + imgPanel.setImageDisplayMode(pictureWidget.getShowType()); + } else { + imgPanel.setBackgroundImage(IOUtils.readImage("com/fr/design/images/form/designer/widget/picture_widget_designer_bg.png")); + imgPanel.setImageDisplayMode(0); + } + this.editor.add(imgPanel, "Center"); + } + return this.editor; + } + + @Override + public boolean canEnterIntoParaPane() { + return false; + } +} diff --git a/designer-form/src/main/java/com/fr/design/designer/ui/ImgPanel.java b/designer-form/src/main/java/com/fr/design/designer/ui/ImgPanel.java new file mode 100644 index 0000000000..05aa8ba465 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/designer/ui/ImgPanel.java @@ -0,0 +1,111 @@ +package com.fr.design.designer.ui; + +import com.fr.general.ImageWithSuffix; +import java.awt.Graphics; +import java.awt.Image; +import javax.swing.JComponent; + + +/** +* +*

图片控件中的已选图片展示面板

+* +* @author Jimmy.Zheng created on 2022/8/11 21:17 +**/ +public class ImgPanel extends JComponent { + private static final long serialVersionUID = 1L; + private Image backgroundImage; + private int imageDisplayMode; + private int modeIndex; + + public ImgPanel() { + this(null, 0); + } + + public ImgPanel(Image image, int modeName) { + setBackgroundImage(image); + setImageDisplayMode(modeName); + } + + public void setBackgroundImage(Image image) { + this.backgroundImage = image; + repaint(); + } + + public Image getBackgroundImage() { + return this.backgroundImage; + } + + public void setImageDisplayMode(int modeName) { + if (modeName == 1) { + this.modeIndex = 0; + } + + if (modeName == 0) { + this.imageDisplayMode = 0; + this.modeIndex = 1; + } + + if (modeName == 2) { + this.imageDisplayMode = 2; + this.modeIndex = 2; + } + if (modeName == 4) { + this.imageDisplayMode = 4; + this.modeIndex = 3; + } + repaint(); + } + + public int getImageDisplayMode() { + return this.imageDisplayMode; + } + + @Override + protected void paintComponent(Graphics g) { + super.paintComponent(g); + + if (this.backgroundImage != null) { + if (this.backgroundImage instanceof ImageWithSuffix) { + this.backgroundImage = ((ImageWithSuffix) backgroundImage).getImage(); + } + int width = getWidth(); + int height = getHeight(); + int imageWidth = this.backgroundImage.getWidth(this); + int imageHeight = this.backgroundImage.getHeight(this); + + switch (this.modeIndex) { + case 0: + int x = (width - imageWidth) / 2; + int y = (height - imageHeight) / 2; + g.drawImage(this.backgroundImage, x, y, this); + break; + case 1: + for (int ix = 0; ix < width; ix += imageWidth) { + for (int iy = 0; iy < height; iy += imageHeight) { + g.drawImage(this.backgroundImage, ix, iy, this); + } + } + + break; + case 2: + g.drawImage(this.backgroundImage, 0, 0, width, height, this); + break; + case 3: + double sx = 1.0 * width / imageWidth; + double sy = 1.0 * height / imageHeight; + + if (sx > sy) { + sx = sy; + width = (int) (sx * imageWidth); + } else { + sy = sx; + height = (int) (sy * imageHeight); + } + int xx = (getWidth() - width) / 2; + int yy = (getHeight() - height) / 2; + g.drawImage(this.backgroundImage, xx, yy, width, height, this); + } + } + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessiblePictureModelEditor.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessiblePictureModelEditor.java new file mode 100644 index 0000000000..9e72b5c2ac --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessiblePictureModelEditor.java @@ -0,0 +1,77 @@ +package com.fr.design.mainframe.widget.accessibles; + +import com.fr.base.Style; +import com.fr.design.DesignModelAdapter; +import com.fr.design.designer.creator.XPicture; +import com.fr.design.designer.ui.ImgPanel; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.WidgetPropertyPane; +import com.fr.design.mainframe.widget.wrappers.PictureModelWrapper; +import com.fr.design.report.SelectImagePane; +import com.fr.form.ui.PictureWidget; +import com.fr.general.ComparatorUtils; +import com.fr.report.cell.FloatElement; +import com.fr.report.cell.cellattr.CellImage; +import javax.swing.JComponent; + + +/** +* +*

图片控件的图片选择、编辑器

+* +* @author Jimmy.Zheng created on 2022/8/11 21:13 +**/ +public class AccessiblePictureModelEditor extends UneditableAccessibleEditor { + protected FloatElement element = new FloatElement(); + private PictureWidget pic; + + public AccessiblePictureModelEditor(PictureWidget pic) { + super(new PictureModelWrapper()); + this.pic = pic; + } + + @Override + public FloatElement getValue() { + return (FloatElement) super.getValue(); + } + + @Override + protected void showEditorPane() { + final SelectImagePane imageEditorPane = new SelectImagePane(); + if (super.getValue() != null) { + this.element = ((FloatElement) super.getValue()); + } + this.element.setStyle(Style.getInstance().deriveImageLayout(this.pic.getShowType())); + imageEditorPane.populate(this.element); + final Object oldValue = this.element.getValue(); + final Style oldStyle = this.element.getStyle(); + final String oldname = this.element.getName(); + imageEditorPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { + @Override + public void doOk() { + CellImage cellImage = imageEditorPane.update(); + if ((!ComparatorUtils.equals(cellImage.getImage(), oldValue)) || (!ComparatorUtils.equals(cellImage.getStyle(), oldStyle))) { + AccessiblePictureModelEditor.this.element.setValue(cellImage.getImage()); + AccessiblePictureModelEditor.this.element.setStyle(cellImage.getStyle()); + AccessiblePictureModelEditor.this.element.setName(imageEditorPane.getSelectedImage() == null ? oldname : imageEditorPane.getSelectedImage().toString()); + AccessiblePictureModelEditor.this.setValue(AccessiblePictureModelEditor.this.element); + AccessiblePictureModelEditor.this.pic.setShowType(cellImage.getStyle().getImageLayout()); + AccessiblePictureModelEditor.this.pic.setPicUrl(element); + ImgPanel p = AccessiblePictureModelEditor.this.getCurrentImgPanel(); + p.setBackgroundImage(cellImage.getBufferImage()); + p.setImageDisplayMode(cellImage.getStyle().getImageLayout()); + AccessiblePictureModelEditor.this.fireStateChanged(); + DesignModelAdapter d = DesignModelAdapter.getCurrentModelAdapter(); + d.fireTargetModified(); + } + } + }).setVisible(true); + } + + private ImgPanel getCurrentImgPanel() { + XPicture xPicture = (XPicture) WidgetPropertyPane.getInstance().getEditingFormDesigner().getSelectionModel().getSelection().getSelectedCreator(); + JComponent editor = (JComponent) xPicture.getComponent(0); + return (ImgPanel) editor.getComponent(0); + } +} \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleUrlLinkModelEditor.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleUrlLinkModelEditor.java new file mode 100644 index 0000000000..2dd4b54991 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleUrlLinkModelEditor.java @@ -0,0 +1,57 @@ +package com.fr.design.mainframe.widget.accessibles; + +import com.fr.design.DesignModelAdapter; +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.gui.frpane.HyperlinkGroupPaneActionProvider; +import com.fr.design.gui.xpane.FormHyperlinkGroupPane; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.widget.wrappers.UrlLinkModelWrapper; +import com.fr.js.NameJavaScriptGroup; +import com.fr.stable.bridge.StableFactory; + +/** + *

表单图片控件的链接编辑器

+ * @author Jimmy + */ +public class AccessibleUrlLinkModelEditor extends UneditableAccessibleEditor { + private FormHyperlinkGroupPane hyperlinkPane; + + public AccessibleUrlLinkModelEditor() { + super(new UrlLinkModelWrapper()); + } + /** + * 原插件使用 + *

DesignerContext.getDesignerFrame().getSelectedJTemplate().getHyperLinkPaneNoPop( + * HyperlinkGroupPaneActionImpl.getInstance()));

获取{@see this.hyperlinkPane} + * 合并插件依赖不到,换种方式 用{@see DesignerActivator将实例注册了} + */ + @Override + protected void showEditorPane() { + if (this.hyperlinkPane == null) { + HyperlinkGroupPaneActionProvider hyperlinkGroupPaneActionProvider = StableFactory.getMarkedInstanceObjectFromClass(HyperlinkGroupPaneActionProvider.XML_TAG,HyperlinkGroupPaneActionProvider.class); + this.hyperlinkPane = (FormHyperlinkGroupPane) DesignerContext.getDesignerFrame().getSelectedJTemplate().getHyperLinkPaneNoPop( + hyperlinkGroupPaneActionProvider); + } + BasicDialog dialog = this.hyperlinkPane.showWindow(DesignerContext.getDesignerFrame()); + dialog.addDialogActionListener(new DialogActionAdapter() { + @Override + public void doOk() { + super.doOk(); + NameJavaScriptGroup hyperlinks = AccessibleUrlLinkModelEditor.this.hyperlinkPane.updateJSGroup(); + AccessibleUrlLinkModelEditor.this.setValue(hyperlinks); + AccessibleUrlLinkModelEditor.this.fireStateChanged(); + DesignModelAdapter d = DesignModelAdapter.getCurrentModelAdapter(); + d.fireTargetModified(); + } + }); + this.hyperlinkPane.populate(getValue()); + + dialog.setVisible(true); + } + + @Override + public NameJavaScriptGroup getValue() { + return (NameJavaScriptGroup) super.getValue(); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/editors/PictureEditor.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/editors/PictureEditor.java new file mode 100644 index 0000000000..c7bbff80a3 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/editors/PictureEditor.java @@ -0,0 +1,17 @@ +package com.fr.design.mainframe.widget.editors; + +import com.fr.design.mainframe.widget.accessibles.AccessiblePictureModelEditor; +import com.fr.design.mainframe.widget.accessibles.AccessiblePropertyEditor; +import com.fr.form.ui.PictureWidget; +/** +* +*

图片控件的图片选择、编辑器

+* +* @author Jimmy.Zheng created on 2022/8/11 21:15 +**/ +public class PictureEditor extends AccessiblePropertyEditor { + + public PictureEditor(Object o) { + super(new AccessiblePictureModelEditor((PictureWidget) o)); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/editors/UrlLinkEditor.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/editors/UrlLinkEditor.java new file mode 100644 index 0000000000..195e8f5250 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/editors/UrlLinkEditor.java @@ -0,0 +1,17 @@ +package com.fr.design.mainframe.widget.editors; + +import com.fr.design.mainframe.widget.accessibles.AccessiblePropertyEditor; +import com.fr.design.mainframe.widget.accessibles.AccessibleUrlLinkModelEditor; + +/** +* +*

图片控件的链接编辑器

+* +* @author Jimmy.Zheng created on 2022/8/11 21:19 +**/ +public class UrlLinkEditor extends AccessiblePropertyEditor { + + public UrlLinkEditor() { + super(new AccessibleUrlLinkModelEditor()); + } +} \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/renderer/PictureRenderer.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/renderer/PictureRenderer.java new file mode 100644 index 0000000000..82fcc85b43 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/renderer/PictureRenderer.java @@ -0,0 +1,15 @@ +package com.fr.design.mainframe.widget.renderer; + +import com.fr.design.mainframe.widget.wrappers.PictureModelWrapper; + +/** + *

图片控件的图片编辑器的EncoderCellRenderer

+ * + * @author Jimmy.Zheng created on 2022/8/11 21:29 + **/ +public class PictureRenderer extends EncoderCellRenderer { + + public PictureRenderer() { + super(new PictureModelWrapper()); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/renderer/UrlLinkRenderer.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/renderer/UrlLinkRenderer.java new file mode 100644 index 0000000000..a81187d2d5 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/renderer/UrlLinkRenderer.java @@ -0,0 +1,16 @@ +package com.fr.design.mainframe.widget.renderer; + + +import com.fr.design.mainframe.widget.wrappers.UrlLinkModelWrapper; + +/** + *

图片控件的链接编辑器的EncoderCellRenderer

+ * + * @author Jimmy.Zheng created on 2022/8/11 21:29 + **/ +public class UrlLinkRenderer extends EncoderCellRenderer { + + public UrlLinkRenderer() { + super(new UrlLinkModelWrapper()); + } +} \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/wrappers/PictureModelWrapper.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/wrappers/PictureModelWrapper.java new file mode 100644 index 0000000000..ed9fd0a4ac --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/wrappers/PictureModelWrapper.java @@ -0,0 +1,34 @@ +package com.fr.design.mainframe.widget.wrappers; + +import com.fr.design.Exception.ValidationException; +import com.fr.design.designer.properties.Decoder; +import com.fr.design.designer.properties.Encoder; +import com.fr.report.cell.FloatElement; +import com.fr.stable.StringUtils; + +/** + *

图片选择器 {@link com.fr.design.mainframe.widget.accessibles.AccessiblePictureModelEditor}的 Wrapper

+ *

插件中直接移入,未作改动

+ * + * @author Jimmy.Zheng created on 2022/8/11 21:25 + **/ +public class PictureModelWrapper implements Encoder, Decoder { + + @Override + public FloatElement decode(String txt) { + return null; + } + + @Override + public void validate(String txt) throws ValidationException { + // do nothing + } + + @Override + public String encode(FloatElement v) { + if (v != null) { + return v.getName(); + } + return StringUtils.EMPTY; + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/wrappers/UrlLinkModelWrapper.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/wrappers/UrlLinkModelWrapper.java new file mode 100644 index 0000000000..a892065ad7 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/wrappers/UrlLinkModelWrapper.java @@ -0,0 +1,33 @@ +package com.fr.design.mainframe.widget.wrappers; + +import com.fr.design.Exception.ValidationException; +import com.fr.design.designer.properties.Decoder; +import com.fr.design.designer.properties.Encoder; +import com.fr.js.NameJavaScriptGroup; + +/** + *

链接选择器 {@link com.fr.design.mainframe.widget.accessibles.AccessibleUrlLinkModelEditor}的 Wrapper

+ *

插件中直接移入,未作改动

+ * + * @author Jimmy.Zheng created on 2022/8/11 21:28 + **/ +public class UrlLinkModelWrapper implements Encoder, Decoder { + + @Override + public NameJavaScriptGroup decode(String txt) { + return null; + } + + @Override + public void validate(String txt) throws ValidationException { + // do nothing + } + + @Override + public String encode(NameJavaScriptGroup v) { + if (v.size() > 0) { + return v.getNameHyperlink(0).getName(); + } + return null; + } +} \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java index af32f596c4..92d1fc6a4a 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java @@ -41,6 +41,7 @@ import com.fr.design.form.parameter.FormParaDesigner; import com.fr.design.fun.ElementUIProvider; import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameableCreator; +import com.fr.design.gui.frpane.HyperlinkGroupPaneActionProvider; import com.fr.design.hyperlink.ReportletHyperlinkPane; import com.fr.design.hyperlink.WebHyperlinkPane; import com.fr.design.hyperlink.popup.MobilePopupPane; @@ -55,6 +56,7 @@ import com.fr.design.login.message.DesignerMessageHelper; import com.fr.design.login.socketio.LoginAuthServer; import com.fr.design.mainframe.BaseJForm; import com.fr.design.mainframe.FormHierarchyTreePane; +import com.fr.design.mainframe.HyperlinkGroupPaneActionImpl; import com.fr.design.mainframe.InformationCollector; import com.fr.design.mainframe.JTemplateEvent; import com.fr.design.mainframe.WidgetPropertyPane; @@ -143,14 +145,13 @@ import com.fr.start.common.DesignerStartupPool; import com.fr.task.Once; import com.fr.workspace.WorkContext; import com.fr.xml.ReportXMLUtils; - -import javax.swing.SwingWorker; import java.awt.Image; import java.awt.image.BufferedImage; import java.util.ArrayList; import java.util.List; import java.util.Set; import java.util.concurrent.CompletableFuture; +import javax.swing.SwingWorker; /** * Created by juhaoyu on 2018/1/31. @@ -404,6 +405,7 @@ public class DesignerActivator extends Activator implements Prepare { private static void registerOtherPane() { StableFactory.registerMarkedClass(BBSGuestPaneProvider.XML_TAG, BBSGuestPane.class); + StableFactory.registerMarkedObject(HyperlinkGroupPaneActionProvider.XML_TAG, HyperlinkGroupPaneActionImpl.getInstance()); } /** diff --git a/designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java b/designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java index 24d23565c0..aad478348f 100644 --- a/designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java +++ b/designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java @@ -242,6 +242,7 @@ public class ImagePreLoader { "com/fr/design/images/buttonicon/widget/label_16_normal.svg", "com/fr/web/images/form/resources/button_16.png", "com/fr/design/images/buttonicon/widget/button_16.png", + "com/fr/web/images/form/resources/picture_widget_16.png", "com/fr/design/images/buttonicon/widget/button_16_normal.svg", "com/fr/design/images/buttonicon/widget/files_up.png", "com/fr/design/images/buttonicon/widget/files_up_normal.svg", From 9d39612afbc341f37e6afe3cf4337871aa29806b Mon Sep 17 00:00:00 2001 From: rinoux Date: Sun, 25 Sep 2022 16:37:54 +0800 Subject: [PATCH 003/310] =?UTF-8?q?REPORT-80583=20=E5=A4=9A=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E9=A2=84=E8=A7=88=E5=8F=82=E6=95=B0=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/data/DesignTableDataManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java index 35a539a50c..2b654b6f49 100644 --- a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java +++ b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java @@ -637,8 +637,9 @@ public abstract class DesignTableDataManager { // 存储过程有些特殊处理 // 这个就简单直接获取暂存列表吧 - // TODO 参数处理? if (needLoadingBar) { + ParameterProvider[] parameters = DataOperator.getInstance().getTableDataParameters(tableData); + showParaWindow(parameterMap, parameters); MultiResultTableDataWrapper.loadingBar.start(); } return DataOperator.getInstance().previewMultiResultTableData(tableData, parameterMap, 0); From 177af481bea505bef6ff05677d46684ca25c0b68 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 26 Sep 2022 12:52:18 +0800 Subject: [PATCH 004/310] =?UTF-8?q?REPORT-80491=20linux=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E8=B0=83=E7=94=A8=E7=B3=BB=E7=BB=9F=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=A4=B9=EF=BC=8C=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=97=AA=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/os/impl/SupportOSImpl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java b/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java index 5751c3ecb9..d8eda915b7 100644 --- a/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java +++ b/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java @@ -152,7 +152,13 @@ public enum SupportOSImpl implements SupportOS { @Override public boolean support() { - return (OperatingSystem.isLinux() && Arch.getArch() == Arch.ARM) || MACOS_12_VERSION_ADAPTER.support(); + boolean javafxExist = true; + try { + Class.forName("javafx.stage.FileChooser"); + } catch (ClassNotFoundException e) { + javafxExist = false; + } + return !javafxExist || (OperatingSystem.isLinux() && Arch.getArch() == Arch.ARM) || MACOS_12_VERSION_ADAPTER.support(); } }, From 2f8216cd831e7ae6d83d323bfc75e19fb774a8c9 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 26 Sep 2022 13:45:48 +0800 Subject: [PATCH 005/310] =?UTF-8?q?REPORT-75998=20=E8=BF=9B=E5=85=A5?= =?UTF-8?q?=E5=BC=80=E5=8F=91=E8=80=85=E8=B0=83=E8=AF=95&=E6=9D=83?= =?UTF-8?q?=E9=99=90=E7=BC=96=E8=BE=91=E6=A8=A1=E5=BC=8F=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E5=A4=84=E7=90=86=E3=80=81=E5=AE=8C=E5=96=84=E9=80=9A=E9=85=8D?= =?UTF-8?q?=E7=AC=A6=E3=80=81=E4=BC=98=E5=8C=96=E7=95=8C=E9=9D=A2=E3=80=81?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8B=BE=E9=80=89=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/AllowAuthorityEditAction.java | 8 ++ .../fr/design/module/DesignModuleFactory.java | 13 +++ .../fr/design/preview/DeveloperPreview.java | 8 ++ .../action/ShowSearchResultAction.java | 4 +- .../replace/ui/ITReplaceMainDialog.java | 26 +++++- .../replace/ui/ITReplaceNorthPanel.java | 5 +- .../replace/ui/ITReplaceSouthPanel.java | 7 +- .../actions/replace/ui/ITTableButton.java | 1 - .../actions/replace/ui/ITTableEditorPane.java | 4 +- .../actions/replace/utils/ShowValueUtils.java | 79 +++++++++++++++---- .../fr/start/module/DesignerActivator.java | 2 + 11 files changed, 133 insertions(+), 24 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java b/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java index 1a0509d267..bb26e17118 100644 --- a/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java @@ -4,11 +4,14 @@ import com.fr.base.svg.IconUtils; import com.fr.base.vcs.DesignerMode; import com.fr.design.constants.UIConstants; import com.fr.design.menu.KeySetUtils; +import com.fr.design.module.DesignModuleFactory; import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.designer.TargetComponent; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.mainframe.*; +import com.fr.invoke.Reflect; +import com.fr.log.FineLoggerFactory; /** * Author : daisy @@ -61,6 +64,11 @@ public class AllowAuthorityEditAction extends TemplateComponentAction { DesignerContext.getDesignerFrame().refreshDottedLine(); EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance()); EastRegionContainerPane.getInstance().removeParameterPane(); + try { + Reflect.on(DesignModuleFactory.getReplacePane().newInstance()).call("close"); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } //画虚线 return true; diff --git a/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java b/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java index baed29be47..60a4dfcf18 100644 --- a/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java +++ b/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java @@ -50,6 +50,7 @@ public class DesignModuleFactory { private Class ITReplaceAction; private Class formParaDesigner; private Class paraPropertyPane; + private Class replacePane; private Class formHierarchyPaneCls; private Class widgetPropertyPane; private Class buttonDetailPaneClass; @@ -131,6 +132,18 @@ public class DesignModuleFactory { return instance.ITReplaceAction; } + /** + * 注册一下查找替换面板 + * @param r + */ + public static void registerReplacePane(Class r){ + instance.replacePane = r; + } + + public static Class getReplacePane(){ + return instance.replacePane; + } + public static void registerParaPropertyPaneClass(Class p) { instance.paraPropertyPane = p; } diff --git a/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java b/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java index 69e514b408..5c0a623857 100644 --- a/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java +++ b/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java @@ -6,9 +6,12 @@ import com.fr.design.fun.impl.AbstractPreviewProvider; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.JForm; import com.fr.design.mainframe.JTemplate; +import com.fr.design.module.DesignModuleFactory; import com.fr.design.worker.WorkerManager; import com.fr.design.worker.save.CallbackSaveWorker; import com.fr.general.web.ParameterConstants; +import com.fr.invoke.Reflect; +import com.fr.log.FineLoggerFactory; import java.util.HashMap; import java.util.Map; @@ -47,6 +50,11 @@ public class DeveloperPreview extends AbstractPreviewProvider { @Override public void onClick(JTemplate jt) { super.onClick(jt); + try { + Reflect.on(DesignModuleFactory.getReplacePane().newInstance()).call("close"); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } SwingWorker worker = WorkerManager.getInstance().getWorker(jt.getRuntimeId()); if (worker instanceof CallbackSaveWorker) { CallbackSaveWorker callbackSaveWorker = (CallbackSaveWorker) worker; diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/ShowSearchResultAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/ShowSearchResultAction.java index 601b3d09e5..f555de9689 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/ShowSearchResultAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/ShowSearchResultAction.java @@ -75,7 +75,7 @@ public enum ShowSearchResultAction implements ShowValue { } else { Map stringHashMap = info.getValue(); String content = stringHashMap.getOrDefault(objectContentKey, StringUtils.EMPTY); - if (content.contains(str) && StringUtils.isNotEmpty(content)) { + if (ShowValueUtils.contains(content,str) && StringUtils.isNotEmpty(content)) { info.getContent().setShowStr(ShowValueUtils.getCommonString(content, str)); info.getContent().setOldShowStr(content); info.getContent().setOperatorArray(ShowValueUtils.getStringStartAndEndIndex(content, str)); @@ -416,6 +416,6 @@ public enum ShowSearchResultAction implements ShowValue { * @return */ public boolean isTitleNameValid(Title title, String str){ - return title != null && GeneralUtils.objectToString(title.getTextObject()).contains(str) && StringUtils.isNotEmpty(GeneralUtils.objectToString(title.getTextObject())); + return title != null && ShowValueUtils.contains(GeneralUtils.objectToString(title.getTextObject()),str) && StringUtils.isNotEmpty(GeneralUtils.objectToString(title.getTextObject())); } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index f145cae021..2a922902f7 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -52,8 +52,9 @@ public class ITReplaceMainDialog extends UIDialog { private ITReplaceWestPanel westPanel; private boolean searchFlag; private String searchStr; + private static boolean existed = false; - private ITReplaceMainDialog() { + public ITReplaceMainDialog() { super(DesignerContext.getDesignerFrame()); init(); } @@ -66,6 +67,7 @@ public class ITReplaceMainDialog extends UIDialog { initFrame(); fitScreen(); ITReplaceFlag = true; + existed = true; } /** @@ -309,6 +311,28 @@ public class ITReplaceMainDialog extends UIDialog { } } + /** + * 面板是否存在 + * @return + */ + public static boolean isExisted() { + return existed; + } + + public static void setExisted(boolean existed) { + ITReplaceMainDialog.existed = existed; + } + + + /** + * 进入权限编辑状态&开发者调试时关闭面板 + */ + public static void close(){ + if (isExisted()){ + getInstance().dispose(); + setExisted(false); + } + } /** * 检测结果是否合法 */ diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java index bc4e82255f..a4fe1fef0f 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java @@ -47,6 +47,7 @@ public class ITReplaceNorthPanel { private static final int HEIGHT = 161; private static final int BUTTON_WIDTH = 60; private static final int BUTTON_GAP = 20; + private static final int MATCH_WIDTH = 70; private int findLabelX, findLabelY, findLabelWidth, findLabelHeight; @@ -83,7 +84,7 @@ public class ITReplaceNorthPanel { resultLabel = new UILabel(); String[] rangeItems = new String[]{Toolkit.i18nText("Fine-Design_Basic_Export_JS_Template_Current")}; - String[] replaceInputItems = new String[]{""}; + String[] replaceInputItems = new String[]{StringUtils.EMPTY}; findCombobox = new UIComboBox(findItems.toArray()); rangeCombobox = new UIComboBox(rangeItems); findInputCombobox = new UIComboBox(findInputItems.toArray()) { @@ -247,7 +248,7 @@ public class ITReplaceNorthPanel { private void setUIRadioButtonBounds(int x, int y, int templateWidth) { matchX = x + templateWidth / 60; matchY = y + 90; - matchWidth = templateWidth; + matchWidth = MATCH_WIDTH; matchHeight = 25; matchRadioButton.setBounds(matchX, matchY, matchWidth, matchHeight); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java index 7db6b52850..8921dce5ff 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java @@ -18,7 +18,12 @@ public class ITReplaceSouthPanel { public ITReplaceSouthPanel() { itTableEditor = new ITTableEditor(); tableEditorPane = new ITTableEditorPane<>(itTableEditor); - RowSorter sorter = new TableRowSorter(itTableEditor); + RowSorter sorter = new TableRowSorter(itTableEditor){ + @Override + public boolean isSortable(int column) { + return column != 0 || column != 6; + } + }; tableEditorPane.getEditTable().setRowSorter(sorter); tableEditorPane.getEditTable().setSelectionBackground(new Color(217, 235, 254)); tableEditorPane.getEditTable().setRowHeight(tableEditorPane.getEditTable().getRowHeight() / 2 + tableEditorPane.getEditTable().getRowHeight()); diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java index 4c94cc1147..03717a725c 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java @@ -43,7 +43,6 @@ public class ITTableButton extends AbstractCellEditor implements TableCellEditor if (StringUtils.isNotEmpty(GeneralUtils.objectToString(content.getTrlString()))) { ITReplaceMainDialog.setITReplaceFlag(true); HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().navigate(new TRL(GeneralUtils.objectToString(content.getTrlString()))); - ReportComponentComposite composite = (ReportComponentComposite) HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getCurrentReportComponentPane(); } ITReplaceMainDialog.setITReplaceFlag(false); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java index 928c2da67d..c35f2ef14d 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java @@ -71,7 +71,7 @@ public class ITTableEditorPane extends BasicPane { int row = ((JTable) e.getSource()).rowAtPoint(e.getPoint()); int col = ((JTable) e.getSource()).columnAtPoint(e.getPoint()); if (col == 0) { - ITContent content = (ITContent) editTable.getValueAt(row, 7); + ITContent content = (ITContent) editTable.getValueAt(row, 6); if (content.isSelected()) { content.setSelected(false); editTable.setValueAt(content.isSelected(), row, col); @@ -187,7 +187,7 @@ public class ITTableEditorPane extends BasicPane { */ public static void selectAllOrNull(Boolean value) { for (int i = 0; i < getEditTable().getRowCount(); i++) { - ((ITContent) (getEditTable().getValueAt(i, 7))).setSelected(value); + ((ITContent) (getEditTable().getValueAt(i, 6))).setSelected(value); } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java index b215a16c6d..b7da5fc23c 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java @@ -1,9 +1,8 @@ package com.fr.design.actions.replace.utils; -import com.fr.design.actions.replace.info.Info; - +import com.fr.design.actions.replace.ui.ITReplaceMainDialog; import com.fr.stable.StringUtils; import com.fr.stable.collections.combination.Pair; @@ -30,6 +29,20 @@ public class ShowValueUtils { public static final String ANY_THING_REGEX = "."; public static final String NUMBER_REGEX = "[0-9]"; public static final String ENGLISH_REGEX = "[a-zA-Z]"; + private static List specialCharList = new ArrayList<>(); + static { + //正则特殊字符:? * () [] {} ^ $ + //如果是? 并采用通配符 ,会自动转成“.” 所以 ? 不用处理 + //$同理 + specialCharList.add("*"); + specialCharList.add("("); + specialCharList.add(")"); + specialCharList.add("["); + specialCharList.add("]"); + specialCharList.add("{"); + specialCharList.add("}"); + specialCharList.add("^"); + } /** * 获取除内容外其他一次性展示所有的内容(名称、水印...) @@ -42,9 +55,7 @@ public class ShowValueUtils { if (StringUtils.isEmpty(searchStr)) { return str; } else { - return "
" + - replaceAll(str, searchStr, "" + searchStr + "") + - "
"; + return updateHighlight(str, searchStr); } } @@ -57,7 +68,11 @@ public class ShowValueUtils { * @return 替换后的字符串 */ public static String replaceAll(String str, String regex, String replacement) { - return str.replace(regex, replacement); + if (ITReplaceMainDialog.isMatched()) { + return str.replaceAll(changeRegex(regex), replacement); + } else { + return str.replace(regex, replacement); + } } /** @@ -70,6 +85,10 @@ public class ShowValueUtils { regex = regex.replace(NUMBER, NUMBER_REGEX); regex = regex.replace(ENGLISH, ENGLISH_REGEX); regex = regex.replace(ANY_THING, ANY_THING_REGEX); + String change = "\\"; + for (int i = 0 ; i < specialCharList.size() ; i ++){ + regex = regex.replace(specialCharList.get(i),change + specialCharList.get(i)); + } return regex; } @@ -101,18 +120,36 @@ public class ShowValueUtils { return pairs; } + /** - * 更新高亮状态 + * 更新高亮 * - * @param info - * @param replaceStr + * @param str + * @param searchStr + * @return */ - public static void updateHighlight(Info info, String replaceStr) { - String s = info.getInfoShowStr(info); - s = s.replace(info.getContent().getLastSearchStr(), "" + replaceStr + ""); - info.getContent().setShowStr( - "
" + s + "
" - ); + public static String updateHighlight(String str, String searchStr) { + if (ITReplaceMainDialog.isMatched()) { + String result = str; + Pattern pattern = Pattern.compile(changeRegex(searchStr)); + Matcher matcher = pattern.matcher(str); + String head = ""; + String tail = ""; + int size = head.length() + tail.length(); + int index = 0; + StringBuilder builder = new StringBuilder(str); + while (matcher.find()) { + builder.replace(matcher.start() + index, matcher.end() + index, head + matcher.group() + tail); + index += size; + } + return "
" + + builder.toString() + + "
"; + } else { + return "
" + + replaceAll(str, searchStr, "" + searchStr + "") + + "
"; + } } @@ -146,4 +183,16 @@ public class ShowValueUtils { } return failReturn; } + + public static boolean contains(String originStr, String matchStr) { + if (ITReplaceMainDialog.isMatched()) { + String str = changeRegex(matchStr); + Pattern pattern = Pattern.compile(str); + Matcher matcher = pattern.matcher(originStr); + return matcher.find(); + } else { + return originStr.contains(matchStr); + } + + } } diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java index af32f596c4..1a04c79ac9 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java @@ -32,6 +32,7 @@ import com.fr.design.actions.insert.flot.FormulaFloatAction; import com.fr.design.actions.insert.flot.ImageFloatAction; import com.fr.design.actions.insert.flot.TextBoxFloatAction; import com.fr.design.actions.replace.ITReplaceAction; +import com.fr.design.actions.replace.ui.ITReplaceMainDialog; import com.fr.design.bridge.DesignToolbarProvider; import com.fr.design.constants.DesignerLaunchStatus; import com.fr.design.env.DesignerWorkspaceLoader; @@ -466,6 +467,7 @@ public class DesignerActivator extends Activator implements Prepare { DesignModuleFactory.registerNewFormActionClass(NewFormAction.class); DesignModuleFactory.registerReplaceActionClass(ITReplaceAction.class); + DesignModuleFactory.registerReplacePane(ITReplaceMainDialog.class); DesignModuleFactory.registerFormParaDesignerClass(FormParaDesigner.class); DesignModuleFactory.registerParaPropertyPaneClass(ParameterPropertyPane.class); DesignModuleFactory.registerFormHierarchyPaneClass(FormHierarchyTreePane.class); From 7f835f9f8f64067203ff4ed8bd54326c72a3c04b Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 26 Sep 2022 14:48:43 +0800 Subject: [PATCH 006/310] =?UTF-8?q?REPORT-75998=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E5=AF=8C=E6=96=87=E6=9C=AC=E9=80=BB=E8=BE=91=E3=80=81=E5=AE=8C?= =?UTF-8?q?=E5=96=84=E9=80=9A=E9=85=8D=E7=AC=A6=E3=80=81=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=82=AC=E6=B5=AE=E5=85=83=E7=B4=A0=E5=9B=BE=E7=89=87=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../replace/action/SearchManagerCenter.java | 2 +- .../action/ShowSearchResultAction.java | 31 ++++++++++------- .../action/content/cell/SearchCellAction.java | 1 + .../floatelement/SearchFloatAction.java | 5 ++- .../content/formula/FormulaReplaceObject.java | 34 ------------------- .../cell/SearchCellFormulaManager.java | 2 -- .../design/actions/replace/info/CellInfo.java | 28 --------------- .../actions/replace/utils/ShowValueUtils.java | 9 ++--- 8 files changed, 30 insertions(+), 82 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/SearchManagerCenter.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/SearchManagerCenter.java index 211ab41d66..0608bde483 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/SearchManagerCenter.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/SearchManagerCenter.java @@ -61,7 +61,7 @@ public class SearchManagerCenter { */ public enum ManagerType implements SearchManager { /** - * 注册单元格不同值类型中自己特有的公式(数据列、子报表、公式、富文本,可自己添加) + * 注册单元格不同值类型中自己特有的公式(数据列、子报表、公式,可自己添加) */ CELL_FORMULA(0) { @Override diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/ShowSearchResultAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/ShowSearchResultAction.java index f555de9689..846263c5a9 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/ShowSearchResultAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/ShowSearchResultAction.java @@ -24,6 +24,7 @@ import com.fr.design.mainframe.JTemplate; import com.fr.general.GeneralUtils; import com.fr.report.cell.CellElement; import com.fr.report.cell.FloatElement; +import com.fr.report.cell.cellattr.core.RichText; import com.fr.stable.StringUtils; import com.fr.stable.collections.combination.Pair; import org.jetbrains.annotations.Nullable; @@ -75,7 +76,7 @@ public enum ShowSearchResultAction implements ShowValue { } else { Map stringHashMap = info.getValue(); String content = stringHashMap.getOrDefault(objectContentKey, StringUtils.EMPTY); - if (ShowValueUtils.contains(content,str) && StringUtils.isNotEmpty(content)) { + if (isValueValid(content, str, info)) { info.getContent().setShowStr(ShowValueUtils.getCommonString(content, str)); info.getContent().setOldShowStr(content); info.getContent().setOperatorArray(ShowValueUtils.getStringStartAndEndIndex(content, str)); @@ -94,6 +95,11 @@ public enum ShowSearchResultAction implements ShowValue { cellInfo.getContent().setSelected(true); } + private boolean isValueValid(String content, String str, Info info) { + CellElement cellElement = (CellElement) info.getContent().getReplaceObject(); + return ShowValueUtils.contains(content, str) && StringUtils.isNotEmpty(content) && !(cellElement.getValue() instanceof RichText); + + } }, /** * 搜索JS事件 @@ -139,7 +145,7 @@ public enum ShowSearchResultAction implements ShowValue { private void searchMap4JS(Map map, List jsInfos, JSInfo info, String str) { if (map.containsKey(objectNameKey) && StringUtils.isNotEmpty(map.get(objectNameKey))) { String name = map.get(objectNameKey); - if (name.contains(str)) { + if (ShowValueUtils.contains(name,str)) { JSInfo nameJSInfo = info.copy(); nameJSInfo.getContent().setShowStr(ShowValueUtils.getCommonString(name, str)); nameJSInfo.getContent().setOperatorArray(ShowValueUtils.getStringStartAndEndIndex(name, str)); @@ -151,7 +157,7 @@ public enum ShowSearchResultAction implements ShowValue { } if (map.containsKey(objectContentKey) && StringUtils.isNotEmpty(map.get(objectContentKey))) { String content = map.get(objectContentKey); - if (content.contains(str)) { + if (ShowValueUtils.contains(content,str)) { JSInfo contentJSInfo = info.copy(); contentJSInfo.getContent().setShowStr(ShowValueUtils.getCommonString(content, str)); contentJSInfo.getContent().setOperatorArray(ShowValueUtils.getStringStartAndEndIndex(content, str)); @@ -195,7 +201,7 @@ public enum ShowSearchResultAction implements ShowValue { private void searchMap4SQLContent(Map map, List sqlInfos, SQLInfo info, String str) { if (map.containsKey(objectContentKey) && StringUtils.isNotEmpty(map.get(objectContentKey))) { String content = map.get(objectContentKey); - if (content.contains(str)) { + if (ShowValueUtils.contains(content,str)) { SQLInfo contentJSInfo = info.copy(); contentJSInfo.getContent().setShowStr(ShowValueUtils.getCommonString(content, str)); contentJSInfo.getContent().setOperatorArray(ShowValueUtils.getStringStartAndEndIndex(content, str)); @@ -231,7 +237,7 @@ public enum ShowSearchResultAction implements ShowValue { if (((FloatInfo) info).isChartExist()) { ChartCollection chartCollection = (ChartCollection) floatElement.getValue(); for (int i = 0; i < chartCollection.getChartCount(); i++) { - if (isTitleNameValid(chartCollection.getChart(i).getTitle(),str)) { + if (isTitleNameValid(chartCollection.getChart(i).getTitle(), str)) { String titleName = GeneralUtils.objectToString(chartCollection.getChart(i).getTitle().getTextObject()); FloatInfo floatInfo = ((FloatInfo) info).copy(); floatInfo.setFloatChartIndex(i); @@ -244,7 +250,7 @@ public enum ShowSearchResultAction implements ShowValue { } } } else { - if (GeneralUtils.objectToString(floatElement.getValue()).contains(str)) { + if (ShowValueUtils.contains(GeneralUtils.objectToString(floatElement.getValue()), str)) { FloatInfo floatInfo = ((FloatInfo) info).copy(); setShowInfo(floatInfo, GeneralUtils.objectToString(floatElement.getValue()), str); floatInfos.add(floatInfo); @@ -285,7 +291,7 @@ public enum ShowSearchResultAction implements ShowValue { private void searchMap4Component(Map stringHashMap, ArrayList componentInfos, ComponentInfo info, String str) { if (stringHashMap.containsKey(objectContentKey)) { String content = stringHashMap.get(objectContentKey); - if (content.contains(str)) { + if (ShowValueUtils.contains(content,str)) { info.getContent().setShowStr(ShowValueUtils.getCommonString(content, str)); info.getContent().setOldShowStr(stringHashMap.get(objectContentKey)); info.getContent().setOperatorArray(ShowValueUtils.getStringStartAndEndIndex(content, str)); @@ -319,7 +325,7 @@ public enum ShowSearchResultAction implements ShowValue { private void searchMap4Widget(Map map, List widgetInfos, WidgetInfo info, String str) { if (map.containsKey(objectNameKey)) { String name = map.get(objectNameKey); - if (StringUtils.isNotEmpty(name) && name.contains(str)) { + if (StringUtils.isNotEmpty(name) && ShowValueUtils.contains(name,str)) { WidgetInfo nameInfo = info.copy(info); nameInfo.getContent().setShowStr(ShowValueUtils.getCommonString(name, str)); nameInfo.getContent().setOldShowStr(map.get(objectNameKey)); @@ -331,7 +337,7 @@ public enum ShowSearchResultAction implements ShowValue { } if (map.containsKey(objectWaterMarkKey)) { String waterMark = map.get(objectWaterMarkKey); - if (StringUtils.isNotEmpty(waterMark) && waterMark.contains(str)) { + if (StringUtils.isNotEmpty(waterMark) && ShowValueUtils.contains(waterMark,str)) { WidgetInfo widgetInfo = info.copy(info); widgetInfo.getContent().setShowStr(ShowValueUtils.getCommonString(waterMark, str)); widgetInfo.getContent().setOldShowStr(map.get(objectWaterMarkKey)); @@ -368,7 +374,7 @@ public enum ShowSearchResultAction implements ShowValue { private void searchMap4Formula(Map stringHashMap, List formulaInfos, FormulaInfo info, String str) { if (stringHashMap.containsKey(objectContentKey)) { String name = stringHashMap.get(objectContentKey); - if (name.contains(str)) { + if (ShowValueUtils.contains(name,str)) { info.getContent().setShowStr(ShowValueUtils.getCommonString(name, str)); info.getContent().setOldShowStr(stringHashMap.get(objectContentKey)); info.getContent().setOperatorArray(ShowValueUtils.getStringStartAndEndIndex(name, str)); @@ -411,11 +417,12 @@ public enum ShowSearchResultAction implements ShowValue { /** * 标题是否可用 + * * @param title * @param str * @return */ - public boolean isTitleNameValid(Title title, String str){ - return title != null && ShowValueUtils.contains(GeneralUtils.objectToString(title.getTextObject()),str) && StringUtils.isNotEmpty(GeneralUtils.objectToString(title.getTextObject())); + public boolean isTitleNameValid(Title title, String str) { + return title != null && ShowValueUtils.contains(GeneralUtils.objectToString(title.getTextObject()), str) && StringUtils.isNotEmpty(GeneralUtils.objectToString(title.getTextObject())); } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/cell/SearchCellAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/cell/SearchCellAction.java index 826b247e0c..0f2f6d181a 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/cell/SearchCellAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/cell/SearchCellAction.java @@ -17,6 +17,7 @@ import com.fr.form.ui.widget.CRBoundsWidget; import com.fr.general.GeneralUtils; import com.fr.main.impl.WorkBook; import com.fr.report.cell.CellElement; +import com.fr.report.cell.cellattr.core.RichText; import com.fr.report.elementcase.ElementCase; import com.fr.report.poly.PolyECBlock; import com.fr.report.report.Report; diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/floatelement/SearchFloatAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/floatelement/SearchFloatAction.java index 6f0a338b90..4a478b596e 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/floatelement/SearchFloatAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/floatelement/SearchFloatAction.java @@ -7,6 +7,7 @@ import com.fr.design.actions.replace.info.FloatInfo; import com.fr.design.actions.replace.info.base.ITContent; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.JTemplate; +import com.fr.general.ImageWithSuffix; import com.fr.main.impl.WorkBook; import com.fr.report.cell.FloatElement; import com.fr.report.elementcase.ElementCase; @@ -84,7 +85,9 @@ public class SearchFloatAction implements SearchAction { if (floatElement.getValue() instanceof ChartCollection) { floatInfo.setChartExist(true); } - result.add(floatInfo); + if (!(floatElement.getValue() instanceof ImageWithSuffix)){ + result.add(floatInfo); + } } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java index 720dbab1e8..e002832656 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java @@ -133,40 +133,6 @@ public enum FormulaReplaceObject implements DealWithInfoValue { return false; } }, - /** - * 富文本 - */ - RICH_CHAR("RichChar") { - @Override - public Map getValue(Object... o) { - HashMap map = new HashMap<>(); - if (o[0] instanceof RichChar) { - if (StringUtils.isNotEmpty(((RichChar) o[0]).getText())) { - map.put("content", (((RichChar) o[0]).getText())); - } - } - return map; - } - - @Override - public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { - Object replaceObject = info.getContent().getReplaceObject(); - if (replaceObject instanceof RichChar) { - RichChar richChar = (RichChar) replaceObject; - info.updateOldStr(richChar.getText(), findStr); - richChar.setText(ShowValueUtils.replaceAll(richChar.getText(), findStr, replaceStr)); - } - } - - @Override - public boolean check(Info info) { - if (info.getContent().getReplaceObject() instanceof RichChar){ - RichChar richChar = (RichChar) info.getContent().getReplaceObject(); - return StringUtils.equals(richChar.getText(), info.getContent().getOldShowStr()); - } - return false; - } - }, /** * KV */ diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaManager.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaManager.java index eee99bf203..59982245e3 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaManager.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaManager.java @@ -25,8 +25,6 @@ public class SearchCellFormulaManager implements SearchManager { register(DS_COLUMN, SearchDSColumnFormulaAction.getInstance()); //公式 register(FORMULA, SearchCellFormulaTypeAction.getInstance()); - //富文本 - register(RICH_TEXT, SearchRichFormulaAction.getInstance()); //子报表 register(SUB_REPORT, SearchSubReportFormulaAction.getInstance()); diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/CellInfo.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/CellInfo.java index 94a8f73ce5..e5a6ce4fa2 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/CellInfo.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/CellInfo.java @@ -219,34 +219,6 @@ public class CellInfo implements Info { return ((DSColumn) o.getValue()).getDSName(); } }, - - /** - * 富文本形式 - * 为了不破坏富文本的格式,暂时不对样式不同的文本进行连接替换,每个样式不同的文本都是一个独立的个体 - */ - RICH_TEXT("RichText") { - @Override - public void setValue(CellInfo cellInfo, Object o, String findStr, String replaceStr) { - cellInfo.updateOldStr(GeneralUtils.objectToString(((RichText) o).getContent()), findStr); - Iterator it = ((RichText) o).charIterator(); - while (it.hasNext()) { - RichChar richChar = it.next(); - richChar.setText(ShowValueUtils.replaceAll(richChar.getText(), findStr, replaceStr)); - } - } - - @Override - public void addValue2Map(Object o, HashMap map) { - map.put("content", ((RichText) o).getContent()); - } - - @Override - public String getCheckValue(Info info) { - CellElement o = (CellElement) info.getContent().getReplaceObject(); - return ((RichText) o.getValue()).getContent(); - } - }, - /** * 公式类型 */ diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java index b7da5fc23c..c0d95e7079 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java @@ -31,7 +31,7 @@ public class ShowValueUtils { public static final String ENGLISH_REGEX = "[a-zA-Z]"; private static List specialCharList = new ArrayList<>(); static { - //正则特殊字符:? * () [] {} ^ $ + //正则特殊字符:? * () [] {} ^ $ . //如果是? 并采用通配符 ,会自动转成“.” 所以 ? 不用处理 //$同理 specialCharList.add("*"); @@ -42,6 +42,7 @@ public class ShowValueUtils { specialCharList.add("{"); specialCharList.add("}"); specialCharList.add("^"); + specialCharList.add("."); } /** @@ -82,13 +83,13 @@ public class ShowValueUtils { * @return */ public static String changeRegex(String regex) { - regex = regex.replace(NUMBER, NUMBER_REGEX); - regex = regex.replace(ENGLISH, ENGLISH_REGEX); - regex = regex.replace(ANY_THING, ANY_THING_REGEX); String change = "\\"; for (int i = 0 ; i < specialCharList.size() ; i ++){ regex = regex.replace(specialCharList.get(i),change + specialCharList.get(i)); } + regex = regex.replace(NUMBER, NUMBER_REGEX); + regex = regex.replace(ENGLISH, ENGLISH_REGEX); + regex = regex.replace(ANY_THING, ANY_THING_REGEX); return regex; } From 92bd5476c6fe342a0f7d7959d6a4b24aac912193 Mon Sep 17 00:00:00 2001 From: rinoux Date: Mon, 26 Sep 2022 15:00:47 +0800 Subject: [PATCH 007/310] =?UTF-8?q?REPORT-80583=20=E5=A4=9A=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E6=95=B0=E6=8D=AE=E9=9B=86=E9=A2=84=E8=A7=88=E8=A6=81?= =?UTF-8?q?=E5=BC=B9=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/data/DesignTableDataManager.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java index 2b654b6f49..2ce2a7d828 100644 --- a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java +++ b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java @@ -625,6 +625,8 @@ public abstract class DesignTableDataManager { // 把storeProcedure写成xml文件到out DataCoreXmlUtils.writeXMLStoreProcedure(writer, storeProcedure, null); if (storeProcedure.getDataModelList().size() > 0 && !storeProcedure.isFirstExpand()) { + // 存储过程有些特殊处理 + // 这个就简单直接获取暂存列表吧 return storeProcedure.getDataModelList().toArray(new ProcedureDataModel[0]); } ParameterProvider[] inParameters = DataOperator.getInstance().getStoreProcedureParameters(storeProcedure); @@ -633,13 +635,14 @@ public abstract class DesignTableDataManager { showParaWindow(parameterMap, inParameters); } storeProcedure.setFirstExpand(false); + } else { + ParameterProvider[] parameters = DataOperator.getInstance().getTableDataParameters(tableData); + if (parameters.length > 0) { + showParaWindow(parameterMap, parameters); + } } - // 存储过程有些特殊处理 - // 这个就简单直接获取暂存列表吧 if (needLoadingBar) { - ParameterProvider[] parameters = DataOperator.getInstance().getTableDataParameters(tableData); - showParaWindow(parameterMap, parameters); MultiResultTableDataWrapper.loadingBar.start(); } return DataOperator.getInstance().previewMultiResultTableData(tableData, parameterMap, 0); From 3df37c4bddd4e397e7f72ac4ed692863d46e1a6d Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 26 Sep 2022 15:49:51 +0800 Subject: [PATCH 008/310] =?UTF-8?q?REPORT-80444=20=E6=96=B0=E8=87=AA?= =?UTF-8?q?=E9=80=82=E5=BA=94=E6=8E=A7=E4=BB=B6=E6=A0=B7=E5=BC=8F=E6=95=88?= =?UTF-8?q?=E6=9E=9C=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/creator/XCreatorUtils.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java index 5e7807698a..9b30a42d45 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java @@ -19,6 +19,7 @@ import com.fr.design.designer.creator.cardlayout.XWCardTagLayout; import com.fr.design.designer.creator.cardlayout.XWCardTitleLayout; import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; import com.fr.design.file.HistoryTemplateListCache; +import com.fr.design.fit.common.TemplateTool; import com.fr.design.fun.ChartWidgetOptionProvider; import com.fr.design.fun.FormWidgetOptionProvider; import com.fr.design.fun.ParameterWidgetOptionProvider; @@ -39,6 +40,7 @@ import com.fr.form.ui.ComboCheckBox; import com.fr.form.ui.DateEditor; import com.fr.form.ui.EditorHolder; import com.fr.form.ui.ElementCaseEditor; +import com.fr.form.ui.FieldEditor; import com.fr.form.ui.FileEditor; import com.fr.form.ui.FreeButton; import com.fr.form.ui.IframeEditor; @@ -51,6 +53,7 @@ import com.fr.form.ui.Radio; import com.fr.form.ui.RadioGroup; import com.fr.form.ui.TextArea; import com.fr.form.ui.TextEditor; +import com.fr.form.ui.ToggleButton; import com.fr.form.ui.TreeComboBoxEditor; import com.fr.form.ui.TreeEditor; import com.fr.form.ui.Widget; @@ -236,14 +239,30 @@ public class XCreatorUtils { } public static XCreator createThemedXCreator(Widget widget) { + JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); TemplateTheme theme = template.getTemplateTheme(); if (theme instanceof FormTheme) { widget = setupTemplateTheme(widget, true, (FormTheme) theme, TemplateThemeCompatible.NONE); } + if (TemplateTool.isCurrentEditingNewJForm()){ + resetWidgetDefaultProperty(widget); + } return createXCreator(widget); } + /** + * 新表单下控件的字体默认都为9pt + * @param widget 控件 + */ + private static void resetWidgetDefaultProperty(Widget widget) { + if (widget.acceptType(FieldEditor.class)) { + ((FieldEditor) widget).setFontSize(Widget.DEFAULT_FONT_PT_SIZE); + } else if (widget.acceptType(ToggleButton.class)) { + ((ToggleButton) widget).setFontSize(Widget.DEFAULT_FONT_PT_SIZE); + } + } + /** * 创建creator * From a3041d2f0ba102fd8a7c0215407cfcd75a626f8e Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 26 Sep 2022 16:05:39 +0800 Subject: [PATCH 009/310] =?UTF-8?q?REPORT-75998=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E7=BB=84=E5=90=88=E5=9B=BEJS=E3=80=81=E5=85=AC=E5=BC=8F?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SearchChartCollectionFormulaAction.java | 33 ++++++++++++++----- .../content/js/SearchChartJSAction.java | 29 ++++++++++++++++ .../actions/replace/info/ReplaceObject.java | 22 +++++-------- 3 files changed, 62 insertions(+), 22 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java index 6d85266228..40ff04006c 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java @@ -9,6 +9,7 @@ import com.fr.chart.base.AttrChangeConfig; import com.fr.chart.chartattr.Axis; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; +import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.SwitchTitle; import com.fr.chart.chartattr.Title; @@ -28,6 +29,9 @@ import com.fr.js.NameJavaScriptGroup; import com.fr.plugin.chart.attr.axis.VanChartAlertValue; import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.axis.VanChartValueAxis; +import com.fr.plugin.chart.custom.CustomPlotFactory; +import com.fr.plugin.chart.custom.VanChartCustomPlot; +import com.fr.plugin.chart.custom.type.CustomPlotType; import com.fr.report.cell.TemplateCellElement; import com.fr.stable.StringUtils; @@ -92,20 +96,31 @@ public class SearchChartCollectionFormulaAction { Toolkit.i18nText("Fine-Design_Chart_Animation_Special"), Toolkit.i18nText("Fine-Design_Chart_Interactive") ); - if (chart.getPlot() != null) { - NameJavaScriptGroup javaScriptGroup = chart.getPlot().getHotHyperLink(); - if (javaScriptGroup != null) { - for (int i = 0; i < javaScriptGroup.size(); i++) { - NameJavaScript javaScript = javaScriptGroup.getNameHyperlink(i); - conditionContent.addOtherPos(javaScript.getName()); - SearchJSHighlightAction action = SearchJSHighlightAction.getInstance(); - action.searchJSFormulaFromOther(formulaInfos, conditionContent, javaScript.getJavaScript()); - } + + if (chart.getPlot() instanceof VanChartCustomPlot){ + VanChartCustomPlot plot = chart.getPlot(); + for (int i = 0 ; i < plot.getCustomPlotList().size() ; i++){ + ITContent customContent = ITContent.copy(conditionContent); + customContent.addOtherPos(CustomPlotFactory.getTitle(CustomPlotFactory.getCustomType(plot.getCustomPlotList().get(i)))); + dealPlot(formulaInfos,customContent,plot.getCustomPlotList().get(i)); } + } else if (chart.getPlot() != null) { + dealPlot(formulaInfos,conditionContent,chart.getPlot()); } } + private void dealPlot(List formulaInfos, ITContent content, Plot plot){ + NameJavaScriptGroup javaScriptGroup = plot.getHotHyperLink(); + if (javaScriptGroup != null) { + for (int i = 0; i < javaScriptGroup.size(); i++) { + NameJavaScript javaScript = javaScriptGroup.getNameHyperlink(i); + content.addOtherPos(javaScript.getName()); + SearchJSHighlightAction action = SearchJSHighlightAction.getInstance(); + action.searchJSFormulaFromOther(formulaInfos, content, javaScript.getJavaScript()); + } + } + } private void searchFormulaFromChartPresent(List formulaInfos, ITContent content, TopDefinitionProvider provider) { searchPresent4Formula(provider.getCategoryPresent(), content, formulaInfos); diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchChartJSAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchChartJSAction.java index bbcb960053..069167260a 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchChartJSAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchChartJSAction.java @@ -7,14 +7,20 @@ import com.fr.design.actions.replace.info.JSInfo; import com.fr.design.actions.replace.info.base.ITContent; import com.fr.design.actions.replace.utils.SearchJSUtils; import com.fr.design.i18n.Toolkit; +import com.fr.js.JavaScriptImpl; import com.fr.js.NameJavaScript; +import com.fr.js.NameJavaScriptGroup; import com.fr.plugin.chart.attr.axis.VanChartAxis; +import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.base.RefreshMoreLabel; import com.fr.plugin.chart.base.VanChartHtmlLabel; +import com.fr.plugin.chart.custom.CustomPlotFactory; +import com.fr.plugin.chart.custom.VanChartCustomPlot; import com.fr.plugin.chart.vanchart.VanChart; import com.fr.stable.collections.combination.Pair; +import java.util.ArrayList; import java.util.List; /** @@ -60,7 +66,30 @@ public class SearchChartJSAction { chartContent.addOtherPos(chartCollection.getChart(i).getChartName()); //坐标轴 searchAxisJS(jsInfos, chartContent, chartCollection.getChart(i)); + //组合图表-条件属性-超链特判 + dealCustomPlot(jsInfos, conditionContent,chartCollection.getChart(i)); + } + } + private void dealCustomPlot(List jsInfos, ITContent conditionContent, Chart chart) { + if (chart.getPlot() instanceof VanChartCustomPlot){ + VanChartCustomPlot customPlot = chart.getPlot(); + for (VanChartPlot plot : customPlot.getCustomPlotList()){ + NameJavaScriptGroup javaScriptGroup = plot.getHotHyperLink(); + if (javaScriptGroup != null){ + for (int i = 0 ; i < javaScriptGroup.size();i++){ + if (javaScriptGroup.getNameHyperlink(i).getJavaScript() instanceof JavaScriptImpl){ + ITContent content = ITContent.copy(conditionContent); + content.addOtherPos( + CustomPlotFactory.getTitle(CustomPlotFactory.getCustomType(plot)), + javaScriptGroup.getNameHyperlink(i).getName() + ); + content.setReplaceObject(javaScriptGroup.getNameHyperlink(i)); + jsInfos.add(new JSInfo(content)); + } + } + } + } } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java index 9f06a2d716..240ac6ba36 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java @@ -46,7 +46,7 @@ public enum ReplaceObject implements DealWithInfoValue { } else { NameJavaScript javaScript = ((NameJavaScript) (info.getContent().getReplaceObject())); info.updateOldStr(javaScript.getName(), findStr); - javaScript.setName(javaScript.getName().replaceAll(findStr, replaceStr)); + javaScript.setName(ShowValueUtils.replaceAll(javaScript.getName(), findStr, replaceStr)); } } @@ -87,15 +87,13 @@ public enum ReplaceObject implements DealWithInfoValue { @Override public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { if (((JSInfo) info).isContent()) { - if (operatorArray.size() > 0) { - JavaScriptImpl javaScript = (JavaScriptImpl) ((Listener) (info.getContent().getReplaceObject())).getAction(); - info.updateOldStr(javaScript.getContent(), findStr); - javaScript.setContent(ShowValueUtils.replaceAll(javaScript.getContent(), findStr, replaceStr)); - } + JavaScriptImpl javaScript = (JavaScriptImpl) ((Listener) (info.getContent().getReplaceObject())).getAction(); + info.updateOldStr(javaScript.getContent(), findStr); + javaScript.setContent(ShowValueUtils.replaceAll(javaScript.getContent(), findStr, replaceStr)); } else { Listener listener = ((Listener) ((info.getContent().getReplaceObject()))); info.updateOldStr(listener.getName(), findStr); - listener.setName(listener.getName().replaceAll(findStr, replaceStr)); + listener.setName(ShowValueUtils.replaceAll(listener.getName(), findStr, replaceStr)); } } @@ -135,12 +133,10 @@ public enum ReplaceObject implements DealWithInfoValue { @Override public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { if (((JSInfo) info).isContent()) { - if (operatorArray.size() > 0) { - VanChartHtmlLabel htmlLabel = ((VanChartHtmlLabel) (info.getContent().getReplaceObject())); - StringBuilder stringBuilder = new StringBuilder(htmlLabel.getCustomText()); - info.updateOldStr(htmlLabel.getCustomText(), findStr); - htmlLabel.setCustomText(ShowValueUtils.replaceAll(htmlLabel.getCustomText(), findStr, replaceStr)); - } + VanChartHtmlLabel htmlLabel = ((VanChartHtmlLabel) (info.getContent().getReplaceObject())); + StringBuilder stringBuilder = new StringBuilder(htmlLabel.getCustomText()); + info.updateOldStr(htmlLabel.getCustomText(), findStr); + htmlLabel.setCustomText(ShowValueUtils.replaceAll(htmlLabel.getCustomText(), findStr, replaceStr)); } } From eca25b845df9100f487390816f1d9c90a78c9af0 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 26 Sep 2022 16:14:26 +0800 Subject: [PATCH 010/310] =?UTF-8?q?REPORT-75998=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=B3=A8=E9=87=8A=E3=80=81=E8=B0=83=E6=95=B4=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../action/content/cell/SearchCellAction.java | 1 - .../content/floatelement/SearchFloatAction.java | 2 +- .../chart/SearchChartCollectionFormulaAction.java | 10 +++++----- .../condition/SearchFormulaConditionAction.java | 1 - .../action/content/js/SearchChartJSAction.java | 12 ++++++------ .../design/actions/replace/utils/ShowValueUtils.java | 12 +++++++++--- 6 files changed, 21 insertions(+), 17 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/cell/SearchCellAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/cell/SearchCellAction.java index 0f2f6d181a..826b247e0c 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/cell/SearchCellAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/cell/SearchCellAction.java @@ -17,7 +17,6 @@ import com.fr.form.ui.widget.CRBoundsWidget; import com.fr.general.GeneralUtils; import com.fr.main.impl.WorkBook; import com.fr.report.cell.CellElement; -import com.fr.report.cell.cellattr.core.RichText; import com.fr.report.elementcase.ElementCase; import com.fr.report.poly.PolyECBlock; import com.fr.report.report.Report; diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/floatelement/SearchFloatAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/floatelement/SearchFloatAction.java index 4a478b596e..4eaa574bea 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/floatelement/SearchFloatAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/floatelement/SearchFloatAction.java @@ -85,7 +85,7 @@ public class SearchFloatAction implements SearchAction { if (floatElement.getValue() instanceof ChartCollection) { floatInfo.setChartExist(true); } - if (!(floatElement.getValue() instanceof ImageWithSuffix)){ + if (!(floatElement.getValue() instanceof ImageWithSuffix)) { result.add(floatInfo); } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java index 40ff04006c..aadf2aee41 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java @@ -97,20 +97,20 @@ public class SearchChartCollectionFormulaAction { Toolkit.i18nText("Fine-Design_Chart_Interactive") ); - if (chart.getPlot() instanceof VanChartCustomPlot){ + if (chart.getPlot() instanceof VanChartCustomPlot) { VanChartCustomPlot plot = chart.getPlot(); - for (int i = 0 ; i < plot.getCustomPlotList().size() ; i++){ + for (int i = 0; i < plot.getCustomPlotList().size(); i++) { ITContent customContent = ITContent.copy(conditionContent); customContent.addOtherPos(CustomPlotFactory.getTitle(CustomPlotFactory.getCustomType(plot.getCustomPlotList().get(i)))); - dealPlot(formulaInfos,customContent,plot.getCustomPlotList().get(i)); + dealPlot(formulaInfos, customContent, plot.getCustomPlotList().get(i)); } } else if (chart.getPlot() != null) { - dealPlot(formulaInfos,conditionContent,chart.getPlot()); + dealPlot(formulaInfos, conditionContent, chart.getPlot()); } } - private void dealPlot(List formulaInfos, ITContent content, Plot plot){ + private void dealPlot(List formulaInfos, ITContent content, Plot plot) { NameJavaScriptGroup javaScriptGroup = plot.getHotHyperLink(); if (javaScriptGroup != null) { for (int i = 0; i < javaScriptGroup.size(); i++) { diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/condition/SearchFormulaConditionAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/condition/SearchFormulaConditionAction.java index c6b8533219..44d495018b 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/condition/SearchFormulaConditionAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/condition/SearchFormulaConditionAction.java @@ -21,7 +21,6 @@ public class SearchFormulaConditionAction implements SearchConditionFormula { } - @Override public void searchFormulaFromCondition(List formulaInfos, ITContent content, Condition condition) { if (((FormulaCondition) (condition)).getFormula() != null) { diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchChartJSAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchChartJSAction.java index 069167260a..ad97655263 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchChartJSAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchChartJSAction.java @@ -67,18 +67,18 @@ public class SearchChartJSAction { //坐标轴 searchAxisJS(jsInfos, chartContent, chartCollection.getChart(i)); //组合图表-条件属性-超链特判 - dealCustomPlot(jsInfos, conditionContent,chartCollection.getChart(i)); + dealCustomPlot(jsInfos, conditionContent, chartCollection.getChart(i)); } } private void dealCustomPlot(List jsInfos, ITContent conditionContent, Chart chart) { - if (chart.getPlot() instanceof VanChartCustomPlot){ + if (chart.getPlot() instanceof VanChartCustomPlot) { VanChartCustomPlot customPlot = chart.getPlot(); - for (VanChartPlot plot : customPlot.getCustomPlotList()){ + for (VanChartPlot plot : customPlot.getCustomPlotList()) { NameJavaScriptGroup javaScriptGroup = plot.getHotHyperLink(); - if (javaScriptGroup != null){ - for (int i = 0 ; i < javaScriptGroup.size();i++){ - if (javaScriptGroup.getNameHyperlink(i).getJavaScript() instanceof JavaScriptImpl){ + if (javaScriptGroup != null) { + for (int i = 0; i < javaScriptGroup.size(); i++) { + if (javaScriptGroup.getNameHyperlink(i).getJavaScript() instanceof JavaScriptImpl) { ITContent content = ITContent.copy(conditionContent); content.addOtherPos( CustomPlotFactory.getTitle(CustomPlotFactory.getCustomType(plot)), diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java index c0d95e7079..8f962667d3 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java @@ -1,7 +1,6 @@ package com.fr.design.actions.replace.utils; - import com.fr.design.actions.replace.ui.ITReplaceMainDialog; import com.fr.stable.StringUtils; import com.fr.stable.collections.combination.Pair; @@ -30,6 +29,7 @@ public class ShowValueUtils { public static final String NUMBER_REGEX = "[0-9]"; public static final String ENGLISH_REGEX = "[a-zA-Z]"; private static List specialCharList = new ArrayList<>(); + static { //正则特殊字符:? * () [] {} ^ $ . //如果是? 并采用通配符 ,会自动转成“.” 所以 ? 不用处理 @@ -84,8 +84,8 @@ public class ShowValueUtils { */ public static String changeRegex(String regex) { String change = "\\"; - for (int i = 0 ; i < specialCharList.size() ; i ++){ - regex = regex.replace(specialCharList.get(i),change + specialCharList.get(i)); + for (int i = 0; i < specialCharList.size(); i++) { + regex = regex.replace(specialCharList.get(i), change + specialCharList.get(i)); } regex = regex.replace(NUMBER, NUMBER_REGEX); regex = regex.replace(ENGLISH, ENGLISH_REGEX); @@ -185,6 +185,12 @@ public class ShowValueUtils { return failReturn; } + /** + * 支持通配符的contains + * @param originStr + * @param matchStr + * @return + */ public static boolean contains(String originStr, String matchStr) { if (ITReplaceMainDialog.isMatched()) { String str = changeRegex(matchStr); From b583847db8be588f2797de936ea9aaecb35511b6 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 26 Sep 2022 16:33:58 +0800 Subject: [PATCH 011/310] =?UTF-8?q?REPORT-75998=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E9=AD=94=E6=9C=AF=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../replace/ui/ITReplaceSouthPanel.java | 6 +++++- .../actions/replace/ui/ITTableEditor.java | 6 +++--- .../actions/replace/ui/ITTableEditorPane.java | 10 +++++----- .../actions/replace/utils/ShowValueUtils.java | 20 +++++++++---------- 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java index 8921dce5ff..a240eba967 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java @@ -14,6 +14,10 @@ import java.awt.Color; public class ITReplaceSouthPanel { ITTableEditorPane tableEditorPane; ITTableEditor itTableEditor; + //勾选框索引 + public static final int CHECKBOX_INDEX = 0; + //ITContent在表格的列索引 + public static final int CONTENT_INDEX = 6; public ITReplaceSouthPanel() { itTableEditor = new ITTableEditor(); @@ -21,7 +25,7 @@ public class ITReplaceSouthPanel { RowSorter sorter = new TableRowSorter(itTableEditor){ @Override public boolean isSortable(int column) { - return column != 0 || column != 6; + return column != CHECKBOX_INDEX || column != CONTENT_INDEX; } }; tableEditorPane.getEditTable().setRowSorter(sorter); diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java index 45e209f3a8..5c57e6d6a1 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java @@ -48,8 +48,8 @@ public class ITTableEditor extends UITableModelAdapter { this.setDefaultEditor(ITTableButton.class, new ITTableButton()); this.setDefaultRenderer(ITTableButton.class, new ITTableButton()); - this.createTable().getColumnModel().getColumn(6).setMaxWidth(50); - this.createTable().getColumnModel().getColumn(0).setMaxWidth(50); + this.createTable().getColumnModel().getColumn(ITReplaceSouthPanel.CONTENT_INDEX).setMaxWidth(50); + this.createTable().getColumnModel().getColumn(ITReplaceSouthPanel.CHECKBOX_INDEX).setMaxWidth(50); } @@ -81,7 +81,7 @@ public class ITTableEditor extends UITableModelAdapter { */ @Override public boolean isCellEditable(int row, int col) { - return col == 6 || col == 0; + return col == ITReplaceSouthPanel.CONTENT_INDEX || col == ITReplaceSouthPanel.CHECKBOX_INDEX; } /** diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java index c35f2ef14d..a9fe470edd 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java @@ -70,8 +70,8 @@ public class ITTableEditorPane extends BasicPane { public void mouseClicked(MouseEvent e) { int row = ((JTable) e.getSource()).rowAtPoint(e.getPoint()); int col = ((JTable) e.getSource()).columnAtPoint(e.getPoint()); - if (col == 0) { - ITContent content = (ITContent) editTable.getValueAt(row, 6); + if (col == ITReplaceSouthPanel.CHECKBOX_INDEX) { + ITContent content = (ITContent) editTable.getValueAt(row, ITReplaceSouthPanel.CONTENT_INDEX); if (content.isSelected()) { content.setSelected(false); editTable.setValueAt(content.isSelected(), row, col); @@ -116,7 +116,7 @@ public class ITTableEditorPane extends BasicPane { if (e.getClickCount() > 0) { //获得选中列 int selectColumn = tableHeader.columnAtPoint(e.getPoint()); - if (selectColumn == 0) { + if (selectColumn == ITReplaceSouthPanel.CHECKBOX_INDEX) { boolean value = !selectBox.isSelected(); selectBox.setSelected(value); selectAllOrNull(value); @@ -152,7 +152,7 @@ public class ITTableEditorPane extends BasicPane { label.setHorizontalAlignment(SwingConstants.LEFT); selectBox.setHorizontalAlignment(SwingConstants.CENTER); selectBox.setBorderPainted(true); - JComponent component = (column == 0) ? selectBox : label; + JComponent component = (column == ITReplaceSouthPanel.CHECKBOX_INDEX) ? selectBox : label; component.setForeground(tableHeader.getForeground()); component.setBackground(tableHeader.getBackground()); component.setFont(tableHeader.getFont()); @@ -187,7 +187,7 @@ public class ITTableEditorPane extends BasicPane { */ public static void selectAllOrNull(Boolean value) { for (int i = 0; i < getEditTable().getRowCount(); i++) { - ((ITContent) (getEditTable().getValueAt(i, 6))).setSelected(value); + ((ITContent) (getEditTable().getValueAt(i, ITReplaceSouthPanel.CONTENT_INDEX))).setSelected(value); } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java index 8f962667d3..fa28c6de8b 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java @@ -79,18 +79,18 @@ public class ShowValueUtils { /** * 转换正则表达式 * - * @param regex + * @param regexStr * @return */ - public static String changeRegex(String regex) { + public static String changeRegex(String regexStr) { String change = "\\"; for (int i = 0; i < specialCharList.size(); i++) { - regex = regex.replace(specialCharList.get(i), change + specialCharList.get(i)); + regexStr = regexStr.replace(specialCharList.get(i), change + specialCharList.get(i)); } - regex = regex.replace(NUMBER, NUMBER_REGEX); - regex = regex.replace(ENGLISH, ENGLISH_REGEX); - regex = regex.replace(ANY_THING, ANY_THING_REGEX); - return regex; + regexStr = regexStr.replace(NUMBER, NUMBER_REGEX); + regexStr = regexStr.replace(ENGLISH, ENGLISH_REGEX); + regexStr = regexStr.replace(ANY_THING, ANY_THING_REGEX); + return regexStr; } /** @@ -170,13 +170,13 @@ public class ShowValueUtils { * 支持正则表达式的indexOf * * @param str - * @param regex + * @param regexStr * @return */ - public static int indexOf(String str, String regex) { + public static int indexOf(String str, String regexStr) { CharSequence inputStr = str; int failReturn = -1; - String patternStr = changeRegex(regex); + String patternStr = changeRegex(regexStr); Pattern pattern = Pattern.compile(patternStr); Matcher matcher = pattern.matcher(inputStr); if (matcher.find()) { From a0c4924612e8c9afb9f03d25a14e5988cdf6c4ba Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 26 Sep 2022 17:46:01 +0800 Subject: [PATCH 012/310] =?UTF-8?q?REPORT-75998=20=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E5=85=AC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SearchCommit2DBJSFormulaAction.java | 16 ++++++++ .../SearchExportJSFormulaAction.java | 15 +++++++ .../widget/SearchDateEditorFormulaAction.java | 4 +- .../widget/SearchTreeEditorFormulaAction.java | 40 +++++++++++++------ 4 files changed, 60 insertions(+), 15 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java index 76ad5ee2bb..dec08034ab 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java @@ -1,5 +1,6 @@ package com.fr.design.actions.replace.action.content.formula.highlight.javascript; +import com.fr.base.Formula; import com.fr.design.actions.replace.action.content.formula.highlight.condition.SearchConditionFormula; import com.fr.design.actions.replace.action.content.formula.highlight.condition.SearchConditionManager; import com.fr.design.actions.replace.info.FormulaInfo; @@ -10,6 +11,7 @@ import com.fr.js.Commit2DBJavaScript; import com.fr.js.JavaScript; import com.fr.write.DBManipulation; import com.fr.write.DMLConfigJob; +import com.fr.write.config.ColumnConfig; import com.fr.write.config.DMLConfig; import java.util.List; @@ -41,12 +43,26 @@ public class SearchCommit2DBJSFormulaAction implements SearchJSFormula { private void dealWithDBManipulation(List formulaInfos, ITContent content, DBManipulation dbManipulation) { DMLConfig dmlConfig = dbManipulation.getDmlConfig(); + //值中的公式 + dealWithColumnValue(formulaInfos, content, dmlConfig); //处理提交条件中的公式 dealWithCommit2DBCondition(formulaInfos, content, dmlConfig); //处理DBManipulation dealWithSubmitJob(formulaInfos, content, dmlConfig); } + private void dealWithColumnValue(List formulaInfos, ITContent content, DMLConfig dmlConfig) { + for (int i = 0; i < dmlConfig.getColumnConfigCount(); i++) { + ColumnConfig columnConfig = dmlConfig.getColumnConfig(i); + if (columnConfig.getColumnValue() instanceof Formula) { + ITContent configContent = ITContent.copy(content); + configContent.addOtherPos(Toolkit.i18nText("Fine-Design_Basic_Base_Value")); + configContent.setReplaceObject(columnConfig.getColumnValue()); + formulaInfos.add(new FormulaInfo(configContent)); + } + } + } + private void dealWithSubmitJob(List formulaInfos, ITContent content, DMLConfig dmlConfig) { for (int i = 0; i < dmlConfig.getSubmitJobCount(); i++) { //这边自定义事件不需要处理,只处理提交事件 diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchExportJSFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchExportJSFormulaAction.java index 716c2d908f..d19970c218 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchExportJSFormulaAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchExportJSFormulaAction.java @@ -1,11 +1,14 @@ package com.fr.design.actions.replace.action.content.formula.highlight.javascript; +import com.fr.base.Formula; +import com.fr.base.Parameter; import com.fr.design.actions.replace.info.FormulaInfo; import com.fr.design.actions.replace.info.base.ITContent; import com.fr.design.i18n.Toolkit; import com.fr.js.ExportJavaScript; import com.fr.js.JavaScript; import com.fr.js.SingleJavaScript; +import com.fr.stable.ParameterProvider; import java.util.List; @@ -26,8 +29,10 @@ public class SearchExportJSFormulaAction implements SearchJSFormula { public void searchJSFormulaFromOther(List formulaInfos, ITContent content, JavaScript javaScript) { //如果导出当前模板,可以存公式的地方就是命名方式-自定义 if (((ExportJavaScript) javaScript).isCurrentTemplate()) { + content.addOtherPos(Toolkit.i18nText("Fine-Design_Basic_Export_JS_Template_Current")); dealSingleJavaScript(formulaInfos, content, ((ExportJavaScript) javaScript).getCurrentTemplateJavaScript()); } else { + content.addOtherPos(Toolkit.i18nText("Fine-Design_Basic_Export_JS_Template_Other")); List list = ((ExportJavaScript) javaScript).getJsListForOtherTemplates(); if (isListExist(list)) { for (SingleJavaScript singleJavaScript : list) { @@ -51,6 +56,16 @@ public class SearchExportJSFormulaAction implements SearchJSFormula { ); formulaInfos.add(new FormulaInfo(newContent)); } + if (!javaScript.isExtendParameters()) { + ITContent paraContent = ITContent.copy(content); + for (ParameterProvider parameter : javaScript.getParameters()) { + if (parameter.getValue() instanceof Formula) { + paraContent.addOtherPos(Toolkit.i18nText("Fine-Design_Basic_Base_Value")); + paraContent.setReplaceObject(parameter.getValue()); + formulaInfos.add(new FormulaInfo(paraContent)); + } + } + } } /** diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/SearchDateEditorFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/SearchDateEditorFormulaAction.java index 67548b4157..28bd17c9b5 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/SearchDateEditorFormulaAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/SearchDateEditorFormulaAction.java @@ -34,7 +34,7 @@ public class SearchDateEditorFormulaAction extends AbstractSearchWidgetFormulaAc if (dateEditor.getEndDateFM() != null && StringUtils.isNotEmpty(dateEditor.getEndDateFM().getContent())) { ITContent newContent = ITContent.copy(content); newContent.setReplaceObject(dateEditor.getEndDateFM()); - newContent.addOtherPos(Toolkit.i18nText("Fine-Design_Chart_End_Time")); + newContent.addOtherPos(Toolkit.i18nText("Fine-Design_Report_FS_End_Date")); formulaInfos.add(new FormulaInfo(newContent)); } } @@ -44,7 +44,7 @@ public class SearchDateEditorFormulaAction extends AbstractSearchWidgetFormulaAc if (dateEditor.getStartDateFM() != null && StringUtils.isNotEmpty(dateEditor.getStartDateFM().getContent())) { ITContent newContent = ITContent.copy(content); newContent.setReplaceObject(dateEditor.getStartDateFM()); - newContent.addOtherPos(Toolkit.i18nText("Fine-Design_Chart_Start_Time")); + newContent.addOtherPos(Toolkit.i18nText("Fine-Design_Report_FS_Start_Date")); formulaInfos.add(new FormulaInfo(newContent)); } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/SearchTreeEditorFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/SearchTreeEditorFormulaAction.java index d1251c5b8c..3a36eb510c 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/SearchTreeEditorFormulaAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/SearchTreeEditorFormulaAction.java @@ -1,11 +1,15 @@ package com.fr.design.actions.replace.action.content.formula.widget; +import com.fr.data.Dictionary; +import com.fr.data.impl.FormulaDictionary; import com.fr.data.impl.FormulaDisplayDictionary; +import com.fr.data.impl.TableDataDictionary; import com.fr.data.impl.TreeNodeAttr; import com.fr.data.impl.TreeNodeWrapper; import com.fr.design.actions.replace.info.FormulaInfo; import com.fr.design.actions.replace.info.base.ITContent; import com.fr.design.i18n.Toolkit; +import com.fr.form.ui.DictionaryContainer; import com.fr.form.ui.TreeEditor; import com.fr.form.ui.tree.LayerConfig; import com.fr.stable.StringUtils; @@ -37,28 +41,38 @@ public class SearchTreeEditorFormulaAction extends AbstractSearchWidgetFormulaAc if (((TreeEditor) content.getReplaceObject()).getBuildModelConfig() != null) { //LayerConfig[] 急速分层构建 //TreeNodeWrapper 普通分层构建 - if (((TreeEditor) content.getReplaceObject()).getBuildModelConfig() instanceof LayerConfig[]) { - LayerConfig[] layerConfigs = (LayerConfig[]) ((TreeEditor) content.getReplaceObject()).getBuildModelConfig(); + //TableDataDictionary 自动构建 + Object object = ((TreeEditor) content.getReplaceObject()).getBuildModelConfig(); + if (object instanceof LayerConfig[]) { + LayerConfig[] layerConfigs = (LayerConfig[]) object; dealWithLayerConfigs(layerConfigs, content, formulaInfos); - } else if (((TreeEditor) content.getReplaceObject()).getBuildModelConfig() instanceof TreeNodeWrapper) { - TreeNodeWrapper wrapper = (TreeNodeWrapper) ((TreeEditor) content.getReplaceObject()).getBuildModelConfig(); + } else if (object instanceof TreeNodeWrapper) { + TreeNodeWrapper wrapper = (TreeNodeWrapper) object; dealWithTreeNodeWrapper(wrapper, content, formulaInfos); + } else if (object instanceof TableDataDictionary) { + TableDataDictionary tableDataDictionary = (TableDataDictionary) object; + if (tableDataDictionary.getFormula() != null) { + ITContent autoContent = ITContent.copy(content); + autoContent.addOtherPos( + Toolkit.i18nText("Fine-Design_Basic_Auto_Build"), + Toolkit.i18nText("Fine-Design_Basic_Display_Value") + ); + autoContent.setReplaceObject(tableDataDictionary.getFormula()); + formulaInfos.add(new FormulaInfo(autoContent)); + } } + } } } private void dealWithTreeNodeWrapper(TreeNodeWrapper wrapper, ITContent content, List formulaInfos) { for (TreeNodeAttr attr : wrapper.getTreeNodeAttrs()) { - if (((FormulaDisplayDictionary) attr.getDictionary()).getFormula() != null - && StringUtils.isNotEmpty(((FormulaDisplayDictionary) attr.getDictionary()).getFormula().getContent())) { - ITContent newContent = ITContent.copy(content); - newContent.setReplaceObject(((FormulaDisplayDictionary) attr.getDictionary()).getFormula()); - newContent.addOtherPos( - Toolkit.i18nText("Fine-Design_Basic_DS_Dictionary"), - Toolkit.i18nText("Fine-Design_Basic_Layer_Build") - ); - formulaInfos.add(new FormulaInfo(newContent)); + if (attr.getDictionary() != null) { + DictionaryType type = DictionaryType.match(attr.getDictionary().getClass().getSimpleName()); + if (type != null) { + type.searchFormulaFromDictionary(content, formulaInfos, attr.getDictionary()); + } } } } From d64049244c7723940aa9e24d40bfa778c20f029f Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 27 Sep 2022 10:06:10 +0800 Subject: [PATCH 013/310] =?UTF-8?q?REPORT-75998=20=E6=94=B9=E5=8F=98?= =?UTF-8?q?=E5=BA=95=E5=B1=82=E5=85=B3=E9=97=AD=E9=9D=A2=E6=9D=BF=E6=96=B9?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/AllowAuthorityEditAction.java | 11 ++------ .../actions/help/replace/ITReplaceHelper.java | 19 ++++++++++++++ .../actions/help/replace/ITReplaceUtils.java | 26 +++++++++++++++++++ .../fr/design/preview/DeveloperPreview.java | 9 +++---- .../SearchCommit2DBJSFormulaAction.java | 4 +-- .../replace/ui/ITReplaceMainDialog.java | 11 ++++---- .../actions/replace/utils/ShowValueUtils.java | 10 +++++-- 7 files changed, 65 insertions(+), 25 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceHelper.java create mode 100644 designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceUtils.java diff --git a/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java b/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java index bb26e17118..c7287ad838 100644 --- a/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java @@ -1,17 +1,14 @@ package com.fr.design.actions; -import com.fr.base.svg.IconUtils; import com.fr.base.vcs.DesignerMode; +import com.fr.design.actions.help.replace.ITReplaceUtils; import com.fr.design.constants.UIConstants; import com.fr.design.menu.KeySetUtils; -import com.fr.design.module.DesignModuleFactory; import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.designer.TargetComponent; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.mainframe.*; -import com.fr.invoke.Reflect; -import com.fr.log.FineLoggerFactory; /** * Author : daisy @@ -64,11 +61,7 @@ public class AllowAuthorityEditAction extends TemplateComponentAction { DesignerContext.getDesignerFrame().refreshDottedLine(); EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance()); EastRegionContainerPane.getInstance().removeParameterPane(); - try { - Reflect.on(DesignModuleFactory.getReplacePane().newInstance()).call("close"); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } + ITReplaceUtils.close(); //画虚线 return true; diff --git a/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceHelper.java b/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceHelper.java new file mode 100644 index 0000000000..755a69ef63 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceHelper.java @@ -0,0 +1,19 @@ +package com.fr.design.actions.help.replace; + + +/** + * 定义一些底层操作 + * + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-09-27 + */ +public interface ITReplaceHelper { + + + /** + * 关闭面板 + */ + void close(); + +} diff --git a/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceUtils.java b/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceUtils.java new file mode 100644 index 0000000000..fe7ba9d8c3 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceUtils.java @@ -0,0 +1,26 @@ +package com.fr.design.actions.help.replace; + +import com.fr.design.module.DesignModuleFactory; +import com.fr.log.FineLoggerFactory; + +/** + * 工具类 + * + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-09-27 + */ +public class ITReplaceUtils { + + + /** + * 进入权限编辑&开发者调试时要关闭面板 + */ + public static void close(){ + try { + DesignModuleFactory.getReplacePane().newInstance().close(); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } +} diff --git a/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java b/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java index 5c0a623857..e8be79b641 100644 --- a/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java +++ b/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java @@ -1,5 +1,7 @@ package com.fr.design.preview; +import com.fr.design.actions.help.replace.ITReplaceHelper; +import com.fr.design.actions.help.replace.ITReplaceUtils; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.MutilTempalteTabPane; import com.fr.design.fun.impl.AbstractPreviewProvider; @@ -10,7 +12,6 @@ import com.fr.design.module.DesignModuleFactory; import com.fr.design.worker.WorkerManager; import com.fr.design.worker.save.CallbackSaveWorker; import com.fr.general.web.ParameterConstants; -import com.fr.invoke.Reflect; import com.fr.log.FineLoggerFactory; import java.util.HashMap; @@ -50,11 +51,7 @@ public class DeveloperPreview extends AbstractPreviewProvider { @Override public void onClick(JTemplate jt) { super.onClick(jt); - try { - Reflect.on(DesignModuleFactory.getReplacePane().newInstance()).call("close"); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } + ITReplaceUtils.close(); SwingWorker worker = WorkerManager.getInstance().getWorker(jt.getRuntimeId()); if (worker instanceof CallbackSaveWorker) { CallbackSaveWorker callbackSaveWorker = (CallbackSaveWorker) worker; diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java index dec08034ab..946dc0d31c 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java @@ -52,7 +52,7 @@ public class SearchCommit2DBJSFormulaAction implements SearchJSFormula { } private void dealWithColumnValue(List formulaInfos, ITContent content, DMLConfig dmlConfig) { - for (int i = 0; i < dmlConfig.getColumnConfigCount(); i++) { + for (int i = 0, len = dmlConfig.getColumnConfigCount(); i < len; i++) { ColumnConfig columnConfig = dmlConfig.getColumnConfig(i); if (columnConfig.getColumnValue() instanceof Formula) { ITContent configContent = ITContent.copy(content); @@ -64,7 +64,7 @@ public class SearchCommit2DBJSFormulaAction implements SearchJSFormula { } private void dealWithSubmitJob(List formulaInfos, ITContent content, DMLConfig dmlConfig) { - for (int i = 0; i < dmlConfig.getSubmitJobCount(); i++) { + for (int i = 0, len = dmlConfig.getColumnConfigCount(); i < len; i++) { //这边自定义事件不需要处理,只处理提交事件 if (dmlConfig.getSubmitJob(i) instanceof DMLConfigJob) { ITContent newContent = ITContent.copy(content); diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index 2a922902f7..f6c82d8890 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -1,16 +1,14 @@ package com.fr.design.actions.replace.ui; +import com.fr.design.actions.help.replace.ITReplaceHelper; import com.fr.design.actions.replace.action.ShowSearchResultAction; import com.fr.design.actions.replace.info.Info; -import com.fr.design.actions.replace.utils.ShowValueUtils; - import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.UIDialog; import com.fr.design.file.HistoryTemplateListCache; -import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; @@ -41,7 +39,7 @@ import static com.fr.design.actions.replace.ui.ITTableEditorPane.getEditTable; * @version 11.0 * created by Destiny.Lin on 2022-08-10 */ -public class ITReplaceMainDialog extends UIDialog { +public class ITReplaceMainDialog extends UIDialog implements ITReplaceHelper { List searchResultList = new ArrayList<>(); private static boolean ITReplaceFlag = false; private static boolean matched = false; @@ -315,7 +313,7 @@ public class ITReplaceMainDialog extends UIDialog { * 面板是否存在 * @return */ - public static boolean isExisted() { + public boolean isExisted() { return existed; } @@ -327,7 +325,8 @@ public class ITReplaceMainDialog extends UIDialog { /** * 进入权限编辑状态&开发者调试时关闭面板 */ - public static void close(){ + @Override + public void close(){ if (isExisted()){ getInstance().dispose(); setExisted(false); diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java index fa28c6de8b..7ea1bdbbd0 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java @@ -140,7 +140,7 @@ public class ShowValueUtils { int index = 0; StringBuilder builder = new StringBuilder(str); while (matcher.find()) { - builder.replace(matcher.start() + index, matcher.end() + index, head + matcher.group() + tail); + builder.replace(matcher.start() + index, matcher.end() + index, head + changeHtmlStr(matcher.group()) + tail); index += size; } return "
" + @@ -148,12 +148,18 @@ public class ShowValueUtils { "
"; } else { return "
" + - replaceAll(str, searchStr, "" + searchStr + "") + + replaceAll(str, searchStr, "" + changeHtmlStr(searchStr) + "") + "
"; } } + private static String changeHtmlStr(String searchStr){ + String showStr = searchStr; + showStr = showStr.replace("<","<"); + showStr = showStr.replace(">", ">"); + return showStr; + } /** * 集合是否不为空 From 2162f3568574a8f8cea9c430d2521ff931856074 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 27 Sep 2022 10:08:08 +0800 Subject: [PATCH 014/310] =?UTF-8?q?REPORT-75998=20=E6=94=B9=E5=8F=98?= =?UTF-8?q?=E5=BA=95=E5=B1=82=E5=85=B3=E9=97=AD=E9=9D=A2=E6=9D=BF=E6=96=B9?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/module/DesignModuleFactory.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java b/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java index 60a4dfcf18..2c75509f52 100644 --- a/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java +++ b/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java @@ -1,6 +1,7 @@ package com.fr.design.module; import com.fr.base.chart.BaseChartCollection; +import com.fr.design.actions.help.replace.ITReplaceHelper; import com.fr.design.gui.chart.BaseChartPropertyPane; import com.fr.design.gui.chart.MiddleChartComponent; import com.fr.design.gui.chart.MiddleChartDialog; @@ -136,11 +137,11 @@ public class DesignModuleFactory { * 注册一下查找替换面板 * @param r */ - public static void registerReplacePane(Class r){ + public static void registerReplacePane(Class r) { instance.replacePane = r; } - public static Class getReplacePane(){ + public static Class getReplacePane() { return instance.replacePane; } From a35cfde57c6883266c66b7b3f0cfd12c249d8853 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 27 Sep 2022 11:16:14 +0800 Subject: [PATCH 015/310] =?UTF-8?q?REPORT-75998=20=E6=94=B9=E5=8F=98?= =?UTF-8?q?=E5=BA=95=E5=B1=82=E5=85=B3=E9=97=AD=E9=9D=A2=E6=9D=BF=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=E3=80=81=E4=BF=AE=E6=94=B9=E6=AD=A3=E5=88=99=E8=A1=A8?= =?UTF-8?q?=E8=BE=BE=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/AllowAuthorityEditAction.java | 4 +- .../actions/help/replace/ITReplaceUtils.java | 26 ------------ .../fr/design/module/DesignModuleFactory.java | 12 +++--- .../fr/design/preview/DeveloperPreview.java | 5 +-- .../replace/ui/ITReplaceMainDialog.java | 20 ++++----- .../replace/utils/ReplaceOperator.java | 41 +++++++++++++++++++ .../actions/replace/utils/ShowValueUtils.java | 7 ++-- .../fr/start/module/DesignerActivator.java | 5 ++- 8 files changed, 63 insertions(+), 57 deletions(-) delete mode 100644 designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceUtils.java create mode 100644 designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceOperator.java diff --git a/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java b/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java index c7287ad838..2b1ad225ac 100644 --- a/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java @@ -1,9 +1,9 @@ package com.fr.design.actions; import com.fr.base.vcs.DesignerMode; -import com.fr.design.actions.help.replace.ITReplaceUtils; import com.fr.design.constants.UIConstants; import com.fr.design.menu.KeySetUtils; +import com.fr.design.module.DesignModuleFactory; import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.designer.TargetComponent; @@ -61,7 +61,7 @@ public class AllowAuthorityEditAction extends TemplateComponentAction { DesignerContext.getDesignerFrame().refreshDottedLine(); EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance()); EastRegionContainerPane.getInstance().removeParameterPane(); - ITReplaceUtils.close(); + DesignModuleFactory.getReplaceOperator().close(); //画虚线 return true; diff --git a/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceUtils.java b/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceUtils.java deleted file mode 100644 index fe7ba9d8c3..0000000000 --- a/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceUtils.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.fr.design.actions.help.replace; - -import com.fr.design.module.DesignModuleFactory; -import com.fr.log.FineLoggerFactory; - -/** - * 工具类 - * - * @author Destiny.Lin - * @version 11.0 - * created by Destiny.Lin on 2022-09-27 - */ -public class ITReplaceUtils { - - - /** - * 进入权限编辑&开发者调试时要关闭面板 - */ - public static void close(){ - try { - DesignModuleFactory.getReplacePane().newInstance().close(); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } -} diff --git a/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java b/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java index 2c75509f52..166ea80b1f 100644 --- a/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java +++ b/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java @@ -51,7 +51,7 @@ public class DesignModuleFactory { private Class ITReplaceAction; private Class formParaDesigner; private Class paraPropertyPane; - private Class replacePane; + private static ITReplaceHelper replaceHelper; private Class formHierarchyPaneCls; private Class widgetPropertyPane; private Class buttonDetailPaneClass; @@ -135,14 +135,14 @@ public class DesignModuleFactory { /** * 注册一下查找替换面板 - * @param r + * @param */ - public static void registerReplacePane(Class r) { - instance.replacePane = r; + public static void registerReplace(ITReplaceHelper replace) { + replaceHelper = replace; } - public static Class getReplacePane() { - return instance.replacePane; + public static ITReplaceHelper getReplaceOperator() { + return replaceHelper; } public static void registerParaPropertyPaneClass(Class p) { diff --git a/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java b/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java index e8be79b641..07d40053c1 100644 --- a/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java +++ b/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java @@ -1,7 +1,5 @@ package com.fr.design.preview; -import com.fr.design.actions.help.replace.ITReplaceHelper; -import com.fr.design.actions.help.replace.ITReplaceUtils; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.MutilTempalteTabPane; import com.fr.design.fun.impl.AbstractPreviewProvider; @@ -12,7 +10,6 @@ import com.fr.design.module.DesignModuleFactory; import com.fr.design.worker.WorkerManager; import com.fr.design.worker.save.CallbackSaveWorker; import com.fr.general.web.ParameterConstants; -import com.fr.log.FineLoggerFactory; import java.util.HashMap; import java.util.Map; @@ -51,7 +48,7 @@ public class DeveloperPreview extends AbstractPreviewProvider { @Override public void onClick(JTemplate jt) { super.onClick(jt); - ITReplaceUtils.close(); + DesignModuleFactory.getReplaceOperator().close(); SwingWorker worker = WorkerManager.getInstance().getWorker(jt.getRuntimeId()); if (worker instanceof CallbackSaveWorker) { CallbackSaveWorker callbackSaveWorker = (CallbackSaveWorker) worker; diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index f6c82d8890..784821b8fd 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -6,6 +6,7 @@ import com.fr.design.actions.replace.action.ShowSearchResultAction; import com.fr.design.actions.replace.info.Info; +import com.fr.design.actions.replace.utils.ShowValueUtils; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.UIDialog; import com.fr.design.file.HistoryTemplateListCache; @@ -29,6 +30,7 @@ import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.List; +import java.util.regex.Pattern; import static com.fr.design.actions.replace.ui.ITTableEditorPane.getEditTable; @@ -39,7 +41,7 @@ import static com.fr.design.actions.replace.ui.ITTableEditorPane.getEditTable; * @version 11.0 * created by Destiny.Lin on 2022-08-10 */ -public class ITReplaceMainDialog extends UIDialog implements ITReplaceHelper { +public class ITReplaceMainDialog extends UIDialog { List searchResultList = new ArrayList<>(); private static boolean ITReplaceFlag = false; private static boolean matched = false; @@ -81,7 +83,7 @@ public class ITReplaceMainDialog extends UIDialog implements ITReplaceHelper { } } } - instance.fitScreen(); + setExisted(true); return instance; } @@ -285,6 +287,7 @@ public class ITReplaceMainDialog extends UIDialog implements ITReplaceHelper { itTableEditor.clear(); String searchStr = ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).getText(); setSearchStr(searchStr); + ShowValueUtils.containPattern = Pattern.compile(ShowValueUtils.changeRegex(searchStr)); ShowSearchResultAction searchAction = ShowSearchResultAction.match(GeneralUtils.objectToString(northPane.getFindCombobox().getSelectedItem())); if (searchAction != null) { searchResultList = searchAction.addMatchResult(searchStr, searchAction.showSearchValue(jTemplate)); @@ -313,7 +316,7 @@ public class ITReplaceMainDialog extends UIDialog implements ITReplaceHelper { * 面板是否存在 * @return */ - public boolean isExisted() { + public static boolean isExisted() { return existed; } @@ -322,16 +325,7 @@ public class ITReplaceMainDialog extends UIDialog implements ITReplaceHelper { } - /** - * 进入权限编辑状态&开发者调试时关闭面板 - */ - @Override - public void close(){ - if (isExisted()){ - getInstance().dispose(); - setExisted(false); - } - } + /** * 检测结果是否合法 */ diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceOperator.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceOperator.java new file mode 100644 index 0000000000..4ce50e4ef4 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceOperator.java @@ -0,0 +1,41 @@ +package com.fr.design.actions.replace.utils; + +import com.fr.design.actions.help.replace.ITReplaceHelper; +import com.fr.design.actions.replace.ui.ITReplaceMainDialog; + +/** + * 操作面板 + * + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-09-27 + */ +public class ReplaceOperator implements ITReplaceHelper { + + /** + * 进入权限编辑状态&开发者调试时关闭面板 + */ + @Override + public void close(){ + if (isExisted()){ + ITReplaceMainDialog.getInstance().dispose(); + setExisted(false); + } + } + + /** + * 面板是否存在 + * @return + */ + public boolean isExisted(){ + return ITReplaceMainDialog.isExisted(); + } + + /** + * 设置面板存在属性 + * @param existed + */ + public void setExisted(boolean existed){ + ITReplaceMainDialog.setExisted(existed); + } +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java index 7ea1bdbbd0..438c3d98c7 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java @@ -28,6 +28,7 @@ public class ShowValueUtils { public static final String ANY_THING_REGEX = "."; public static final String NUMBER_REGEX = "[0-9]"; public static final String ENGLISH_REGEX = "[a-zA-Z]"; + public static Pattern containPattern; private static List specialCharList = new ArrayList<>(); static { @@ -182,8 +183,7 @@ public class ShowValueUtils { public static int indexOf(String str, String regexStr) { CharSequence inputStr = str; int failReturn = -1; - String patternStr = changeRegex(regexStr); - Pattern pattern = Pattern.compile(patternStr); + Pattern pattern = containPattern; Matcher matcher = pattern.matcher(inputStr); if (matcher.find()) { return matcher.start(); @@ -199,8 +199,7 @@ public class ShowValueUtils { */ public static boolean contains(String originStr, String matchStr) { if (ITReplaceMainDialog.isMatched()) { - String str = changeRegex(matchStr); - Pattern pattern = Pattern.compile(str); + Pattern pattern = containPattern; Matcher matcher = pattern.matcher(originStr); return matcher.find(); } else { diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java index 1a04c79ac9..7e937911c3 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java @@ -32,7 +32,7 @@ import com.fr.design.actions.insert.flot.FormulaFloatAction; import com.fr.design.actions.insert.flot.ImageFloatAction; import com.fr.design.actions.insert.flot.TextBoxFloatAction; import com.fr.design.actions.replace.ITReplaceAction; -import com.fr.design.actions.replace.ui.ITReplaceMainDialog; +import com.fr.design.actions.replace.utils.ReplaceOperator; import com.fr.design.bridge.DesignToolbarProvider; import com.fr.design.constants.DesignerLaunchStatus; import com.fr.design.env.DesignerWorkspaceLoader; @@ -467,12 +467,13 @@ public class DesignerActivator extends Activator implements Prepare { DesignModuleFactory.registerNewFormActionClass(NewFormAction.class); DesignModuleFactory.registerReplaceActionClass(ITReplaceAction.class); - DesignModuleFactory.registerReplacePane(ITReplaceMainDialog.class); DesignModuleFactory.registerFormParaDesignerClass(FormParaDesigner.class); DesignModuleFactory.registerParaPropertyPaneClass(ParameterPropertyPane.class); DesignModuleFactory.registerFormHierarchyPaneClass(FormHierarchyTreePane.class); DesignModuleFactory.registerWidgetPropertyPaneClass(WidgetPropertyPane.class); DesignModuleFactory.registerButtonDetailPaneClass(FormSubmitButtonDetailPane.class); + + DesignModuleFactory.registerReplace(new ReplaceOperator()); DesignModuleFactory.registerParameterReader(new FormParameterReader()); StableFactory.registerMarkedClass(BaseJForm.XML_TAG, NewJForm.class); From 69ae4d6c1159eb4edc0ef43f1c8e3cf61b175550 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 27 Sep 2022 11:19:21 +0800 Subject: [PATCH 016/310] =?UTF-8?q?REPORT-75998=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=AD=A3=E5=88=99=E8=A1=A8=E8=BE=BE=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/actions/replace/utils/ShowValueUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java index 438c3d98c7..19ab2758f3 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java @@ -133,7 +133,7 @@ public class ShowValueUtils { public static String updateHighlight(String str, String searchStr) { if (ITReplaceMainDialog.isMatched()) { String result = str; - Pattern pattern = Pattern.compile(changeRegex(searchStr)); + Pattern pattern = containPattern; Matcher matcher = pattern.matcher(str); String head = ""; String tail = ""; From 77ee617fe3e38b1bd1152112dd06572dfca825b1 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 27 Sep 2022 11:27:34 +0800 Subject: [PATCH 017/310] =?UTF-8?q?REPORT-75998=20=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=85=A5=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../highlight/javascript/SearchCommit2DBJSFormulaAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java index 946dc0d31c..99ed9774ce 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java @@ -64,7 +64,7 @@ public class SearchCommit2DBJSFormulaAction implements SearchJSFormula { } private void dealWithSubmitJob(List formulaInfos, ITContent content, DMLConfig dmlConfig) { - for (int i = 0, len = dmlConfig.getColumnConfigCount(); i < len; i++) { + for (int i = 0, len = dmlConfig.getSubmitJobCount(); i < len; i++) { //这边自定义事件不需要处理,只处理提交事件 if (dmlConfig.getSubmitJob(i) instanceof DMLConfigJob) { ITContent newContent = ITContent.copy(content); From c1c17b85932d5138940757dfc8c6648d93c64aee Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 27 Sep 2022 12:05:19 +0800 Subject: [PATCH 018/310] =?UTF-8?q?REPORT-75998=20=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E6=B3=A8=E9=87=8A=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E5=B1=9E=E6=80=A7-=E6=8E=92=E5=BA=8F=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E5=85=AC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/AllowAuthorityEditAction.java | 1 + .../fr/design/module/DesignModuleFactory.java | 4 +++ .../fr/design/preview/DeveloperPreview.java | 1 + .../actions/replace/ITReplaceAction.java | 1 + .../content/formula/FormulaReplaceObject.java | 30 +++++++++++++++++++ .../replace/ui/ITReplaceMainDialog.java | 14 --------- .../replace/utils/ReplaceOperator.java | 22 ++------------ 7 files changed, 40 insertions(+), 33 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java b/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java index 2b1ad225ac..546a702979 100644 --- a/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java @@ -61,6 +61,7 @@ public class AllowAuthorityEditAction extends TemplateComponentAction { DesignerContext.getDesignerFrame().refreshDottedLine(); EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance()); EastRegionContainerPane.getInstance().removeParameterPane(); + //进入时要关闭查找替换面板 DesignModuleFactory.getReplaceOperator().close(); //画虚线 diff --git a/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java b/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java index 166ea80b1f..272daa7f5c 100644 --- a/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java +++ b/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java @@ -141,6 +141,10 @@ public class DesignModuleFactory { replaceHelper = replace; } + /** + * 获取查找替换面板的操作类 + * @return + */ public static ITReplaceHelper getReplaceOperator() { return replaceHelper; } diff --git a/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java b/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java index 07d40053c1..176c44fe01 100644 --- a/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java +++ b/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java @@ -48,6 +48,7 @@ public class DeveloperPreview extends AbstractPreviewProvider { @Override public void onClick(JTemplate jt) { super.onClick(jt); + //进入时要关闭查找替换面板 DesignModuleFactory.getReplaceOperator().close(); SwingWorker worker = WorkerManager.getInstance().getWorker(jt.getRuntimeId()); if (worker instanceof CallbackSaveWorker) { diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ITReplaceAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ITReplaceAction.java index 1a9f67bb8a..358dc19652 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ITReplaceAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ITReplaceAction.java @@ -55,6 +55,7 @@ public class ITReplaceAction extends UpdateAction { */ public void actionPerformed(ActionEvent event) { ITReplaceMainDialog mainFrame = ITReplaceMainDialog.getInstance(); + mainFrame.fitScreen(); mainFrame.setVisible(true); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java index e002832656..6260565551 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java @@ -22,6 +22,7 @@ import com.fr.main.impl.WorkBook; import com.fr.report.cell.cellattr.CellInsertPolicyAttr; import com.fr.report.cell.cellattr.core.RichChar; import com.fr.report.cell.cellattr.core.group.DSColumn; +import com.fr.report.core.sort.sortexpression.FormulaSortExpression; import com.fr.stable.FormulaProvider; import com.fr.stable.ParameterProvider; import com.fr.stable.StringUtils; @@ -495,6 +496,35 @@ public enum FormulaReplaceObject implements DealWithInfoValue { public boolean check(Info info) { return true; } + }, + /** + * 排序 + */ + FORMULA_SORT_EXPRESSION("FormulaSortExpression"){ + @Override + public Map getValue(Object... o) { + HashMap map = new HashMap<>(); + if (StringUtils.isNotEmpty(((FormulaSortExpression) o[0]).getFormula())) { + map.put("content", ((FormulaSortExpression) o[0]).getFormula()); + } + return map; + } + + @Override + public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { + Object replaceObject = info.getContent().getReplaceObject(); + info.updateOldStr((((FormulaSortExpression) replaceObject).getFormula()), findStr); + ((FormulaSortExpression) replaceObject).setFormula(ShowValueUtils.replaceAll((((FormulaSortExpression) replaceObject).getFormula()), findStr, replaceStr)); + } + + @Override + public boolean check(Info info) { + if (info.getContent().getReplaceObject() instanceof FormulaSortExpression){ + FormulaSortExpression sortExpression = (FormulaSortExpression) info.getContent().getReplaceObject(); + return StringUtils.equals(sortExpression.getFormula(), info.getContent().getOldShowStr()); + } + return false; + } } ; diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index 784821b8fd..f6fd8b6dc4 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -52,7 +52,6 @@ public class ITReplaceMainDialog extends UIDialog { private ITReplaceWestPanel westPanel; private boolean searchFlag; private String searchStr; - private static boolean existed = false; public ITReplaceMainDialog() { super(DesignerContext.getDesignerFrame()); @@ -67,7 +66,6 @@ public class ITReplaceMainDialog extends UIDialog { initFrame(); fitScreen(); ITReplaceFlag = true; - existed = true; } /** @@ -83,7 +81,6 @@ public class ITReplaceMainDialog extends UIDialog { } } } - setExisted(true); return instance; } @@ -312,17 +309,6 @@ public class ITReplaceMainDialog extends UIDialog { } } - /** - * 面板是否存在 - * @return - */ - public static boolean isExisted() { - return existed; - } - - public static void setExisted(boolean existed) { - ITReplaceMainDialog.existed = existed; - } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceOperator.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceOperator.java index 4ce50e4ef4..e405c6be5f 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceOperator.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceOperator.java @@ -13,29 +13,13 @@ import com.fr.design.actions.replace.ui.ITReplaceMainDialog; public class ReplaceOperator implements ITReplaceHelper { /** - * 进入权限编辑状态&开发者调试时关闭面板 + * 关闭面板 + * (当前关闭时机:进入权限编辑状态&开发者调试) */ @Override public void close(){ - if (isExisted()){ - ITReplaceMainDialog.getInstance().dispose(); - setExisted(false); - } + ITReplaceMainDialog.getInstance().dispose(); } - /** - * 面板是否存在 - * @return - */ - public boolean isExisted(){ - return ITReplaceMainDialog.isExisted(); - } - /** - * 设置面板存在属性 - * @param existed - */ - public void setExisted(boolean existed){ - ITReplaceMainDialog.setExisted(existed); - } } From b4e8ed97828082f02625541dee39c59acbf0a540 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 27 Sep 2022 15:59:02 +0800 Subject: [PATCH 019/310] =?UTF-8?q?REPORT-75998=20=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=8A=A5=E8=A1=A8=E5=A1=AB=E6=8A=A5=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=EF=BC=8C=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3=E5=90=8D?= =?UTF-8?q?=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...laceHelper.java => ITReplaceOperator.java} | 2 +- .../content/formula/FormulaReplaceObject.java | 2 +- .../action/content/formula/FormulaTag.java | 13 +++ .../formula/cell/SearchCellFormulaAction.java | 3 + .../SearchHighlightFormulaManager.java | 16 ++- .../SearchCommit2DBJSFormulaAction.java | 17 ++- .../javascript/SearchJSHighlightAction.java | 6 +- .../present/SearchPresentHighlightAction.java | 91 ++++++++++++++++ .../value/SearchValueHighlightAction.java | 70 ++++++++++++ .../template/SearchTemplateFormulaAction.java | 101 ++++++++++++++++-- .../action/content/js/SearchWebJSAction.java | 3 +- .../action/content/sql/SearchSQLAction.java | 3 +- .../actions/replace/info/ReplaceObject.java | 1 - .../actions/replace/info/base/SearchTag.java | 4 + .../replace/ui/ITReplaceMainDialog.java | 1 - .../replace/utils/ReplaceOperator.java | 4 +- 16 files changed, 306 insertions(+), 31 deletions(-) rename designer-base/src/main/java/com/fr/design/actions/help/replace/{ITReplaceHelper.java => ITReplaceOperator.java} (85%) create mode 100644 designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/present/SearchPresentHighlightAction.java create mode 100644 designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/value/SearchValueHighlightAction.java diff --git a/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceHelper.java b/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceOperator.java similarity index 85% rename from designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceHelper.java rename to designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceOperator.java index 755a69ef63..bbaaedd651 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceHelper.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceOperator.java @@ -8,7 +8,7 @@ package com.fr.design.actions.help.replace; * @version 11.0 * created by Destiny.Lin on 2022-09-27 */ -public interface ITReplaceHelper { +public interface ITReplaceOperator { /** diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java index 6260565551..02cd18810e 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java @@ -196,7 +196,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { /** * present */ - PRESENT("Present") { + FORMULA_PRESENT("FormulaPresent") { @Override public Map getValue(Object... o) { HashMap map = new HashMap<>(); diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java index c5c12d3bfc..532a530883 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java @@ -1,6 +1,7 @@ package com.fr.design.actions.replace.action.content.formula; import com.fr.chart.chartdata.MeterReportDefinition; +import com.fr.data.VerifyItem; import com.fr.design.actions.replace.info.DealWithInfoValue; import com.fr.design.actions.replace.info.Info; import com.fr.design.actions.replace.info.base.SearchTag; @@ -92,6 +93,18 @@ public enum FormulaTag implements DealWithInfoValue { definition.setEndAreaName(ShowValueUtils.replaceAll(GeneralUtils.objectToString(definition.getEndAreaName()), findStr, replaceStr)); } } + }, + /** + * 模板填报属性数据校验提示 + */ + WRITE_ATTR_MESSAGE(SearchTag.WRITE_ATTR_MESSAGE) { + @Override + public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { + if (info.getContent().getHoldObject() instanceof VerifyItem) { + VerifyItem item = (VerifyItem) info.getContent().getHoldObject(); + item.setMessage(ShowValueUtils.replaceAll(item.getMessage(), findStr, replaceStr)); + } + } }; int index; diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java index 9cfdd43433..b58008e7bc 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java @@ -106,6 +106,9 @@ public class SearchCellFormulaAction implements SearchCellFormula { //处理HighlightAction SearchHighlightFormulaAction searchHighlightAction = SearchHighlightFormulaAction.getInstance(); ITContent newContent = ITContent.copy(cellInfo.getContent()); + newContent.addOtherPos( + Toolkit.i18nText("Fine-Design_Basic_Condition_Attributes"), + highlightGroup.getHighlight(i).getName()); searchHighlightAction.dealWithHighlightAction(newContent, formulaInfos, highlightAction); } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/SearchHighlightFormulaManager.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/SearchHighlightFormulaManager.java index 28a5b752a9..290731f8f6 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/SearchHighlightFormulaManager.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/SearchHighlightFormulaManager.java @@ -3,6 +3,8 @@ package com.fr.design.actions.replace.action.content.formula.highlight; import com.fr.design.actions.replace.action.SearchAction; import com.fr.design.actions.replace.action.SearchManager; import com.fr.design.actions.replace.action.content.formula.highlight.javascript.SearchJSHighlightAction; +import com.fr.design.actions.replace.action.content.formula.highlight.present.SearchPresentHighlightAction; +import com.fr.design.actions.replace.action.content.formula.highlight.value.SearchValueHighlightAction; import java.util.HashMap; import java.util.Map; @@ -17,19 +19,23 @@ import java.util.Map; public class SearchHighlightFormulaManager implements SearchManager { private Map highlightType = new HashMap<>(); public static final String HYPERLINK_HIGHLIGHT_ACTION = "HyperlinkHighlightAction"; + public static final String PRESENT_HIGHLIGHT_ACTION = "PresentHighlightAction"; + public static final String VALUE_HIGHLIGHT_ACTION = "ValueHighlightAction"; + private SearchHighlightFormulaManager() { //这边控件类型不做处理,在SearchWidgetFormulaAction统一处理即可 //条件属性-超级链接 register(HYPERLINK_HIGHLIGHT_ACTION, SearchJSHighlightAction.getInstance()); - //条件属性-... - // TODO: 2022/9/14 条件属性的其他类型 + //条件属性-形态 + register(PRESENT_HIGHLIGHT_ACTION, SearchPresentHighlightAction.getInstance()); + //条件属性-新值 + register(VALUE_HIGHLIGHT_ACTION, SearchValueHighlightAction.getInstance()); } - @Override public void registerAction(String tag, SearchAction searchAction) { - if (searchAction instanceof SearchHighlightFormula){ + if (searchAction instanceof SearchHighlightFormula) { register(tag, (SearchHighlightFormula) searchAction); } } @@ -42,7 +48,7 @@ public class SearchHighlightFormulaManager implements SearchManager { /** * 注册 * - * @param tag 用于匹配的类型tag + * @param tag 用于匹配的类型tag * @param searchHighlightFormula 对应的实现类 */ private void register(String tag, SearchHighlightFormula searchHighlightFormula) { diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java index 99ed9774ce..1b1c352741 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java @@ -11,6 +11,7 @@ import com.fr.js.Commit2DBJavaScript; import com.fr.js.JavaScript; import com.fr.write.DBManipulation; import com.fr.write.DMLConfigJob; +import com.fr.write.NameSubmitJob; import com.fr.write.config.ColumnConfig; import com.fr.write.config.DMLConfig; @@ -41,7 +42,13 @@ public class SearchCommit2DBJSFormulaAction implements SearchJSFormula { } } - private void dealWithDBManipulation(List formulaInfos, ITContent content, DBManipulation dbManipulation) { + /** + * 处理DBManipulation + * @param formulaInfos + * @param content + * @param dbManipulation + */ + public void dealWithDBManipulation(List formulaInfos, ITContent content, DBManipulation dbManipulation) { DMLConfig dmlConfig = dbManipulation.getDmlConfig(); //值中的公式 dealWithColumnValue(formulaInfos, content, dmlConfig); @@ -66,12 +73,14 @@ public class SearchCommit2DBJSFormulaAction implements SearchJSFormula { private void dealWithSubmitJob(List formulaInfos, ITContent content, DMLConfig dmlConfig) { for (int i = 0, len = dmlConfig.getSubmitJobCount(); i < len; i++) { //这边自定义事件不需要处理,只处理提交事件 - if (dmlConfig.getSubmitJob(i) instanceof DMLConfigJob) { + NameSubmitJob job = dmlConfig.getNameSubmitJob(i); + if (job != null && job.getSubmitJob() instanceof DMLConfigJob) { ITContent newContent = ITContent.copy(content); newContent.addOtherPos( - Toolkit.i18nText("Fine-Design_Basic_Write_Submit_Event") + Toolkit.i18nText("Fine-Design_Basic_Write_Submit_Event"), + job.getName() ); - dealWithDBManipulation(formulaInfos, newContent, (((DMLConfigJob) dmlConfig.getSubmitJob(i)).getDBManipulation())); + dealWithDBManipulation(formulaInfos, newContent, (((DMLConfigJob) job.getSubmitJob()).getDBManipulation())); } } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchJSHighlightAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchJSHighlightAction.java index 4d2bd573b8..40c31abe9e 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchJSHighlightAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchJSHighlightAction.java @@ -34,11 +34,7 @@ public class SearchJSHighlightAction implements SearchJSFormula { for (int i = 0; i < nameJavaScriptGroup.size(); i++) { //单元格条件属性-属性-超级链接里面参数的公式统一判断获取一下 ITContent newContent = ITContent.copy(content); - newContent.addOtherPos( - Toolkit.i18nText("Fine-Design_Basic_Cell"), - Toolkit.i18nText("Fine-Design_Basic_Condition_Attributes"), - nameJavaScriptGroup.getNameHyperlink(i).getName() - ); + newContent.addOtherPos(nameJavaScriptGroup.getNameHyperlink(i).getName()); addFormulaInfosFromJSPara(formulaInfos, newContent, nameJavaScriptGroup.getNameHyperlink(i).getJavaScript()); } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/present/SearchPresentHighlightAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/present/SearchPresentHighlightAction.java new file mode 100644 index 0000000000..6826ff3fd1 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/present/SearchPresentHighlightAction.java @@ -0,0 +1,91 @@ +package com.fr.design.actions.replace.action.content.formula.highlight.present; + +import com.fr.base.Formula; +import com.fr.base.present.DictPresent; +import com.fr.base.present.FormulaPresent; +import com.fr.design.actions.replace.action.content.formula.highlight.SearchHighlightFormula; +import com.fr.design.actions.replace.action.content.formula.highlight.javascript.SearchJSHighlightAction; +import com.fr.design.actions.replace.action.content.formula.widget.DictionaryType; +import com.fr.design.actions.replace.info.FormulaInfo; +import com.fr.design.actions.replace.info.base.ITContent; +import com.fr.design.i18n.Toolkit; +import com.fr.report.cell.TemplateCellElement; +import com.fr.report.cell.cellattr.highlight.HighlightAction; +import com.fr.report.cell.cellattr.highlight.PresentHighlightAction; + +import java.util.List; + +/** + * 条件属性-属性-形态 + * + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-09-27 + */ +public class SearchPresentHighlightAction implements SearchHighlightFormula { + + private SearchPresentHighlightAction() { + } + + + @Override + public void dealWithHighlightAction(ITContent content, List formulaInfos, HighlightAction highlightAction) { + if (highlightAction instanceof PresentHighlightAction) { + ITContent newContent = ITContent.copy(content); + newContent.addOtherPos(Toolkit.i18nText("Fine-Design_Report_Present")); + PresentHighlightAction action = (PresentHighlightAction) highlightAction; + //公式形态 + if (action.getPresent() instanceof FormulaPresent) { + newContent.setReplaceObject(action.getPresent()); + formulaInfos.add(new FormulaInfo(newContent)); + } else if (action.getPresent() instanceof DictPresent) { + //数据字典 + DictPresent present = (DictPresent) action.getPresent(); + if (present.getDictionary() != null) { + DictionaryType type = DictionaryType.match(present.getDictionary().getClass().getSimpleName()); + if (type != null) { + type.searchFormulaFromDictionary(newContent, formulaInfos, present.getDictionary()); + } + } + } else if (action.getValue() instanceof Formula) { + //普通 + newContent.setReplaceObject(action.getValue()); + formulaInfos.add(new FormulaInfo(newContent)); + + } + } + } + + /** + * 获取单例 + * + * @return + */ + public static SearchPresentHighlightAction getInstance() { + return SearchPresentHighlightActionEnum.SINGLETON.getInstance(); + } + + /** + * 枚举实现单例 + */ + private enum SearchPresentHighlightActionEnum { + /** + * 单例实现 + */ + SINGLETON; + private SearchPresentHighlightAction instance; + + SearchPresentHighlightActionEnum() { + instance = new SearchPresentHighlightAction(); + } + + /** + * 拿到对象 + * + * @return + */ + public SearchPresentHighlightAction getInstance() { + return instance; + } + } +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/value/SearchValueHighlightAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/value/SearchValueHighlightAction.java new file mode 100644 index 0000000000..1d692c197a --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/value/SearchValueHighlightAction.java @@ -0,0 +1,70 @@ +package com.fr.design.actions.replace.action.content.formula.highlight.value; + +import com.fr.base.Formula; +import com.fr.design.actions.replace.action.content.formula.highlight.SearchHighlightFormula; +import com.fr.design.actions.replace.action.content.formula.highlight.javascript.SearchMobileHyperlinkFormulaAction; +import com.fr.design.actions.replace.info.FormulaInfo; +import com.fr.design.actions.replace.info.base.ITContent; +import com.fr.design.i18n.Toolkit; +import com.fr.report.cell.cellattr.highlight.HighlightAction; +import com.fr.report.cell.cellattr.highlight.ValueHighlightAction; + +import java.util.List; + +/** + * 条件属性-新值-公式 + * + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-09-27 + */ +public class SearchValueHighlightAction implements SearchHighlightFormula { + private SearchValueHighlightAction() { + } + + @Override + public void dealWithHighlightAction(ITContent content, List formulaInfos, HighlightAction highlightAction) { + if (highlightAction instanceof ValueHighlightAction) { + ValueHighlightAction action = (ValueHighlightAction) highlightAction; + if (action.getValue() instanceof Formula) { + ITContent valueContent = ITContent.copy(content); + valueContent.addOtherPos(Toolkit.i18nText("Fine-Design_Report_New_Value")); + valueContent.setReplaceObject(action.getValue()); + formulaInfos.add(new FormulaInfo(valueContent)); + } + } + } + + /** + * 获取单例 + * + * @return + */ + public static SearchValueHighlightAction getInstance() { + return SearchValueHighlightActionEnum.SINGLETON.getInstance(); + } + + /** + * 枚举实现单例 + */ + private enum SearchValueHighlightActionEnum { + /** + * 单例实现 + */ + SINGLETON; + private SearchValueHighlightAction instance; + + SearchValueHighlightActionEnum() { + instance = new SearchValueHighlightAction(); + } + + /** + * 拿到对象 + * + * @return + */ + public SearchValueHighlightAction getInstance() { + return instance; + } + } +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java index 39c98dda3f..9c57f2ad00 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java @@ -5,11 +5,22 @@ import com.fr.base.Parameter; import com.fr.base.ParameterConfig; import com.fr.base.io.AttrMark; import com.fr.base.iofile.attr.WatermarkAttr; +import com.fr.data.Verifier; +import com.fr.data.VerifyItem; +import com.fr.design.actions.replace.action.content.formula.highlight.javascript.SearchCommit2DBJSFormulaAction; import com.fr.design.actions.replace.info.FormulaInfo; import com.fr.design.actions.replace.info.base.ITContent; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.JTemplate; +import com.fr.main.impl.WorkBook; import com.fr.report.core.ReportUtils; +import com.fr.report.report.Report; +import com.fr.report.worksheet.WorkSheet; +import com.fr.report.write.BuiltInSQLSubmiter; +import com.fr.report.write.ReportWriteAttr; +import com.fr.report.write.SubmitVisitor; +import com.fr.report.write.ValueVerifier; +import com.fr.stable.CommonUtils; import java.util.List; @@ -33,8 +44,79 @@ public class SearchTemplateFormulaAction implements SearchTemplateFormula { ITContent content = new ITContent(); content.setTemplateName(jTemplate.getTemplateName()); content.setJumpAble(false); + //参数 searchTemplateParaFormula(jTemplate, formulaInfos, content); + //水印 searchTemplateWaterMarkFormula(jTemplate, formulaInfos, content); + //报表填报属性 + searchTemplateWriteAttrFormula(jTemplate, formulaInfos, content); + } + + private void searchTemplateWriteAttrFormula(JTemplate jTemplate, List formulaInfos, ITContent content) { + if (jTemplate.getTarget() instanceof WorkBook) { + WorkBook workBook = (WorkBook) jTemplate.getTarget(); + for (int i = 0, len = workBook.getReportCount(); i < len; i++) { + Report report = workBook.getReport(i); + if (report instanceof WorkSheet) { + ITContent sheetContent = ITContent.copy(content); + sheetContent.setSheetName(workBook.getReportName(i)); + sheetContent.addOtherPos(Toolkit.i18nText("Fine-Design_Basic_Report_Write_Attributes")); + dealWorkSheetAttr(formulaInfos, sheetContent, (WorkSheet) report); + } + } + } + } + + private void dealWorkSheetAttr(List formulaInfos, ITContent sheetContent, WorkSheet report) { + ReportWriteAttr attr = report.getAttributeTarget(ReportWriteAttr.XML_TAG); + if (attr != null){ + //提交 + for (int i = 0 ,len = attr.getSubmitVisitorCount(); i < len ; i ++){ + SubmitVisitor visitor = attr.getSubmitVisitor(i); + ITContent submitContent = ITContent.copy(sheetContent); + submitContent.addOtherPos(Toolkit.i18nText("FIne-Design_Basic_Submit")); + dealBuiltSQLSubmiter4Formula(formulaInfos, submitContent, visitor); + } + + //数据校验 + for (int i = 0 , len = attr.getValueVerifierCount() ;i < len ; i++){ + Verifier verifier = attr.getVerifier(i); + if (verifier instanceof ValueVerifier){ + ITContent content = ITContent.copy(sheetContent); + content.addOtherPos(Toolkit.i18nText("Fine-Design_Report_Verify_Data_Verify")); + dealValueVerifier4Formula(formulaInfos,content, (ValueVerifier) verifier); + } + } + } + + } + + private void dealValueVerifier4Formula(List formulaInfos, ITContent content, ValueVerifier verifier) { + ITContent verifyContent = ITContent.copy(content); + verifyContent.addOtherPos(verifier.getName()); + for (int i = 0,len = verifier.getVerifyItemsCount() ;i < len ; i ++){ + VerifyItem item = verifier.getVerifyItem(i); + if (item.getFormula() != null){ + ITContent formulaContent = ITContent.copy(verifyContent); + formulaContent.setReplaceObject(item.getFormula()); + formulaInfos.add(new FormulaInfo(formulaContent)); + } + if (CommonUtils.canBeFormula(item.getMessage())){ + ITContent messageContent = ITContent.copy(verifyContent); + messageContent.setReplaceObject(item.getMessage()); + messageContent.setHoldObject(item); + formulaInfos.add(new FormulaInfo(messageContent)); + } + } + } + + private void dealBuiltSQLSubmiter4Formula(List formulaInfos, ITContent submitContent, SubmitVisitor visitor) { + if (visitor instanceof BuiltInSQLSubmiter){ + BuiltInSQLSubmiter submiter = (BuiltInSQLSubmiter) visitor; + ITContent content = ITContent.copy(submitContent); + content.addOtherPos(submiter.getName()); + SearchCommit2DBJSFormulaAction.getInstance().dealWithDBManipulation(formulaInfos,content, submiter.getDBManipulation()); + } } @Override @@ -60,15 +142,16 @@ public class SearchTemplateFormulaAction implements SearchTemplateFormula { } } - Parameter[] globalParameters = ParameterConfig.getInstance().getGlobalParameters(); - for (Parameter parameter : globalParameters) { - if (parameter.getValue() instanceof Formula) { - ITContent paraContent = ITContent.copy(content); - paraContent.addOtherPos(Toolkit.i18nText("Fine-Design_Basic_Parameter_Source_Type_Server")); - paraContent.setReplaceObject(parameter); - formulaInfos.add(new FormulaInfo(paraContent)); - } - } + ////全局类二期再做 + //Parameter[] globalParameters = ParameterConfig.getInstance().getGlobalParameters(); + //for (Parameter parameter : globalParameters) { + // if (parameter.getValue() instanceof Formula) { + // ITContent paraContent = ITContent.copy(content); + // paraContent.addOtherPos(Toolkit.i18nText("Fine-Design_Basic_Parameter_Source_Type_Server")); + // paraContent.setReplaceObject(parameter); + // formulaInfos.add(new FormulaInfo(paraContent)); + // } + //} } /** diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchWebJSAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchWebJSAction.java index 0e35fa525f..0ceec53617 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchWebJSAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchWebJSAction.java @@ -59,7 +59,8 @@ public class SearchWebJSAction implements SearchJS { private void addJSInfos2ListFromWeb(JTemplate jTemplate, List jsInfos) { - dealServerWebAttr(jTemplate, jsInfos); + ////服务器相关二期再做 + //dealServerWebAttr(jTemplate, jsInfos); dealTemplateWebAttr(jTemplate, jsInfos); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/sql/SearchSQLAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/sql/SearchSQLAction.java index f37f6acac1..f36e3afbeb 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/sql/SearchSQLAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/sql/SearchSQLAction.java @@ -36,7 +36,8 @@ public class SearchSQLAction implements SearchAction { content.setTemplateName(jTemplate.getTemplateName()); content.setJumpAble(false); addModelDataInfos2Array(jTemplate, content, sqlInfos); - addServerDataInfos2Array(content, sqlInfos); + ////服务器的数据二期再查询 + //addServerDataInfos2Array(content, sqlInfos); setSqlInfos(sqlInfos); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java index 240ac6ba36..3d615e18a9 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java @@ -2,7 +2,6 @@ package com.fr.design.actions.replace.info; import com.fr.data.impl.DBTableData; import com.fr.design.actions.replace.utils.ShowValueUtils; -import com.fr.design.data.DesignTableDataManager; import com.fr.form.event.Listener; import com.fr.js.JavaScriptImpl; import com.fr.js.NameJavaScript; diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java index 2106c51c0f..f7bbff40e7 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java @@ -32,6 +32,10 @@ public class SearchTag { * 终点区域名 */ public static final int CHART_AREA_END_NAME = 5; + /** + * 模板填报属性数据校验提示 + */ + public static final int WRITE_ATTR_MESSAGE = 6; } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index f6fd8b6dc4..de4628b590 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -1,7 +1,6 @@ package com.fr.design.actions.replace.ui; -import com.fr.design.actions.help.replace.ITReplaceHelper; import com.fr.design.actions.replace.action.ShowSearchResultAction; import com.fr.design.actions.replace.info.Info; diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceOperator.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceOperator.java index e405c6be5f..be6dc6eb1d 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceOperator.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceOperator.java @@ -1,6 +1,6 @@ package com.fr.design.actions.replace.utils; -import com.fr.design.actions.help.replace.ITReplaceHelper; +import com.fr.design.actions.help.replace.ITReplaceOperator; import com.fr.design.actions.replace.ui.ITReplaceMainDialog; /** @@ -10,7 +10,7 @@ import com.fr.design.actions.replace.ui.ITReplaceMainDialog; * @version 11.0 * created by Destiny.Lin on 2022-09-27 */ -public class ReplaceOperator implements ITReplaceHelper { +public class ReplaceOperator implements ITReplaceOperator { /** * 关闭面板 From 49ac7e25e38f59e5f7b7c992d44cc5ea19576bbf Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 27 Sep 2022 16:06:53 +0800 Subject: [PATCH 020/310] =?UTF-8?q?REPORT-75998=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SearchCommit2DBJSFormulaAction.java | 1 + .../template/SearchTemplateFormulaAction.java | 20 +++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java index 1b1c352741..54e971ee3e 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java @@ -44,6 +44,7 @@ public class SearchCommit2DBJSFormulaAction implements SearchJSFormula { /** * 处理DBManipulation + * * @param formulaInfos * @param content * @param dbManipulation diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java index 9c57f2ad00..6c8419512d 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java @@ -69,9 +69,9 @@ public class SearchTemplateFormulaAction implements SearchTemplateFormula { private void dealWorkSheetAttr(List formulaInfos, ITContent sheetContent, WorkSheet report) { ReportWriteAttr attr = report.getAttributeTarget(ReportWriteAttr.XML_TAG); - if (attr != null){ + if (attr != null) { //提交 - for (int i = 0 ,len = attr.getSubmitVisitorCount(); i < len ; i ++){ + for (int i = 0, len = attr.getSubmitVisitorCount(); i < len; i++) { SubmitVisitor visitor = attr.getSubmitVisitor(i); ITContent submitContent = ITContent.copy(sheetContent); submitContent.addOtherPos(Toolkit.i18nText("FIne-Design_Basic_Submit")); @@ -79,12 +79,12 @@ public class SearchTemplateFormulaAction implements SearchTemplateFormula { } //数据校验 - for (int i = 0 , len = attr.getValueVerifierCount() ;i < len ; i++){ + for (int i = 0, len = attr.getValueVerifierCount(); i < len; i++) { Verifier verifier = attr.getVerifier(i); - if (verifier instanceof ValueVerifier){ + if (verifier instanceof ValueVerifier) { ITContent content = ITContent.copy(sheetContent); content.addOtherPos(Toolkit.i18nText("Fine-Design_Report_Verify_Data_Verify")); - dealValueVerifier4Formula(formulaInfos,content, (ValueVerifier) verifier); + dealValueVerifier4Formula(formulaInfos, content, (ValueVerifier) verifier); } } } @@ -94,14 +94,14 @@ public class SearchTemplateFormulaAction implements SearchTemplateFormula { private void dealValueVerifier4Formula(List formulaInfos, ITContent content, ValueVerifier verifier) { ITContent verifyContent = ITContent.copy(content); verifyContent.addOtherPos(verifier.getName()); - for (int i = 0,len = verifier.getVerifyItemsCount() ;i < len ; i ++){ + for (int i = 0, len = verifier.getVerifyItemsCount(); i < len; i++) { VerifyItem item = verifier.getVerifyItem(i); - if (item.getFormula() != null){ + if (item.getFormula() != null) { ITContent formulaContent = ITContent.copy(verifyContent); formulaContent.setReplaceObject(item.getFormula()); formulaInfos.add(new FormulaInfo(formulaContent)); } - if (CommonUtils.canBeFormula(item.getMessage())){ + if (CommonUtils.canBeFormula(item.getMessage())) { ITContent messageContent = ITContent.copy(verifyContent); messageContent.setReplaceObject(item.getMessage()); messageContent.setHoldObject(item); @@ -111,11 +111,11 @@ public class SearchTemplateFormulaAction implements SearchTemplateFormula { } private void dealBuiltSQLSubmiter4Formula(List formulaInfos, ITContent submitContent, SubmitVisitor visitor) { - if (visitor instanceof BuiltInSQLSubmiter){ + if (visitor instanceof BuiltInSQLSubmiter) { BuiltInSQLSubmiter submiter = (BuiltInSQLSubmiter) visitor; ITContent content = ITContent.copy(submitContent); content.addOtherPos(submiter.getName()); - SearchCommit2DBJSFormulaAction.getInstance().dealWithDBManipulation(formulaInfos,content, submiter.getDBManipulation()); + SearchCommit2DBJSFormulaAction.getInstance().dealWithDBManipulation(formulaInfos, content, submiter.getDBManipulation()); } } From 8cb8c26b26d67e93fdc8543abc156ad50537113a Mon Sep 17 00:00:00 2001 From: "Jimmy.Zheng" Date: Tue, 27 Sep 2022 16:35:10 +0800 Subject: [PATCH 021/310] =?UTF-8?q?REPORT-70593=20=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E5=90=88=E5=B9=B6=E4=B8=BB=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/designer/ui/ImgPanel.java | 56 ++++++++++--------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/ui/ImgPanel.java b/designer-form/src/main/java/com/fr/design/designer/ui/ImgPanel.java index 05aa8ba465..1c17c56c34 100644 --- a/designer-form/src/main/java/com/fr/design/designer/ui/ImgPanel.java +++ b/designer-form/src/main/java/com/fr/design/designer/ui/ImgPanel.java @@ -1,17 +1,17 @@ package com.fr.design.designer.ui; import com.fr.general.ImageWithSuffix; +import com.fr.stable.Constants; import java.awt.Graphics; import java.awt.Image; import javax.swing.JComponent; /** -* -*

图片控件中的已选图片展示面板

-* -* @author Jimmy.Zheng created on 2022/8/11 21:17 -**/ + *

图片控件中的已选图片展示面板

+ * + * @author Jimmy.Zheng created on 2022/8/11 21:17 + **/ public class ImgPanel extends JComponent { private static final long serialVersionUID = 1L; private Image backgroundImage; @@ -27,40 +27,41 @@ public class ImgPanel extends JComponent { setImageDisplayMode(modeName); } + public Image getBackgroundImage() { + return this.backgroundImage; + } + public void setBackgroundImage(Image image) { this.backgroundImage = image; repaint(); } - public Image getBackgroundImage() { - return this.backgroundImage; + public int getImageDisplayMode() { + return this.imageDisplayMode; } public void setImageDisplayMode(int modeName) { - if (modeName == 1) { - this.modeIndex = 0; - } - - if (modeName == 0) { - this.imageDisplayMode = 0; - this.modeIndex = 1; - } - - if (modeName == 2) { - this.imageDisplayMode = 2; - this.modeIndex = 2; - } - if (modeName == 4) { - this.imageDisplayMode = 4; - this.modeIndex = 3; + switch (modeName) { + case Constants.IMAGE_CENTER: + this.modeIndex = 0; + break; + case Constants.IMAGE_TILED: + this.imageDisplayMode = 0; + this.modeIndex = 1; + break; + case Constants.IMAGE_EXTEND: + this.imageDisplayMode = 2; + this.modeIndex = 2; + break; + case Constants.IMAGE_ADJUST: + this.imageDisplayMode = 4; + this.modeIndex = 3; + break; + default: } repaint(); } - public int getImageDisplayMode() { - return this.imageDisplayMode; - } - @Override protected void paintComponent(Graphics g) { super.paintComponent(g); @@ -105,6 +106,7 @@ public class ImgPanel extends JComponent { int xx = (getWidth() - width) / 2; int yy = (getHeight() - height) / 2; g.drawImage(this.backgroundImage, xx, yy, width, height, this); + default: } } } From ac73c3f1699f26a23ed742cad05e380a678fe5dd Mon Sep 17 00:00:00 2001 From: "Link.Zhao" Date: Wed, 28 Sep 2022 10:58:20 +0800 Subject: [PATCH 022/310] =?UTF-8?q?REPORT-81231=E3=80=90=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91alphafine?= =?UTF-8?q?=E4=B8=8D=E9=80=89=E6=8B=A9=E4=BB=BB=E4=BD=95TAB=EF=BC=8C?= =?UTF-8?q?=E7=82=B9=E5=87=BBalphafine,=E6=97=A5=E5=BF=97=E4=B8=AD?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E6=8A=A5=E9=94=99=20REPORT-81241=E3=80=90?= =?UTF-8?q?=E8=BF=90=E8=90=A5=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F?= =?UTF-8?q?=E3=80=91=E6=8F=92=E4=BB=B6=E4=B8=AD=E5=BF=83=E6=96=AD=E7=BD=91?= =?UTF-8?q?=E5=90=8E=E7=9A=84=E9=87=8D=E6=96=B0=E5=8A=A0=E8=BD=BD=E6=97=A0?= =?UTF-8?q?=E5=8F=8D=E5=BA=94=20REPORT-80752=E3=80=90=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E6=97=A0=E6=B3=95=E6=98=BE=E7=A4=BA=E5=87=BA=E6=9D=A5?= =?UTF-8?q?=EF=BC=8C=E8=8B=A5=E6=8F=92=E4=BB=B6=E4=B8=AD=E5=BF=83=E5=9C=A8?= =?UTF-8?q?=E9=A6=96=E4=B8=AA=E4=B9=9F=E6=97=A0=E6=B3=95=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=20REPORT-81211=E3=80=90=E8=BF=90=E8=90=A5=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91=E6=8F=92=E4=BB=B6=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E6=9F=A5=E8=AF=A2=E7=9A=84=E6=8E=A8=E8=8D=90=E4=B8=8E?= =?UTF-8?q?=E8=A7=86=E8=A7=89=E5=9B=BEUI=E4=B8=8D=E4=B8=80=E8=87=B4=201?= =?UTF-8?q?=E3=80=81=E5=B1=8F=E8=94=BD=E6=8A=A5=E9=94=99=202=E3=80=81?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E8=AE=BE=E7=BD=AEreload=E6=96=B9=E6=B3=95=20?= =?UTF-8?q?3=E3=80=81=E6=94=B9=E4=B8=8Bui?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/AlphaFineConfigManager.java | 8 +++ .../fr/design/remote/button/IconButton.java | 10 +++- .../mainframe/alphafine/AlphaFineHelper.java | 2 +- .../alphafine/component/AlphaFineFrame.java | 1 + .../component/RecommendSearchLabel.java | 2 +- .../alphafine/component/SearchHintPane.java | 5 +- .../download/FineMarketDownloadManager.java | 9 +-- .../alphafine/preview/DefaultContentPane.java | 8 +++ .../preview/DefaultPluginContentPane.java | 58 ++++++++++++++++--- .../alphafine/search/SearchWorkerManager.java | 3 +- 10 files changed, 83 insertions(+), 23 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java index c74ddaa65a..2e78d1062d 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java @@ -484,6 +484,14 @@ public class AlphaFineConfigManager implements XMLable { this.showTemplateShop = showTemplateShop; } + /** + * 是否展示alphafine窗口,设置-搜索范围 0勾选,则不显示 + */ + public boolean needShowAlphaFineDialog() { + return hasTemplateShop() || isContainDocument() || isContainPlugin() || + isContainAction() || isProductDynamics() || isContainMyTemplate(); + } + /** * 返回tab显示顺序 */ diff --git a/designer-base/src/main/java/com/fr/design/remote/button/IconButton.java b/designer-base/src/main/java/com/fr/design/remote/button/IconButton.java index 598ec7f057..d2d04b8d4c 100644 --- a/designer-base/src/main/java/com/fr/design/remote/button/IconButton.java +++ b/designer-base/src/main/java/com/fr/design/remote/button/IconButton.java @@ -4,6 +4,7 @@ import com.fr.base.BaseUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.stable.StringUtils; +import javax.swing.Icon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; @@ -15,14 +16,19 @@ import java.awt.Graphics2D; import java.awt.Point; public final class IconButton extends JButton { - public IconButton() { + + public IconButton(Icon icon) { super(StringUtils.EMPTY); setContentAreaFilled(false); setFocusPainted(false); - setIcon(BaseUtils.readIcon("com/fr/design/remote/images/icon_tab_close_normal.png")); + setIcon(icon); setBorder(null); } + public IconButton() { + this(BaseUtils.readIcon("com/fr/design/remote/images/icon_tab_close_normal.png")); + } + @Override protected void paintBorder(Graphics g) { } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java index 441bd03ac6..126e883d9b 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java @@ -58,7 +58,7 @@ public class AlphaFineHelper { * 弹出alphafine搜索面板 */ public static void showAlphaFineDialog(boolean forceOpen) { - if (!AlphaFineConfigManager.isALPHALicAvailable()) { + if (!AlphaFineConfigManager.isALPHALicAvailable() || !AlphaFineConfigManager.getInstance().needShowAlphaFineDialog()) { return; } if (alphaFineDialog == null) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java index 8e9a4d3cdd..0269480b60 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java @@ -920,6 +920,7 @@ public class AlphaFineFrame extends JFrame { this.productNewsSearchWorkerManager.doSearch(searchTextBean); this.documentWorkerManager.doSearch(searchTextBean); this.pluginSearchWorkerManager.doSearch(searchTextBean); + this.templateResourceSearchWorkerManager.doSearch(searchTextBean); } /** diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/RecommendSearchLabel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/RecommendSearchLabel.java index 8d3b760706..f7e017024f 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/RecommendSearchLabel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/RecommendSearchLabel.java @@ -23,7 +23,7 @@ public class RecommendSearchLabel extends JPanel { private static final Color RECOMMEND_SEARCH_KEY_BLUE = new Color(0x419bf9); public RecommendSearchLabel(String title, @NotNull List tips) { - this.setLayout(new FlowLayout(FlowLayout.LEFT)); + this.setLayout(new FlowLayout(FlowLayout.CENTER)); this.setBackground(Color.WHITE); JLabel recommend = new JLabel(title); this.add(recommend); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SearchHintPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SearchHintPane.java index adc5fc8352..83a2fdffcd 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SearchHintPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SearchHintPane.java @@ -31,8 +31,9 @@ public class SearchHintPane extends JPanel { private static final String TITLE = Toolkit.i18nText("Fine-Design_Report_AlphaFine_Search_Title"); private static final String RECOMMEND = Toolkit.i18nText("Fine-Design_Report_AlphaFine_Recommend_Search"); private static final Icon ICON = IconUtils.readIcon("com/fr/design/mainframe/alphafine/images/search_hint.svg"); - private static final int HEIGHT = 305; + private static final int HEIGHT = 200; private static final int WIDTH = 300; + private static final int TITLE_LABEL_HEIGHT = 30; private static final int TITLE_FONT_SIZE = 14; public SearchHintPane() { @@ -45,6 +46,7 @@ public class SearchHintPane extends JPanel { public SearchHintPane(List hints, Icon icon, String title) { setLayout(new BorderLayout()); + setBorder(BorderFactory.createEmptyBorder(40,0,0,0)); setBackground(Color.white); setPreferredSize(new Dimension(WIDTH, HEIGHT)); setAlignmentY(SwingConstants.CENTER); @@ -64,6 +66,7 @@ public class SearchHintPane extends JPanel { description.setFont(DesignUtils.getDefaultGUIFont().applySize(TITLE_FONT_SIZE)); description.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); description.setHorizontalAlignment(SwingConstants.CENTER); + description.setPreferredSize(new Dimension(WIDTH, TITLE_LABEL_HEIGHT)); return description; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/download/FineMarketDownloadManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/download/FineMarketDownloadManager.java index 29172f94ef..127d2002b0 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/download/FineMarketDownloadManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/download/FineMarketDownloadManager.java @@ -2,7 +2,6 @@ package com.fr.design.mainframe.alphafine.download; import com.fr.base.svg.IconUtils; import com.fr.common.util.Strings; -import com.fr.decision.webservice.v10.log.download.utils.LogZipUtils; import com.fr.design.DesignerEnvManager; import com.fr.design.extra.Process; import com.fr.design.i18n.Toolkit; @@ -14,7 +13,6 @@ import com.fr.design.mainframe.alphafine.search.helper.FineMarketClientHelper; import com.fr.design.mainframe.toast.SimpleToast; import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; -import com.fr.stable.pinyin.ChineseHelper; import javax.swing.SwingUtilities; import javax.swing.filechooser.FileSystemView; @@ -82,11 +80,8 @@ public class FineMarketDownloadManager { if (fileName.endsWith(FineMarketConstants.ZIP)) { File file = new File(fileName); File parentDir = file.getParentFile(); - if (ChineseHelper.containChinese(fileName)) { - IOUtils.unzip(file, parentDir.getAbsolutePath(), LogZipUtils.GBK); - } else { - IOUtils.unzip(file, parentDir.getAbsolutePath()); - } + // TODO:之前用的gbk解码太容易乱码了。这里应该自动识别编码,然后解压,但是要添加1个三方包,可能会赶不上发布。所以先暂时用utf8顶着。 + IOUtils.unzip(file, parentDir.getAbsolutePath(), "UTF-8"); } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DefaultContentPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DefaultContentPane.java index 56c14dc28a..99c312e882 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DefaultContentPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DefaultContentPane.java @@ -35,6 +35,14 @@ public class DefaultContentPane extends JPanel { this.searchWorkerManager.showDefault(this); } + /** + * 显示搜索结果 + */ + public void showResult(JPanel result) { + add(result); + repaint(); + } + public DefaultContentPane() { } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DefaultPluginContentPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DefaultPluginContentPane.java index fc9838e9fb..9ed5003d36 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DefaultPluginContentPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DefaultPluginContentPane.java @@ -10,8 +10,9 @@ import com.fr.design.mainframe.alphafine.search.manager.SearchProviderRegistry; import com.fr.general.CloudCenter; import com.fr.log.FineLoggerFactory; +import javax.swing.JPanel; import javax.swing.SwingWorker; -import java.awt.BorderLayout; +import java.awt.CardLayout; import java.util.ArrayList; import java.util.List; @@ -25,18 +26,46 @@ import java.util.List; public class DefaultPluginContentPane extends DefaultContentPane { private static final String[] HINTS = CloudCenter.getInstance().acquireConf("alphafine.plugin.recommend", "JS,API,JSON").split(","); - // 左边展示内容,右边展示搜索提示 + private static final String LOADING_PANE = "loading"; + private static final String NETWORK_ERROR = "networkError"; + private static final String RESULT_PANE = "result"; private SearchWorkerManager searchWorkerManager; private CellType cellType; + private AlphaFineFrame parentWindow; + private CardLayout cardLayout; + private SearchLoadingPane searchLoadingPane; + private NetWorkFailedPane netWorkFailedPane; + private SwingWorker worker; + public DefaultPluginContentPane(CellType cellType, AlphaFineFrame parentWindow) { super(); - this.setLayout(new BorderLayout()); + this.cellType = cellType; + this.parentWindow = parentWindow; + this.cardLayout = new CardLayout(); + this.setLayout(cardLayout); this.setPreferredSize(AlphaFineConstants.PREVIEW_SIZE); - new SwingWorker() { + initPanel(); + add(searchLoadingPane, LOADING_PANE); + add(netWorkFailedPane, NETWORK_ERROR); + worker = createWorker(); + worker.execute(); + } + + private void initPanel() { + this.searchLoadingPane = new SearchLoadingPane(); + this.netWorkFailedPane = new NetWorkFailedPane(()-> reload()); + } + + private void switchPane(String tag) { + cardLayout.show(this, tag); + } + + private SwingWorker createWorker() { + return new SwingWorker() { @Override protected Boolean doInBackground() throws Exception { - add(new SearchLoadingPane()); + switchPane(LOADING_PANE); return AlphaFineHelper.isNetworkOk(); } @@ -45,9 +74,8 @@ public class DefaultPluginContentPane extends DefaultContentPane { super.done(); try { boolean networkOk = get(); - removeAll(); if (!networkOk) { - add(new NetWorkFailedPane()); + switchPane(NETWORK_ERROR); } else { List searchKeys = new ArrayList<>(); for (String s : HINTS) { @@ -64,10 +92,22 @@ public class DefaultPluginContentPane extends DefaultContentPane { } catch (Exception e) { FineLoggerFactory.getLogger().error(e, e.getMessage()); } - } - }.execute(); + }; + } + + @Override + public void showResult(JPanel result) { + add(result, RESULT_PANE); + switchPane(RESULT_PANE); + } + /** + * 网络异常时,重新加载 + */ + public void reload() { + worker = createWorker(); + worker.execute(); } public CellType getCellType() { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/SearchWorkerManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/SearchWorkerManager.java index bca8904a13..cdacd681d7 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/SearchWorkerManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/SearchWorkerManager.java @@ -135,8 +135,7 @@ public class SearchWorkerManager implements SearchManager { searchResultPane.getSearchResultList().setModel(searchListModel); searchResultPane.getSearchResultList().setSelectedIndex(0); searchResultPane.getSearchResultList().requestFocus(); - defaultContentPane.add(searchResultPane); - SwingUtilities.invokeLater(()->defaultContentPane.repaint()); + SwingUtilities.invokeLater(()->defaultContentPane.showResult(searchResultPane)); } @Override From 1c781a2c9be59d2b5a8829d9cb8afd2bf2d3a30e Mon Sep 17 00:00:00 2001 From: "Link.Zhao" Date: Wed, 28 Sep 2022 11:02:33 +0800 Subject: [PATCH 023/310] =?UTF-8?q?REPORT-81231=E3=80=90=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91alphafine?= =?UTF-8?q?=E4=B8=8D=E9=80=89=E6=8B=A9=E4=BB=BB=E4=BD=95TAB=EF=BC=8C?= =?UTF-8?q?=E7=82=B9=E5=87=BBalphafine,=E6=97=A5=E5=BF=97=E4=B8=AD?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E6=8A=A5=E9=94=99=20REPORT-81241=E3=80=90?= =?UTF-8?q?=E8=BF=90=E8=90=A5=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F?= =?UTF-8?q?=E3=80=91=E6=8F=92=E4=BB=B6=E4=B8=AD=E5=BF=83=E6=96=AD=E7=BD=91?= =?UTF-8?q?=E5=90=8E=E7=9A=84=E9=87=8D=E6=96=B0=E5=8A=A0=E8=BD=BD=E6=97=A0?= =?UTF-8?q?=E5=8F=8D=E5=BA=94=20REPORT-80752=E3=80=90=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E6=97=A0=E6=B3=95=E6=98=BE=E7=A4=BA=E5=87=BA=E6=9D=A5?= =?UTF-8?q?=EF=BC=8C=E8=8B=A5=E6=8F=92=E4=BB=B6=E4=B8=AD=E5=BF=83=E5=9C=A8?= =?UTF-8?q?=E9=A6=96=E4=B8=AA=E4=B9=9F=E6=97=A0=E6=B3=95=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=20REPORT-81211=E3=80=90=E8=BF=90=E8=90=A5=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91=E6=8F=92=E4=BB=B6=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E6=9F=A5=E8=AF=A2=E7=9A=84=E6=8E=A8=E8=8D=90=E4=B8=8E?= =?UTF-8?q?=E8=A7=86=E8=A7=89=E5=9B=BEUI=E4=B8=8D=E4=B8=80=E8=87=B4=201?= =?UTF-8?q?=E3=80=81=E4=BF=AE=E6=94=B9pr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/download/FineMarketDownloadManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/download/FineMarketDownloadManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/download/FineMarketDownloadManager.java index 127d2002b0..bc195865ac 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/download/FineMarketDownloadManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/download/FineMarketDownloadManager.java @@ -11,6 +11,7 @@ import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.model.TemplateResource; import com.fr.design.mainframe.alphafine.search.helper.FineMarketClientHelper; import com.fr.design.mainframe.toast.SimpleToast; +import com.fr.file.FileCommonUtils; import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; @@ -81,7 +82,7 @@ public class FineMarketDownloadManager { File file = new File(fileName); File parentDir = file.getParentFile(); // TODO:之前用的gbk解码太容易乱码了。这里应该自动识别编码,然后解压,但是要添加1个三方包,可能会赶不上发布。所以先暂时用utf8顶着。 - IOUtils.unzip(file, parentDir.getAbsolutePath(), "UTF-8"); + IOUtils.unzip(file, FileCommonUtils.getAbsolutePath(parentDir), "UTF-8"); } } From e24487da1e02f7369dd2e239d958524cfe586c2a Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 28 Sep 2022 11:07:44 +0800 Subject: [PATCH 024/310] =?UTF-8?q?REPORT-75998=20=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/module/DesignModuleFactory.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java b/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java index 272daa7f5c..bab9bb1ac8 100644 --- a/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java +++ b/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java @@ -1,7 +1,7 @@ package com.fr.design.module; import com.fr.base.chart.BaseChartCollection; -import com.fr.design.actions.help.replace.ITReplaceHelper; +import com.fr.design.actions.help.replace.ITReplaceOperator; import com.fr.design.gui.chart.BaseChartPropertyPane; import com.fr.design.gui.chart.MiddleChartComponent; import com.fr.design.gui.chart.MiddleChartDialog; @@ -51,7 +51,7 @@ public class DesignModuleFactory { private Class ITReplaceAction; private Class formParaDesigner; private Class paraPropertyPane; - private static ITReplaceHelper replaceHelper; + private static ITReplaceOperator replaceHelper; private Class formHierarchyPaneCls; private Class widgetPropertyPane; private Class buttonDetailPaneClass; @@ -137,7 +137,7 @@ public class DesignModuleFactory { * 注册一下查找替换面板 * @param */ - public static void registerReplace(ITReplaceHelper replace) { + public static void registerReplace(ITReplaceOperator replace) { replaceHelper = replace; } @@ -145,7 +145,7 @@ public class DesignModuleFactory { * 获取查找替换面板的操作类 * @return */ - public static ITReplaceHelper getReplaceOperator() { + public static ITReplaceOperator getReplaceOperator() { return replaceHelper; } From 63a48b68867360453e5ad50ab24357540d55670f Mon Sep 17 00:00:00 2001 From: "Jimmy.Zheng" Date: Wed, 28 Sep 2022 11:23:51 +0800 Subject: [PATCH 025/310] =?UTF-8?q?Revert=20"REPORT-70593=20=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E6=8E=A7=E4=BB=B6=E8=AE=BE=E8=AE=A1=E5=99=A8=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=EF=BC=8C=E5=8E=9F=E6=8F=92=E4=BB=B6=E7=A6=81=E7=94=A8?= =?UTF-8?q?=E3=80=82=E6=96=B9=E6=A1=88=E5=8F=82=E8=80=83https://kms.finere?= =?UTF-8?q?s.com/pages/viewpage.action=3FpageId=3D457117391"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1c5d2aa9 --- .../src/main/java/com/fr/start/module/DesignerActivator.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java index e7a00a4f19..9787a12158 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java @@ -160,7 +160,6 @@ public class DesignerActivator extends Activator implements Prepare { private LogHandler logHandler = null; private static final String PLUGIN_EXPORT_IMAGE_SETTING = "com.fr.plugin.exportimagesettings.v11"; - private static final String PICTURE_WIDGET_PLUGIN_ID = "com.fr.plugin.widget.picture.v11"; private final Once pushUpdateTask = new Once(new Runnable() { @Override public void run() { @@ -552,7 +551,6 @@ public class DesignerActivator extends Activator implements Prepare { private void prepareDefaultEmbedPluginInfo() { addMutable(PluginEmbedInfo.KEY, DefaultPluginEmbedInfo.create(PLUGIN_EXPORT_IMAGE_SETTING)); - addMutable(PluginEmbedInfo.KEY, DefaultPluginEmbedInfo.create(PICTURE_WIDGET_PLUGIN_ID)); } private void startBBSLoginAuthServer() { From a0a92ce1c472388a467e99e7339aba29598c227b Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 28 Sep 2022 14:38:43 +0800 Subject: [PATCH 026/310] =?UTF-8?q?REPORT-75998=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=9C=8D=E5=8A=A1=E5=99=A8=E5=85=AC=E5=BC=8F?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E3=80=81=E5=A2=9E=E5=8A=A0=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E9=AB=98=E4=BA=AE=E3=80=81=E6=8C=89=E9=92=AE=E7=BD=AE=E7=81=B0?= =?UTF-8?q?=E3=80=81=E6=90=9C=E7=B4=A2sheet=E5=90=8D=E7=A7=B0=E5=85=AC?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../action/content/formula/FormulaTag.java | 12 ++++++++ .../formula/data/SearchDataFormulaAction.java | 4 +-- .../template/SearchTemplateFormulaAction.java | 25 ++++++++++++++++ .../actions/replace/info/base/SearchTag.java | 5 ++++ .../replace/ui/ITReplaceMainDialog.java | 29 +++++++++++++++++++ .../actions/replace/ui/ITTableEditorPane.java | 16 +++++++++- 6 files changed, 88 insertions(+), 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java index 532a530883..0a20c503ce 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java @@ -7,6 +7,7 @@ import com.fr.design.actions.replace.info.Info; import com.fr.design.actions.replace.info.base.SearchTag; import com.fr.design.actions.replace.utils.ShowValueUtils; import com.fr.general.GeneralUtils; +import com.fr.main.impl.WorkBook; import com.fr.plugin.chart.map.data.VanMapReportDefinition; import com.fr.stable.collections.combination.Pair; import org.jetbrains.annotations.Nullable; @@ -105,6 +106,17 @@ public enum FormulaTag implements DealWithInfoValue { item.setMessage(ShowValueUtils.replaceAll(item.getMessage(), findStr, replaceStr)); } } + }, + SHEET_NAME(SearchTag.SHEET_NAME) { + @Override + public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { + if (info.getContent().getHoldObject() instanceof WorkBook) { + WorkBook workBook = (WorkBook) info.getContent().getHoldObject(); + int sheetId = Integer.parseInt(info.getContent().getSheetID()); + String name = workBook.getReportName(sheetId); + workBook.setReportName(sheetId, ShowValueUtils.replaceAll(name, findStr, replaceStr)); + } + } }; int index; diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/data/SearchDataFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/data/SearchDataFormulaAction.java index aa296a0721..3d4c66adc0 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/data/SearchDataFormulaAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/data/SearchDataFormulaAction.java @@ -31,8 +31,8 @@ public class SearchDataFormulaAction implements SearchFormula { //模板数据集 dealTemplateData(jTemplate, formulaInfos); - //服务器数据集 - dealServerData(formulaInfos); + ////服务器数据集二期再考虑 + //dealServerData(formulaInfos); } private void dealServerData(List fomulaInfos) { diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java index 6c8419512d..de653dd706 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java @@ -10,8 +10,13 @@ import com.fr.data.VerifyItem; import com.fr.design.actions.replace.action.content.formula.highlight.javascript.SearchCommit2DBJSFormulaAction; import com.fr.design.actions.replace.info.FormulaInfo; import com.fr.design.actions.replace.info.base.ITContent; +import com.fr.design.actions.replace.info.base.SearchTag; +import com.fr.design.file.HistoryTemplateListCache; +import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.JTemplate; +import com.fr.design.mainframe.ReportComponentComposite; +import com.fr.design.mainframe.SheetNameTabPane; import com.fr.main.impl.WorkBook; import com.fr.report.core.ReportUtils; import com.fr.report.report.Report; @@ -50,6 +55,26 @@ public class SearchTemplateFormulaAction implements SearchTemplateFormula { searchTemplateWaterMarkFormula(jTemplate, formulaInfos, content); //报表填报属性 searchTemplateWriteAttrFormula(jTemplate, formulaInfos, content); + //sheet名称 + searchTemplateSheetNameFormula(jTemplate, formulaInfos, content); + } + + private void searchTemplateSheetNameFormula(JTemplate jTemplate, List formulaInfos, ITContent content) { + if (jTemplate.getTarget() instanceof WorkBook) { + WorkBook workBook = (WorkBook) jTemplate.getTarget(); + for (int i = 0, len = workBook.getReportCount(); i < len; i++) { + String name = workBook.getReportName(i); + if (CommonUtils.canBeFormula(name)) { + ITContent sheetContent = ITContent.copy(content); + sheetContent.addOtherPos(Toolkit.i18nText("Fine-Design_Replace_Sheet")); + sheetContent.setReplaceObject(name); + sheetContent.setHoldObject(workBook); + sheetContent.setTag(SearchTag.SHEET_NAME); + sheetContent.setSheetID(String.valueOf(i)); + formulaInfos.add(new FormulaInfo(sheetContent)); + } + } + } } private void searchTemplateWriteAttrFormula(JTemplate jTemplate, List formulaInfos, ITContent content) { diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java index f7bbff40e7..b4163f57bf 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java @@ -36,6 +36,11 @@ public class SearchTag { * 模板填报属性数据校验提示 */ public static final int WRITE_ATTR_MESSAGE = 6; + /** + * sheet名称 + */ + public static final int SHEET_NAME = 7; + } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index de4628b590..96ee17b6cd 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -51,6 +51,8 @@ public class ITReplaceMainDialog extends UIDialog { private ITReplaceWestPanel westPanel; private boolean searchFlag; private String searchStr; + private static final int FIRST_ROW = 0; + public static int selectCount = 0; public ITReplaceMainDialog() { super(DesignerContext.getDesignerFrame()); @@ -117,6 +119,7 @@ public class ITReplaceMainDialog extends UIDialog { northPane.getFindInputCombobox().setEditable(true); northPane.getReplaceInputCombobox().setEditable(false); + northPane.getReplaceButton().setEnabled(false); ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).setPlaceholder(Toolkit.i18nText("Fine-Design_Replace_Search_Input")); ((UITextField) (northPane.getReplaceInputCombobox().getEditor().getEditorComponent())).setPlaceholder(Toolkit.i18nText("Fine-Design_Replace_Input")); @@ -282,9 +285,13 @@ public class ITReplaceMainDialog extends UIDialog { templateID = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTarget().getTemplateID(); itTableEditor.clear(); String searchStr = ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).getText(); + //更新搜索内容 setSearchStr(searchStr); + //处理通配符的regexStr ShowValueUtils.containPattern = Pattern.compile(ShowValueUtils.changeRegex(searchStr)); + //获取搜索目标 ShowSearchResultAction searchAction = ShowSearchResultAction.match(GeneralUtils.objectToString(northPane.getFindCombobox().getSelectedItem())); + //搜索 if (searchAction != null) { searchResultList = searchAction.addMatchResult(searchStr, searchAction.showSearchValue(jTemplate)); itTableEditor.add(searchResultList); @@ -295,7 +302,15 @@ public class ITReplaceMainDialog extends UIDialog { itTableEditor.fireTableDataChanged(); northPane.refreshFindInputComboBoxItems(); setSearchFlag(true); + selectCount = searchResultList.size(); + //如果有结果,默认选中第一行 + if (searchResultList.size() > 0){ + getEditTable().addRowSelectionInterval(FIRST_ROW,FIRST_ROW); + northPane.getReplaceButton().setEnabled(true); + } + + //设置替换输入框的可用性 if (StringUtils.isNotEmpty(searchStr)) { ((UITextField) (northPane.getReplaceInputCombobox().getEditor().getEditorComponent())).setEditable(true); northPane.getReplaceInputCombobox().setEditable(true); @@ -309,7 +324,21 @@ public class ITReplaceMainDialog extends UIDialog { } + public ITReplaceSouthPanel getSouthPanel() { + return southPanel; + } + + public void setSouthPanel(ITReplaceSouthPanel southPanel) { + this.southPanel = southPanel; + } + + public ITReplaceNorthPanel getNorthPane() { + return northPane; + } + public void setNorthPane(ITReplaceNorthPanel northPane) { + this.northPane = northPane; + } /** * 检测结果是否合法 diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java index a9fe470edd..4d2f39718d 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java @@ -75,9 +75,13 @@ public class ITTableEditorPane extends BasicPane { if (content.isSelected()) { content.setSelected(false); editTable.setValueAt(content.isSelected(), row, col); + ITReplaceMainDialog.selectCount--; + ITReplaceMainDialog.getInstance().getNorthPane().getReplaceButton().setEnabled(ITReplaceMainDialog.selectCount > 0); } else { content.setSelected(true); editTable.setValueAt(content.isSelected(), row, col); + ITReplaceMainDialog.selectCount++; + ITReplaceMainDialog.getInstance().getNorthPane().getReplaceButton().setEnabled(true); } } @@ -120,6 +124,11 @@ public class ITTableEditorPane extends BasicPane { boolean value = !selectBox.isSelected(); selectBox.setSelected(value); selectAllOrNull(value); + if (value) { + ITReplaceMainDialog.selectCount = getEditTable().getRowCount(); + } else { + ITReplaceMainDialog.selectCount = 0; + } tableHeader.repaint(); table.repaint(); } @@ -130,6 +139,7 @@ public class ITTableEditorPane extends BasicPane { /** * 刷新表头 + * * @param table */ public void refreshHeader(JTable table) { @@ -186,7 +196,11 @@ public class ITTableEditorPane extends BasicPane { * @param value */ public static void selectAllOrNull(Boolean value) { - for (int i = 0; i < getEditTable().getRowCount(); i++) { + int len = getEditTable().getRowCount(); + if (len > 0) { + ITReplaceMainDialog.getInstance().getNorthPane().getReplaceButton().setEnabled(value); + } + for (int i = 0; i < len; i++) { ((ITContent) (getEditTable().getValueAt(i, ITReplaceSouthPanel.CONTENT_INDEX))).setSelected(value); } } From dfa49d772c205e419d1473a3df5e497d1f450214 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 28 Sep 2022 14:41:51 +0800 Subject: [PATCH 027/310] =?UTF-8?q?REPORT-75998=20=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/replace/action/content/formula/FormulaTag.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java index 0a20c503ce..fd2367f3be 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java @@ -107,6 +107,9 @@ public enum FormulaTag implements DealWithInfoValue { } } }, + /** + * sheet名称 + */ SHEET_NAME(SearchTag.SHEET_NAME) { @Override public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { From cd7fa16fa186189d2e8edcab23a24b6895ae7f6f Mon Sep 17 00:00:00 2001 From: "Link.Zhao" Date: Wed, 28 Sep 2022 16:13:21 +0800 Subject: [PATCH 028/310] =?UTF-8?q?REPORT-81241=E3=80=90=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E4=B8=AD=E5=BF=83=E6=96=AD=E7=BD=91=E5=90=8E=E7=9A=84?= =?UTF-8?q?=E9=87=8D=E6=96=B0=E5=8A=A0=E8=BD=BD=E6=97=A0=E5=8F=8D=E5=BA=94?= =?UTF-8?q?=201=E3=80=81=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96=E4=BA=91?= =?UTF-8?q?=E7=AB=AF=E5=8F=98=E9=87=8F=E7=9A=84=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/AlphaFineCloudConstants.java | 204 +++++++++++++----- .../alphafine/cell/model/BottomModel.java | 2 +- .../alphafine/cell/model/DocumentModel.java | 4 +- .../alphafine/cell/model/PluginModel.java | 6 +- .../alphafine/cell/model/RobotModel.java | 4 +- .../alphafine/component/AlphaFineDialog.java | 2 +- .../preview/HelpDocumentNoResultPane.java | 2 +- .../preview/NoResultWithLinkPane.java | 2 +- .../alphafine/preview/RobotPreviewPane.java | 2 +- .../manager/impl/ComplementAdviceManager.java | 2 +- .../search/manager/impl/HotIssuesManager.java | 2 +- .../manager/impl/PluginSearchManager.java | 6 +- .../impl/ProductNewsSearchManager.java | 4 +- .../manager/impl/RecommendSearchManager.java | 2 +- .../manager/impl/SimilarSearchManager.java | 2 +- .../alphafine/cell/model/ModelTest.java | 4 +- 16 files changed, 174 insertions(+), 76 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java index 5e527d9916..b1ff5d8606 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java @@ -3,8 +3,7 @@ package com.fr.design.actions.help.alphafine; import com.fr.general.CloudCenter; /** - * 需要从云端获取的常量单独放一起 - * 以防AlphaFineConstants被加载时,CloudCenter还没启动,导致常量获取不到。 + * 云端变量统一管理 * * @author Link * @version 11.0 @@ -12,55 +11,154 @@ import com.fr.general.CloudCenter; */ public class AlphaFineCloudConstants { - public static final String PLUGIN_SEARCH_URL = CloudCenter.getInstance().acquireUrlByKind("plugin.searchAPI"); - - public static final String SEARCH_ALL_PLUGIN_URL = CloudCenter.getInstance().acquireUrlByKind("plugin.all.searchAPI"); - - public static final String PLUGIN_URL = CloudCenter.getInstance().acquireUrlByKind("af.pluginInfo"); - - public static final String REUSE_URL = CloudCenter.getInstance().acquireUrlByKind("af.reuseInfo"); - - public static final String DOCUMENT_DOC_URL = CloudCenter.getInstance().acquireUrlByKind("af.doc_view"); - - public static final String DOCUMENT_SEARCH_URL = CloudCenter.getInstance().acquireUrlByKind("af.doc_search"); - - public static final String DOCUMENT_INFORMATION_URL = CloudCenter.getInstance().acquireUrlByKind("af.doc_info"); - - public static final String PLUGIN_IMAGE_URL = CloudCenter.getInstance().acquireUrlByKind("af.plugin_image"); - - public static final String CLOUD_SERVER_URL = CloudCenter.getInstance().acquireUrlByKind("af.record"); - - public static final String SEARCH_API = CloudCenter.getInstance().acquireUrlByKind("af.cloud_search"); - - public static final String SIMILAR_SEARCH_URL_PREFIX = CloudCenter.getInstance().acquireUrlByKind("af.similar_search"); - - public static final String COMPLEMENT_ADVICE_SEARCH_URL_PREFIX = CloudCenter.getInstance().acquireUrlByKind("af.advice_search"); - - public static final String ALPHA_HOT_SEARCH = CloudCenter.getInstance().acquireUrlByKind("af.hot_search"); - - public static final String ALPHA_GO_TO_FORUM = CloudCenter.getInstance().acquireUrlByKind("af.go_fourm"); - - public static final String ALPHA_GO_TO_WEB = CloudCenter.getInstance().acquireUrlByKind("af.go_web"); - - public static final String ALPHA_PREVIEW = CloudCenter.getInstance().acquireUrlByKind("af.preview"); - - public static final String ALPHA_CID = CloudCenter.getInstance().acquireUrlByKind("af.cid.new"); - - public static final String ALPHA_CID_USER_GROUP_INFO = CloudCenter.getInstance().acquireUrlByKind("af.cid.user.group.info"); - - private static final String QUICK_START_URL = CloudCenter.getInstance().acquireUrlByKind("af.help.quick.start"); - - private static final String REPORT_LEARNING_PATH = CloudCenter.getInstance().acquireUrlByKind("af.help.report.learning.path"); - - private static final String PARAMETER_LEARNING_PATH = CloudCenter.getInstance().acquireUrlByKind("af.help.param.learning.path"); - - private static final String FILL_LEARNING_PATH = CloudCenter.getInstance().acquireUrlByKind("af.help.fill.learning.path"); - - private static final String API_SUMMARY = CloudCenter.getInstance().acquireUrlByKind("af.help.api.summary"); - - private static final String MONTHLY_DOCUMENT = CloudCenter.getInstance().acquireUrlByKind("af.help.monthly.document"); - - private static final String DEFAULT_RECOMMEND = "[ { \"name\":\"快速入门指南\", \"link\":\"" + QUICK_START_URL + "\" }, { \"name\":\"报表应用学习路径\", \"link\":\"" + REPORT_LEARNING_PATH + "\" }, { \"name\":\"参数应用学习路径\", \"link\":\"" + PARAMETER_LEARNING_PATH + "\" }, { \"name\":\"填报学习路径\", \"link\":\"" + FILL_LEARNING_PATH + "\" }, { \"name\":\"API接口汇总\", \"link\":\"" + API_SUMMARY + "\" }, { \"name\":\"文档月刊\", \"link\":\"" + MONTHLY_DOCUMENT + "\" } ]"; - - public static final String ALPHA_HELP_RECOMMEND = CloudCenter.getInstance().acquireUrlByKind("af.recommend", DEFAULT_RECOMMEND); + /** + * get PluginSearchUrl + */ + public static String getPluginSearchUrl() { + return CloudCenter.getInstance().acquireUrlByKind("plugin.searchAPI"); + }; + + /** + * get SearchAllPluginUrl + */ + public static String getSearchAllPluginUrl() { + return CloudCenter.getInstance().acquireUrlByKind("plugin.all.searchAPI"); + } + + /** + * get PluginUrl + */ + public static String getPluginUrl() { + return CloudCenter.getInstance().acquireUrlByKind("af.pluginInfo"); + } + + /** + * get ReuseUrl + */ + public static String getReuseUrl() { + return CloudCenter.getInstance().acquireUrlByKind("af.reuseInfo"); + } + + /** + * get DocumentDocUrl + */ + public static String getDocumentDocUrl() { + return CloudCenter.getInstance().acquireUrlByKind("af.doc_view"); + } + + /** + * get DocumentSearchUrl + */ + public static String getDocumentSearchUrl() { + return CloudCenter.getInstance().acquireUrlByKind("af.doc_search"); + } + + /** + * get DocumentInformationUrl + */ + public static String getDocumentInformationUrl() { + return CloudCenter.getInstance().acquireUrlByKind("af.doc_info"); + } + + /** + * get PluginImageUrl + */ + public static String getPluginImageUrl() { + return CloudCenter.getInstance().acquireUrlByKind("af.plugin_image"); + } + + /** + * get CloudServerUrl + */ + public static String getCloudServerUrl() { + return CloudCenter.getInstance().acquireUrlByKind("af.record"); + } + + /** + * get SearchApi + */ + public static String getSearchApi() { + return CloudCenter.getInstance().acquireUrlByKind("af.cloud_search"); + } + + /** + * get SimilarSearchUrlPrefix + */ + public static String getSimilarSearchUrlPrefix() { + return CloudCenter.getInstance().acquireUrlByKind("af.similar_search"); + } + + /** + * get ComplementAdviceSearchUrlPrefix + */ + public static String getComplementAdviceSearchUrlPrefix() { + return CloudCenter.getInstance().acquireUrlByKind("af.advice_search"); + } + + /** + * get AlphaHotSearch + */ + public static String getAlphaHotSearch() { + return CloudCenter.getInstance().acquireUrlByKind("af.hot_search"); + } + + /** + * get AlphaGoToForum + */ + public static String getAlphaGoToForum() { + return CloudCenter.getInstance().acquireUrlByKind("af.go_fourm"); + } + + /** + * get AlphaGoToWeb + */ + public static String getAlphaGoToWeb() { + return CloudCenter.getInstance().acquireUrlByKind("af.go_web"); + } + + /** + * get AlphaPreview + */ + public static String getAlphaPreview() { + return CloudCenter.getInstance().acquireUrlByKind("af.preview"); + } + + /** + * get AlphaCid + */ + public static String getAlphaCid() { + return CloudCenter.getInstance().acquireUrlByKind("af.cid.new"); + } + + /** + * get AlphaCidUserGroupInfo + */ + public static String getAlphaCidUserGroupInfo() { + return CloudCenter.getInstance().acquireUrlByKind("af.cid.user.group.info"); + } + + /** + * get DefaultRecommend + */ + public static String getDefaultRecommend() { + String quickStartUrl = CloudCenter.getInstance().acquireUrlByKind("af.help.quick.start"); + String reportLearningPath = CloudCenter.getInstance().acquireUrlByKind("af.help.report.learning.path"); + String parameterLearningPath = CloudCenter.getInstance().acquireUrlByKind("af.help.param.learning.path"); + String fillLearningPath = CloudCenter.getInstance().acquireUrlByKind("af.help.fill.learning.path"); + String apiSummary = CloudCenter.getInstance().acquireUrlByKind("af.help.api.summary"); + String monthlyDocument = CloudCenter.getInstance().acquireUrlByKind("af.help.monthly.document"); + return "[{\"name\":\"快速入门指南\", \"link\":\"" + quickStartUrl + "\"}," + + "{\"name\":\"报表应用学习路径\", \"link\":\"" + reportLearningPath + "\"}," + + "{\"name\":\"参数应用学习路径\", \"link\":\"" + parameterLearningPath + "\"}," + + "{\"name\":\"填报学习路径\", \"link\":\"" + fillLearningPath + "\"}," + + "{\"name\":\"API接口汇总\", \"link\":\"" + apiSummary + "\"}," + + "{\"name\":\"文档月刊\", \"link\":\"" + monthlyDocument + "\"} ]"; + } + + /** + * get AlphaHelpRecommend + */ + public static String getAlphaHelpRecommend() { + return CloudCenter.getInstance().acquireUrlByKind("af.recommend", getDefaultRecommend()); + } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/BottomModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/BottomModel.java index fff60ea1f6..7699879484 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/BottomModel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/BottomModel.java @@ -48,7 +48,7 @@ public class BottomModel extends AlphaCellModel { @Override public void doAction() { try { - Desktop.getDesktop().browse(new URI(AlphaFineCloudConstants.ALPHA_GO_TO_FORUM)); + Desktop.getDesktop().browse(new URI(AlphaFineCloudConstants.getAlphaGoToForum())); } catch (IOException | URISyntaxException e) { FineLoggerFactory.getLogger().error(e.getMessage()); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java index 8fa7ca2515..e5c1638f75 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java @@ -26,8 +26,8 @@ public class DocumentModel extends AlphaCellModel { public DocumentModel(String name, String content, int documentId) { super(name, content, CellType.DOCUMENT); this.documentId = documentId; - this.informationUrl = AlphaFineCloudConstants.DOCUMENT_INFORMATION_URL + documentId; - this.documentUrl = AlphaFineCloudConstants.DOCUMENT_DOC_URL + documentId + ".html"; + this.informationUrl = AlphaFineCloudConstants.getDocumentInformationUrl() + documentId; + this.documentUrl = AlphaFineCloudConstants.getDocumentDocUrl() + documentId + ".html"; } public DocumentModel(String name, String content, int documentId, int searchCount) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java index 7eda90015d..f936376bb2 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java @@ -36,9 +36,9 @@ public class PluginModel extends AlphaCellModel { this.price = price; this.pluginId = pluginId; if (getType() == CellType.PLUGIN) { - this.informationUrl = AlphaFineCloudConstants.PLUGIN_URL + id; + this.informationUrl = AlphaFineCloudConstants.getPluginUrl() + id; } else { - this.informationUrl = AlphaFineCloudConstants.REUSE_URL + id; + this.informationUrl = AlphaFineCloudConstants.getReuseUrl() + id; } } @@ -99,7 +99,7 @@ public class PluginModel extends AlphaCellModel { @Override public void doAction() { - if (StringUtils.isBlank(this.pluginId) || !WorkContext.getCurrent().isLocal()) { + if ((StringUtils.isBlank(this.pluginId) && StringUtils.isBlank(this.getName())) || !WorkContext.getCurrent().isLocal()) { return; } WebViewDlgHelper.createPluginDialog(getName()); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java index 79e02f18e0..4c304d107f 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java @@ -47,7 +47,7 @@ public class RobotModel extends AlphaCellModel { public static String getContent(String titleStr) { String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + titleStr); - String url = AlphaFineCloudConstants.ALPHA_GO_TO_WEB + titleStr + "&token=" + token; + String url = AlphaFineCloudConstants.getAlphaGoToWeb() + titleStr + "&token=" + token; try { String result = HttpToolbox.get(url); @@ -84,7 +84,7 @@ public class RobotModel extends AlphaCellModel { @Override public void doAction() { try { - Desktop.getDesktop().browse(new URI(AlphaFineCloudConstants.ALPHA_PREVIEW + URLEncoder.encode(super.getName(), EncodeConstants.ENCODING_UTF_8))); + Desktop.getDesktop().browse(new URI(AlphaFineCloudConstants.getAlphaPreview() + URLEncoder.encode(super.getName(), EncodeConstants.ENCODING_UTF_8))); } catch (IOException e) { FineLoggerFactory.getLogger().error(e.getMessage()); } catch (URISyntaxException e) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index f7112c27a6..dab1051258 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -969,7 +969,7 @@ public class AlphaFineDialog extends UIDialog { String date = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime()); para.put("token", CodeUtils.md5Encode(date, StringUtils.EMPTY, "MD5")); para.put("content", object.toString()); - HttpClient httpClient = new HttpClient(AlphaFineCloudConstants.CLOUD_SERVER_URL, para, true); + HttpClient httpClient = new HttpClient(AlphaFineCloudConstants.getCloudServerUrl(), para, true); httpClient.asGet(); if (!httpClient.isServerAlive()) { FineLoggerFactory.getLogger().error("Failed to sent data to server!"); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/HelpDocumentNoResultPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/HelpDocumentNoResultPane.java index 87a27cd29d..bee71f5859 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/HelpDocumentNoResultPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/HelpDocumentNoResultPane.java @@ -98,7 +98,7 @@ public class HelpDocumentNoResultPane extends JPanel { private Map generateMap() { - JSONArray jsonArray = JSONFactory.createJSON(JSON.ARRAY, AlphaFineCloudConstants.ALPHA_HELP_RECOMMEND); + JSONArray jsonArray = JSONFactory.createJSON(JSON.ARRAY, AlphaFineCloudConstants.getAlphaHelpRecommend()); Map linkMap = new LinkedHashMap<>(); for (int i = 0, len = jsonArray.size(); i < len; i++) { JSONObject json = jsonArray.getJSONObject(i); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultWithLinkPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultWithLinkPane.java index 31082f9e44..0159959de2 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultWithLinkPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultWithLinkPane.java @@ -34,7 +34,7 @@ public class NoResultWithLinkPane extends NoResultPane { String[] para1 = title.split(TAG_A_START); String[] para2 = para1[1].split(TAG_A_END); - MessageWithLink messageWithLink = new MessageWithLink(para1[0], para2[0], AlphaFineCloudConstants.ALPHA_GO_TO_FORUM, para2[1], Color.WHITE, DesignUtils.getDefaultGUIFont().applySize(14), AlphaFineConstants.MEDIUM_GRAY) { + MessageWithLink messageWithLink = new MessageWithLink(para1[0], para2[0], AlphaFineCloudConstants.getAlphaGoToForum(), para2[1], Color.WHITE, DesignUtils.getDefaultGUIFont().applySize(14), AlphaFineConstants.MEDIUM_GRAY) { @Override protected void initListener(String link) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java index 7df9e3d4cc..2340766925 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java @@ -61,7 +61,7 @@ public class RobotPreviewPane extends JPanel { .replaceAll("\\('", StringUtils.EMPTY) .replaceAll("'\\)", StringUtils.EMPTY); try { - Desktop.getDesktop().browse(new URI(AlphaFineCloudConstants.ALPHA_PREVIEW + URLEncoder.encode(s, EncodeConstants.ENCODING_UTF_8))); + Desktop.getDesktop().browse(new URI(AlphaFineCloudConstants.getAlphaPreview() + URLEncoder.encode(s, EncodeConstants.ENCODING_UTF_8))); } catch (IOException | URISyntaxException e1) { FineLoggerFactory.getLogger().error(e1.getMessage()); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java index 8a9acb87c6..8aaa0abd5e 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java @@ -41,7 +41,7 @@ public class ComplementAdviceManager { SearchResult searchResult = new SearchResult(); for (int j = 0; j < searchText.length; j++) { String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + searchText[j]); - String url = AlphaFineCloudConstants.COMPLEMENT_ADVICE_SEARCH_URL_PREFIX + "msg=" + searchText[j] + "&token=" + token; + String url = AlphaFineCloudConstants.getComplementAdviceSearchUrlPrefix() + "msg=" + searchText[j] + "&token=" + token; try { String result = HttpToolbox.get(url); AlphaFineHelper.checkCancel(); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java index 5346e05ec1..a0815c2e3b 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java @@ -75,7 +75,7 @@ public class HotIssuesManager { public String[][] getHotIssues() { try { - String result = HttpToolbox.get(AlphaFineCloudConstants.ALPHA_HOT_SEARCH); + String result = HttpToolbox.get(AlphaFineCloudConstants.getAlphaHotSearch()); JSONArray jsonArray = JSONFactory.createJSON(JSON.ARRAY, result); if(jsonArray != null){ for (int i = 0; i < HOT_ITEM_NUM; i++) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java index f9729d1712..babf9f4865 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java @@ -74,7 +74,7 @@ public class PluginSearchManager implements AlphaFineSearchProvider { int searchCount = object.optInt("searchCount"); String imageUrl = null; try { - imageUrl = isFromCloud ? AlphaFineCloudConstants.PLUGIN_IMAGE_URL + URLEncoder.encode(object.optString("pic").toString().substring(AlphaFineCloudConstants.PLUGIN_IMAGE_URL.length()), "utf8") : object.optString("pic"); + imageUrl = isFromCloud ? AlphaFineCloudConstants.getPluginImageUrl() + URLEncoder.encode(object.optString("pic").toString().substring(AlphaFineCloudConstants.getPluginImageUrl().length()), "utf8") : object.optString("pic"); } catch (UnsupportedEncodingException e) { FineLoggerFactory.getLogger().error("plugin icon error: " + e.getMessage()); } @@ -126,7 +126,7 @@ public class PluginSearchManager implements AlphaFineSearchProvider { for (int j = 0; j < searchText.length; j++) { try { String encodedKey = URLEncoder.encode(searchText[j], EncodeConstants.ENCODING_UTF_8); - String url = AlphaFineCloudConstants.PLUGIN_SEARCH_URL + "?keyword=" + encodedKey; + String url = AlphaFineCloudConstants.getPluginSearchUrl() + "?keyword=" + encodedKey; String result = HttpToolbox.get(url); AlphaFineHelper.checkCancel(); JSONObject jsonObject = new JSONObject(result); @@ -174,7 +174,7 @@ public class PluginSearchManager implements AlphaFineSearchProvider { public SearchResult getDefaultResult() { this.defaultModelList = new SearchResult(); try { - String url = AlphaFineCloudConstants.SEARCH_ALL_PLUGIN_URL; + String url = AlphaFineCloudConstants.getSearchAllPluginUrl(); String result = HttpToolbox.get(url); AlphaFineHelper.checkCancel(); JSONObject jsonObject = new JSONObject(result); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ProductNewsSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ProductNewsSearchManager.java index c20d3bb48b..f4299fc7e3 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ProductNewsSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ProductNewsSearchManager.java @@ -83,7 +83,7 @@ public class ProductNewsSearchManager { public List getProductNewsList() throws Exception { productNewsList = new ArrayList<>(); idSet = new HashSet<>(); - String jsonStr = HttpToolbox.get(AlphaFineCloudConstants.ALPHA_CID); + String jsonStr = HttpToolbox.get(AlphaFineCloudConstants.getAlphaCid()); AlphaFineHelper.checkCancel(); JSONObject cidJSON = JSONFactory.createJSON(JSON.OBJECT, jsonStr); JSONArray jsonArray = cidJSON.getJSONArray("data"); @@ -151,7 +151,7 @@ public class ProductNewsSearchManager { * 根据用户组id,查询用户组信息(改用户组中的所有设计器id) * */ private Set searchUserGroupInfo(String userGroupId) { - String url = AlphaFineCloudConstants.ALPHA_CID_USER_GROUP_INFO + AlphaFineConstants.SEARCH_BY_ID + userGroupId; + String url = AlphaFineCloudConstants.getAlphaCidUserGroupInfo() + AlphaFineConstants.SEARCH_BY_ID + userGroupId; Set idSet = new HashSet<>(); try { String jsonStr = HttpToolbox.get(url); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java index 88872d2d8b..d0fcbd3b0c 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java @@ -60,7 +60,7 @@ public class RecommendSearchManager implements AlphaFineSearchProvider { for (int j = 0; j < searchText.length; j++) { searchText[j] = searchText[j].replaceAll(StringUtils.BLANK, StringUtils.EMPTY); try { - String url = AlphaFineCloudConstants.SEARCH_API + CodeUtils.cjkEncode(searchText[j]); + String url = AlphaFineCloudConstants.getSearchApi() + CodeUtils.cjkEncode(searchText[j]); String result = HttpToolbox.get(url); AlphaFineHelper.checkCancel(); JSONObject jsonObject = new JSONObject(result); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java index 5e08795ef1..18afdcaeba 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java @@ -48,7 +48,7 @@ public class SimilarSearchManager implements AlphaFineSearchProvider { SearchResult allModelList = new SearchResult(); for (int j = 0; j < searchText.length; j++) { String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + searchText[j]); - String url = AlphaFineCloudConstants.SIMILAR_SEARCH_URL_PREFIX + "msg=" + searchText[j] + "&token=" + token; + String url = AlphaFineCloudConstants.getSimilarSearchUrlPrefix() + "msg=" + searchText[j] + "&token=" + token; try { String result = HttpToolbox.get(url); AlphaFineHelper.checkCancel(); diff --git a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java b/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java index 2311514d17..8c62b827ee 100644 --- a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java +++ b/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java @@ -14,8 +14,8 @@ public class ModelTest { Assert.assertEquals("name", documentModel.getName()); Assert.assertEquals("content", documentModel.getContent()); Assert.assertEquals(1, documentModel.getDocumentId()); - Assert.assertEquals(AlphaFineCloudConstants.DOCUMENT_DOC_URL + documentModel.getDocumentId() + ".html", documentModel.getDocumentUrl()); - Assert.assertEquals(AlphaFineCloudConstants.DOCUMENT_INFORMATION_URL + documentModel.getDocumentId(), documentModel.getInformationUrl()); + Assert.assertEquals(AlphaFineCloudConstants.getDocumentDocUrl() + documentModel.getDocumentId() + ".html", documentModel.getDocumentUrl()); + Assert.assertEquals(AlphaFineCloudConstants.getDocumentInformationUrl() + documentModel.getDocumentId(), documentModel.getInformationUrl()); Assert.assertEquals(documentModel.getStoreInformation(), documentModel.getInformationUrl()); Assert.assertEquals(CellType.DOCUMENT, documentModel.getType()); Assert.assertEquals(true, documentModel.hasAction()); From f4b7b83f913d786320f748449b65a6e9676bca59 Mon Sep 17 00:00:00 2001 From: "Link.Zhao" Date: Wed, 28 Sep 2022 16:17:45 +0800 Subject: [PATCH 029/310] =?UTF-8?q?REPORT-81241=E3=80=90=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E4=B8=AD=E5=BF=83=E6=96=AD=E7=BD=91=E5=90=8E=E7=9A=84?= =?UTF-8?q?=E9=87=8D=E6=96=B0=E5=8A=A0=E8=BD=BD=E6=97=A0=E5=8F=8D=E5=BA=94?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9pr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/alphafine/cell/model/PluginModel.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java index f936376bb2..0bdb1ec669 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java @@ -98,8 +98,10 @@ public class PluginModel extends AlphaCellModel { @Override public void doAction() { - - if ((StringUtils.isBlank(this.pluginId) && StringUtils.isBlank(this.getName())) || !WorkContext.getCurrent().isLocal()) { + if (StringUtils.isBlank(this.pluginId) && StringUtils.isBlank(this.getName())) { + return; + } + if (!WorkContext.getCurrent().isLocal()) { return; } WebViewDlgHelper.createPluginDialog(getName()); From 4cb4577ceac45a2461bdfca6c907932fe7d7b9e9 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 28 Sep 2022 16:29:05 +0800 Subject: [PATCH 030/310] =?UTF-8?q?REPORT-75998=20=E8=A1=A5=E5=85=85sheet?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E3=80=81=E4=BF=AE=E5=A4=8D=E5=AE=9A=E4=BD=8D?= =?UTF-8?q?=E5=90=8E=E6=BB=9A=E5=8A=A8=E4=B8=8D=E5=88=B0=E4=BD=8D=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../formula/template/SearchTemplateFormulaAction.java | 5 ++++- .../main/java/com/fr/design/mainframe/WorkSheetDesigner.java | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java index de653dd706..0f9124721f 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java @@ -66,7 +66,10 @@ public class SearchTemplateFormulaAction implements SearchTemplateFormula { String name = workBook.getReportName(i); if (CommonUtils.canBeFormula(name)) { ITContent sheetContent = ITContent.copy(content); - sheetContent.addOtherPos(Toolkit.i18nText("Fine-Design_Replace_Sheet")); + sheetContent.addOtherPos( + Toolkit.i18nText("Fine-Design_Replace_Sheet"), + name + ); sheetContent.setReplaceObject(name); sheetContent.setHoldObject(workBook); sheetContent.setTag(SearchTag.SHEET_NAME); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/WorkSheetDesigner.java b/designer-realize/src/main/java/com/fr/design/mainframe/WorkSheetDesigner.java index 0529cf82a3..629f71b6bb 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/WorkSheetDesigner.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/WorkSheetDesigner.java @@ -217,9 +217,9 @@ public class WorkSheetDesigner extends ReportComponent Date: Wed, 28 Sep 2022 16:38:28 +0800 Subject: [PATCH 031/310] 111111111 --- .../main/java/com/fr/design/file/HistoryTemplateListPane.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java index 2dc56cc9da..c62a7fef39 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java @@ -27,6 +27,7 @@ public class HistoryTemplateListPane implements CallbackEvent { synchronized (HistoryTemplateListPane.class) { if (THIS == null) { THIS = new HistoryTemplateListPane(); + int a = 111; } } } From dd77af15e0b8ef8786b1661218c74faea77cd93d Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 28 Sep 2022 16:55:11 +0800 Subject: [PATCH 032/310] =?UTF-8?q?REPORT-75998=20=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=8D=95=E5=85=83=E6=A0=BC=E5=B1=9E=E6=80=A7?= =?UTF-8?q?-=E5=85=B6=E4=BB=96-=E5=86=85=E5=AE=B9=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E7=9A=84=E5=85=AC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../action/content/formula/FormulaTag.java | 13 +++++++++ .../formula/cell/SearchCellFormulaAction.java | 27 +++++++++++++++++++ .../actions/replace/info/base/SearchTag.java | 4 +++ 3 files changed, 44 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java index fd2367f3be..ff8755974b 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java @@ -9,6 +9,7 @@ import com.fr.design.actions.replace.utils.ShowValueUtils; import com.fr.general.GeneralUtils; import com.fr.main.impl.WorkBook; import com.fr.plugin.chart.map.data.VanMapReportDefinition; +import com.fr.report.cell.cellattr.CellGUIAttr; import com.fr.stable.collections.combination.Pair; import org.jetbrains.annotations.Nullable; @@ -120,6 +121,18 @@ public enum FormulaTag implements DealWithInfoValue { workBook.setReportName(sheetId, ShowValueUtils.replaceAll(name, findStr, replaceStr)); } } + }, + /** + * 单元格属性-其他-内容提示 + */ + CELL_TOOL_TIP(SearchTag.CELL_TOOL_TIP) { + @Override + public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { + if (info.getContent().getHoldObject() instanceof CellGUIAttr) { + CellGUIAttr attr = (CellGUIAttr) info.getContent().getHoldObject(); + attr.setTooltipText(ShowValueUtils.replaceAll(attr.getTooltipText(), findStr, replaceStr)); + } + } }; int index; diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java index b58008e7bc..67593b12a7 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java @@ -20,12 +20,14 @@ import com.fr.general.data.Condition; import com.fr.js.NameJavaScriptGroup; import com.fr.report.cell.CellElement; import com.fr.report.cell.TemplateCellElement; +import com.fr.report.cell.cellattr.CellGUIAttr; import com.fr.report.cell.cellattr.highlight.DefaultHighlight; import com.fr.report.cell.cellattr.highlight.HighlightAction; import com.fr.report.cell.cellattr.highlight.HighlightGroup; import com.fr.report.core.sort.common.CellSortAttr; import com.fr.report.core.sort.sortexpression.FormulaSortExpression; import com.fr.report.core.sort.sortexpression.SortExpression; +import com.fr.stable.CommonUtils; import java.util.List; @@ -69,6 +71,8 @@ public class SearchCellFormulaAction implements SearchCellFormula { searchCellSortAttr4Formula(cellInfo, formulaInfos); //单元格属性-形态 searchCellPresent4Formula(cellInfo, formulaInfos); + //单元格属性-其他-内容提示-自定义 + searchCellToolTip4Formula(cellInfo, formulaInfos); //单元格属性-其他-插入策略 searchCellInsertPolicy4Formula(cellInfo, formulaInfos); //单元格条件属性-参数-公式 @@ -84,6 +88,29 @@ public class SearchCellFormulaAction implements SearchCellFormula { } + private void searchCellToolTip4Formula(CellInfo cellInfo, List formulaInfos) { + if (cellInfo.getContent().getReplaceObject() instanceof TemplateCellElement) { + TemplateCellElement cellElement = (TemplateCellElement) cellInfo.getContent().getReplaceObject(); + if (isCellGUIAttrValid(cellElement.getCellGUIAttr())) { + CellGUIAttr attr = cellElement.getCellGUIAttr(); + ITContent attrContent = ITContent.copy(cellInfo.getContent()); + attrContent.addOtherPos( + Toolkit.i18nText("Fine-Design_Basic_Cell_Attributes"), + Toolkit.i18nText("Fine-Design_Report_Other"), + Toolkit.i18nText("Fine-Design_Report_CellWrite_ToolTip"), + Toolkit.i18nText("Fine-Design_Basic_Custom") + ); + attrContent.setReplaceObject(attr.getTooltipText()); + attrContent.setHoldObject(attr); + formulaInfos.add(new FormulaInfo(attrContent)); + } + } + } + + private boolean isCellGUIAttrValid(CellGUIAttr attr) { + return attr != null && attr.isCustomTooltip() && CommonUtils.canBeFormula(attr.getTooltipText()); + } + private void searchCellHyperLink4Formula(CellInfo cellInfo, List formulaInfos) { NameJavaScriptGroup nameJavaScriptGroup = ((CellElement) cellInfo.getContent().getReplaceObject()).getNameHyperlinkGroup(); if (nameJavaScriptGroup != null) { diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java index b4163f57bf..1bbba05b35 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java @@ -40,6 +40,10 @@ public class SearchTag { * sheet名称 */ public static final int SHEET_NAME = 7; + /** + * 单元格属性-其他-内容提示 + */ + public static final int CELL_TOOL_TIP = 8; From 22d54f426c60f698d8eafc551f487cfd7bc3eb37 Mon Sep 17 00:00:00 2001 From: "Link.Zhao" Date: Wed, 28 Sep 2022 16:57:51 +0800 Subject: [PATCH 033/310] =?UTF-8?q?REPORT-81324=20alphafine=E9=80=82?= =?UTF-8?q?=E9=85=8D=E5=B8=86=E8=BD=AF=E5=B8=82=E5=9C=BA=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=2011=E4=B8=8D=E8=83=BD=E6=90=9C=E5=88=B010=E7=9A=84=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E8=B5=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/search/helper/FineMarketClientHelper.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java index f4add755e5..22c6b4c45c 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java @@ -48,6 +48,7 @@ public class FineMarketClientHelper { private static final String CERTIFICATE_PUBLIC_KEY = FineMarketPublicKeyHolder.getInstance().getDefaultKey(); public static final String FINE_MARKET_TEMPLATE_INFO = CloudCenter.getInstance().acquireUrlByKind("market.template.info"); public static final String FINE_MARKET_TEMPLATE_URL = CloudCenter.getInstance().acquireUrlByKind("market.template.url"); + public static final String VERSION = "&version=11.0"; public static final String FILE_DOWNLOAD = "file/download/"; public static final String PACKAGE_DOWNLOAD = "package/download/"; public static final String TEMPLATES_PARENT_PACKAGE = "parent/"; @@ -268,7 +269,7 @@ public class FineMarketClientHelper { } public @Nullable JSONArray getTemplateInfoByName(String name) throws IOException { - String url = FINE_MARKET_TEMPLATE_INFO + NAME_SEARCH + name; + String url = FINE_MARKET_TEMPLATE_INFO + NAME_SEARCH + name + VERSION; String jsonString = HttpToolbox.get(url); JSONObject jsonObject = new JSONObject(jsonString); String responseState = (String) jsonObject.get(RESPONSE_STATE); From c032eb0d0c35294c0033cb1f72e13d89bc04cf28 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 28 Sep 2022 16:58:03 +0800 Subject: [PATCH 034/310] =?UTF-8?q?REPORT-75998=20=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E4=B8=B2=E5=A4=84=E7=90=86=E7=9A=84Tag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../action/content/formula/cell/SearchCellFormulaAction.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java index 67593b12a7..39ccf32585 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java @@ -14,6 +14,7 @@ import com.fr.design.actions.replace.info.CellInfo; import com.fr.design.actions.replace.info.FormulaInfo; import com.fr.design.actions.replace.info.base.ITContent; +import com.fr.design.actions.replace.info.base.SearchTag; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.JTemplate; import com.fr.general.data.Condition; @@ -102,6 +103,7 @@ public class SearchCellFormulaAction implements SearchCellFormula { ); attrContent.setReplaceObject(attr.getTooltipText()); attrContent.setHoldObject(attr); + attrContent.setTag(SearchTag.CELL_TOOL_TIP); formulaInfos.add(new FormulaInfo(attrContent)); } } From 6285908bd85522b54b8715ef38d49033ad250175 Mon Sep 17 00:00:00 2001 From: levy Date: Wed, 28 Sep 2022 19:55:55 +0800 Subject: [PATCH 035/310] =?UTF-8?q?REPORT-80251=20=E8=8B=B1=E6=96=87?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=9B=BD=E9=99=85=E5=8C=96=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98=20=E9=97=AE=E9=A2=98=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0=EF=BC=9A=201=E3=80=81=E9=83=A8=E5=88=86=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E6=A8=A1=E5=9D=97=E7=9A=84label=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=96=87=E5=AD=97=E6=9C=AA=E5=81=9A=E8=87=AA=E5=8A=A8=E6=8D=A2?= =?UTF-8?q?=E8=A1=8C=E8=AE=BE=E7=BD=AE=E3=80=82=202=E3=80=81=E5=8E=9F?= =?UTF-8?q?=E5=85=88=E5=BC=80=E5=A7=8B=E7=95=8C=E9=9D=A2=E5=8F=B3=E9=94=AE?= =?UTF-8?q?=E5=BC=B9=E5=87=BA=E6=A1=86=E5=AE=BD=E5=BA=A6=E8=A2=AB=E5=9B=BA?= =?UTF-8?q?=E5=AE=9A=EF=BC=8C=E6=9C=AA=E8=80=83=E8=99=91=E4=B8=8D=E5=90=8C?= =?UTF-8?q?=E8=AF=AD=E8=A8=80=E7=9A=84=E9=80=82=E9=85=8D=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=82=20=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=EF=BC=9A=201?= =?UTF-8?q?=E3=80=81=E6=9B=B4=E6=94=B9label=E4=B8=BA=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=8D=A2=E8=A1=8C=E3=80=82=202=E3=80=81=E5=B1=80=E9=83=A8?= =?UTF-8?q?=E5=BE=AE=E8=B0=83UI=EF=BC=88=E6=A8=AA=E6=8E=92=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=8F=98=E7=AB=96=E6=8E=92=EF=BC=8C=E5=B7=B2=E4=B8=8E?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E6=B2=9F=E9=80=9A=E6=97=A0=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=89=E3=80=82=203=E3=80=81=E8=AE=BE=E7=BD=AE=E5=8F=B3?= =?UTF-8?q?=E9=94=AE=E5=BC=B9=E5=87=BA=E6=A1=86=E5=89=8D=EF=BC=8C=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E5=BD=93=E5=89=8D=E8=AF=AD=E8=A8=80=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E7=A1=AE=E5=AE=9A=E5=BC=B9=E5=87=BA=E6=A1=86=E5=AE=BD=E5=BA=A6?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/file/PreferencePane.java | 19 +++++++++---------- .../design/carton/FeedbackToolboxDialog.java | 3 +-- .../design/file/HistoryTemplateListPane.java | 1 - .../fr/design/file/MutilTempalteTabPane.java | 14 +++++++++++++- 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index fdc0a46ae8..46485409bb 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -119,6 +119,7 @@ public class PreferencePane extends BasicPane { private static final int CACHING_DEFAULT = 5; private static final int CACHING_GAP = 5; private static final int MEMORY_TIP_LABEL_MAX_WIDTH = 230; + private static final int PREFERENCE_LABEL_MAX_WIDTH = 460; private static final int OFFSET_HEIGHT = 60; private static final String TYPE = "pressed"; @@ -423,22 +424,20 @@ public class PreferencePane extends BasicPane { private void createFunctionPane(JPanel generalPane) { JPanel topVerticalTitledBorderPane = FRGUIPaneFactory.createTopVerticalTitledBorderPane(i18nText("Fine-Design_Basic_Preference_Function")); - JPanel upper = new JPanel(FRGUIPaneFactory.createLeftZeroVgapNormalHgapLayout()); - JPanel lower = new JPanel(FRGUIPaneFactory.createLeftZeroVgapNormalHgapLayout()); - topVerticalTitledBorderPane.add(upper); - topVerticalTitledBorderPane.add(lower); + JPanel supportUndoPanel = new JPanel(FRGUIPaneFactory.createLeftZeroVgapNormalHgapLayout()); + topVerticalTitledBorderPane.add(supportUndoPanel); generalPane.add(topVerticalTitledBorderPane); //添加supportUndo选择项 supportUndoCheckBox = new UICheckBox(i18nText("Fine-Design_Basic_Preference_Support_Undo")); - upper.add(supportUndoCheckBox); + supportUndoPanel.add(supportUndoCheckBox); //添加maxUndoLimit //String[] undoTimes = {"最大撤销次数","5次","10次","15次","20次","50次"}; String[] undoTimes = {i18nText("Fine-Design_Basic_Max_Undo_Limit"), MAX_UNDO_LIMIT_5 + i18nText("Fine-Design_Basic_Time(s)"), MAX_UNDO_LIMIT_10 + i18nText("Fine-Design_Basic_Time(s)") , MAX_UNDO_LIMIT_15 + i18nText("Fine-Design_Basic_Time(s)"), MAX_UNDO_LIMIT_20 + i18nText("Fine-Design_Basic_Time(s)"), MAX_UNDO_LIMIT_50 + i18nText("Fine-Design_Basic_Time(s)")}; maxUndoLimit = new UIComboBox(undoTimes); - upper.add(maxUndoLimit); + supportUndoPanel.add(maxUndoLimit); //不支持撤销则不能选择撤销可缓存,也不能设置最大撤销次数 supportUndoCheckBox.addActionListener(new ActionListener() { @@ -452,14 +451,14 @@ public class PreferencePane extends BasicPane { //添加supportDefaultParentCalculate选择项 supportDefaultParentCalculateCheckBox = new UICheckBox( i18nText("Fine-Design_Basic_Preference_Support_Default_Parent_Calculate")); - upper.add(supportDefaultParentCalculateCheckBox); + topVerticalTitledBorderPane.add(supportDefaultParentCalculateCheckBox); //添加是否展示打开模板提示缺少插件选择项 showTemplateMissingPlugin = new UICheckBox( i18nText("Fine-Design_Basic_Preference_Show-Template-Missing-Plugin")); - upper.add(showTemplateMissingPlugin); + topVerticalTitledBorderPane.add(showTemplateMissingPlugin); startWithEmptyFile = new UICheckBox(i18nText("Fine-Design_Basic_Preference_Start_Empty_File")); - lower.add(startWithEmptyFile); + topVerticalTitledBorderPane.add(startWithEmptyFile); } private void createEditPane(JPanel generalPane) { @@ -661,7 +660,7 @@ public class PreferencePane extends BasicPane { startupPageEnabledCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Startup_Page_Config_Check_Text")); startupPane.add(startupPageEnabledCheckBox); - UILabel descLabel = new UILabel(Toolkit.i18nText("Fine-Design_Startup_Page_Config_Desc")); + UILabel descLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Startup_Page_Config_Desc"), PREFERENCE_LABEL_MAX_WIDTH); descLabel.setForeground(new Color(51, 51, 52, (int)Math.round(0.5 * 255))); startupPane.add(descLabel); } diff --git a/designer-base/src/main/java/com/fr/design/carton/FeedbackToolboxDialog.java b/designer-base/src/main/java/com/fr/design/carton/FeedbackToolboxDialog.java index c7192eb099..877f6993c0 100644 --- a/designer-base/src/main/java/com/fr/design/carton/FeedbackToolboxDialog.java +++ b/designer-base/src/main/java/com/fr/design/carton/FeedbackToolboxDialog.java @@ -94,8 +94,7 @@ public class FeedbackToolboxDialog extends JDialog { private JPanel createInfoPane() { JPanel northPane = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(2, 10, 10); UILabel title = new UILabel(); - //空格布局会好看一点 - title.setText(" " + Toolkit.i18nText("Fine-Design_Basic_Carton_Record_Lag_Time") + ": "); + title.setText(Toolkit.i18nText("Fine-Design_Basic_Carton_Record_Lag_Time") + ": "); //判断一下当天是否有卡顿日志记录,如果有将日期设置为当天,如果没有设置为空 boolean cartonExists = SwitchForSwingChecker.isCartonExists(); if (cartonExists) { diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java index c62a7fef39..2dc56cc9da 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java @@ -27,7 +27,6 @@ public class HistoryTemplateListPane implements CallbackEvent { synchronized (HistoryTemplateListPane.class) { if (THIS == null) { THIS = new HistoryTemplateListPane(); - int a = 111; } } } diff --git a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java index 480edea346..53b262c4f7 100644 --- a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java +++ b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java @@ -24,6 +24,7 @@ import com.fr.design.utils.TemplateUtils; import com.fr.design.worker.save.CallbackSaveWorker; import com.fr.file.FILE; import com.fr.general.ComparatorUtils; +import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.Constants; @@ -67,6 +68,7 @@ import java.awt.geom.Line2D; import java.awt.geom.Path2D; import java.awt.geom.RoundRectangle2D; import java.util.List; +import java.util.Locale; import static com.fr.design.dialog.FineJOptionPane.showConfirmDialog; import static javax.swing.JOptionPane.OK_CANCEL_OPTION; @@ -197,7 +199,17 @@ public class MutilTempalteTabPane extends JComponent { height += 25; } } - menu.setPreferredSize(new Dimension(170, height)); + //当前i18n适配中英日,其中英日字符串长度较长,需调整popupMenu的宽度 + //后续版本可考虑读取字符串像素宽度,以自适应调整menu + int popupMenuWidth; + if(ComparatorUtils.equals(GeneralContext.getLocale(), Locale.US)){ + popupMenuWidth = 350; + }else if(ComparatorUtils.equals(GeneralContext.getLocale(), Locale.JAPAN)){ + popupMenuWidth = 240; + }else { + popupMenuWidth = 170; + } + menu.setPreferredSize(new Dimension(popupMenuWidth, height)); GUICoreUtils.showPopupMenu(menu, MutilTempalteTabPane.getInstance(), e.getX(), MutilTempalteTabPane.getInstance().getY() - 1 + MutilTempalteTabPane.getInstance().getHeight()); } } From da5b635450794685b542129bb48ec3b8aec4c231 Mon Sep 17 00:00:00 2001 From: "Link.Zhao" Date: Wed, 28 Sep 2022 21:40:20 +0800 Subject: [PATCH 036/310] =?UTF-8?q?REPORT-81241=E3=80=90=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E4=B8=AD=E5=BF=83=E6=96=AD=E7=BD=91=E5=90=8E=E7=9A=84?= =?UTF-8?q?=E9=87=8D=E6=96=B0=E5=8A=A0=E8=BD=BD=E6=97=A0=E5=8F=8D=E5=BA=94?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9pr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/AlphaFineCloudConstants.java | 25 ++++++++----------- .../search/helper/FineMarketClientHelper.java | 11 +++++--- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java index b1ff5d8606..ee85b7078d 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java @@ -12,14 +12,14 @@ import com.fr.general.CloudCenter; public class AlphaFineCloudConstants { /** - * get PluginSearchUrl + * 获取插件搜索api */ public static String getPluginSearchUrl() { return CloudCenter.getInstance().acquireUrlByKind("plugin.searchAPI"); }; /** - * get SearchAllPluginUrl + * 帆软市场里全部插件api */ public static String getSearchAllPluginUrl() { return CloudCenter.getInstance().acquireUrlByKind("plugin.all.searchAPI"); @@ -47,21 +47,21 @@ public class AlphaFineCloudConstants { } /** - * get DocumentSearchUrl + * 帮助文档搜索api */ public static String getDocumentSearchUrl() { return CloudCenter.getInstance().acquireUrlByKind("af.doc_search"); } /** - * get DocumentInformationUrl + * 帮助文档信息api */ public static String getDocumentInformationUrl() { return CloudCenter.getInstance().acquireUrlByKind("af.doc_info"); } /** - * get PluginImageUrl + * 插件图片api */ public static String getPluginImageUrl() { return CloudCenter.getInstance().acquireUrlByKind("af.plugin_image"); @@ -96,14 +96,14 @@ public class AlphaFineCloudConstants { } /** - * get AlphaHotSearch + * 获取热门问题 */ public static String getAlphaHotSearch() { return CloudCenter.getInstance().acquireUrlByKind("af.hot_search"); } /** - * get AlphaGoToForum + * 跳转论坛url */ public static String getAlphaGoToForum() { return CloudCenter.getInstance().acquireUrlByKind("af.go_fourm"); @@ -124,23 +124,20 @@ public class AlphaFineCloudConstants { } /** - * get AlphaCid + * cid系统的产品动态api */ public static String getAlphaCid() { return CloudCenter.getInstance().acquireUrlByKind("af.cid.new"); } /** - * get AlphaCidUserGroupInfo + * cid系统的 用户组信息api */ public static String getAlphaCidUserGroupInfo() { return CloudCenter.getInstance().acquireUrlByKind("af.cid.user.group.info"); } - /** - * get DefaultRecommend - */ - public static String getDefaultRecommend() { + private static String getDefaultRecommend() { String quickStartUrl = CloudCenter.getInstance().acquireUrlByKind("af.help.quick.start"); String reportLearningPath = CloudCenter.getInstance().acquireUrlByKind("af.help.report.learning.path"); String parameterLearningPath = CloudCenter.getInstance().acquireUrlByKind("af.help.param.learning.path"); @@ -156,7 +153,7 @@ public class AlphaFineCloudConstants { } /** - * get AlphaHelpRecommend + * 获取默认推荐帮助文档url */ public static String getAlphaHelpRecommend() { return CloudCenter.getInstance().acquireUrlByKind("af.recommend", getDefaultRecommend()); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java index 22c6b4c45c..1f9d5fb09a 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java @@ -48,12 +48,13 @@ public class FineMarketClientHelper { private static final String CERTIFICATE_PUBLIC_KEY = FineMarketPublicKeyHolder.getInstance().getDefaultKey(); public static final String FINE_MARKET_TEMPLATE_INFO = CloudCenter.getInstance().acquireUrlByKind("market.template.info"); public static final String FINE_MARKET_TEMPLATE_URL = CloudCenter.getInstance().acquireUrlByKind("market.template.url"); - public static final String VERSION = "&version=11.0"; + public static final String VERSION = "version"; + private static final String CURRENT_VERSION = "11.0"; public static final String FILE_DOWNLOAD = "file/download/"; public static final String PACKAGE_DOWNLOAD = "package/download/"; public static final String TEMPLATES_PARENT_PACKAGE = "parent/"; public static final String TEMPLATES_TAGS = "filter"; - public static final String NAME_SEARCH = "?searchKeyword="; + public static final String NAME_SEARCH = "searchKeyword"; public static final String RESPONSE_STATE = "state"; public static final String RESPONSE_SUCCESS = "ok"; @@ -269,8 +270,10 @@ public class FineMarketClientHelper { } public @Nullable JSONArray getTemplateInfoByName(String name) throws IOException { - String url = FINE_MARKET_TEMPLATE_INFO + NAME_SEARCH + name + VERSION; - String jsonString = HttpToolbox.get(url); + Map params = new HashMap(); + params.put(NAME_SEARCH, name); + params.put(VERSION, CURRENT_VERSION); + String jsonString = HttpToolbox.get(FINE_MARKET_TEMPLATE_INFO, params); JSONObject jsonObject = new JSONObject(jsonString); String responseState = (String) jsonObject.get(RESPONSE_STATE); if (RESPONSE_SUCCESS.equals(responseState)) { From 66fead7e41b408d064df7c4e4f74a6e6f47ee619 Mon Sep 17 00:00:00 2001 From: levy Date: Thu, 29 Sep 2022 09:14:49 +0800 Subject: [PATCH 037/310] =?UTF-8?q?REPORT-80251=20=E8=8B=B1=E6=96=87?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=9B=BD=E9=99=85=E5=8C=96=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98=20=E3=80=90=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=E3=80=911=E3=80=81=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=A8=A1=E5=9D=97=E7=9A=84label=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=96=87=E5=AD=97=E6=9C=AA=E5=81=9A=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=8D=A2=E8=A1=8C=E8=AE=BE=E7=BD=AE=E3=80=822=E3=80=81?= =?UTF-8?q?=E5=BC=80=E5=A7=8B=E7=95=8C=E9=9D=A2=E5=8F=B3=E9=94=AE=E5=BC=B9?= =?UTF-8?q?=E5=87=BA=E6=A1=86=E5=AE=BD=E5=BA=A6=E8=A2=AB=E5=9B=BA=E5=AE=9A?= =?UTF-8?q?=EF=BC=8C=E6=9C=AA=E8=80=83=E8=99=91=E4=B8=8D=E5=90=8C=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E7=9A=84=E9=80=82=E9=85=8D=E9=97=AE=E9=A2=98=E3=80=82?= =?UTF-8?q?=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=911?= =?UTF-8?q?=E3=80=81=E6=9B=B4=E6=94=B9label=E4=B8=BA=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=8D=A2=E8=A1=8C=E3=80=822=E3=80=81=E5=B1=80=E9=83=A8?= =?UTF-8?q?=E5=BE=AE=E8=B0=83UI=EF=BC=88=E6=A8=AA=E6=8E=92=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=8F=98=E7=AB=96=E6=8E=92=EF=BC=8C=E5=B7=B2=E4=B8=8E?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E6=B2=9F=E9=80=9A=E6=97=A0=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=89=E3=80=823=E3=80=81=E6=A0=B9=E6=8D=AE=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E8=AF=AD=E8=A8=80=E7=8E=AF=E5=A2=83=E7=A1=AE=E5=AE=9A?= =?UTF-8?q?=E5=8F=B3=E9=94=AE=E5=BC=B9=E5=87=BA=E6=A1=86=E5=AE=BD=E5=BA=A6?= =?UTF-8?q?=E3=80=82=20=E3=80=90Review=E5=BB=BA=E8=AE=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/file/MutilTempalteTabPane.java | 15 ++++----------- .../com/fr/design/i18n/dimension_en.properties | 3 ++- .../com/fr/design/i18n/dimension_ja_JP.properties | 3 ++- .../com/fr/design/i18n/dimension_ko_KR.properties | 3 ++- .../com/fr/design/i18n/dimension_zh.properties | 3 ++- .../com/fr/design/i18n/dimension_zh_TW.properties | 3 ++- 6 files changed, 14 insertions(+), 16 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java index 53b262c4f7..aa352b4bcb 100644 --- a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java +++ b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java @@ -11,6 +11,7 @@ import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.gui.imenu.UIScrollPopUpMenu; +import com.fr.design.i18n.DesignSizeI18nManager; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; @@ -199,17 +200,9 @@ public class MutilTempalteTabPane extends JComponent { height += 25; } } - //当前i18n适配中英日,其中英日字符串长度较长,需调整popupMenu的宽度 - //后续版本可考虑读取字符串像素宽度,以自适应调整menu - int popupMenuWidth; - if(ComparatorUtils.equals(GeneralContext.getLocale(), Locale.US)){ - popupMenuWidth = 350; - }else if(ComparatorUtils.equals(GeneralContext.getLocale(), Locale.JAPAN)){ - popupMenuWidth = 240; - }else { - popupMenuWidth = 170; - } - menu.setPreferredSize(new Dimension(popupMenuWidth, height)); + //根据当前i18n语言环境,动态调整popupMenu的宽度 + menu.setPreferredSize(new Dimension((int)DesignSizeI18nManager.getInstance(). + i18nDimension("com.fr.design.file.MultiTemplateTabPane.popUpMenu").getWidth(),height)); GUICoreUtils.showPopupMenu(menu, MutilTempalteTabPane.getInstance(), e.getX(), MutilTempalteTabPane.getInstance().getY() - 1 + MutilTempalteTabPane.getInstance().getHeight()); } } diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties index 7f249d1a5e..f26123e3d6 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties @@ -21,4 +21,5 @@ com.fr.design.ds.column.sort.pane=250*180 com.fr.design.sort.expand.header.pane=95*10 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369 -com.fr.design.report.WatermarkSettingPane=720*600 \ No newline at end of file +com.fr.design.report.WatermarkSettingPane=720*600 +com.fr.design.file.MultiTemplateTabPane.popUpMenu=350*65 \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties index ec876154ae..9c9105b416 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties @@ -20,4 +20,5 @@ com.fr.design.ds.column.sort.pane=250*165 com.fr.design.sort.expand.header.pane=95*10 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369 -com.fr.design.report.WatermarkSettingPane=720*600 \ No newline at end of file +com.fr.design.report.WatermarkSettingPane=720*600 +com.fr.design.file.MultiTemplateTabPane.popUpMenu=240*65 \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties index dd8e8571b5..f05f8a3925 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties @@ -20,4 +20,5 @@ com.fr.design.ds.column.sort.pane=250*180 com.fr.design.sort.expand.header.pane=95*10 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369 -com.fr.design.report.WatermarkSettingPane=720*600 \ No newline at end of file +com.fr.design.report.WatermarkSettingPane=720*600 +com.fr.design.file.MultiTemplateTabPane.popUpMenu=240*65 \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties index 44ea2f3bd8..d8b31cf103 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties @@ -22,4 +22,5 @@ com.fr.design.ds.column.sort.pane=220*150 com.fr.design.sort.expand.header.pane=108*10 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369 -com.fr.design.report.WatermarkSettingPane=720*600 \ No newline at end of file +com.fr.design.report.WatermarkSettingPane=720*600 +com.fr.design.file.MultiTemplateTabPane.popUpMenu=170*65 \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties index 90d082cc9f..dc92be1a0c 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties @@ -20,4 +20,5 @@ com.fr.design.ds.column.sort.pane=220*150 com.fr.design.sort.expand.header.pane=108*10 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369 -com.fr.design.report.WatermarkSettingPane=720*600 \ No newline at end of file +com.fr.design.report.WatermarkSettingPane=720*600 +com.fr.design.file.MultiTemplateTabPane.popUpMenu=170*65 \ No newline at end of file From 6181f58a03cb0bb0d5810078aa1c12ecd864d8d0 Mon Sep 17 00:00:00 2001 From: levy Date: Thu, 29 Sep 2022 10:18:27 +0800 Subject: [PATCH 038/310] =?UTF-8?q?REPORT-80251=20=E8=8B=B1=E6=96=87?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=9B=BD=E9=99=85=E5=8C=96=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98=20=E3=80=90=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=E3=80=911=E3=80=81=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=A8=A1=E5=9D=97=E7=9A=84label=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=96=87=E5=AD=97=E6=9C=AA=E5=81=9A=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=8D=A2=E8=A1=8C=E8=AE=BE=E7=BD=AE=E3=80=822=E3=80=81?= =?UTF-8?q?=E5=BC=80=E5=A7=8B=E7=95=8C=E9=9D=A2=E5=8F=B3=E9=94=AE=E5=BC=B9?= =?UTF-8?q?=E5=87=BA=E6=A1=86=E5=AE=BD=E5=BA=A6=E8=A2=AB=E5=9B=BA=E5=AE=9A?= =?UTF-8?q?=EF=BC=8C=E6=9C=AA=E8=80=83=E8=99=91=E4=B8=8D=E5=90=8C=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E7=9A=84=E9=80=82=E9=85=8D=E9=97=AE=E9=A2=98=E3=80=82?= =?UTF-8?q?=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=911?= =?UTF-8?q?=E3=80=81=E6=9B=B4=E6=94=B9label=E4=B8=BA=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=8D=A2=E8=A1=8C=E3=80=822=E3=80=81=E5=B1=80=E9=83=A8?= =?UTF-8?q?=E5=BE=AE=E8=B0=83UI=EF=BC=88=E6=A8=AA=E6=8E=92=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=8F=98=E7=AB=96=E6=8E=92=EF=BC=8C=E5=B7=B2=E4=B8=8E?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E6=B2=9F=E9=80=9A=E6=97=A0=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=89=E3=80=823=E3=80=81=E6=A0=B9=E6=8D=AE=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E8=AF=AD=E8=A8=80=E7=8E=AF=E5=A2=83=E7=A1=AE=E5=AE=9A?= =?UTF-8?q?=E5=8F=B3=E9=94=AE=E5=BC=B9=E5=87=BA=E6=A1=86=E5=AE=BD=E5=BA=A6?= =?UTF-8?q?=E3=80=82=20=E3=80=90Review=E5=BB=BA=E8=AE=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/carton/FeedbackToolboxDialog.java | 6 +++--- .../java/com/fr/design/file/MutilTempalteTabPane.java | 10 +++++----- .../com/fr/design/i18n/dimension_en.properties | 2 +- .../com/fr/design/i18n/dimension_ja_JP.properties | 2 +- .../com/fr/design/i18n/dimension_ko_KR.properties | 2 +- .../com/fr/design/i18n/dimension_zh.properties | 2 +- .../com/fr/design/i18n/dimension_zh_TW.properties | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/carton/FeedbackToolboxDialog.java b/designer-base/src/main/java/com/fr/design/carton/FeedbackToolboxDialog.java index 877f6993c0..83d6e24ac8 100644 --- a/designer-base/src/main/java/com/fr/design/carton/FeedbackToolboxDialog.java +++ b/designer-base/src/main/java/com/fr/design/carton/FeedbackToolboxDialog.java @@ -94,7 +94,7 @@ public class FeedbackToolboxDialog extends JDialog { private JPanel createInfoPane() { JPanel northPane = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(2, 10, 10); UILabel title = new UILabel(); - title.setText(Toolkit.i18nText("Fine-Design_Basic_Carton_Record_Lag_Time") + ": "); + title.setText(" " + Toolkit.i18nText("Fine-Design_Basic_Carton_Record_Lag_Time") + ": "); //判断一下当天是否有卡顿日志记录,如果有将日期设置为当天,如果没有设置为空 boolean cartonExists = SwitchForSwingChecker.isCartonExists(); if (cartonExists) { @@ -343,8 +343,8 @@ public class FeedbackToolboxDialog extends JDialog { /** * 导出卡顿日志到本地或远程服务器WEB-INF下 * - * @param sourceFile 导出的卡顿日志所在文件夹 - * @param path 文件需要导出到的路径 + * @param sourceFile 导出的卡顿日志所在文件夹 + * @param path 文件需要导出到的路径 * @param sourceFilePath 导出的卡顿日志所在文件夹的路径 */ private void exportCartonLog(File sourceFile, String path, String sourceFilePath) { diff --git a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java index aa352b4bcb..3589d9812e 100644 --- a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java +++ b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java @@ -201,8 +201,8 @@ public class MutilTempalteTabPane extends JComponent { } } //根据当前i18n语言环境,动态调整popupMenu的宽度 - menu.setPreferredSize(new Dimension((int)DesignSizeI18nManager.getInstance(). - i18nDimension("com.fr.design.file.MultiTemplateTabPane.popUpMenu").getWidth(),height)); + menu.setPreferredSize(new Dimension((int) DesignSizeI18nManager.getInstance(). + i18nDimension("com.fr.design.file.MultiTemplateTabPane.popUpMenu").getWidth(), height)); GUICoreUtils.showPopupMenu(menu, MutilTempalteTabPane.getInstance(), e.getX(), MutilTempalteTabPane.getInstance().getY() - 1 + MutilTempalteTabPane.getInstance().getHeight()); } } @@ -339,7 +339,7 @@ public class MutilTempalteTabPane extends JComponent { } } - private void closeTemplate(JTemplate[] templates, JTemplate currentTemplate) { + private void closeTemplate(JTemplate[] templates, JTemplate currentTemplate) { for (int i = 0; i < templates.length; i++) { if (option.shouldClose(tplIndex, i)) { JTemplate jTemplate = templates[i]; @@ -940,7 +940,7 @@ public class MutilTempalteTabPane extends JComponent { /** * 后台关闭当前编辑模板 */ - public void closeCurrentTpl(){ + public void closeCurrentTpl() { JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); this.setIsCloseCurrent(true); this.closeFormat(jTemplate); @@ -1164,7 +1164,7 @@ public class MutilTempalteTabPane extends JComponent { boolean completed = WorkerManager.getInstance().isCompleted(template.getTarget().getTemplateID()); if (!completed) { FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), - Toolkit.i18nText("Fine-Design_Close_Template_Tip", template.getEditingFILE().getName())); + Toolkit.i18nText("Fine-Design_Close_Template_Tip", template.getEditingFILE().getName())); return; } } diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties index f26123e3d6..0205e6ea2b 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties @@ -22,4 +22,4 @@ com.fr.design.sort.expand.header.pane=95*10 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369 com.fr.design.report.WatermarkSettingPane=720*600 -com.fr.design.file.MultiTemplateTabPane.popUpMenu=350*65 \ No newline at end of file +com.fr.design.file.MultiTemplateTabPane.popUpMenu=350*65 diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties index 9c9105b416..9b143294f3 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties @@ -21,4 +21,4 @@ com.fr.design.sort.expand.header.pane=95*10 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369 com.fr.design.report.WatermarkSettingPane=720*600 -com.fr.design.file.MultiTemplateTabPane.popUpMenu=240*65 \ No newline at end of file +com.fr.design.file.MultiTemplateTabPane.popUpMenu=240*65 diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties index f05f8a3925..e0f0130224 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties @@ -21,4 +21,4 @@ com.fr.design.sort.expand.header.pane=95*10 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369 com.fr.design.report.WatermarkSettingPane=720*600 -com.fr.design.file.MultiTemplateTabPane.popUpMenu=240*65 \ No newline at end of file +com.fr.design.file.MultiTemplateTabPane.popUpMenu=240*65 diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties index d8b31cf103..d1e84b4618 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties @@ -23,4 +23,4 @@ com.fr.design.sort.expand.header.pane=108*10 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369 com.fr.design.report.WatermarkSettingPane=720*600 -com.fr.design.file.MultiTemplateTabPane.popUpMenu=170*65 \ No newline at end of file +com.fr.design.file.MultiTemplateTabPane.popUpMenu=170*65 diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties index dc92be1a0c..c00c2b8a9a 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties @@ -21,4 +21,4 @@ com.fr.design.sort.expand.header.pane=108*10 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369 com.fr.design.report.WatermarkSettingPane=720*600 -com.fr.design.file.MultiTemplateTabPane.popUpMenu=170*65 \ No newline at end of file +com.fr.design.file.MultiTemplateTabPane.popUpMenu=170*65 From 188125ad26f530a02f9d040edb2d7722bb5d6524 Mon Sep 17 00:00:00 2001 From: levy Date: Thu, 29 Sep 2022 10:53:50 +0800 Subject: [PATCH 039/310] =?UTF-8?q?REPORT-80251=20=E8=8B=B1=E6=96=87?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=9B=BD=E9=99=85=E5=8C=96=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98=20=E3=80=90=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=E3=80=911=E3=80=81=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=A8=A1=E5=9D=97=E7=9A=84label=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=96=87=E5=AD=97=E6=9C=AA=E5=81=9A=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=8D=A2=E8=A1=8C=E8=AE=BE=E7=BD=AE=E3=80=822=E3=80=81?= =?UTF-8?q?=E5=BC=80=E5=A7=8B=E7=95=8C=E9=9D=A2=E5=8F=B3=E9=94=AE=E5=BC=B9?= =?UTF-8?q?=E5=87=BA=E6=A1=86=E5=AE=BD=E5=BA=A6=E8=A2=AB=E5=9B=BA=E5=AE=9A?= =?UTF-8?q?=EF=BC=8C=E6=9C=AA=E8=80=83=E8=99=91=E4=B8=8D=E5=90=8C=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E7=9A=84=E9=80=82=E9=85=8D=E9=97=AE=E9=A2=98=E3=80=82?= =?UTF-8?q?=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=911?= =?UTF-8?q?=E3=80=81=E6=9B=B4=E6=94=B9label=E4=B8=BA=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=8D=A2=E8=A1=8C=E3=80=822=E3=80=81=E5=B1=80=E9=83=A8?= =?UTF-8?q?=E5=BE=AE=E8=B0=83UI=EF=BC=88=E6=A8=AA=E6=8E=92=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=8F=98=E7=AB=96=E6=8E=92=EF=BC=8C=E5=B7=B2=E4=B8=8E?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E6=B2=9F=E9=80=9A=E6=97=A0=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=89=E3=80=823=E3=80=81=E6=A0=B9=E6=8D=AE=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E8=AF=AD=E8=A8=80=E7=8E=AF=E5=A2=83=E7=A1=AE=E5=AE=9A?= =?UTF-8?q?=E5=8F=B3=E9=94=AE=E5=BC=B9=E5=87=BA=E6=A1=86=E5=AE=BD=E5=BA=A6?= =?UTF-8?q?=E3=80=82=20=E3=80=90Review=E5=BB=BA=E8=AE=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/com/fr/design/i18n/dimension_zh_TW.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties index c00c2b8a9a..3b493f6df2 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties @@ -22,3 +22,4 @@ com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369 com.fr.design.report.WatermarkSettingPane=720*600 com.fr.design.file.MultiTemplateTabPane.popUpMenu=170*65 + From 747f3518dc26edd85ebf5787388dfa75a5ba5bcf Mon Sep 17 00:00:00 2001 From: levy Date: Thu, 29 Sep 2022 10:55:42 +0800 Subject: [PATCH 040/310] =?UTF-8?q?REPORT-80251=20=E8=8B=B1=E6=96=87?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=9B=BD=E9=99=85=E5=8C=96=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98=20=E3=80=90=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=E3=80=911=E3=80=81=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=A8=A1=E5=9D=97=E7=9A=84label=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=96=87=E5=AD=97=E6=9C=AA=E5=81=9A=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=8D=A2=E8=A1=8C=E8=AE=BE=E7=BD=AE=E3=80=822=E3=80=81?= =?UTF-8?q?=E5=BC=80=E5=A7=8B=E7=95=8C=E9=9D=A2=E5=8F=B3=E9=94=AE=E5=BC=B9?= =?UTF-8?q?=E5=87=BA=E6=A1=86=E5=AE=BD=E5=BA=A6=E8=A2=AB=E5=9B=BA=E5=AE=9A?= =?UTF-8?q?=EF=BC=8C=E6=9C=AA=E8=80=83=E8=99=91=E4=B8=8D=E5=90=8C=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E7=9A=84=E9=80=82=E9=85=8D=E9=97=AE=E9=A2=98=E3=80=82?= =?UTF-8?q?=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=911?= =?UTF-8?q?=E3=80=81=E6=9B=B4=E6=94=B9label=E4=B8=BA=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=8D=A2=E8=A1=8C=E3=80=822=E3=80=81=E5=B1=80=E9=83=A8?= =?UTF-8?q?=E5=BE=AE=E8=B0=83UI=EF=BC=88=E6=A8=AA=E6=8E=92=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=8F=98=E7=AB=96=E6=8E=92=EF=BC=8C=E5=B7=B2=E4=B8=8E?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E6=B2=9F=E9=80=9A=E6=97=A0=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=89=E3=80=823=E3=80=81=E6=A0=B9=E6=8D=AE=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E8=AF=AD=E8=A8=80=E7=8E=AF=E5=A2=83=E7=A1=AE=E5=AE=9A?= =?UTF-8?q?=E5=8F=B3=E9=94=AE=E5=BC=B9=E5=87=BA=E6=A1=86=E5=AE=BD=E5=BA=A6?= =?UTF-8?q?=E3=80=82=20=E3=80=90Review=E5=BB=BA=E8=AE=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/com/fr/design/i18n/dimension_zh_TW.properties | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties index 3b493f6df2..c00c2b8a9a 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties @@ -22,4 +22,3 @@ com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500 com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369 com.fr.design.report.WatermarkSettingPane=720*600 com.fr.design.file.MultiTemplateTabPane.popUpMenu=170*65 - From c726fd6c071148ff4bc8d4b3c362a4799a9aebb9 Mon Sep 17 00:00:00 2001 From: "Link.Zhao" Date: Thu, 29 Sep 2022 11:47:49 +0800 Subject: [PATCH 041/310] =?UTF-8?q?REPORT-81241=E3=80=90=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E4=B8=AD=E5=BF=83=E6=96=AD=E7=BD=91=E5=90=8E=E7=9A=84?= =?UTF-8?q?=E9=87=8D=E6=96=B0=E5=8A=A0=E8=BD=BD=E6=97=A0=E5=8F=8D=E5=BA=94?= =?UTF-8?q?=20=E6=B7=BB=E5=8A=A0url=E7=BC=96=E7=A0=81=20=E6=8F=90=E5=8F=96?= =?UTF-8?q?=E5=B8=B8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/AlphaFineCloudConstants.java | 76 +++++++++++++------ .../alphafine/cell/model/PluginModel.java | 10 ++- .../search/helper/FineMarketClientHelper.java | 4 +- .../manager/impl/ComplementAdviceManager.java | 7 +- .../manager/impl/DocumentSearchManager.java | 2 +- .../manager/impl/SimilarSearchManager.java | 7 +- 6 files changed, 74 insertions(+), 32 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java index ee85b7078d..35b363eb71 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java @@ -11,139 +11,165 @@ import com.fr.general.CloudCenter; */ public class AlphaFineCloudConstants { + private static final String PLUGIN_SEARCH_API = "plugin.searchAPI"; + private static final String PLUGIN_ALL_SEARCH_API = "plugin.all.searchAPI"; + private static final String AF_PLUGIN_INFO = "af.pluginInfo"; + private static final String AF_REUSE_INFO = "af.reuseInfo"; + private static final String AF_DOC_VIEW = "af.doc_view"; + private static final String AF_DOC_SEARCH = "af.doc_search"; + private static final String AF_DOC_INFO = "af.doc_info"; + private static final String AF_PLUGIN_IMAGE = "af.plugin_image"; + private static final String AF_RECORD = "af.record"; + private static final String AF_CLOUD_SEARCH = "af.cloud_search"; + private static final String AF_SIMILAR_SEARCH = "af.similar_search"; + private static final String AF_ADVICE_SEARCH = "af.advice_search"; + private static final String AF_HOT_SEARCH = "af.hot_search"; + private static final String AF_GO_FORUM = "af.go_fourm"; + private static final String AF_GO_WEB = "af.go_web"; + private static final String AF_PREVIEW = "af.preview"; + private static final String AF_CID_NEW = "af.cid.new"; + private static final String AF_CID_USER_GROUP_INFO = "af.cid.user.group.info"; + private static final String AF_HELP_QUICK_START = "af.help.quick.start"; + private static final String AF_HELP_REPORT_LEARNING_PATH = "af.help.report.learning.path"; + private static final String AF_HELP_PARAM_LEARNING_PATH = "af.help.param.learning.path"; + private static final String AF_HELP_FILL_LEARNING_PATH = "af.help.fill.learning.path"; + private static final String AF_HELP_API_SUMMARY = "af.help.api.summary"; + private static final String AF_HELP_MONTHLY_DOCUMENT = "af.help.monthly.document"; + private static final String AF_RECOMMEND = "af.recommend"; + /** * 获取插件搜索api */ public static String getPluginSearchUrl() { - return CloudCenter.getInstance().acquireUrlByKind("plugin.searchAPI"); + return CloudCenter.getInstance().acquireUrlByKind(PLUGIN_SEARCH_API); }; /** * 帆软市场里全部插件api */ public static String getSearchAllPluginUrl() { - return CloudCenter.getInstance().acquireUrlByKind("plugin.all.searchAPI"); + return CloudCenter.getInstance().acquireUrlByKind(PLUGIN_ALL_SEARCH_API); } /** * get PluginUrl */ public static String getPluginUrl() { - return CloudCenter.getInstance().acquireUrlByKind("af.pluginInfo"); + return CloudCenter.getInstance().acquireUrlByKind(AF_PLUGIN_INFO); } /** * get ReuseUrl */ public static String getReuseUrl() { - return CloudCenter.getInstance().acquireUrlByKind("af.reuseInfo"); + return CloudCenter.getInstance().acquireUrlByKind(AF_REUSE_INFO); } /** * get DocumentDocUrl */ public static String getDocumentDocUrl() { - return CloudCenter.getInstance().acquireUrlByKind("af.doc_view"); + return CloudCenter.getInstance().acquireUrlByKind(AF_DOC_VIEW); } /** * 帮助文档搜索api */ public static String getDocumentSearchUrl() { - return CloudCenter.getInstance().acquireUrlByKind("af.doc_search"); + return CloudCenter.getInstance().acquireUrlByKind(AF_DOC_SEARCH); } /** * 帮助文档信息api */ public static String getDocumentInformationUrl() { - return CloudCenter.getInstance().acquireUrlByKind("af.doc_info"); + return CloudCenter.getInstance().acquireUrlByKind(AF_DOC_INFO); } /** * 插件图片api */ public static String getPluginImageUrl() { - return CloudCenter.getInstance().acquireUrlByKind("af.plugin_image"); + return CloudCenter.getInstance().acquireUrlByKind(AF_PLUGIN_IMAGE); } /** * get CloudServerUrl */ public static String getCloudServerUrl() { - return CloudCenter.getInstance().acquireUrlByKind("af.record"); + return CloudCenter.getInstance().acquireUrlByKind(AF_RECORD); } /** * get SearchApi */ public static String getSearchApi() { - return CloudCenter.getInstance().acquireUrlByKind("af.cloud_search"); + return CloudCenter.getInstance().acquireUrlByKind(AF_CLOUD_SEARCH); } /** * get SimilarSearchUrlPrefix */ public static String getSimilarSearchUrlPrefix() { - return CloudCenter.getInstance().acquireUrlByKind("af.similar_search"); + return CloudCenter.getInstance().acquireUrlByKind(AF_SIMILAR_SEARCH); } /** * get ComplementAdviceSearchUrlPrefix */ public static String getComplementAdviceSearchUrlPrefix() { - return CloudCenter.getInstance().acquireUrlByKind("af.advice_search"); + return CloudCenter.getInstance().acquireUrlByKind(AF_ADVICE_SEARCH); } /** * 获取热门问题 */ public static String getAlphaHotSearch() { - return CloudCenter.getInstance().acquireUrlByKind("af.hot_search"); + return CloudCenter.getInstance().acquireUrlByKind(AF_HOT_SEARCH); } /** * 跳转论坛url */ public static String getAlphaGoToForum() { - return CloudCenter.getInstance().acquireUrlByKind("af.go_fourm"); + return CloudCenter.getInstance().acquireUrlByKind(AF_GO_FORUM); } /** * get AlphaGoToWeb */ public static String getAlphaGoToWeb() { - return CloudCenter.getInstance().acquireUrlByKind("af.go_web"); + return CloudCenter.getInstance().acquireUrlByKind(AF_GO_WEB); } /** * get AlphaPreview */ public static String getAlphaPreview() { - return CloudCenter.getInstance().acquireUrlByKind("af.preview"); + return CloudCenter.getInstance().acquireUrlByKind(AF_PREVIEW); } /** * cid系统的产品动态api */ public static String getAlphaCid() { - return CloudCenter.getInstance().acquireUrlByKind("af.cid.new"); + return CloudCenter.getInstance().acquireUrlByKind(AF_CID_NEW); } /** * cid系统的 用户组信息api */ public static String getAlphaCidUserGroupInfo() { - return CloudCenter.getInstance().acquireUrlByKind("af.cid.user.group.info"); + return CloudCenter.getInstance().acquireUrlByKind(AF_CID_USER_GROUP_INFO); } private static String getDefaultRecommend() { - String quickStartUrl = CloudCenter.getInstance().acquireUrlByKind("af.help.quick.start"); - String reportLearningPath = CloudCenter.getInstance().acquireUrlByKind("af.help.report.learning.path"); - String parameterLearningPath = CloudCenter.getInstance().acquireUrlByKind("af.help.param.learning.path"); - String fillLearningPath = CloudCenter.getInstance().acquireUrlByKind("af.help.fill.learning.path"); - String apiSummary = CloudCenter.getInstance().acquireUrlByKind("af.help.api.summary"); - String monthlyDocument = CloudCenter.getInstance().acquireUrlByKind("af.help.monthly.document"); + String quickStartUrl = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_QUICK_START); + String reportLearningPath = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_REPORT_LEARNING_PATH); + String parameterLearningPath = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_PARAM_LEARNING_PATH); + String fillLearningPath = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_FILL_LEARNING_PATH); + String apiSummary = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_API_SUMMARY); + String monthlyDocument = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_MONTHLY_DOCUMENT); return "[{\"name\":\"快速入门指南\", \"link\":\"" + quickStartUrl + "\"}," + "{\"name\":\"报表应用学习路径\", \"link\":\"" + reportLearningPath + "\"}," + "{\"name\":\"参数应用学习路径\", \"link\":\"" + parameterLearningPath + "\"}," + @@ -156,6 +182,6 @@ public class AlphaFineCloudConstants { * 获取默认推荐帮助文档url */ public static String getAlphaHelpRecommend() { - return CloudCenter.getInstance().acquireUrlByKind("af.recommend", getDefaultRecommend()); + return CloudCenter.getInstance().acquireUrlByKind(AF_RECOMMEND, getDefaultRecommend()); } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java index 0bdb1ec669..9c60db3192 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java @@ -104,7 +104,15 @@ public class PluginModel extends AlphaCellModel { if (!WorkContext.getCurrent().isLocal()) { return; } - WebViewDlgHelper.createPluginDialog(getName()); + openPluginStore(getName()); + } + + /** + * 打开插件商城 + * 方便埋点 + */ + private void openPluginStore(String name) { + WebViewDlgHelper.createPluginDialog(name); } @Override diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java index 1f9d5fb09a..42b28cfe8a 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.alphafine.search.helper; +import com.fr.base.login.ClientHelper; import com.fr.design.DesignerEnvManager; import com.fr.design.extra.PluginConstants; import com.fr.design.mainframe.alphafine.download.FineMarketDownloadManager; @@ -12,6 +13,7 @@ import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.market.key.FineMarketPublicKeyHolder; import com.fr.security.SecurityToolbox; +import com.fr.stable.EncodeConstants; import com.fr.stable.StableUtils; import com.fr.third.org.apache.http.HttpEntity; import com.fr.third.org.apache.http.HttpException; @@ -327,7 +329,7 @@ public class FineMarketClientHelper { * */ private void initTags() throws IOException { tags = new HashMap<>(); - String url = FINE_MARKET_TEMPLATE_INFO + TEMPLATES_TAGS; + String url = FINE_MARKET_TEMPLATE_INFO + ClientHelper.urlEncode(TEMPLATES_TAGS, EncodeConstants.ENCODING_UTF_8); String jsonString = HttpToolbox.get(url); JSONObject jsonObject = new JSONObject(jsonString); String responseState = (String) jsonObject.get(RESPONSE_STATE); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java index 8aaa0abd5e..a00803210e 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.alphafine.search.manager.impl; +import com.fr.base.login.ClientHelper; import com.fr.design.DesignerEnvManager; import com.fr.design.actions.help.alphafine.AlphaFineCloudConstants; import com.fr.design.actions.help.alphafine.AlphaFineConstants; @@ -7,6 +8,7 @@ import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.general.http.HttpToolbox; import com.fr.log.FineLoggerFactory; +import com.fr.stable.EncodeConstants; import com.fr.third.org.apache.commons.codec.digest.DigestUtils; @@ -40,8 +42,9 @@ public class ComplementAdviceManager { if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isNeedIntelligentCustomerService()) { SearchResult searchResult = new SearchResult(); for (int j = 0; j < searchText.length; j++) { - String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + searchText[j]); - String url = AlphaFineCloudConstants.getComplementAdviceSearchUrlPrefix() + "msg=" + searchText[j] + "&token=" + token; + String msg = ClientHelper.urlEncode(searchText[j], EncodeConstants.ENCODING_UTF_8); + String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + msg); + String url = AlphaFineCloudConstants.getComplementAdviceSearchUrlPrefix() + "msg=" + msg + "&token=" + ClientHelper.urlEncode(token, EncodeConstants.ENCODING_UTF_8); try { String result = HttpToolbox.get(url); AlphaFineHelper.checkCancel(); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java index 0c8ef70536..69c34ba61c 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java @@ -71,7 +71,7 @@ public class DocumentSearchManager implements AlphaFineSearchProvider { searchResult = new SearchResult(); for (int j = 0; j < searchText.length; j++) { long start = System.currentTimeMillis(); - String url = AlphaFineCloudConstants.DOCUMENT_SEARCH_URL + searchText[j]; + String url = AlphaFineCloudConstants.getDocumentSearchUrl() + searchText[j]; try { String result = HttpToolbox.get(url); AlphaFineHelper.checkCancel(); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java index 18afdcaeba..102ead1bb2 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.alphafine.search.manager.impl; +import com.fr.base.login.ClientHelper; import com.fr.design.DesignerEnvManager; import com.fr.design.actions.help.alphafine.AlphaFineCloudConstants; import com.fr.design.actions.help.alphafine.AlphaFineConstants; @@ -13,6 +14,7 @@ import com.fr.general.http.HttpToolbox; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; +import com.fr.stable.EncodeConstants; import com.fr.third.org.apache.commons.codec.digest.DigestUtils; /** @@ -47,8 +49,9 @@ public class SimilarSearchManager implements AlphaFineSearchProvider { } SearchResult allModelList = new SearchResult(); for (int j = 0; j < searchText.length; j++) { - String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + searchText[j]); - String url = AlphaFineCloudConstants.getSimilarSearchUrlPrefix() + "msg=" + searchText[j] + "&token=" + token; + String msg = ClientHelper.urlEncode(searchText[j], EncodeConstants.ENCODING_UTF_8); + String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + msg); + String url = AlphaFineCloudConstants.getSimilarSearchUrlPrefix() + "msg=" + msg + "&token=" + ClientHelper.urlEncode(token, EncodeConstants.ENCODING_UTF_8); try { String result = HttpToolbox.get(url); AlphaFineHelper.checkCancel(); From c7f87592a4bbfac239d8cdf4b76f9fdfd8b72fa3 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 29 Sep 2022 13:40:36 +0800 Subject: [PATCH 042/310] =?UTF-8?q?REPORT-75998=20=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=AD=97=E5=85=B8-=E5=85=AC=E5=BC=8F?= =?UTF-8?q?=E7=9A=84=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91=E3=80=81=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=8B=BE=E9=80=89=E6=A1=86=E7=9A=84=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E3=80=81=E6=9F=A5=E6=89=BE=E6=A1=86=E6=97=A0?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=97=B6=E6=9B=BF=E6=8D=A2=E6=A1=86=E7=A6=81?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../action/content/formula/FormulaTag.java | 19 ++++++++ .../formula/widget/DictionaryType.java | 9 +++- .../actions/replace/info/FormulaInfo.java | 16 ++----- .../actions/replace/info/base/SearchTag.java | 8 ++++ .../replace/ui/ITReplaceMainDialog.java | 27 +++++++----- .../actions/replace/ui/ITTableEditorPane.java | 44 +++++++++++++------ 6 files changed, 83 insertions(+), 40 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java index ff8755974b..c3f3c83a1d 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java @@ -2,6 +2,7 @@ package com.fr.design.actions.replace.action.content.formula; import com.fr.chart.chartdata.MeterReportDefinition; import com.fr.data.VerifyItem; +import com.fr.data.impl.FormulaDictionary; import com.fr.design.actions.replace.info.DealWithInfoValue; import com.fr.design.actions.replace.info.Info; import com.fr.design.actions.replace.info.base.SearchTag; @@ -133,6 +134,24 @@ public enum FormulaTag implements DealWithInfoValue { attr.setTooltipText(ShowValueUtils.replaceAll(attr.getTooltipText(), findStr, replaceStr)); } } + }, + DICT_EXCUTE(SearchTag.DICT_EXCUTE) { + @Override + public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { + if (info.getContent().getHoldObject() instanceof FormulaDictionary) { + FormulaDictionary dictionary = (FormulaDictionary) info.getContent().getHoldObject(); + dictionary.setExcuteFormula(ShowValueUtils.replaceAll(dictionary.getExcuteFormula(), findStr, replaceStr)); + } + } + }, + DICT_PRODUCE(SearchTag.DICT_PRODUCE) { + @Override + public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { + if (info.getContent().getHoldObject() instanceof FormulaDictionary) { + FormulaDictionary dictionary = (FormulaDictionary) info.getContent().getHoldObject(); + dictionary.setProduceFormula(ShowValueUtils.replaceAll(dictionary.getProduceFormula(), findStr, replaceStr)); + } + } }; int index; diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/DictionaryType.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/DictionaryType.java index 22d4cb3959..6a55aebf9b 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/DictionaryType.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/DictionaryType.java @@ -6,6 +6,7 @@ import com.fr.data.impl.FormulaDictionary; import com.fr.data.impl.TableDataDictionary; import com.fr.design.actions.replace.info.FormulaInfo; import com.fr.design.actions.replace.info.base.ITContent; +import com.fr.design.actions.replace.info.base.SearchTag; import com.fr.design.i18n.Toolkit; import org.jetbrains.annotations.Nullable; @@ -32,23 +33,27 @@ public enum DictionaryType implements DictionaryAction { //显示值 if (formulaDictionary.getExcuteFormula() != null) { ITContent excuteContent = ITContent.copy(content); - excuteContent.setReplaceObject(dictionary); + excuteContent.setReplaceObject(formulaDictionary.getExcuteFormula()); excuteContent.addOtherPos( Toolkit.i18nText("Fine-Design_Basic_DS_Dictionary"), Toolkit.i18nText("Fine-Design_Basic_Formula"), Toolkit.i18nText("Fine-Design_Basic_Display_Value") ); + excuteContent.setHoldObject(dictionary); + excuteContent.setTag(SearchTag.DICT_EXCUTE); formulaInfos.add(new FormulaInfo(excuteContent)); } //实际值 if (formulaDictionary.getProduceFormula() != null) { ITContent produceContent = ITContent.copy(content); - produceContent.setReplaceObject(dictionary); + produceContent.setReplaceObject(formulaDictionary.getProduceFormula()); produceContent.addOtherPos( Toolkit.i18nText("Fine-Design_Basic_DS_Dictionary"), Toolkit.i18nText("Fine-Design_Basic_Formula"), Toolkit.i18nText("Fine-Design_Basic_Actual_Value") ); + produceContent.setHoldObject(dictionary); + produceContent.setTag(SearchTag.DICT_PRODUCE); formulaInfos.add(new FormulaInfo(produceContent)); } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/FormulaInfo.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/FormulaInfo.java index 73a0750cb8..ce2ecd36c6 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/FormulaInfo.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/FormulaInfo.java @@ -40,14 +40,7 @@ public class FormulaInfo implements Info { @Override public Map getValue(Object... o) { Map map = new HashMap<>(); - //这边比较特殊,存的都是FormulaDictionary ,特殊判断一下 - if (this.content.getOtherPos().contains(DISPLAY)) { - map.put("content", ((FormulaDictionary) this.getContent().getReplaceObject()).getExcuteFormula()); - } else if (this.content.getOtherPos().contains(ACTUAL)) { - map.put("content", ((FormulaDictionary) this.getContent().getReplaceObject()).getProduceFormula()); - } else { - map = getCommonValue(); - } + map = getCommonValue(); return map; } @@ -70,11 +63,8 @@ public class FormulaInfo implements Info { @Override public Boolean checkValid() { - FormulaReplaceObject formulaReplaceObject = FormulaReplaceObject.match(this.content.getReplaceObject().getClass().getSimpleName()); - if (formulaReplaceObject != null) { - return formulaReplaceObject.check(this); - } - return false; + //校验二期才完善,目前都给过 + return true; } private Map getCommonValue() { diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java index 1bbba05b35..956d3ff386 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java @@ -44,6 +44,14 @@ public class SearchTag { * 单元格属性-其他-内容提示 */ public static final int CELL_TOOL_TIP = 8; + /** + * 数据字典-公式-显示值 + */ + public static final int DICT_EXCUTE = 9; + /** + * 数据字典-公式-实际值 + */ + public static final int DICT_PRODUCE = 10; diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index 96ee17b6cd..4843df57f4 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -9,6 +9,7 @@ import com.fr.design.actions.replace.utils.ShowValueUtils; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.UIDialog; import com.fr.design.file.HistoryTemplateListCache; +import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; @@ -22,6 +23,7 @@ import com.fr.stable.StringUtils; import javax.swing.JOptionPane; import javax.swing.JPanel; import java.awt.BorderLayout; +import java.awt.Color; import java.awt.Dimension; import java.awt.Point; import java.awt.event.ActionEvent; @@ -117,8 +119,10 @@ public class ITReplaceMainDialog extends UIDialog { JPanel center = new JPanel(new BorderLayout()); + UIComboBox replaceComboBox = northPane.getReplaceInputCombobox(); northPane.getFindInputCombobox().setEditable(true); - northPane.getReplaceInputCombobox().setEditable(false); + replaceComboBox.setEnabled(false); + replaceComboBox.setEditable(true); northPane.getReplaceButton().setEnabled(false); ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).setPlaceholder(Toolkit.i18nText("Fine-Design_Replace_Search_Input")); @@ -160,7 +164,8 @@ public class ITReplaceMainDialog extends UIDialog { private void replace() { String searchStr = ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).getText(); String replaceStr = ((UITextField) (northPane.getReplaceInputCombobox().getEditor().getEditorComponent())).getText(); - if (StringUtils.equals(getSearchStr(), searchStr)) { + //替换内容为空需要触发搜索 + if (StringUtils.equals(getSearchStr(), searchStr) && StringUtils.isNotEmpty(replaceStr)) { if (isITReplaceValid() && checkTemplateChanged(searchResultList)) { for (Info info : searchResultList) { if (info.getContent().isSelected()) { @@ -298,7 +303,8 @@ public class ITReplaceMainDialog extends UIDialog { northPane.getResultLabel().setText("" + Toolkit.i18nText("Fine-Design_Replace_Search_Finish") + "" + searchResultList.size() + "" + Toolkit.i18nText("Fine-Design_Replace_Result")); } ITTableEditorPane.ITHeaderRenderer renderer = (ITTableEditorPane.ITHeaderRenderer) getEditTable().getTableHeader().getDefaultRenderer(); - renderer.refreshHeader(getEditTable()); + //刷新表头,并且重新勾选中表头全选框 + renderer.refreshHeader(getEditTable(), true); itTableEditor.fireTableDataChanged(); northPane.refreshFindInputComboBoxItems(); setSearchFlag(true); @@ -306,18 +312,17 @@ public class ITReplaceMainDialog extends UIDialog { //如果有结果,默认选中第一行 if (searchResultList.size() > 0){ getEditTable().addRowSelectionInterval(FIRST_ROW,FIRST_ROW); - northPane.getReplaceButton().setEnabled(true); } - - //设置替换输入框的可用性 - if (StringUtils.isNotEmpty(searchStr)) { - ((UITextField) (northPane.getReplaceInputCombobox().getEditor().getEditorComponent())).setEditable(true); - northPane.getReplaceInputCombobox().setEditable(true); + //更新替换按钮可用性 + if (StringUtils.isEmpty(searchStr) || searchResultList.size() == 0){ + northPane.getReplaceButton().setEnabled(false); } else { - ((UITextField) (northPane.getReplaceInputCombobox().getEditor().getEditorComponent())).setEditable(false); - northPane.getReplaceInputCombobox().setEditable(false); + northPane.getReplaceButton().setEnabled(true); } + + //设置替换输入框的可用性 + northPane.getReplaceInputCombobox().setEnabled(StringUtils.isNotEmpty(searchStr)); } else { //todo } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java index 4d2f39718d..0a743d34eb 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java @@ -72,17 +72,8 @@ public class ITTableEditorPane extends BasicPane { int col = ((JTable) e.getSource()).columnAtPoint(e.getPoint()); if (col == ITReplaceSouthPanel.CHECKBOX_INDEX) { ITContent content = (ITContent) editTable.getValueAt(row, ITReplaceSouthPanel.CONTENT_INDEX); - if (content.isSelected()) { - content.setSelected(false); - editTable.setValueAt(content.isSelected(), row, col); - ITReplaceMainDialog.selectCount--; - ITReplaceMainDialog.getInstance().getNorthPane().getReplaceButton().setEnabled(ITReplaceMainDialog.selectCount > 0); - } else { - content.setSelected(true); - editTable.setValueAt(content.isSelected(), row, col); - ITReplaceMainDialog.selectCount++; - ITReplaceMainDialog.getInstance().getNorthPane().getReplaceButton().setEnabled(true); - } + //改变面板的各个状态 + changeComponentStatus(content, row, col); } } @@ -90,10 +81,35 @@ public class ITTableEditorPane extends BasicPane { UIScrollPane scrollPane = new UIScrollPane(editTable); scrollPane.setBorder(new UIRoundedBorder(UIConstants.TITLED_BORDER_COLOR, 1, UIConstants.ARC)); pane.add(scrollPane, BorderLayout.CENTER); + } - + /** + * 改变面板的各个状态(替换按钮、表头勾选框) + * @param content + * @param row + * @param col + */ + public void changeComponentStatus(ITContent content, int row, int col) { + if (content.isSelected()) { + content.setSelected(false); + editTable.setValueAt(content.isSelected(), row, col); + ITReplaceMainDialog.selectCount--; + //如果没有选中,替换按钮需要置灰 + ITReplaceMainDialog.getInstance().getNorthPane().getReplaceButton().setEnabled(ITReplaceMainDialog.selectCount > 0); + } else { + content.setSelected(true); + editTable.setValueAt(content.isSelected(), row, col); + ITReplaceMainDialog.selectCount++; + ITReplaceMainDialog.getInstance().getNorthPane().getReplaceButton().setEnabled(true); + } + //更新表头的勾选框状态 + if (editTable.getTableHeader().getDefaultRenderer() instanceof ITHeaderRenderer) { + ITHeaderRenderer renderer = (ITHeaderRenderer) editTable.getTableHeader().getDefaultRenderer(); + renderer.refreshHeader(editTable, ITReplaceMainDialog.selectCount >= editTable.getRowCount()); + } } + public UITableModelAdapter getTableModel() { return tableModel; } @@ -142,8 +158,8 @@ public class ITTableEditorPane extends BasicPane { * * @param table */ - public void refreshHeader(JTable table) { - selectBox.setSelected(true); + public void refreshHeader(JTable table, boolean value) { + selectBox.setSelected(value); int rowHeight = table.getRowHeight(); table.updateUI(); table.setRowHeight(rowHeight); From 9f293a456bbf5956f3bc72f8b5eeaf524bba9c9b Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 29 Sep 2022 14:11:34 +0800 Subject: [PATCH 043/310] =?UTF-8?q?REPORT-75998=20=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=AD=97=E5=85=B8-=E5=85=AC=E5=BC=8F?= =?UTF-8?q?=E7=9A=84=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91=E3=80=81=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=8B=BE=E9=80=89=E6=A1=86=E7=9A=84=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E3=80=81=E6=9F=A5=E6=89=BE=E6=A1=86=E6=97=A0?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=97=B6=E6=9B=BF=E6=8D=A2=E6=A1=86=E7=A6=81?= =?UTF-8?q?=E7=94=A8=20REPORT-75998=20=E5=A2=9E=E5=8A=A0=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E6=A8=A1=E6=9D=BFWeb=E5=B1=9E=E6=80=A7=E5=BC=95=E7=94=A8JS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../action/content/js/SearchWebJSAction.java | 20 +++++++ .../actions/replace/info/ReplaceObject.java | 58 ++++++++++++++++--- .../actions/replace/info/base/SearchTag.java | 4 ++ 3 files changed, 75 insertions(+), 7 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchWebJSAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchWebJSAction.java index 0ceec53617..725d1280db 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchWebJSAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchWebJSAction.java @@ -4,6 +4,7 @@ import com.fr.design.actions.replace.info.JSInfo; import com.fr.design.actions.replace.info.base.ITContent; +import com.fr.design.actions.replace.info.base.SearchTag; import com.fr.design.actions.replace.utils.SearchJSUtils; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.JTemplate; @@ -19,6 +20,7 @@ import com.fr.report.web.util.ReportEngineEventMapping; import com.fr.web.attr.ReportWebAttr; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -86,12 +88,30 @@ public class SearchWebJSAction implements SearchJS { content.setTemplateName(jTemplate.getTemplateName()); content.setJumpAble(false); addWebContent2Array(webAttr); + //处理引用JS + dealImportJS(content,jsInfos,webAttr); for (int i = 0; i < arrayList.size(); i++) { addJSInfos2ListFromArray(content, jsInfos, arrayList.get(i)); } } } + private void dealImportJS(ITContent content, List jsInfos, ReportWebAttr webAttr) { + if (webAttr != null){ + for (String jsStr : webAttr.getJSImport()){ + ITContent jsContent = ITContent.copy(content); + jsContent.addOtherPos( + Toolkit.i18nText("Fine-Design_Basic_Report_Web_Attributes"), + Toolkit.i18nText("Fine-Design_Report_Import_JavaScript") + ); + jsContent.setReplaceObject(jsStr); + jsContent.setHoldObject(webAttr); + jsContent.setTag(SearchTag.IMPORT_JS); + jsInfos.add(new JSInfo(jsContent)); + } + } + } + private void addJSInfos2ListFromServerWebAttr(ITContent content, List jsInfos, WebContent webContent) { ITContent newContent = ITContent.copy(content); if (SERVER_MAP.containsKey(webContent.getClass().getSimpleName())) { diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java index 3d615e18a9..d803f31012 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java @@ -3,13 +3,16 @@ package com.fr.design.actions.replace.info; import com.fr.data.impl.DBTableData; import com.fr.design.actions.replace.utils.ShowValueUtils; import com.fr.form.event.Listener; +import com.fr.general.GeneralUtils; import com.fr.js.JavaScriptImpl; import com.fr.js.NameJavaScript; import com.fr.plugin.chart.base.VanChartHtmlLabel; import com.fr.stable.StringUtils; import com.fr.stable.collections.combination.Pair; +import com.fr.web.attr.ReportWebAttr; import org.jetbrains.annotations.Nullable; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -184,36 +187,77 @@ public enum ReplaceObject implements DealWithInfoValue { return StringUtils.equals(javaScript.getContent(), info.getContent().getOldShowStr()); } }, + /** + * 模板Web属性——引用JS + */ + IMPORT_JS("String") { + @Override + public Map getValue(Object... o) { + HashMap map = new HashMap<>(); + addValue2Map(contentKey, GeneralUtils.objectToString(o[0]), map); + return map; + } + + @Override + public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { + if (info.getContent().getHoldObject() instanceof ReportWebAttr) { + ReportWebAttr attr = (ReportWebAttr) info.getContent().getHoldObject(); + List jsImports = Arrays.asList(attr.getJSImport()); + String jsName = GeneralUtils.objectToString(info.getContent().getReplaceObject()); + for (int i = 0, len = jsImports.size(); i < len; i++) { + if (StringUtils.equals(jsImports.get(i), jsName)) { + jsImports.set(i, ShowValueUtils.replaceAll(jsName, findStr, replaceStr)); + } + } + attr.clearJSImportList(); + for (int i = 0, len = jsImports.size(); i < len; i++) { + attr.addJSImport(jsImports.get(i)); + } + } + } + + @Override + public String getInfoShowStr(Info info) { + return GeneralUtils.objectToString(info.getContent().getReplaceObject()); + } + + @Override + boolean check(Info info) { + return true; + } + }, /** * DBTableData——SQL */ DB_TABLE_DATA("DBTableData") { @Override - boolean check(Info info) { + boolean check (Info info){ DBTableData dbTableData = (DBTableData) info.getContent().getReplaceObject(); return StringUtils.equals(dbTableData.getQuery(), info.getContent().getOldShowStr()); } @Override - public Map getValue(Object... o) { + public Map getValue (Object...o){ HashMap map = new HashMap<>(); addValue2Map(contentKey, ((DBTableData) o[0]).getQuery(), map); return map; } @Override - public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { + public void setValue (Info info, String findStr, String + replaceStr, List < Pair < Integer, Integer >> operatorArray){ DBTableData dbTableData = (DBTableData) info.getContent().getReplaceObject(); info.updateOldStr(dbTableData.getQuery(), findStr); dbTableData.setQuery(ShowValueUtils.replaceAll(dbTableData.getQuery(), findStr, replaceStr)); - //todo DesignTableDataManager } @Override - public String getInfoShowStr(Info info) { + public String getInfoShowStr (Info info){ return info.getInfoShowStr(info); } - }; + } + + ; String name; @@ -256,4 +300,4 @@ public enum ReplaceObject implements DealWithInfoValue { abstract boolean check(Info info); -} + } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java index 956d3ff386..b5e202bcb1 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java @@ -52,6 +52,10 @@ public class SearchTag { * 数据字典-公式-实际值 */ public static final int DICT_PRODUCE = 10; + /** + * 引用JS + */ + public static final int IMPORT_JS = 11; From 9094e69ddf871eb27bde8e3d2843dac3eac98b24 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 29 Sep 2022 14:11:34 +0800 Subject: [PATCH 044/310] =?UTF-8?q?REPORT-75998=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=A8=A1=E6=9D=BFWeb=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E5=BC=95=E7=94=A8JS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../action/content/js/SearchWebJSAction.java | 20 +++++++ .../actions/replace/info/ReplaceObject.java | 58 ++++++++++++++++--- .../actions/replace/info/base/SearchTag.java | 4 ++ 3 files changed, 75 insertions(+), 7 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchWebJSAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchWebJSAction.java index 0ceec53617..725d1280db 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchWebJSAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchWebJSAction.java @@ -4,6 +4,7 @@ import com.fr.design.actions.replace.info.JSInfo; import com.fr.design.actions.replace.info.base.ITContent; +import com.fr.design.actions.replace.info.base.SearchTag; import com.fr.design.actions.replace.utils.SearchJSUtils; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.JTemplate; @@ -19,6 +20,7 @@ import com.fr.report.web.util.ReportEngineEventMapping; import com.fr.web.attr.ReportWebAttr; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -86,12 +88,30 @@ public class SearchWebJSAction implements SearchJS { content.setTemplateName(jTemplate.getTemplateName()); content.setJumpAble(false); addWebContent2Array(webAttr); + //处理引用JS + dealImportJS(content,jsInfos,webAttr); for (int i = 0; i < arrayList.size(); i++) { addJSInfos2ListFromArray(content, jsInfos, arrayList.get(i)); } } } + private void dealImportJS(ITContent content, List jsInfos, ReportWebAttr webAttr) { + if (webAttr != null){ + for (String jsStr : webAttr.getJSImport()){ + ITContent jsContent = ITContent.copy(content); + jsContent.addOtherPos( + Toolkit.i18nText("Fine-Design_Basic_Report_Web_Attributes"), + Toolkit.i18nText("Fine-Design_Report_Import_JavaScript") + ); + jsContent.setReplaceObject(jsStr); + jsContent.setHoldObject(webAttr); + jsContent.setTag(SearchTag.IMPORT_JS); + jsInfos.add(new JSInfo(jsContent)); + } + } + } + private void addJSInfos2ListFromServerWebAttr(ITContent content, List jsInfos, WebContent webContent) { ITContent newContent = ITContent.copy(content); if (SERVER_MAP.containsKey(webContent.getClass().getSimpleName())) { diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java index 3d615e18a9..d803f31012 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java @@ -3,13 +3,16 @@ package com.fr.design.actions.replace.info; import com.fr.data.impl.DBTableData; import com.fr.design.actions.replace.utils.ShowValueUtils; import com.fr.form.event.Listener; +import com.fr.general.GeneralUtils; import com.fr.js.JavaScriptImpl; import com.fr.js.NameJavaScript; import com.fr.plugin.chart.base.VanChartHtmlLabel; import com.fr.stable.StringUtils; import com.fr.stable.collections.combination.Pair; +import com.fr.web.attr.ReportWebAttr; import org.jetbrains.annotations.Nullable; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -184,36 +187,77 @@ public enum ReplaceObject implements DealWithInfoValue { return StringUtils.equals(javaScript.getContent(), info.getContent().getOldShowStr()); } }, + /** + * 模板Web属性——引用JS + */ + IMPORT_JS("String") { + @Override + public Map getValue(Object... o) { + HashMap map = new HashMap<>(); + addValue2Map(contentKey, GeneralUtils.objectToString(o[0]), map); + return map; + } + + @Override + public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { + if (info.getContent().getHoldObject() instanceof ReportWebAttr) { + ReportWebAttr attr = (ReportWebAttr) info.getContent().getHoldObject(); + List jsImports = Arrays.asList(attr.getJSImport()); + String jsName = GeneralUtils.objectToString(info.getContent().getReplaceObject()); + for (int i = 0, len = jsImports.size(); i < len; i++) { + if (StringUtils.equals(jsImports.get(i), jsName)) { + jsImports.set(i, ShowValueUtils.replaceAll(jsName, findStr, replaceStr)); + } + } + attr.clearJSImportList(); + for (int i = 0, len = jsImports.size(); i < len; i++) { + attr.addJSImport(jsImports.get(i)); + } + } + } + + @Override + public String getInfoShowStr(Info info) { + return GeneralUtils.objectToString(info.getContent().getReplaceObject()); + } + + @Override + boolean check(Info info) { + return true; + } + }, /** * DBTableData——SQL */ DB_TABLE_DATA("DBTableData") { @Override - boolean check(Info info) { + boolean check (Info info){ DBTableData dbTableData = (DBTableData) info.getContent().getReplaceObject(); return StringUtils.equals(dbTableData.getQuery(), info.getContent().getOldShowStr()); } @Override - public Map getValue(Object... o) { + public Map getValue (Object...o){ HashMap map = new HashMap<>(); addValue2Map(contentKey, ((DBTableData) o[0]).getQuery(), map); return map; } @Override - public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { + public void setValue (Info info, String findStr, String + replaceStr, List < Pair < Integer, Integer >> operatorArray){ DBTableData dbTableData = (DBTableData) info.getContent().getReplaceObject(); info.updateOldStr(dbTableData.getQuery(), findStr); dbTableData.setQuery(ShowValueUtils.replaceAll(dbTableData.getQuery(), findStr, replaceStr)); - //todo DesignTableDataManager } @Override - public String getInfoShowStr(Info info) { + public String getInfoShowStr (Info info){ return info.getInfoShowStr(info); } - }; + } + + ; String name; @@ -256,4 +300,4 @@ public enum ReplaceObject implements DealWithInfoValue { abstract boolean check(Info info); -} + } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java index 956d3ff386..b5e202bcb1 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java @@ -52,6 +52,10 @@ public class SearchTag { * 数据字典-公式-实际值 */ public static final int DICT_PRODUCE = 10; + /** + * 引用JS + */ + public static final int IMPORT_JS = 11; From 8548304e6266631af204bc8ff46a68c1fe79f5c3 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 29 Sep 2022 14:22:14 +0800 Subject: [PATCH 045/310] =?UTF-8?q?REPORT-75998=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E9=83=A8=E5=88=86=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/actions/replace/info/ReplaceObject.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java index d803f31012..53bd77a4d1 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java @@ -244,8 +244,7 @@ public enum ReplaceObject implements DealWithInfoValue { } @Override - public void setValue (Info info, String findStr, String - replaceStr, List < Pair < Integer, Integer >> operatorArray){ + public void setValue (Info info, String findStr, String replaceStr, List < Pair < Integer, Integer >> operatorArray){ DBTableData dbTableData = (DBTableData) info.getContent().getReplaceObject(); info.updateOldStr(dbTableData.getQuery(), findStr); dbTableData.setQuery(ShowValueUtils.replaceAll(dbTableData.getQuery(), findStr, replaceStr)); @@ -255,9 +254,7 @@ public enum ReplaceObject implements DealWithInfoValue { public String getInfoShowStr (Info info){ return info.getInfoShowStr(info); } - } - - ; + }; String name; From c0ebf7f3cf9cabc0c550dd56d27277b630f2814b Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 29 Sep 2022 14:44:01 +0800 Subject: [PATCH 046/310] =?UTF-8?q?REPORT-75998=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=A0=A1=E9=AA=8C=E8=AE=A1=E6=95=B0=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../content/formula/template/SearchTemplateFormulaAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java index 0f9124721f..0dd6919558 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java @@ -107,7 +107,7 @@ public class SearchTemplateFormulaAction implements SearchTemplateFormula { } //数据校验 - for (int i = 0, len = attr.getValueVerifierCount(); i < len; i++) { + for (int i = 0, len = attr.getVerifierCount(); i < len; i++) { Verifier verifier = attr.getVerifier(i); if (verifier instanceof ValueVerifier) { ITContent content = ITContent.copy(sheetContent); From 34750dd81b6c50f2e67b2b388def15a0a0076345 Mon Sep 17 00:00:00 2001 From: "Link.Zhao" Date: Thu, 29 Sep 2022 15:18:33 +0800 Subject: [PATCH 047/310] =?UTF-8?q?REPORT-81241=E3=80=90=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E4=B8=AD=E5=BF=83=E6=96=AD=E7=BD=91=E5=90=8E=E7=9A=84?= =?UTF-8?q?=E9=87=8D=E6=96=B0=E5=8A=A0=E8=BD=BD=E6=97=A0=E5=8F=8D=E5=BA=94?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E4=B8=80=E4=BA=9Burl=E7=BC=96=E7=A0=81=20?= =?UTF-8?q?=E7=BB=99=E4=B8=80=E4=BA=9B=E5=B8=B8=E9=87=8F=E5=8A=A0=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/AlphaFineCloudConstants.java | 31 ++++++++++--------- .../alphafine/cell/model/RobotModel.java | 4 ++- .../manager/impl/ComplementAdviceManager.java | 2 +- .../manager/impl/SimilarSearchManager.java | 2 +- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java index 35b363eb71..6f8b296aaa 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java @@ -1,5 +1,6 @@ package com.fr.design.actions.help.alphafine; +import com.fr.design.i18n.Toolkit; import com.fr.general.CloudCenter; /** @@ -52,21 +53,21 @@ public class AlphaFineCloudConstants { } /** - * get PluginUrl + * 获取插件信息api */ public static String getPluginUrl() { return CloudCenter.getInstance().acquireUrlByKind(AF_PLUGIN_INFO); } /** - * get ReuseUrl + * 获取组件信息api */ public static String getReuseUrl() { return CloudCenter.getInstance().acquireUrlByKind(AF_REUSE_INFO); } /** - * get DocumentDocUrl + * 获取帮助文档url */ public static String getDocumentDocUrl() { return CloudCenter.getInstance().acquireUrlByKind(AF_DOC_VIEW); @@ -94,28 +95,28 @@ public class AlphaFineCloudConstants { } /** - * get CloudServerUrl + * 获取云端接口,用于上传alphafine搜索记录 */ public static String getCloudServerUrl() { return CloudCenter.getInstance().acquireUrlByKind(AF_RECORD); } /** - * get SearchApi + * 获取搜索api,输入搜索词,返回fr的相关功能 */ public static String getSearchApi() { return CloudCenter.getInstance().acquireUrlByKind(AF_CLOUD_SEARCH); } /** - * get SimilarSearchUrlPrefix + * 获取模糊搜索api前缀,输入搜索词,返回alphaFine相关内容,插件,文档,功能等 */ public static String getSimilarSearchUrlPrefix() { return CloudCenter.getInstance().acquireUrlByKind(AF_SIMILAR_SEARCH); } /** - * get ComplementAdviceSearchUrlPrefix + * 补全建议搜索结果 api,与AF_SIMILAR_SEARCH接口类似,但是返回的信息更全 */ public static String getComplementAdviceSearchUrlPrefix() { return CloudCenter.getInstance().acquireUrlByKind(AF_ADVICE_SEARCH); @@ -136,14 +137,14 @@ public class AlphaFineCloudConstants { } /** - * get AlphaGoToWeb + * 推荐搜索api,输入搜索词,返回猜你想搜的内容(html格式) */ public static String getAlphaGoToWeb() { return CloudCenter.getInstance().acquireUrlByKind(AF_GO_WEB); } /** - * get AlphaPreview + * 帆软智能客服页面url */ public static String getAlphaPreview() { return CloudCenter.getInstance().acquireUrlByKind(AF_PREVIEW); @@ -170,12 +171,12 @@ public class AlphaFineCloudConstants { String fillLearningPath = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_FILL_LEARNING_PATH); String apiSummary = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_API_SUMMARY); String monthlyDocument = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_MONTHLY_DOCUMENT); - return "[{\"name\":\"快速入门指南\", \"link\":\"" + quickStartUrl + "\"}," + - "{\"name\":\"报表应用学习路径\", \"link\":\"" + reportLearningPath + "\"}," + - "{\"name\":\"参数应用学习路径\", \"link\":\"" + parameterLearningPath + "\"}," + - "{\"name\":\"填报学习路径\", \"link\":\"" + fillLearningPath + "\"}," + - "{\"name\":\"API接口汇总\", \"link\":\"" + apiSummary + "\"}," + - "{\"name\":\"文档月刊\", \"link\":\"" + monthlyDocument + "\"} ]"; + return "[{\"name\":\"" + Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Quick_Start") + "\", \"link\":\"" + quickStartUrl + "\"}," + + "{\"name\":\"" + Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Report_Learning") + "\", \"link\":\"" + reportLearningPath + "\"}," + + "{\"name\":\"" + Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Parameter_Learning") + "\", \"link\":\"" + parameterLearningPath + "\"}," + + "{\"name\":\"" + Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Fill_Learning") + "\", \"link\":\"" + fillLearningPath + "\"}," + + "{\"name\":\"" + Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Api_Summary") + "\", \"link\":\"" + apiSummary + "\"}," + + "{\"name\":\"" + Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Monthly_Document") + "\", \"link\":\"" + monthlyDocument + "\"} ]"; } /** diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java index 4c304d107f..493bf0de7b 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.alphafine.cell.model; +import com.fr.base.login.ClientHelper; import com.fr.design.actions.help.alphafine.AlphaFineCloudConstants; import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.CellType; @@ -46,8 +47,9 @@ public class RobotModel extends AlphaCellModel { } public static String getContent(String titleStr) { + String encodedTitleStr = ClientHelper.urlEncode(titleStr, EncodeConstants.ENCODING_UTF_8); String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + titleStr); - String url = AlphaFineCloudConstants.getAlphaGoToWeb() + titleStr + "&token=" + token; + String url = AlphaFineCloudConstants.getAlphaGoToWeb() + encodedTitleStr + "&token=" + token; try { String result = HttpToolbox.get(url); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java index a00803210e..dbe810c8ea 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java @@ -43,7 +43,7 @@ public class ComplementAdviceManager { SearchResult searchResult = new SearchResult(); for (int j = 0; j < searchText.length; j++) { String msg = ClientHelper.urlEncode(searchText[j], EncodeConstants.ENCODING_UTF_8); - String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + msg); + String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + searchText[j]); String url = AlphaFineCloudConstants.getComplementAdviceSearchUrlPrefix() + "msg=" + msg + "&token=" + ClientHelper.urlEncode(token, EncodeConstants.ENCODING_UTF_8); try { String result = HttpToolbox.get(url); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java index 102ead1bb2..dc7866301e 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java @@ -50,7 +50,7 @@ public class SimilarSearchManager implements AlphaFineSearchProvider { SearchResult allModelList = new SearchResult(); for (int j = 0; j < searchText.length; j++) { String msg = ClientHelper.urlEncode(searchText[j], EncodeConstants.ENCODING_UTF_8); - String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + msg); + String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + searchText[j]); String url = AlphaFineCloudConstants.getSimilarSearchUrlPrefix() + "msg=" + msg + "&token=" + ClientHelper.urlEncode(token, EncodeConstants.ENCODING_UTF_8); try { String result = HttpToolbox.get(url); From 3d8e0d5e6336e4b25c51fa072cd8b08d15d0c8cb Mon Sep 17 00:00:00 2001 From: "Link.Zhao" Date: Thu, 29 Sep 2022 15:58:03 +0800 Subject: [PATCH 048/310] =?UTF-8?q?REPORT-81241=E3=80=90=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E4=B8=AD=E5=BF=83=E6=96=AD=E7=BD=91=E5=90=8E=E7=9A=84?= =?UTF-8?q?=E9=87=8D=E6=96=B0=E5=8A=A0=E8=BD=BD=E6=97=A0=E5=8F=8D=E5=BA=94?= =?UTF-8?q?=20=E5=88=A0=E9=99=A4json=E5=AD=97=E7=AC=A6=E4=B8=B2=EF=BC=8C?= =?UTF-8?q?=E7=94=A8jsonarry=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/AlphaFineCloudConstants.java | 36 ++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java index 6f8b296aaa..9fb243d1e8 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java @@ -2,6 +2,10 @@ package com.fr.design.actions.help.alphafine; import com.fr.design.i18n.Toolkit; import com.fr.general.CloudCenter; +import com.fr.json.JSONArray; + +import java.util.HashMap; +import java.util.Map; /** * 云端变量统一管理 @@ -38,6 +42,9 @@ public class AlphaFineCloudConstants { private static final String AF_HELP_MONTHLY_DOCUMENT = "af.help.monthly.document"; private static final String AF_RECOMMEND = "af.recommend"; + private static final String LINK_NAME = "name"; + private static final String LINK_URL = "link"; + /** * 获取插件搜索api */ @@ -165,18 +172,23 @@ public class AlphaFineCloudConstants { } private static String getDefaultRecommend() { - String quickStartUrl = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_QUICK_START); - String reportLearningPath = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_REPORT_LEARNING_PATH); - String parameterLearningPath = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_PARAM_LEARNING_PATH); - String fillLearningPath = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_FILL_LEARNING_PATH); - String apiSummary = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_API_SUMMARY); - String monthlyDocument = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_MONTHLY_DOCUMENT); - return "[{\"name\":\"" + Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Quick_Start") + "\", \"link\":\"" + quickStartUrl + "\"}," + - "{\"name\":\"" + Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Report_Learning") + "\", \"link\":\"" + reportLearningPath + "\"}," + - "{\"name\":\"" + Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Parameter_Learning") + "\", \"link\":\"" + parameterLearningPath + "\"}," + - "{\"name\":\"" + Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Fill_Learning") + "\", \"link\":\"" + fillLearningPath + "\"}," + - "{\"name\":\"" + Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Api_Summary") + "\", \"link\":\"" + apiSummary + "\"}," + - "{\"name\":\"" + Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Monthly_Document") + "\", \"link\":\"" + monthlyDocument + "\"} ]"; + String[][] links = new String[][]{ + {Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Quick_Start"), CloudCenter.getInstance().acquireUrlByKind(AF_HELP_QUICK_START)}, + {Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Report_Learning"), CloudCenter.getInstance().acquireUrlByKind(AF_HELP_REPORT_LEARNING_PATH)}, + {Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Parameter_Learning"), CloudCenter.getInstance().acquireUrlByKind(AF_HELP_PARAM_LEARNING_PATH)}, + {Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Fill_Learning"), CloudCenter.getInstance().acquireUrlByKind(AF_HELP_FILL_LEARNING_PATH)}, + {Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Api_Summary"), CloudCenter.getInstance().acquireUrlByKind(AF_HELP_API_SUMMARY)}, + {Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Monthly_Document"), CloudCenter.getInstance().acquireUrlByKind(AF_HELP_MONTHLY_DOCUMENT)} + }; + JSONArray jsonArray = new JSONArray(); + for (String[] link : links) { + Map map = new HashMap<>(); + map.put(LINK_NAME, link[0]); + map.put(LINK_URL, link[1]); + jsonArray.put(map); + } + + return jsonArray.toString(); } /** From 5c716eb147fc6032a824395baa85f9de91c7181e Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 29 Sep 2022 17:36:40 +0800 Subject: [PATCH 049/310] =?UTF-8?q?REPORT-75998=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=9F=A5=E6=89=BE=E5=AE=8C=E6=88=90=E5=90=8E=E6=89=93=E5=BC=80?= =?UTF-8?q?=E6=96=B0=E6=A8=A1=E6=9D=BF=E6=97=A0=E6=9F=A5=E6=89=BE=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E4=B8=8D=E7=AC=A6=E7=9A=84=E6=8F=90=E7=A4=BA=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BE=93=E5=85=A5img=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E4=B8=8D=E6=AD=A3=E7=A1=AE=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../replace/ui/ITReplaceMainDialog.java | 55 ++++----- .../actions/replace/ui/ITTableButton.java | 9 +- .../actions/replace/utils/ShowValueUtils.java | 108 ++++++++++++++++-- 3 files changed, 130 insertions(+), 42 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index 4843df57f4..54e6a3bff4 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -48,13 +48,14 @@ public class ITReplaceMainDialog extends UIDialog { private static boolean matched = false; private static volatile ITReplaceMainDialog instance = null; private static String templateID; + private static String templateName; private ITReplaceNorthPanel northPane; private ITReplaceSouthPanel southPanel; private ITReplaceWestPanel westPanel; private boolean searchFlag; private String searchStr; private static final int FIRST_ROW = 0; - public static int selectCount = 0; + public static int selectCount = 0; public ITReplaceMainDialog() { super(DesignerContext.getDesignerFrame()); @@ -165,8 +166,9 @@ public class ITReplaceMainDialog extends UIDialog { String searchStr = ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).getText(); String replaceStr = ((UITextField) (northPane.getReplaceInputCombobox().getEditor().getEditorComponent())).getText(); //替换内容为空需要触发搜索 - if (StringUtils.equals(getSearchStr(), searchStr) && StringUtils.isNotEmpty(replaceStr)) { - if (isITReplaceValid() && checkTemplateChanged(searchResultList)) { + if (isITReplaceValid() && checkTemplateChanged(searchResultList)) { + if (StringUtils.equals(getSearchStr(), searchStr) && StringUtils.isNotEmpty(replaceStr)) { + HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(true); for (Info info : searchResultList) { if (info.getContent().isSelected()) { info.setValue(info, searchStr, replaceStr, info.getContent().getOperatorArray()); @@ -175,29 +177,26 @@ public class ITReplaceMainDialog extends UIDialog { southPanel.getTableEditorPane().update(); northPane.refreshReplaceInputComboBoxItems(); ITTableEditorPane.getEditTable().repaint(); - HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(true); setSearchFlag(false); - search(); - } else { - Object[] options = new Object[]{Toolkit.i18nText("Fine-Design_Replace_Search_Again"), Toolkit.i18nText("Fine-Design_Basic_Cancel")}; - int optionSelected = FineJOptionPane.showOptionDialog( - ITReplaceMainDialog.this, - Toolkit.i18nText("Fine-Design_Replace_Message"), - Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), - JOptionPane.YES_NO_CANCEL_OPTION, - JOptionPane.ERROR_MESSAGE, - null, - // 如果传null, 则按钮为 optionType 类型所表示的按钮(也就是确认对话框) - options, - options[0] - ); - //如果选择了重新查找,则再查找一遍 - if (optionSelected == 0) { - search(); - } } - } else { search(); + } else { + Object[] options = new Object[]{Toolkit.i18nText("Fine-Design_Replace_Search_Again"), Toolkit.i18nText("Fine-Design_Basic_Cancel")}; + int optionSelected = FineJOptionPane.showOptionDialog( + ITReplaceMainDialog.this, + Toolkit.i18nText("Fine-Design_Replace_Message"), + Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), + JOptionPane.YES_NO_CANCEL_OPTION, + JOptionPane.ERROR_MESSAGE, + null, + // 如果传null, 则按钮为 optionType 类型所表示的按钮(也就是确认对话框) + options, + options[0] + ); + //如果选择了重新查找,则再查找一遍 + if (optionSelected == 0) { + search(); + } } @@ -220,7 +219,8 @@ public class ITReplaceMainDialog extends UIDialog { */ public boolean isITReplaceValid() { if (JTemplate.isValid(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate())) { - return StringUtils.equals(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTarget().getTemplateID(), templateID); + return StringUtils.equals(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTarget().getTemplateID(), templateID) + && StringUtils.equals(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplateName(), templateName); } else { return false; } @@ -288,6 +288,7 @@ public class ITReplaceMainDialog extends UIDialog { if (JTemplate.isValid(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate())) { JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); templateID = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTarget().getTemplateID(); + templateName = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplateName(); itTableEditor.clear(); String searchStr = ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).getText(); //更新搜索内容 @@ -310,12 +311,12 @@ public class ITReplaceMainDialog extends UIDialog { setSearchFlag(true); selectCount = searchResultList.size(); //如果有结果,默认选中第一行 - if (searchResultList.size() > 0){ - getEditTable().addRowSelectionInterval(FIRST_ROW,FIRST_ROW); + if (searchResultList.size() > 0) { + getEditTable().addRowSelectionInterval(FIRST_ROW, FIRST_ROW); } //更新替换按钮可用性 - if (StringUtils.isEmpty(searchStr) || searchResultList.size() == 0){ + if (StringUtils.isEmpty(searchStr) || searchResultList.size() == 0) { northPane.getReplaceButton().setEnabled(false); } else { northPane.getReplaceButton().setEnabled(true); diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java index 03717a725c..d64946d09d 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java @@ -6,13 +6,14 @@ import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; -import com.fr.design.mainframe.ReportComponentComposite; +import com.fr.file.FILEFactory; import com.fr.general.GeneralUtils; import com.fr.stable.StringUtils; +import com.fr.stable.project.ProjectConstants; + import javax.swing.AbstractCellEditor; import javax.swing.JTable; -import javax.swing.SwingUtilities; import javax.swing.table.TableCellEditor; import javax.swing.table.TableCellRenderer; import java.awt.Component; @@ -42,7 +43,9 @@ public class ITTableButton extends AbstractCellEditor implements TableCellEditor ITContent content = (ITContent) getEditTable().getValueAt(getEditTable().getEditingRow(), 6); if (StringUtils.isNotEmpty(GeneralUtils.objectToString(content.getTrlString()))) { ITReplaceMainDialog.setITReplaceFlag(true); - HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().navigate(new TRL(GeneralUtils.objectToString(content.getTrlString()))); + TRL trl = new TRL(GeneralUtils.objectToString(content.getTrlString())); + DesignerContext.getDesignerFrame().openTemplate(FILEFactory.createFILE(ProjectConstants.REPORTLETS_NAME + FILEFactory.SEPARATOR + content.getTemplateName())); + HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().navigate(trl); } ITReplaceMainDialog.setITReplaceFlag(false); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java index 19ab2758f3..6c7b16cdd1 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java @@ -28,6 +28,25 @@ public class ShowValueUtils { public static final String ANY_THING_REGEX = "."; public static final String NUMBER_REGEX = "[0-9]"; public static final String ENGLISH_REGEX = "[a-zA-Z]"; + public static final char LEFT_HTML_CHAR = '<'; + public static final char RIGHT_HTML_CHAR = '>'; + public static final String HEAD = ""; + public static final String TAIL = ""; + public static final String FONT_HEAD = ""; + public static final String FONT_TAIL = ""; + public static final String HTML = ""; + public static final String NOBR = ""; + public static final String HTML_TAIL = ""; + public static final String NOBR_TAIL = ""; + public static final int HEAD_LEN = HEAD.length(); + public static final int TAIL_LEN = TAIL.length(); + public static final int FONT_HEAD_LEN = FONT_HEAD.length(); + public static final int FONT_TAIL_LEN = FONT_TAIL.length(); + public static final int HTML_LEN = HTML.length(); + public static final int HTML_TAIL_LEN = HTML_TAIL.length(); + public static final int NOBR_LEN = NOBR.length(); + public static final int NOBR_TAIL_LEN = NOBR_TAIL.length(); + public static Pattern containPattern; private static List specialCharList = new ArrayList<>(); @@ -135,33 +154,97 @@ public class ShowValueUtils { String result = str; Pattern pattern = containPattern; Matcher matcher = pattern.matcher(str); - String head = ""; - String tail = ""; - int size = head.length() + tail.length(); + int size = FONT_HEAD.length() + FONT_TAIL.length(); int index = 0; StringBuilder builder = new StringBuilder(str); while (matcher.find()) { - builder.replace(matcher.start() + index, matcher.end() + index, head + changeHtmlStr(matcher.group()) + tail); + builder.replace(matcher.start() + index, matcher.end() + index, FONT_HEAD + changeHtmlStr(matcher.group()) + FONT_TAIL); index += size; + index += getIncreaseCount(matcher.group()); } - return "
" + - builder.toString() + - "
"; + + return changeOriginHtmlStr(HEAD + builder.toString() + TAIL); } else { - return "
" + - replaceAll(str, searchStr, "" + changeHtmlStr(searchStr) + "") + - "
"; + String ans = HEAD + replaceAll(str, searchStr, FONT_HEAD + changeHtmlStr(searchStr) + FONT_TAIL) + TAIL; + return changeOriginHtmlStr(ans); + } + + } + + /** + * 用于处理原字符串中的尖括号 + */ + private static String changeOriginHtmlStr(String str) { + int count = 0; + int different = 3; + StringBuilder builder = new StringBuilder(str); + for (int i = 0; i < str.length(); i++) { + char c = str.charAt(i); + if (c == LEFT_HTML_CHAR) { + if (!checkValid(str, i)) { + builder.replace(i + count, i + count + 1, "<"); + count += different; + } + } } + return builder.toString(); + } + private static boolean checkValid(String str, int i) { + int leftLen = str.length() - (i + 1); + return checkStrValid(str, i, leftLen, HTML_LEN, HTML) || + checkStrValid(str, i, leftLen, HTML_TAIL_LEN, HTML_TAIL) || + checkStrValid(str, i, leftLen, FONT_HEAD_LEN, FONT_HEAD) || + checkStrValid(str, i, leftLen, FONT_TAIL_LEN, FONT_TAIL) || + checkStrValid(str, i, leftLen, NOBR_LEN, NOBR) || + checkStrValid(str, i, leftLen, NOBR_TAIL_LEN, NOBR_TAIL); } - private static String changeHtmlStr(String searchStr){ + /** + * 是否是所指定的字符串 + * + * @param str + * @param i + * @param leftLen + * @return + */ + private static boolean checkStrValid(String str, int i, int leftLen, int len, String checkStr) { + if (leftLen < len - 1) { + return false; + } else { + return StringUtils.equals(str.substring(i, i + len), checkStr); + } + } + + + /** + * 用于处理搜索的字符中的尖括号 + * + * @param searchStr + * @return + */ + private static String changeHtmlStr(String searchStr) { String showStr = searchStr; - showStr = showStr.replace("<","<"); + showStr = showStr.replace("<", "<"); showStr = showStr.replace(">", ">"); return showStr; } + private static int getIncreaseCount(String str) { + int count = 0; + int leftDifferent = 3; + int rightDifferent = 2; + for (int i = 0; i < str.length(); i++) { + if (str.charAt(i) == LEFT_HTML_CHAR) { + count += leftDifferent; + } + if (str.charAt(i) == RIGHT_HTML_CHAR) { + count += rightDifferent; + } + } + return count; + } + /** * 集合是否不为空 * @@ -193,6 +276,7 @@ public class ShowValueUtils { /** * 支持通配符的contains + * * @param originStr * @param matchStr * @return From 0afa23c3c33303301601d293090b6e3e9fe38acd Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Fri, 30 Sep 2022 10:32:30 +0800 Subject: [PATCH 050/310] =?UTF-8?q?REPORT-75998=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E9=9D=A2=E6=9D=BF=E4=B8=8D=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=9A=84bug=E3=80=81=E4=BC=98=E5=8C=96=E9=AD=94?= =?UTF-8?q?=E6=9C=AF=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/replace/info/ReplaceObject.java | 7 +++++++ .../actions/replace/utils/ShowValueUtils.java | 18 +++++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java index 53bd77a4d1..48a4dbf644 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java @@ -1,7 +1,10 @@ package com.fr.design.actions.replace.info; import com.fr.data.impl.DBTableData; +import com.fr.design.DesignModelAdapter; import com.fr.design.actions.replace.utils.ShowValueUtils; +import com.fr.design.data.DesignTableDataManager; +import com.fr.design.data.datapane.TableDataTreePane; import com.fr.form.event.Listener; import com.fr.general.GeneralUtils; import com.fr.js.JavaScriptImpl; @@ -248,6 +251,10 @@ public enum ReplaceObject implements DealWithInfoValue { DBTableData dbTableData = (DBTableData) info.getContent().getReplaceObject(); info.updateOldStr(dbTableData.getQuery(), findStr); dbTableData.setQuery(ShowValueUtils.replaceAll(dbTableData.getQuery(), findStr, replaceStr)); + //清除缓存 + DesignTableDataManager.removeSelectedColumnNames(dbTableData.getName()); + //收缩菜单 + TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).refreshDockingView(); } @Override diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java index 6c7b16cdd1..d7baa0a733 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java @@ -46,6 +46,14 @@ public class ShowValueUtils { public static final int HTML_TAIL_LEN = HTML_TAIL.length(); public static final int NOBR_LEN = NOBR.length(); public static final int NOBR_TAIL_LEN = NOBR_TAIL.length(); + /** + * <转变为<的长度差 + */ + public static final int LEFT_DIFFERENT = 3; + /** + * >转变为>的长度差 + */ + public static final int RIGHT_DIFFERENT = 2; public static Pattern containPattern; private static List specialCharList = new ArrayList<>(); @@ -168,7 +176,6 @@ public class ShowValueUtils { String ans = HEAD + replaceAll(str, searchStr, FONT_HEAD + changeHtmlStr(searchStr) + FONT_TAIL) + TAIL; return changeOriginHtmlStr(ans); } - } /** @@ -176,14 +183,13 @@ public class ShowValueUtils { */ private static String changeOriginHtmlStr(String str) { int count = 0; - int different = 3; StringBuilder builder = new StringBuilder(str); for (int i = 0; i < str.length(); i++) { char c = str.charAt(i); if (c == LEFT_HTML_CHAR) { if (!checkValid(str, i)) { builder.replace(i + count, i + count + 1, "<"); - count += different; + count += LEFT_DIFFERENT; } } } @@ -232,14 +238,12 @@ public class ShowValueUtils { private static int getIncreaseCount(String str) { int count = 0; - int leftDifferent = 3; - int rightDifferent = 2; for (int i = 0; i < str.length(); i++) { if (str.charAt(i) == LEFT_HTML_CHAR) { - count += leftDifferent; + count += LEFT_DIFFERENT; } if (str.charAt(i) == RIGHT_HTML_CHAR) { - count += rightDifferent; + count += RIGHT_DIFFERENT; } } return count; From ac7943ba9acb7bc079e6b331901135d1fff8146a Mon Sep 17 00:00:00 2001 From: "Link.Zhao" Date: Fri, 30 Sep 2022 10:56:56 +0800 Subject: [PATCH 051/310] =?UTF-8?q?REPORT-81483=E3=80=90=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=9111.0?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=9C=80=E8=A6=81=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E6=90=9C=E7=B4=A210.0&11.0=E7=9A=84=E6=A8=A1=E6=9D=BF=201?= =?UTF-8?q?=E3=80=81=E4=BF=AE=E6=94=B9=E4=BA=86=E8=AF=B7=E6=B1=82=E5=8F=82?= =?UTF-8?q?=E6=95=B0=202=E3=80=81=E4=BF=AE=E6=94=B9=E4=BA=86=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E7=BC=96=E7=A0=81=E6=96=B9=E5=BC=8F=203=E3=80=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E9=87=8D=E8=BD=BD=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=E6=B7=BB=E5=8A=A0=E9=87=8D=E8=BD=BD=E5=8A=A8=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/component/AlphaFineFrame.java | 2 +- .../search/helper/FineMarketClientHelper.java | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java index 0269480b60..e74108fee9 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java @@ -915,7 +915,7 @@ public class AlphaFineFrame extends JFrame { if (StringUtils.isEmpty(text)) { return; } - searchLoadingPane = new SearchLoadingPane(); + initSearchLoadingPane(); SearchTextBean searchTextBean = new SearchTextBean(text, segmentationResult); this.productNewsSearchWorkerManager.doSearch(searchTextBean); this.documentWorkerManager.doSearch(searchTextBean); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java index 42b28cfe8a..817a47cca4 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java @@ -50,13 +50,11 @@ public class FineMarketClientHelper { private static final String CERTIFICATE_PUBLIC_KEY = FineMarketPublicKeyHolder.getInstance().getDefaultKey(); public static final String FINE_MARKET_TEMPLATE_INFO = CloudCenter.getInstance().acquireUrlByKind("market.template.info"); public static final String FINE_MARKET_TEMPLATE_URL = CloudCenter.getInstance().acquireUrlByKind("market.template.url"); - public static final String VERSION = "version"; - private static final String CURRENT_VERSION = "11.0"; public static final String FILE_DOWNLOAD = "file/download/"; public static final String PACKAGE_DOWNLOAD = "package/download/"; public static final String TEMPLATES_PARENT_PACKAGE = "parent/"; public static final String TEMPLATES_TAGS = "filter"; - public static final String NAME_SEARCH = "searchKeyword"; + public static final String NAME_SEARCH = "?searchKeyword="; public static final String RESPONSE_STATE = "state"; public static final String RESPONSE_SUCCESS = "ok"; @@ -271,11 +269,12 @@ public class FineMarketClientHelper { } } + /** + * 通过名字搜索模板信息 + */ public @Nullable JSONArray getTemplateInfoByName(String name) throws IOException { - Map params = new HashMap(); - params.put(NAME_SEARCH, name); - params.put(VERSION, CURRENT_VERSION); - String jsonString = HttpToolbox.get(FINE_MARKET_TEMPLATE_INFO, params); + String url = FINE_MARKET_TEMPLATE_INFO + NAME_SEARCH + ClientHelper.urlEncode(name, EncodeConstants.ENCODING_UTF_8); + String jsonString = HttpToolbox.get(url); JSONObject jsonObject = new JSONObject(jsonString); String responseState = (String) jsonObject.get(RESPONSE_STATE); if (RESPONSE_SUCCESS.equals(responseState)) { From 03e4e616d290e63c7c9d2e1d8aacdd44c738ad9c Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Fri, 30 Sep 2022 11:30:46 +0800 Subject: [PATCH 052/310] =?UTF-8?q?REPORT-81416=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E9=97=AA=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/carton/EventDispatchThreadHangMonitor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/carton/EventDispatchThreadHangMonitor.java b/designer-base/src/main/java/com/fr/design/carton/EventDispatchThreadHangMonitor.java index f472d901a1..56ccaa2c48 100644 --- a/designer-base/src/main/java/com/fr/design/carton/EventDispatchThreadHangMonitor.java +++ b/designer-base/src/main/java/com/fr/design/carton/EventDispatchThreadHangMonitor.java @@ -7,7 +7,6 @@ import com.fr.stable.ArrayUtils; import com.fr.stable.ProductConstantsBase; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; -import com.fr.third.ibm.icu.text.SimpleDateFormat; import org.jetbrains.annotations.NotNull; import javax.swing.SwingUtilities; @@ -22,6 +21,7 @@ import java.io.IOException; import java.lang.management.ManagementFactory; import java.lang.management.ThreadInfo; import java.lang.management.ThreadMXBean; +import java.text.SimpleDateFormat; import java.util.LinkedList; import java.util.Timer; import java.util.TimerTask; From 1023ff0713ac4c656b370f9620ea9644b032f66d Mon Sep 17 00:00:00 2001 From: "Link.Zhao" Date: Fri, 30 Sep 2022 14:36:14 +0800 Subject: [PATCH 053/310] =?UTF-8?q?REPORT-81222=E3=80=90=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=8E=92=E5=BA=8F=E5=85=88=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E9=A6=96=E4=B8=AA=E5=86=8D=E7=82=B9=E5=87=BB=E6=9C=80=E5=90=8E?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=EF=BC=8C=E4=B8=8A=E4=B8=8B=E7=AE=AD=E5=A4=B4?= =?UTF-8?q?=E7=BD=AE=E7=81=B0=E6=98=BE=E7=A4=BA=E6=9C=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 按钮交互逻bug --- .../actions/help/alphafine/component/CustomSortPane.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java index 747b8d8ce0..adb63730de 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java @@ -153,7 +153,11 @@ public class CustomSortPane extends JPanel { if (order == 0) { top.setEnabled(false); up.setEnabled(false); + down.setEnabled(true); + bottom.setEnabled(true); } else if (order == sortItemPane.getComponentCount() - 1) { + up.setEnabled(true); + top.setEnabled(true); down.setEnabled(false); bottom.setEnabled(false); } else { From 3ce6caba58ad04bfb4abf8250f472ed240241fd8 Mon Sep 17 00:00:00 2001 From: "Link.Zhao" Date: Fri, 30 Sep 2022 14:46:03 +0800 Subject: [PATCH 054/310] =?UTF-8?q?REPORT-81222=E3=80=90=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=8E=92=E5=BA=8F=E5=85=88=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E9=A6=96=E4=B8=AA=E5=86=8D=E7=82=B9=E5=87=BB=E6=9C=80=E5=90=8E?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=EF=BC=8C=E4=B8=8A=E4=B8=8B=E7=AE=AD=E5=A4=B4?= =?UTF-8?q?=E7=BD=AE=E7=81=B0=E6=98=BE=E7=A4=BA=E6=9C=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 按钮交互逻bug --- .../alphafine/component/CustomSortPane.java | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java index adb63730de..c544bbac0b 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java @@ -85,6 +85,7 @@ public class CustomSortPane extends JPanel { top.addActionListener(e -> { SwingUtilities.invokeLater(() -> { sortItemPane.setComponentZOrder(selectedLabel, 0); + setToolbarEnable(false, false, true, true); CustomSortPane.this.revalidate(); CustomSortPane.this.repaint(); refreshCurrentOrder(); @@ -94,6 +95,7 @@ public class CustomSortPane extends JPanel { bottom.addActionListener(e -> { SwingUtilities.invokeLater(() -> { sortItemPane.setComponentZOrder(selectedLabel, sortItemPane.getComponentCount() - 1); + setToolbarEnable(true, true, false, false); CustomSortPane.this.revalidate(); CustomSortPane.this.repaint(); refreshCurrentOrder(); @@ -103,6 +105,7 @@ public class CustomSortPane extends JPanel { up.addActionListener(e -> { SwingUtilities.invokeLater(() -> { sortItemPane.setComponentZOrder(selectedLabel, sortItemPane.getComponentZOrder(selectedLabel) - 1); + setToolbarEnable(true, true, true, true); CustomSortPane.this.revalidate(); CustomSortPane.this.repaint(); refreshCurrentOrder(); @@ -112,6 +115,7 @@ public class CustomSortPane extends JPanel { down.addActionListener(e -> { SwingUtilities.invokeLater(() -> { sortItemPane.setComponentZOrder(selectedLabel, sortItemPane.getComponentZOrder(selectedLabel) + 1); + setToolbarEnable(true, true, true, true); CustomSortPane.this.revalidate(); CustomSortPane.this.repaint(); refreshCurrentOrder(); @@ -151,23 +155,26 @@ public class CustomSortPane extends JPanel { private void disableButton() { int order = sortItemPane.getComponentZOrder(selectedLabel); if (order == 0) { - top.setEnabled(false); - up.setEnabled(false); - down.setEnabled(true); - bottom.setEnabled(true); + setToolbarEnable(false, false, true, true); } else if (order == sortItemPane.getComponentCount() - 1) { - up.setEnabled(true); - top.setEnabled(true); - down.setEnabled(false); - bottom.setEnabled(false); + setToolbarEnable(true, true, false, false); } else { - up.setEnabled(true); - top.setEnabled(true); - down.setEnabled(true); - bottom.setEnabled(true); + setToolbarEnable(true, true, true, true); } } + /** + * 设置 置顶,上移,下移,置底 按钮的状态 + * true:启用 + * false:关闭 + */ + private void setToolbarEnable(boolean top, boolean up, boolean down, boolean bottom) { + this.top.setEnabled(top); + this.up.setEnabled(up); + this.down.setEnabled(down); + this.bottom.setEnabled(bottom); + } + private void refreshCurrentOrder() { String[] currentTabOrder = parentPane.getCurrentOrder(); HashSet selectedTab = new HashSet<>(); From 9d4d5f6473a2c1b6b52aa3cf124a90a856014074 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Fri, 30 Sep 2022 14:55:57 +0800 Subject: [PATCH 055/310] =?UTF-8?q?REPORT-75998=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=A4=9A=E7=BA=A7=E8=8F=9C=E5=8D=95=E4=B8=8B=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../replace/action/content/cell/SearchCellAction.java | 1 + .../content/component/SearchComponentAction.java | 1 + .../content/floatelement/SearchFloatAction.java | 1 + .../action/content/widget/SearchWidgetAction.java | 1 + .../design/actions/replace/info/base/ITContent.java | 11 +++++++++++ .../fr/design/actions/replace/ui/ITTableButton.java | 2 +- 6 files changed, 16 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/cell/SearchCellAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/cell/SearchCellAction.java index 826b247e0c..2711069847 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/cell/SearchCellAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/cell/SearchCellAction.java @@ -61,6 +61,7 @@ public class SearchCellAction implements SearchAction { ITContent content = new ITContent(); content.setTemplateName(jTemplate.getTemplateName()); content.addTRL(jTemplate.getTemplateName()); + content.setTemplatePath(jTemplate.getPath()); if (jTemplate.getTarget() instanceof Form) { setCellInfos(dealForm(jTemplate)); } else if (jTemplate.getTarget() instanceof WorkBook) { diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/component/SearchComponentAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/component/SearchComponentAction.java index 336aa93745..fd741fdf7e 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/component/SearchComponentAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/component/SearchComponentAction.java @@ -50,6 +50,7 @@ public class SearchComponentAction implements SearchAction { Form form = (Form) jTemplate.getTarget(); ITContent content = new ITContent(); content.setTemplateName(jTemplate.getTemplateName()); + content.setTemplatePath(jTemplate.getPath()); content.addTRL(jTemplate.getTemplateName()); content.setFrmFlag(true); //处理最底层form组件 diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/floatelement/SearchFloatAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/floatelement/SearchFloatAction.java index 4eaa574bea..13398be1f1 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/floatelement/SearchFloatAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/floatelement/SearchFloatAction.java @@ -44,6 +44,7 @@ public class SearchFloatAction implements SearchAction { Report report = workBook.getReport(i); ITContent content = new ITContent(); content.setTemplateName(jTemplate.getTemplateName()); + content.setTemplatePath(jTemplate.getPath()); content.setSheetID(String.valueOf(i)); content.setSheetName(workBook.getReportName(i)); content.addTRL(jTemplate.getTemplateName()); diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/widget/SearchWidgetAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/widget/SearchWidgetAction.java index 66ca91dd15..32a21bee54 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/widget/SearchWidgetAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/widget/SearchWidgetAction.java @@ -44,6 +44,7 @@ public class SearchWidgetAction implements SearchAction { ArrayList widgetInfos = new ArrayList<>(); ITContent content = new ITContent(); content.setTemplateName(jTemplate.getTemplateName()); + content.setTemplatePath(jTemplate.getPath()); //这边拿SearchCellAction里的CellInfo来查找,由于在SearchCellAction里面已经考虑了决策报表和普通报表两种情况了,这边就不用再做区分 addCellWidget2Array(widgetInfos, jTemplate); content.addTRL(jTemplate.getTemplateName()); diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/ITContent.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/ITContent.java index afa9847f37..ee83e77534 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/ITContent.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/ITContent.java @@ -19,6 +19,7 @@ public class ITContent implements Cloneable { private String sheetID; private String sheetName; private String templateName; + private String templatePath; private String blockName; /** * 一些不好定位的位置先用字符串展示出来就好 @@ -90,6 +91,7 @@ public class ITContent implements Cloneable { this.trlString = StringUtils.EMPTY; this.operatorArray = new ArrayList<>(); this.holdObject = new Object(); + this.templatePath = StringUtils.EMPTY; } @@ -117,6 +119,7 @@ public class ITContent implements Cloneable { result.setJumpAble(content.isJumpAble()); result.setHoldObject(content.getHoldObject()); result.setTag(content.getTag()); + result.setTemplatePath(content.getTemplatePath()); } return result; } @@ -205,6 +208,14 @@ public class ITContent implements Cloneable { this.showObject = showObject; } + public String getTemplatePath() { + return templatePath; + } + + public void setTemplatePath(String templatePath) { + this.templatePath = templatePath; + } + /** * 添加位置信息 * diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java index d64946d09d..1a73d3fcb3 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java @@ -44,7 +44,7 @@ public class ITTableButton extends AbstractCellEditor implements TableCellEditor if (StringUtils.isNotEmpty(GeneralUtils.objectToString(content.getTrlString()))) { ITReplaceMainDialog.setITReplaceFlag(true); TRL trl = new TRL(GeneralUtils.objectToString(content.getTrlString())); - DesignerContext.getDesignerFrame().openTemplate(FILEFactory.createFILE(ProjectConstants.REPORTLETS_NAME + FILEFactory.SEPARATOR + content.getTemplateName())); + DesignerContext.getDesignerFrame().openTemplate(FILEFactory.createFILE(content.getTemplatePath())); HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().navigate(trl); } ITReplaceMainDialog.setITReplaceFlag(false); From 05aad1deddada9f60b4474d1b7c5cfc588ac0e36 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Fri, 30 Sep 2022 16:19:17 +0800 Subject: [PATCH 056/310] =?UTF-8?q?REPORT-75998=20=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E6=AD=A3=E5=88=99=E8=A1=A8=E8=BE=BE=E5=BC=8F=E5=8C=B9=E9=85=8D?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E3=80=81=E5=A2=9E=E5=8A=A0=E6=8E=A7=E4=BB=B6=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E5=9B=9E=E8=B0=83=E5=87=BD=E6=95=B0=E4=B8=AD?= =?UTF-8?q?=E7=9A=84JS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SearchExportJSFormulaAction.java | 6 +- .../actions/replace/utils/SearchJSUtils.java | 25 ++++ .../actions/replace/utils/ShowValueUtils.java | 8 +- .../replace/utils/ShowValueUtilsTest.java | 107 ++++++++++++++++++ 4 files changed, 143 insertions(+), 3 deletions(-) create mode 100644 designer-realize/src/test/java/com/fr/design/actions/replace/utils/ShowValueUtilsTest.java diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchExportJSFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchExportJSFormulaAction.java index d19970c218..32b5721a52 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchExportJSFormulaAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchExportJSFormulaAction.java @@ -27,7 +27,7 @@ public class SearchExportJSFormulaAction implements SearchJSFormula { @Override public void searchJSFormulaFromOther(List formulaInfos, ITContent content, JavaScript javaScript) { - //如果导出当前模板,可以存公式的地方就是命名方式-自定义 + //如果导出当前模板,可以存公式的地方就是命名方式-自定义、参数设置 if (((ExportJavaScript) javaScript).isCurrentTemplate()) { content.addOtherPos(Toolkit.i18nText("Fine-Design_Basic_Export_JS_Template_Current")); dealSingleJavaScript(formulaInfos, content, ((ExportJavaScript) javaScript).getCurrentTemplateJavaScript()); @@ -42,6 +42,8 @@ public class SearchExportJSFormulaAction implements SearchJSFormula { } } + + public boolean isListExist(List list) { return list != null && list.size() > 0; } @@ -57,8 +59,8 @@ public class SearchExportJSFormulaAction implements SearchJSFormula { formulaInfos.add(new FormulaInfo(newContent)); } if (!javaScript.isExtendParameters()) { - ITContent paraContent = ITContent.copy(content); for (ParameterProvider parameter : javaScript.getParameters()) { + ITContent paraContent = ITContent.copy(content); if (parameter.getValue() instanceof Formula) { paraContent.addOtherPos(Toolkit.i18nText("Fine-Design_Basic_Base_Value")); paraContent.setReplaceObject(parameter.getValue()); diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java index a63dabeb77..d04b02aa26 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java @@ -12,6 +12,7 @@ import com.fr.design.i18n.Toolkit; import com.fr.form.event.Listener; import com.fr.form.ui.Widget; import com.fr.general.GeneralUtils; +import com.fr.js.Commit2DBJavaScript; import com.fr.js.JavaScript; import com.fr.js.JavaScriptImpl; import com.fr.js.NameJavaScript; @@ -49,10 +50,34 @@ public class SearchJSUtils { ITContent newContent = ITContent.copy(content); newContent.setReplaceObject(listener); SearchJSUtils.addJSInfos(jsInfos, new JSInfo(newContent)); + } else if (javaScript instanceof Commit2DBJavaScript){ + dealCommit2DBJS(jsInfos, content, (Commit2DBJavaScript) javaScript); } } } + private static void dealCommit2DBJS(List jsInfos, ITContent content, Commit2DBJavaScript javaScript) { + if (!javaScript.getDBManipulation().isEmpty()) { + //处理回调函数 + dealWithCallBack(jsInfos, content, javaScript); + } + } + + private static void dealWithCallBack(List jsInfos, ITContent content, Commit2DBJavaScript commit2DBJavaScript) { + JavaScript javaScript = commit2DBJavaScript.getCallBack(); + ITContent newContent = ITContent.copy(content); + newContent.addOtherPos( + Toolkit.i18nText("Fine-Design_Basic_Set_Callback_Function") + ); + if (javaScript instanceof JavaScriptImpl) { + newContent.setReplaceObject(javaScript); + jsInfos.add(new JSInfo(newContent)); + } else if (javaScript instanceof Commit2DBJavaScript){ + dealCommit2DBJS(jsInfos, newContent, (Commit2DBJavaScript) javaScript); + } + } + + /** * 获取HtmlLabel数组 * diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java index d7baa0a733..b7b46539b3 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java @@ -59,9 +59,11 @@ public class ShowValueUtils { private static List specialCharList = new ArrayList<>(); static { - //正则特殊字符:? * () [] {} ^ $ . + //正则特殊字符:? * () [] {} ^ $ . \ + | //如果是? 并采用通配符 ,会自动转成“.” 所以 ? 不用处理 //$同理 + specialCharList.add("\\"); + specialCharList.add("/"); specialCharList.add("*"); specialCharList.add("("); specialCharList.add(")"); @@ -71,6 +73,10 @@ public class ShowValueUtils { specialCharList.add("}"); specialCharList.add("^"); specialCharList.add("."); + specialCharList.add("+"); + specialCharList.add("|"); + specialCharList.add("!"); + } /** diff --git a/designer-realize/src/test/java/com/fr/design/actions/replace/utils/ShowValueUtilsTest.java b/designer-realize/src/test/java/com/fr/design/actions/replace/utils/ShowValueUtilsTest.java new file mode 100644 index 0000000000..d31511bddc --- /dev/null +++ b/designer-realize/src/test/java/com/fr/design/actions/replace/utils/ShowValueUtilsTest.java @@ -0,0 +1,107 @@ +package com.fr.design.actions.replace.utils; + +import junit.framework.TestCase; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-09-30 + */ +public class ShowValueUtilsTest extends TestCase { + + + public void testChangeRegex() { + + /** + * 字符"." + */ + String regex = "."; + String str = "=\"通配符:我(){}[]是*cu/r?y+单!^个字|+符串/?\\?.\""; + Pattern pattern = Pattern.compile(ShowValueUtils.changeRegex(regex)); + Matcher matcher = pattern.matcher(str); + assertTrue(matcher.find()); + while (matcher.find()){ + assertEquals(".", matcher.group()); + } + + /** + * 字符"?" + */ + regex = "??."; + pattern =Pattern.compile(ShowValueUtils.changeRegex(regex)); + Matcher matcher1 = pattern.matcher(str); + assertTrue(matcher1.find()); + while (matcher1.find()){ + assertEquals("\\?.", matcher1.group()); + } + + /** + * 字符"\" + */ + regex = "?\\"; + pattern =Pattern.compile(ShowValueUtils.changeRegex(regex)); + Matcher matcher2 = pattern.matcher(str); + assertTrue(matcher2.find()); + while (matcher2.find()){ + assertEquals("?\\", matcher2.group()); + } + + /** + * 字符"/" + */ + regex = "/"; + pattern =Pattern.compile(ShowValueUtils.changeRegex(regex)); + Matcher matcher3 = pattern.matcher(str); + assertTrue(matcher3.find()); + while (matcher3.find()){ + assertEquals("/", matcher3.group()); + } + + /** + * 字符"*" + */ + regex = "*"; + pattern =Pattern.compile(ShowValueUtils.changeRegex(regex)); + Matcher matcher4 = pattern.matcher(str); + assertTrue(matcher4.find()); + while (matcher4.find()){ + assertEquals("*", matcher4.group()); + } + + /** + * 字符"(){}[]" + */ + regex = "(){}[]"; + pattern =Pattern.compile(ShowValueUtils.changeRegex(regex)); + Matcher matcher5 = pattern.matcher(str); + assertTrue(matcher5.find()); + while (matcher5.find()){ + assertEquals("(){}[]", matcher5.group()); + } + + /** + * 字符"^" + */ + regex = "!^"; + pattern =Pattern.compile(ShowValueUtils.changeRegex(regex)); + Matcher matcher6 = pattern.matcher(str); + assertTrue(matcher6.find()); + while (matcher6.find()){ + assertEquals("!^", matcher6.group()); + } + + /** + * 字符"|+" + */ + regex = "|+"; + pattern =Pattern.compile(ShowValueUtils.changeRegex(regex)); + Matcher matcher7 = pattern.matcher(str); + assertTrue(matcher7.find()); + while (matcher7.find()){ + assertEquals("|+", matcher7.group()); + } + } +} \ No newline at end of file From 5d8d998af3079ef02d7e77d22a8d31be716fb912 Mon Sep 17 00:00:00 2001 From: Starryi Date: Fri, 30 Sep 2022 17:43:14 +0800 Subject: [PATCH 057/310] =?UTF-8?q?REPORT-81336=20FR11=E5=86=B3=E7=AD=96?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E6=8A=A5=E8=A1=A8=E5=9D=97-=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E9=80=80=E5=87=BA=EF=BC=8C=E7=BC=96=E8=BE=91=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E4=B8=A2=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 1. 将主题应用到模板上时,需要遍历模板对象查找颜色对象,以更新 其颜色。优化后的更新方案,使用了基于clone的值修改,即利用clone 方法遍历执行特征,在FineColor等类的clone方法内,修改返回值的颜 色值,使得Form.clone可以返回一个应用了主题色的新表单对象。 于是就需要使用新的表单对象更新模板,以及设计器界面。 2. 撤销回退时,因为撤销前后模板的主题可能会发生变化,所以需要应用 新主题到模板。所以撤销回退时,需要调用setTemplateTheme 3. BUG发生的直接原因是当主题应用到模板上时,仅仅更新了target, 没有更新报表块编辑界面内ElementCase对象,导致后续在报表块上的更新 保存在了一个无效的,与Target失去联系的ElementCase上了 4. 还有一个BUG: 报表块的撤销回退,没有更新Target,仅仅更新了 ElementCase,导致后续主题更新以及主题色更新时,新Target基于 旧Target产生,所以新Target中的ElementCase还是旧的ElementCase, 从而报表块内的撤销回退无效. 【改动思路】 1. 当编辑报表块时更新主题,需要更新报表块编辑界面内的ElementCase 2. 报表块撤销回退时,更新Target --- .../java/com/fr/design/mainframe/JForm.java | 63 ++++++++++++------- 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index a142ee297c..e3162e9ef6 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -704,8 +704,8 @@ public class JForm extends JTemplate implements BaseJForm implements BaseJForm implements BaseJForm Date: Sat, 8 Oct 2022 15:55:23 +0800 Subject: [PATCH 058/310] =?UTF-8?q?REPORT-78144=20FVS=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E5=9D=97=E5=AD=97=E5=8F=B7=E7=BB=9F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fun/DefaultValueAdjustProvider.java | 56 +++++++++++++++++ .../AbstractDefaultValueAdjustProvider.java | 24 +++++++ .../mainframe/AbsoluteMeasureUIMode.java | 37 +++++++++++ .../fr/design/mainframe/DesignerUIMode.java | 17 +++++ .../mainframe/DesignerUIModeConfig.java | 63 +++---------------- .../design/mainframe/SimulateWebUIMode.java | 38 +++++++++++ .../DefaultThemedTemplateCellElementCase.java | 6 ++ .../java/com/fr/design/utils/DesignUtils.java | 18 ++++++ .../com/fr/design/utils/gui/GUICoreUtils.java | 6 ++ .../java/com/fr/design/chart/ChartDialog.java | 6 ++ .../impl/ChartHyperPoplinkPane.java | 7 ++- .../chart/config/DefaultStyleHelper4Van.java | 7 +++ .../design/cell/editor/RichTextToolBar.java | 19 ++++-- 13 files changed, 244 insertions(+), 60 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/fun/DefaultValueAdjustProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/impl/AbstractDefaultValueAdjustProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/AbsoluteMeasureUIMode.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/DesignerUIMode.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/SimulateWebUIMode.java diff --git a/designer-base/src/main/java/com/fr/design/fun/DefaultValueAdjustProvider.java b/designer-base/src/main/java/com/fr/design/fun/DefaultValueAdjustProvider.java new file mode 100644 index 0000000000..0a93616293 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/DefaultValueAdjustProvider.java @@ -0,0 +1,56 @@ +package com.fr.design.fun; + +import com.fr.base.chart.BaseChartCollection; +import com.fr.chartx.attr.ChartProvider; +import com.fr.general.FRFont; +import com.fr.report.cell.CellElement; +import com.fr.stable.fun.mark.Selectable; + +import java.awt.Font; + +/** + * 主要用于fvs报表块内元素默认值的调整,以达到所见所得效果,后续fvs内置后删除 + */ +public interface DefaultValueAdjustProvider extends Selectable { + String MARK_STRING = "DefaultValueAdjustProvider"; + int CURRENT_LEVEL = 1; + + /** + * 调整单元格对象默认值 + * + * @param cellElement + */ + void adjustCellElement(CellElement cellElement); + + /** + * 调整富文本默认值 + * + * @param fontSize + * @return + */ + int adjustRichTextTransform(int fontSize, double transformedFontSize); + + /** + * 调整ChartCollection + * + * @param chartCollection + */ + void adjustChartCollectionStyle(BaseChartCollection chartCollection); + + /** + * 调整图表 + * + * @param chartProvider + */ + void adjustChart(ChartProvider chartProvider); + + + /** + * 转成当前分辨率下显示的font + * @param font + * @param resolution + * @return + */ + Font transformFontByResolution(FRFont font, int resolution); + +} diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractDefaultValueAdjustProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractDefaultValueAdjustProvider.java new file mode 100644 index 0000000000..b2fc58ba8f --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractDefaultValueAdjustProvider.java @@ -0,0 +1,24 @@ +package com.fr.design.fun.impl; + + +import com.fr.design.fun.DefaultValueAdjustProvider; +import com.fr.stable.fun.assist.Selector; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; + +@API(level = DefaultValueAdjustProvider.CURRENT_LEVEL) +public abstract class AbstractDefaultValueAdjustProvider extends AbstractProvider implements DefaultValueAdjustProvider { + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + public String mark4Provider() { + return this.getClass().getName(); + } + + public Selector selector() { + return Selector.ALWAYS; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/AbsoluteMeasureUIMode.java b/designer-base/src/main/java/com/fr/design/mainframe/AbsoluteMeasureUIMode.java new file mode 100644 index 0000000000..2085127d73 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/AbsoluteMeasureUIMode.java @@ -0,0 +1,37 @@ +package com.fr.design.mainframe; + +import com.fr.base.AutoChangeLineProvider; +import com.fr.base.DefaultAutoChangeLine; +import com.fr.base.ScreenResolution; +import com.fr.design.fun.ReportLengthUNITProvider; +import com.fr.design.unit.UnitConvertUtil; + +public class AbsoluteMeasureUIMode implements DesignerUIMode { + + private static class AbsoluteMeasureUIModeHolder { + private static final AbsoluteMeasureUIMode absoluteMeasureUIMode = new AbsoluteMeasureUIMode(); + } + + private AbsoluteMeasureUIMode() { + + } + + public static AbsoluteMeasureUIMode getInstance() { + return AbsoluteMeasureUIModeHolder.absoluteMeasureUIMode; + } + + @Override + public ReportLengthUNITProvider parseLengthUNIT(int unitType) { + return UnitConvertUtil.parseLengthUNIT(unitType); + } + + @Override + public AutoChangeLineProvider getAutoChangeLineStrategy() { + return new DefaultAutoChangeLine(); + } + + @Override + public int getScreenResolution() { + return ScreenResolution.getScreenResolution(); + } +} \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerUIMode.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerUIMode.java new file mode 100644 index 0000000000..801291125a --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerUIMode.java @@ -0,0 +1,17 @@ +package com.fr.design.mainframe; + +import com.fr.base.AutoChangeLineProvider;; +import com.fr.design.fun.ReportLengthUNITProvider; + +/** + * 设计器上和展示相关配置 + */ +public interface DesignerUIMode { + + ReportLengthUNITProvider parseLengthUNIT(int unitType); + + AutoChangeLineProvider getAutoChangeLineStrategy(); + + int getScreenResolution(); + +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerUIModeConfig.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerUIModeConfig.java index 400f698185..cd99f728a2 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerUIModeConfig.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerUIModeConfig.java @@ -1,19 +1,14 @@ package com.fr.design.mainframe; import com.fr.base.AutoChangeLineProvider; -import com.fr.base.DefaultAutoChangeLine; -import com.fr.base.ScreenResolution; import com.fr.design.fun.ReportLengthUNITProvider; -import com.fr.design.unit.UnitConvertUtil; -import com.fr.form.fit.NewUIModeAutoChangeLine; import com.fr.general.ComparatorUtils; -import com.fr.stable.Constants; /** * Created by kerry on 2020-06-05 */ public class DesignerUIModeConfig { - private DesignerUIMode mode = DesignerUIMode.ABSOLUTE_MEASURE_UI_MODE; + private DesignerUIMode mode = AbsoluteMeasureUIMode.getInstance(); private static class DesignerUIModeConfigHolder { private static final DesignerUIModeConfig designerUIModeConfig = new DesignerUIModeConfig(); @@ -34,21 +29,25 @@ public class DesignerUIModeConfig { * @return boolean */ public boolean simulateWebUIMode() { - return ComparatorUtils.equals(DesignerUIMode.SIMULATE_WEB_UI_MODE, mode); + return ComparatorUtils.equals(SimulateWebUIMode.getInstance(), mode); } /** * 设置新ui模式 */ public void setSimulateWebUIMode() { - this.mode = DesignerUIMode.SIMULATE_WEB_UI_MODE; + this.mode = SimulateWebUIMode.getInstance(); + } + + public void setDesignerUIMode(DesignerUIMode mode) { + this.mode = mode; } /** * 设置老ui模式 */ public void setAbsoluteMeasureUIMode() { - this.mode = DesignerUIMode.ABSOLUTE_MEASURE_UI_MODE; + this.mode = AbsoluteMeasureUIMode.getInstance(); } /** @@ -78,50 +77,4 @@ public class DesignerUIModeConfig { return mode.getScreenResolution(); } - - private enum DesignerUIMode { - ABSOLUTE_MEASURE_UI_MODE { - @Override - protected ReportLengthUNITProvider parseLengthUNIT(int unitType) { - return UnitConvertUtil.parseLengthUNIT(unitType); - } - - @Override - public AutoChangeLineProvider getAutoChangeLineStrategy() { - return new DefaultAutoChangeLine(); - } - - @Override - protected int getScreenResolution() { - return ScreenResolution.getScreenResolution(); - } - - }, - SIMULATE_WEB_UI_MODE { - @Override - protected ReportLengthUNITProvider parseLengthUNIT(int unitType) { - return new PXReportLengthUNIT(); - } - - @Override - public AutoChangeLineProvider getAutoChangeLineStrategy() { - return new NewUIModeAutoChangeLine(); - } - - @Override - protected int getScreenResolution() { - return Constants.DEFAULT_WEBWRITE_AND_SCREEN_RESOLUTION; - } - - }; - - protected abstract ReportLengthUNITProvider parseLengthUNIT(int unitType); - - public abstract AutoChangeLineProvider getAutoChangeLineStrategy(); - - - protected abstract int getScreenResolution(); - - } - } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/SimulateWebUIMode.java b/designer-base/src/main/java/com/fr/design/mainframe/SimulateWebUIMode.java new file mode 100644 index 0000000000..a13bff759f --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/SimulateWebUIMode.java @@ -0,0 +1,38 @@ +package com.fr.design.mainframe; + +import com.fr.base.AutoChangeLineProvider; +import com.fr.design.fun.ReportLengthUNITProvider; +import com.fr.form.fit.NewUIModeAutoChangeLine; +import com.fr.stable.Constants; + +public class SimulateWebUIMode implements DesignerUIMode { + + private static class SimulateWebUIModeHolder { + private static final SimulateWebUIMode simulateWebUIMode = new SimulateWebUIMode(); + } + + private SimulateWebUIMode() { + + } + + public static SimulateWebUIMode getInstance() { + return SimulateWebUIModeHolder.simulateWebUIMode; + } + + + @Override + public ReportLengthUNITProvider parseLengthUNIT(int unitType) { + return new PXReportLengthUNIT(); + } + + @Override + public AutoChangeLineProvider getAutoChangeLineStrategy() { + return new NewUIModeAutoChangeLine(); + } + + @Override + public int getScreenResolution() { + return Constants.DEFAULT_WEBWRITE_AND_SCREEN_RESOLUTION; + } + +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/utils/DefaultThemedTemplateCellElementCase.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/utils/DefaultThemedTemplateCellElementCase.java index 8b1abe71b4..0923c7f659 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/utils/DefaultThemedTemplateCellElementCase.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/utils/DefaultThemedTemplateCellElementCase.java @@ -5,7 +5,9 @@ import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.settings.ThemedCellStyle; import com.fr.design.base.mode.DesignModeContext; import com.fr.design.file.HistoryTemplateListCache; +import com.fr.design.fun.DefaultValueAdjustProvider; import com.fr.design.mainframe.JTemplate; +import com.fr.design.utils.DesignUtils; import com.fr.report.cell.DefaultTemplateCellElement; /** @@ -41,6 +43,10 @@ public class DefaultThemedTemplateCellElementCase { cellElement.setStyle(DesignModeContext.isDuchampMode() ? nameStyle.getRealStyle() : nameStyle); } } + DefaultValueAdjustProvider adjustProvider = DesignUtils.getValueAdjust(); + if (adjustProvider != null) { + adjustProvider.adjustCellElement(cellElement); + } return cellElement; } } diff --git a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java index 47690bba9b..dfeeacc608 100644 --- a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java @@ -7,6 +7,7 @@ import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; import com.fr.design.deeplink.DeepLinkCore; import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.fun.DefaultValueAdjustProvider; import com.fr.design.fun.DesignerEnvProcessor; import com.fr.design.gui.UILookAndFeel; import com.fr.design.i18n.Toolkit; @@ -18,11 +19,14 @@ import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; import com.fr.general.GeneralContext; import com.fr.log.FineLoggerFactory; +import com.fr.plugin.injectable.PluginModule; import com.fr.stable.ArrayUtils; import com.fr.stable.CommonCodeUtils; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; +import com.fr.stable.bridge.ObjectHolder; import com.fr.stable.os.OperatingSystem; +import com.fr.stable.plugin.ExtraDesignClassManagerProvider; import com.fr.start.ServerStarter; import com.fr.start.common.DesignerStartupContext; import com.fr.start.common.DesignerStartupUtil; @@ -48,6 +52,7 @@ import java.net.URI; import java.nio.charset.StandardCharsets; import java.util.Enumeration; import java.util.Locale; +import java.util.Set; import java.util.concurrent.Callable; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -463,4 +468,17 @@ public class DesignUtils { return xmlDesignerVersion; } + public static DefaultValueAdjustProvider getValueAdjust() { + ExtraDesignClassManager extraDesignClassManager = PluginModule.getAgent(PluginModule.ExtraDesign); + if (extraDesignClassManager != null) { + Set providers = extraDesignClassManager.getArray(DefaultValueAdjustProvider.MARK_STRING); + for (DefaultValueAdjustProvider provider : providers) { + if (provider.selector().accept(new ObjectHolder())) { + return provider; + } + } + } + return null; + } + } diff --git a/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java b/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java index ac75786314..d90f2af422 100644 --- a/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java @@ -17,6 +17,7 @@ import com.fr.design.actions.UpdateAction; import com.fr.design.actions.core.ActionFactory; import com.fr.design.border.UITitledBorder; import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.fun.DefaultValueAdjustProvider; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.icheckbox.UICheckBox; @@ -32,6 +33,7 @@ import com.fr.design.style.color.ColorCell; import com.fr.design.style.color.ColorFactory; import com.fr.design.style.color.ColorSelectBox; import com.fr.design.style.color.ColorSelectable; +import com.fr.design.utils.DesignUtils; import com.fr.general.FRFont; import com.fr.stable.AssistUtils; import com.fr.stable.Constants; @@ -171,6 +173,10 @@ public final class GUICoreUtils { FRFont frFont = style.getFRFont(); textField.setFont(new Font(frFont.getFontName(), frFont.getStyle(), frFont.getShowSize(resolution))); + DefaultValueAdjustProvider valueAdjust = DesignUtils.getValueAdjust(); + if (valueAdjust != null) { + textField.setFont(valueAdjust.transformFontByResolution(frFont, resolution)); + } textField.setForeground(style.getFRFont().getForeground()); if (style.getBackground() instanceof ColorBackground) { diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartDialog.java b/designer-chart/src/main/java/com/fr/design/chart/ChartDialog.java index bce90aaaeb..183f14b768 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartDialog.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartDialog.java @@ -4,9 +4,11 @@ import com.fr.base.chart.BaseChartCollection; import com.fr.chart.chartattr.ChartCollection; import com.fr.design.dialog.BasicDialog; import com.fr.design.file.HistoryTemplateListCache; +import com.fr.design.fun.DefaultValueAdjustProvider; import com.fr.design.gui.chart.MiddleChartDialog; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.i18n.Toolkit; +import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.third.joda.time.DateTime; @@ -87,6 +89,10 @@ public class ChartDialog extends MiddleChartDialog { return new ActionListener() { public void actionPerformed(ActionEvent e) { chartTypePane.update((ChartCollection) cc, createTime); + DefaultValueAdjustProvider adjustProvider = DesignUtils.getValueAdjust(); + if (adjustProvider != null) { + adjustProvider.adjustChartCollectionStyle(cc); + } doOK(); } }; diff --git a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java index 11d2e32e4d..35b0c0d5bc 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java @@ -8,10 +8,12 @@ import com.fr.chart.web.ChartHyperPoplink; import com.fr.chartx.attr.ChartProvider; import com.fr.design.chart.gui.ChartComponent; import com.fr.design.file.HistoryTemplateListCache; +import com.fr.design.fun.DefaultValueAdjustProvider; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.hyperlink.AbstractHyperLinkPane; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.chart.ChartHyperEditPane; +import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.log.FineLoggerFactory; import com.fr.van.chart.config.DefaultStyleHelper4Van; @@ -67,7 +69,10 @@ public class ChartHyperPoplinkPane extends AbstractHyperLinkPane Date: Sun, 9 Oct 2022 11:21:36 +0800 Subject: [PATCH 059/310] =?UTF-8?q?REPORT-81307=20A=E5=88=97=E5=88=97?= =?UTF-8?q?=E5=AE=BD=E6=A6=82=E7=8E=87=E6=98=BE=E7=A4=BA=E4=B8=BAB?= =?UTF-8?q?=E5=88=97=E5=88=97=E5=AE=BD=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../grid/AbstractGridHeaderMouseHandler.java | 35 ++++++++++++------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java b/designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java index 97e95a34f4..193d056f02 100644 --- a/designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java +++ b/designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java @@ -38,6 +38,8 @@ import java.lang.reflect.Method; public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter { protected static final int FUZZY_EDGE = 10; protected static final int SEPARATOR_GAP = 5; + //只选中一个 + private static final int ONLY_SELECT_ONE = 1; protected GridHeader gHeader; private int dragType = GridUtils.DRAG_NONE; @@ -109,7 +111,7 @@ public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter { if (between(evt, tmpSize1, tmpSize2)) { if (index >= dragIndex) { try { - if(method != null) { + if (method != null) { method.invoke(report, dragIndex, FU.valueOfPix(evtOffset(evt, oldEndValueSize), resolution)); } } catch (Exception e) { @@ -118,7 +120,7 @@ public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter { //sizeList.set(dragIndex, FU.valueOfPix(evtOffset(evt, oldEndValueSize), resolution)); } else { try { - if(method != null) { + if (method != null) { method.invoke(report, index, FU.valueOfPix(evtOffset(evt, (int) tmpSize1), resolution)); } } catch (Exception e) { @@ -128,7 +130,7 @@ public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter { // from all to do. for (int h = (dragIndex - 1); h > index; h--) { try { - if(method != null) { + if (method != null) { method.invoke(report, h, UNIT.ZERO); } } catch (Exception e) { @@ -219,7 +221,7 @@ public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter { ePane.getGrid().stopEditing();// james 停止当前的所有编辑 // peter:选中格子位置. - ColumnRow selectedCellPoint = GridUtils.getAdjustEventColumnRow_withresolution(ePane, evt.getX(), evt.getY(),resolution); + ColumnRow selectedCellPoint = GridUtils.getAdjustEventColumnRow_withresolution(ePane, evt.getX(), evt.getY(), resolution); iterateScrollBar(ePane, evt, PRESS_ACTION); @@ -227,7 +229,7 @@ public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter { if (SwingUtilities.isRightMouseButton(evt)) { Selection cs = ePane.getSelection(); resetSelectionByRightButton(selectedCellPoint, cs, ePane); - + checkEndMultiSelectIndex(cs); UIPopupMenu popupMenu = createPopupMenu(ePane, evt, Math.max(dragIndex, Math.max(this.startMultiSelectIndex, this.endMultiSelectIndex))); if (popupMenu != null) { GUICoreUtils.showPopupMenu(popupMenu, gHeader, evt.getX() + 1, evt.getY() + 1); @@ -246,6 +248,16 @@ public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter { ePane.repaint(); } + /** + * 如果行列中有只选中一个的情况,更新下endIndex,防止列宽或行宽不匹配 + * @param selection + */ + private void checkEndMultiSelectIndex(Selection selection) { + if (selection.getSelectedColumns().length == ONLY_SELECT_ONE || selection.getSelectedRows().length == ONLY_SELECT_ONE) { + this.endMultiSelectIndex = this.startMultiSelectIndex; + } + } + protected abstract void resetSelectionByRightButton(ColumnRow mouseSelectedColumnRow, Selection cs, ElementCasePane ePane); @@ -305,14 +317,11 @@ public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter { StringBuilder sb = new StringBuilder(); sb.append(String.format("%.2f", new Double(len))) .append('/').append(String.format("%.2f", new Double(tlen))) - .append(unit); - if(!DesignerUIModeConfig.getInstance().simulateWebUIMode()){ - sb.append('(') - .append((int)(unitValue.toPixD(resolution))).append('/') - .append((int)(totalUnitValue.toPixD(resolution))) - .append(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Px")) - .append(')'); - } + .append(unit).append('(') + .append((int) (unitValue.toPixD(resolution))).append('/') + .append((int) (totalUnitValue.toPixD(resolution))) + .append(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Px")) + .append(')'); return sb.toString(); } From f9d77fac63cfc1403d34b29330487249f5742901 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Sun, 9 Oct 2022 11:26:31 +0800 Subject: [PATCH 060/310] =?UTF-8?q?REPORT-81307=20A=E5=88=97=E5=88=97?= =?UTF-8?q?=E5=AE=BD=E6=A6=82=E7=8E=87=E6=98=BE=E7=A4=BA=E4=B8=BAB?= =?UTF-8?q?=E5=88=97=E5=88=97=E5=AE=BD=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/grid/AbstractGridHeaderMouseHandler.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java b/designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java index 193d056f02..760c1f04a3 100644 --- a/designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java +++ b/designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java @@ -317,11 +317,14 @@ public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter { StringBuilder sb = new StringBuilder(); sb.append(String.format("%.2f", new Double(len))) .append('/').append(String.format("%.2f", new Double(tlen))) - .append(unit).append('(') - .append((int) (unitValue.toPixD(resolution))).append('/') - .append((int) (totalUnitValue.toPixD(resolution))) - .append(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Px")) - .append(')'); + .append(unit); + if(!DesignerUIModeConfig.getInstance().simulateWebUIMode()){ + sb.append('(') + .append((int)(unitValue.toPixD(resolution))).append('/') + .append((int)(totalUnitValue.toPixD(resolution))) + .append(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Px")) + .append(')'); + } return sb.toString(); } From 7cca9c2f571cd69bfd16910f14cd150a54041cbd Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Sun, 9 Oct 2022 11:50:51 +0800 Subject: [PATCH 061/310] =?UTF-8?q?REPORT-81307=20=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java b/designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java index 760c1f04a3..2927f74d69 100644 --- a/designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java +++ b/designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java @@ -250,7 +250,7 @@ public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter { /** * 如果行列中有只选中一个的情况,更新下endIndex,防止列宽或行宽不匹配 - * @param selection + * @param selection 与ElementCasePane绑定的选择对象 */ private void checkEndMultiSelectIndex(Selection selection) { if (selection.getSelectedColumns().length == ONLY_SELECT_ONE || selection.getSelectedRows().length == ONLY_SELECT_ONE) { From 97490a81162ed5bc1859032c5f238c578fdf3eae Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 10 Oct 2022 15:22:07 +0800 Subject: [PATCH 062/310] =?UTF-8?q?REPORT-75998=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=B8=AE=E5=8A=A9=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../replace/ui/ITReplaceMainDialog.java | 3 +- .../replace/ui/ITReplaceWestPanel.java | 55 +++++++++++++++---- .../actions/replace/ui/ITTableEditor.java | 2 +- 3 files changed, 46 insertions(+), 14 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index 54e6a3bff4..9a2f5c8de7 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -23,7 +23,6 @@ import com.fr.stable.StringUtils; import javax.swing.JOptionPane; import javax.swing.JPanel; import java.awt.BorderLayout; -import java.awt.Color; import java.awt.Dimension; import java.awt.Point; import java.awt.event.ActionEvent; @@ -153,7 +152,7 @@ public class ITReplaceMainDialog extends UIDialog { }); center.add(northPane.getScrollPane(), BorderLayout.NORTH); center.add(southPanel.getTableEditorPane(), BorderLayout.CENTER); - add(westPanel.getLeftJpanel(), BorderLayout.WEST); + add(westPanel.getLeftPanel(), BorderLayout.WEST); //主体部分 add(center, BorderLayout.CENTER); center.setVisible(true); diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java index 9295baf655..c88e3a19df 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java @@ -1,14 +1,22 @@ package com.fr.design.actions.replace.ui; +import com.fr.base.svg.IconUtils; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.share.ui.base.MouseClickListener; import com.fr.stable.StringUtils; import javax.swing.BorderFactory; +import javax.swing.Icon; import javax.swing.JPanel; import java.awt.Color; +import java.awt.Cursor; +import java.awt.Desktop; +import java.awt.Font; import java.awt.GridLayout; +import java.awt.event.MouseEvent; +import java.net.URI; /** * 左侧面板 @@ -18,28 +26,53 @@ import java.awt.GridLayout; * created by Destiny.Lin on 2022-09-05 */ public class ITReplaceWestPanel { - JPanel leftJpanel; + private JPanel leftPanel; + private UILabel iconLabel; + private static final Icon HELP_ICON = IconUtils.readIcon("com/fr/design/images/buttonicon/replace_help.svg"); + private static final int FILL_COUNT = 13; public ITReplaceWestPanel() { - leftJpanel = new JPanel(new GridLayout(15, 1, 0, 0)); + leftPanel = new JPanel(new GridLayout(15, 1, 0, 0)); + iconLabel = new UILabel("" + Toolkit.i18nText("Fine-Design_Report_Community_Help") + ""); + UIToggleButton contentButton = new UIToggleButton(Toolkit.i18nText("Fine-Design_Basic_Templates_Content")); contentButton.setSelected(true); contentButton.setBorderPainted(false); - leftJpanel.add(contentButton); - leftJpanel.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, new Color(218, 218, 221))); + leftPanel.add(contentButton); + leftPanel.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, new Color(218, 218, 221))); //填充一下面板 - int labelNum = 14; - for (int i = 0; i < labelNum; i++) { - leftJpanel.add(new UILabel(StringUtils.EMPTY)); + for (int i = 0; i < FILL_COUNT; i++) { + leftPanel.add(new UILabel(StringUtils.EMPTY)); } + + //添加帮助文档按钮及超链 + iconLabel.setIcon(HELP_ICON); + iconLabel.setToolTipText(Toolkit.i18nText("Fine-Design_Replace_Tooltip")); + //设置游标 + iconLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); + iconLabel.setFont(new Font("Dialog", Font.BOLD, 12)); + iconLabel.addMouseListener(new MouseClickListener() { + @Override + public void mouseClicked(MouseEvent e) { + Desktop desktop = Desktop.getDesktop(); + try { + //创建URI统一资源标识符 + URI uri = new URI("https://help.fanruan.com/finereport/doc-view-4954.html"); + desktop.browse(uri); + } catch (Exception exception) { + exception.printStackTrace(); + } + } + }); + leftPanel.add(iconLabel); } - public JPanel getLeftJpanel() { - return leftJpanel; + public JPanel getLeftPanel() { + return leftPanel; } - public void setLeftJpanel(JPanel leftJpanel) { - this.leftJpanel = leftJpanel; + public void setLeftPanel(JPanel leftPanel) { + this.leftPanel = leftPanel; } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java index 5c57e6d6a1..0c8819abff 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java @@ -102,8 +102,8 @@ public class ITTableEditor extends UITableModelAdapter { public void add(List list) { for (Info info : list) { addRow(info.getContent()); - fireTableDataChanged(); } + fireTableDataChanged(); } public enum ChooseIndex { From 8ee083f996c29c2c40947a765f4d0e2d3a3770d6 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 10 Oct 2022 15:26:42 +0800 Subject: [PATCH 063/310] =?UTF-8?q?REPORT-75998=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=B8=AE=E5=8A=A9=E6=96=87=E6=A1=A3Icon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/com/fr/design/images/buttonicon/replace_help.svg | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/replace_help.svg diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/replace_help.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/replace_help.svg new file mode 100644 index 0000000000..cfc3370a66 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/replace_help.svg @@ -0,0 +1,3 @@ + + + From c218e9c130be7a8e682ab915d46635a3aca5239b Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 10 Oct 2022 15:31:13 +0800 Subject: [PATCH 064/310] =?UTF-8?q?REPORT-75998=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/actions/replace/ui/ITReplaceWestPanel.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java index c88e3a19df..5b48827511 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java @@ -5,6 +5,7 @@ import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.share.ui.base.MouseClickListener; +import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import javax.swing.BorderFactory; @@ -61,7 +62,7 @@ public class ITReplaceWestPanel { URI uri = new URI("https://help.fanruan.com/finereport/doc-view-4954.html"); desktop.browse(uri); } catch (Exception exception) { - exception.printStackTrace(); + FineLoggerFactory.getLogger().error(exception.getMessage(), exception); } } }); From 1fdd0cac880d7c7b73831fd46660c5f7cc1c1769 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 10 Oct 2022 16:09:38 +0800 Subject: [PATCH 065/310] =?UTF-8?q?REPORT-75998=20=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E9=80=BB=E8=BE=91,=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=E5=B8=AE=E5=8A=A9=E6=96=87=E6=A1=A3Icon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/images/buttonicon/replace_help.svg | 2 +- .../actions/replace/ui/ITReplaceWestPanel.java | 17 ++++------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/replace_help.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/replace_help.svg index cfc3370a66..fdbd5eca5e 100644 --- a/designer-base/src/main/resources/com/fr/design/images/buttonicon/replace_help.svg +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/replace_help.svg @@ -1,3 +1,3 @@ - + diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java index 5b48827511..3363b7db75 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java @@ -5,7 +5,8 @@ import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.share.ui.base.MouseClickListener; -import com.fr.log.FineLoggerFactory; +import com.fr.design.utils.BrowseUtils; +import com.fr.general.CloudCenter; import com.fr.stable.StringUtils; import javax.swing.BorderFactory; @@ -13,11 +14,8 @@ import javax.swing.Icon; import javax.swing.JPanel; import java.awt.Color; import java.awt.Cursor; -import java.awt.Desktop; -import java.awt.Font; import java.awt.GridLayout; import java.awt.event.MouseEvent; -import java.net.URI; /** * 左侧面板 @@ -30,6 +28,7 @@ public class ITReplaceWestPanel { private JPanel leftPanel; private UILabel iconLabel; private static final Icon HELP_ICON = IconUtils.readIcon("com/fr/design/images/buttonicon/replace_help.svg"); + private static final String HELP_URL = CloudCenter.getInstance().acquireUrlByKind("design.replace.help", "https://help.fanruan.com/finereport/doc-view-4954.html"); private static final int FILL_COUNT = 13; public ITReplaceWestPanel() { @@ -52,18 +51,10 @@ public class ITReplaceWestPanel { iconLabel.setToolTipText(Toolkit.i18nText("Fine-Design_Replace_Tooltip")); //设置游标 iconLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); - iconLabel.setFont(new Font("Dialog", Font.BOLD, 12)); iconLabel.addMouseListener(new MouseClickListener() { @Override public void mouseClicked(MouseEvent e) { - Desktop desktop = Desktop.getDesktop(); - try { - //创建URI统一资源标识符 - URI uri = new URI("https://help.fanruan.com/finereport/doc-view-4954.html"); - desktop.browse(uri); - } catch (Exception exception) { - FineLoggerFactory.getLogger().error(exception.getMessage(), exception); - } + BrowseUtils.browser(HELP_URL); } }); leftPanel.add(iconLabel); From 2973891f7b0ca8a53454ca73e8425727070ab90d Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 11 Oct 2022 11:14:02 +0800 Subject: [PATCH 066/310] =?UTF-8?q?REPORT-75998=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=B8=AE=E5=8A=A9=E6=96=87=E6=A1=A3=E7=BD=91=E5=9D=80=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/actions/replace/ui/ITReplaceWestPanel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java index 3363b7db75..a58091a06a 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java @@ -28,7 +28,7 @@ public class ITReplaceWestPanel { private JPanel leftPanel; private UILabel iconLabel; private static final Icon HELP_ICON = IconUtils.readIcon("com/fr/design/images/buttonicon/replace_help.svg"); - private static final String HELP_URL = CloudCenter.getInstance().acquireUrlByKind("design.replace.help", "https://help.fanruan.com/finereport/doc-view-4954.html"); + private static final String HELP_URL = CloudCenter.getInstance().acquireUrlByKind("design.replace.help", "https://help.fanruan.com/finereport/doc-view-4954.html?source=3"); private static final int FILL_COUNT = 13; public ITReplaceWestPanel() { From 7f3dd21e666a69642e4a2fb844320a4e52c4555b Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 11 Oct 2022 11:36:25 +0800 Subject: [PATCH 067/310] =?UTF-8?q?REPORT-81416=20=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E7=9A=84=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/carton/EventDispatchThreadHangMonitor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/carton/EventDispatchThreadHangMonitor.java b/designer-base/src/main/java/com/fr/design/carton/EventDispatchThreadHangMonitor.java index f472d901a1..56ccaa2c48 100644 --- a/designer-base/src/main/java/com/fr/design/carton/EventDispatchThreadHangMonitor.java +++ b/designer-base/src/main/java/com/fr/design/carton/EventDispatchThreadHangMonitor.java @@ -7,7 +7,6 @@ import com.fr.stable.ArrayUtils; import com.fr.stable.ProductConstantsBase; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; -import com.fr.third.ibm.icu.text.SimpleDateFormat; import org.jetbrains.annotations.NotNull; import javax.swing.SwingUtilities; @@ -22,6 +21,7 @@ import java.io.IOException; import java.lang.management.ManagementFactory; import java.lang.management.ThreadInfo; import java.lang.management.ThreadMXBean; +import java.text.SimpleDateFormat; import java.util.LinkedList; import java.util.Timer; import java.util.TimerTask; From ba04ea99b0f72515fc6965a48e3090e4b1d96784 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 11 Oct 2022 15:49:46 +0800 Subject: [PATCH 068/310] =?UTF-8?q?REPORT-75998=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E7=B1=BB=E5=9E=8B=E5=9B=BE=E8=A1=A8=E7=9A=84?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=B8=ADJS=E7=BC=BA=E6=BC=8F=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/replace/utils/SearchJSUtils.java | 90 ++++++++++++++++--- .../actions/replace/utils/ShowValueUtils.java | 22 +++++ 2 files changed, 100 insertions(+), 12 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java index d04b02aa26..5bb27c6686 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java @@ -21,6 +21,9 @@ import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.base.AttrLabel; import com.fr.plugin.chart.base.AttrTooltip; import com.fr.plugin.chart.base.VanChartHtmlLabel; +import com.fr.plugin.chart.map.VanChartMapPlot; +import com.fr.plugin.chart.map.attr.AttrMapLabel; +import com.fr.plugin.chart.map.attr.AttrMapTooltip; import com.fr.plugin.chart.vanchart.VanChart; import com.fr.report.cell.Elem; import com.fr.stable.StringUtils; @@ -39,6 +42,21 @@ import java.util.List; */ public class SearchJSUtils { + /** + * 样式-数据点提示 + */ + public static final String STYLE_TOOLTIP_CUSTOM = ShowValueUtils.joinStr4Position(Toolkit.i18nText("Fine-Design_Basic_Style"), Toolkit.i18nText("Fine-Design_Chart_Tooltip")); + + /** + * 样式-标签 + */ + public static final String STYLE_LABEL = ShowValueUtils.joinStr4Position(Toolkit.i18nText("Fine-Design_Basic_Style"), Toolkit.i18nText("Fine-Design_Chart_Data_Label")); + + /** + * 样式-分类标签 + */ + public static final String CATEGORY_LABEL = ShowValueUtils.joinStr4Position(Toolkit.i18nText("Fine-Design_Basic_Style"), Toolkit.i18nText("Fine-Design_Chart_Data_Label"), Toolkit.i18nText("Fine-Design_Chart_Category_Label")); + /** * 从Listener中获取JS */ @@ -118,29 +136,77 @@ public class SearchJSUtils { */ private static void addAttrLabelHtmlLabel(VanChart chart, List> arrayList) { VanChartPlot plot = chart.getPlot(); - addAttrToolTipCondition2Array(plot, arrayList); - if (isAttrLabelExist(plot)) { - addAttrLabelDetail2Array(plot, arrayList); - addAttrSecondLabelDetail2Array(plot, arrayList); + //如果是地图类型要特殊处理 + if (plot instanceof VanChartMapPlot) { + addMapJS2Array((VanChartMapPlot) plot, arrayList); + } else { + addAttrToolTipCondition2Array(plot, arrayList); + if (isAttrLabelExist(plot)) { + addAttrLabelDetail2Array(plot, arrayList); + addAttrSecondLabelDetail2Array(plot, arrayList); + } + } + } + /** + * 用于处理地图类型图表中的样式中的JS(AttrMapTooltip 与 AttrMapLabel) + * + * @param plot + * @param arrayList + */ + private static void addMapJS2Array(VanChartMapPlot plot, List> arrayList) { + ConditionAttr defaultAttr = plot.getConditionCollection().getDefaultAttr(); + AttrMapTooltip attrMapTooltip = defaultAttr.getExisted(AttrMapTooltip.class); + AttrMapLabel attrMapLabel = defaultAttr.getExisted(AttrMapLabel.class); + //处理三种地图的数据点提示——点地图、流向地图、区域地图 + dealMapTooltipJS(attrMapTooltip.getAreaTooltip(), arrayList); + dealMapTooltipJS(attrMapTooltip.getLineTooltip(), arrayList); + dealMapTooltipJS(attrMapTooltip.getPointTooltip(), arrayList); + + //处理两种地图的标签——点地图、区域地图(流向地图没有标签) + dealMapLabelJS(attrMapLabel.getAreaLabel(), arrayList); + dealMapLabelJS(attrMapLabel.getPointLabel(), arrayList); + + + } + + /** + * 用于处理地图类型图表中的标签中的JS + * + * @param label 地图类型的标签(点地图、区域地图) + * @param arrayList 用于存储htmlLabel的数组 + */ + private static void dealMapLabelJS(AttrLabel label, List> arrayList) { + if (isAttrLabelValid(label)) { + arrayList.add(new Pair<>(label.getContent().getHtmlLabel(), STYLE_LABEL)); } + } + /** + * 用于处理地图类型图表中的数据点提示中的JS + * + * @param tooltip 地图类型的数据点提示(点地图、流向地图、区域地图) + * @param arrayList 用于存储htmlLabel的数组 + */ + private static void dealMapTooltipJS(AttrTooltip tooltip, List> arrayList) { + if (isToolTipValid(tooltip)) { + arrayList.add(new Pair<>(tooltip.getContent().getHtmlLabel(), STYLE_TOOLTIP_CUSTOM)); + } } private static void addAttrToolTipCondition2Array(VanChartPlot plot, List> arrayList) { - if (isToolTipValid(plot)) { - arrayList.add(new Pair<>(((AttrTooltip) plot.getAttrTooltipFromConditionCollection()).getContent().getHtmlLabel(), - Toolkit.i18nText("Fine-Design_Chart_Tooltip") + "-" + Toolkit.i18nText("Fine-Design_Basic_Custom"))); + if (isToolTipValid(plot.getAttrTooltipFromConditionCollection())) { + arrayList.add(new Pair<>(((AttrTooltip) plot.getAttrTooltipFromConditionCollection()).getContent().getHtmlLabel(), STYLE_TOOLTIP_CUSTOM)); } } - private static boolean isToolTipValid(VanChartPlot plot) { - return plot.getAttrTooltipFromConditionCollection() != null && ((AttrTooltip) plot.getAttrTooltipFromConditionCollection()).isEnable() && plot.getAttrTooltipFromConditionCollection() instanceof AttrTooltip; + private static boolean isToolTipValid(DataSeriesCondition tooltip) { + return tooltip instanceof AttrTooltip && ((AttrTooltip) tooltip).isEnable() && ((AttrTooltip) tooltip).getContent() != null && ((AttrTooltip) tooltip).getContent().getHtmlLabel() != null; } private static void addAttrLabelDetail2Array(VanChartPlot plot, List> arrayList) { if (isLabelDetailValid(plot)) { - arrayList.add(new Pair<>(plot.getAttrLabelFromConditionCollection().getAttrLabelDetail().getContent().getHtmlLabel(), Toolkit.i18nText("Fine-Design_Chart_Value_Label"))); + arrayList.add(new Pair<>(plot.getAttrLabelFromConditionCollection().getAttrLabelDetail().getContent().getHtmlLabel(), STYLE_LABEL)); } } @@ -152,7 +218,7 @@ public class SearchJSUtils { private static void addAttrSecondLabelDetail2Array(VanChartPlot plot, List> arrayList) { if (isSecondLabelDetailValid(plot)) { - arrayList.add(new Pair<>(plot.getAttrLabelFromConditionCollection().getSecondLabelDetail().getContent().getHtmlLabel(), Toolkit.i18nText("Fine-Design_Chart_Category_Label"))); + arrayList.add(new Pair<>(plot.getAttrLabelFromConditionCollection().getSecondLabelDetail().getContent().getHtmlLabel(), CATEGORY_LABEL)); } } @@ -194,7 +260,7 @@ public class SearchJSUtils { } private static boolean isAttrLabelValid(AttrLabel label) { - return label.isEnable() && label.getContent() != null && label.getContent().getHtmlLabel() != null; + return label != null && label.isEnable() && label.getContent() != null && label.getContent().getHtmlLabel() != null; } /** diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java index b7b46539b3..d01b475a9f 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java @@ -46,6 +46,8 @@ public class ShowValueUtils { public static final int HTML_TAIL_LEN = HTML_TAIL.length(); public static final int NOBR_LEN = NOBR.length(); public static final int NOBR_TAIL_LEN = NOBR_TAIL.length(); + + public static final String JOIN_GAP_STRING = "-"; /** * <转变为<的长度差 */ @@ -301,4 +303,24 @@ public class ShowValueUtils { } } + + + /** + * 用于拼接展示位置用的字符串,中间用“-”拼接 + * + * @param strings 用于拼接的字符串 + * @return 拼接后的字符串 + */ + public static String joinStr4Position(String... strings) { + StringBuilder builder = new StringBuilder(); + int len = strings.length; + for (int i = 0; i < len; i++) { + if (i == 0) { + builder.append(strings[i]); + } else { + builder.append(JOIN_GAP_STRING).append(strings[i]); + } + } + return builder.toString(); + } } From 501506f39e9394eb1ca5fc42380dce573226c84b Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 11 Oct 2022 16:13:07 +0800 Subject: [PATCH 069/310] =?UTF-8?q?REPORT-75998=20=E6=8B=BC=E6=8E=A5?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E4=B8=B2=E9=87=87=E7=94=A8StableUtils.join?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/replace/utils/ShowValueUtils.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java index d01b475a9f..191a08eefc 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java @@ -2,6 +2,7 @@ package com.fr.design.actions.replace.utils; import com.fr.design.actions.replace.ui.ITReplaceMainDialog; +import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.collections.combination.Pair; @@ -312,15 +313,6 @@ public class ShowValueUtils { * @return 拼接后的字符串 */ public static String joinStr4Position(String... strings) { - StringBuilder builder = new StringBuilder(); - int len = strings.length; - for (int i = 0; i < len; i++) { - if (i == 0) { - builder.append(strings[i]); - } else { - builder.append(JOIN_GAP_STRING).append(strings[i]); - } - } - return builder.toString(); + return StableUtils.join(strings, JOIN_GAP_STRING); } } From 2a1c2c5019d48554d79a879641cd4173ec677d7c Mon Sep 17 00:00:00 2001 From: "John.Ying" Date: Tue, 11 Oct 2022 16:40:51 +0800 Subject: [PATCH 070/310] =?UTF-8?q?REPORT-81270=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E9=85=8D=E7=BD=AE=E7=95=8C=E9=9D=A2=E5=A4=84?= =?UTF-8?q?=E7=90=86IPV6=E6=A0=BC=E5=BC=8F=E7=9A=84url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/env/RemoteEnvPane.java | 4 +++ .../java/com/fr/env/RemoteWorkspaceURL.java | 25 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java index 31bdaa979b..a4423c37dc 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java +++ b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java @@ -325,6 +325,10 @@ public class RemoteEnvPane extends BasicBeanPane { this.remoteWorkspaceURL = Strings.isNullOrEmpty(connection.getUrl()) ? RemoteWorkspaceURL.createDefaultURL() : new RemoteWorkspaceURL(connection.getUrl()); + //判断一下IP地址是不是IPV6的格式,如果是的话在拆分地址和端口的时候需要调整一下格式,用[ 或者 ] 判断 + if (!Strings.isNullOrEmpty(connection.getUrl()) && connection.getUrl().contains("[")) { + this.remoteWorkspaceURL.refreshIPV6Format(); + } String username = fromNullable(connection.getUserName()).or(StringUtils.EMPTY); String pwd = fromNullable(connection.getPassword()).or(StringUtils.EMPTY); String certPath = fromNullable(connection.getCertPath()).or(StringUtils.EMPTY); diff --git a/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java b/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java index 4ea950e845..b37bc4d051 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java +++ b/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java @@ -129,6 +129,31 @@ public class RemoteWorkspaceURL implements FCloneable { return this.url; } + /** + * IPV6地址格式不同,处理字符串的方式不同,需要处理的是port和host + * 形如 http://[XXXX::XXXX:XXXX:XXXX:XXXX]:8080/webroot/decision + */ + public void refreshIPV6Format() { + String url = this.url; + // 第三次出现"/"的地方 + int webIndex = url.indexOf("/", url.indexOf("://") + 3); + int hostIndex = url.indexOf("["); + int portIndex = url.indexOf("]"); + isContainsRelatedIndex(webIndex, hostIndex, portIndex); + this.host = url.substring(hostIndex, portIndex + 1); + this.port = url.substring(portIndex + 2, webIndex); + } + + /** + * + * @param webIndex web指针 + * @param hostIndex 主机指针 + * @param portIndex 端口指针 + * @return 三个指针是否都存在 + */ + public boolean isContainsRelatedIndex(int webIndex, int hostIndex, int portIndex) { + return webIndex != -1 && hostIndex != -1 && portIndex != -1; + } public void setHttps(boolean https) { isHttps = https; From a6fcfbcde38a98f5e3b23263159abffd584865bd Mon Sep 17 00:00:00 2001 From: "John.Ying" Date: Tue, 11 Oct 2022 16:49:15 +0800 Subject: [PATCH 071/310] =?UTF-8?q?REPORT-81270=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E9=85=8D=E7=BD=AE=E7=95=8C=E9=9D=A2=E5=A4=84?= =?UTF-8?q?=E7=90=86IPV6=E6=A0=BC=E5=BC=8F=E7=9A=84url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-base/src/main/java/com/fr/env/RemoteEnvPane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java index a4423c37dc..83b5e7b95c 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java +++ b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java @@ -75,6 +75,7 @@ public class RemoteEnvPane extends BasicBeanPane { private UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Report_OK")); private UIButton cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel")); private UILabel uiLabel = new UILabel(); + private String IPV6_JUDGE_SYMBOL = "["; /** * 是否启用 https 勾选框 @@ -326,7 +327,7 @@ public class RemoteEnvPane extends BasicBeanPane { ? RemoteWorkspaceURL.createDefaultURL() : new RemoteWorkspaceURL(connection.getUrl()); //判断一下IP地址是不是IPV6的格式,如果是的话在拆分地址和端口的时候需要调整一下格式,用[ 或者 ] 判断 - if (!Strings.isNullOrEmpty(connection.getUrl()) && connection.getUrl().contains("[")) { + if (!Strings.isNullOrEmpty(connection.getUrl()) && connection.getUrl().contains(IPV6_JUDGE_SYMBOL)) { this.remoteWorkspaceURL.refreshIPV6Format(); } String username = fromNullable(connection.getUserName()).or(StringUtils.EMPTY); From d3db2cb26c67f6b47d7759ac2e0fd5d23544df78 Mon Sep 17 00:00:00 2001 From: "John.Ying" Date: Tue, 11 Oct 2022 17:17:43 +0800 Subject: [PATCH 072/310] =?UTF-8?q?REPORT-81270=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E9=85=8D=E7=BD=AE=E7=95=8C=E9=9D=A2=E5=A4=84?= =?UTF-8?q?=E7=90=86IPV6=E6=A0=BC=E5=BC=8F=E7=9A=84url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/env/RemoteEnvPane.java | 5 ++- .../java/com/fr/env/RemoteWorkspaceURL.java | 32 ++++++++----------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java index 83b5e7b95c..63854dc713 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java +++ b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java @@ -75,7 +75,7 @@ public class RemoteEnvPane extends BasicBeanPane { private UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Report_OK")); private UIButton cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel")); private UILabel uiLabel = new UILabel(); - private String IPV6_JUDGE_SYMBOL = "["; + private static final String IPV6_JUDGE_SYMBOL = "["; /** * 是否启用 https 勾选框 @@ -210,6 +210,9 @@ public class RemoteEnvPane extends BasicBeanPane { private void actionURLInputChange() { remoteWorkspaceURL = new RemoteWorkspaceURL(remoteEnvURLInput.getText()); + if (remoteWorkspaceURL.getURL().contains(IPV6_JUDGE_SYMBOL)) { + remoteWorkspaceURL.refreshIPV6Format(); + } fillIndividualField(); httpsCheckbox.setSelected(remoteWorkspaceURL.getHttps()); diff --git a/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java b/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java index b37bc4d051..15e1674b11 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java +++ b/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java @@ -1,9 +1,15 @@ package com.fr.env; +import com.fr.log.FineLoggerFactory; import com.fr.stable.AssistUtils; import com.fr.stable.FCloneable; import com.fr.stable.StringUtils; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; + /** * @author yaohwu */ @@ -135,24 +141,13 @@ public class RemoteWorkspaceURL implements FCloneable { */ public void refreshIPV6Format() { String url = this.url; - // 第三次出现"/"的地方 - int webIndex = url.indexOf("/", url.indexOf("://") + 3); - int hostIndex = url.indexOf("["); - int portIndex = url.indexOf("]"); - isContainsRelatedIndex(webIndex, hostIndex, portIndex); - this.host = url.substring(hostIndex, portIndex + 1); - this.port = url.substring(portIndex + 2, webIndex); - } - - /** - * - * @param webIndex web指针 - * @param hostIndex 主机指针 - * @param portIndex 端口指针 - * @return 三个指针是否都存在 - */ - public boolean isContainsRelatedIndex(int webIndex, int hostIndex, int portIndex) { - return webIndex != -1 && hostIndex != -1 && portIndex != -1; + try { + URI uri = new URI(url); + this.host = uri.getHost(); + this.port = String.valueOf(uri.getPort()); + } catch (URISyntaxException e) { + FineLoggerFactory.getLogger().info("error request url"); + } } public void setHttps(boolean https) { @@ -255,4 +250,5 @@ public class RemoteWorkspaceURL implements FCloneable { } } } + } \ No newline at end of file From 20fd8d2221ea8e567327085c0e8d944291f31dee Mon Sep 17 00:00:00 2001 From: "John.Ying" Date: Tue, 11 Oct 2022 17:19:23 +0800 Subject: [PATCH 073/310] =?UTF-8?q?REPORT-81270=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E9=85=8D=E7=BD=AE=E7=95=8C=E9=9D=A2=E5=A4=84?= =?UTF-8?q?=E7=90=86IPV6=E6=A0=BC=E5=BC=8F=E7=9A=84url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/env/RemoteWorkspaceURL.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java b/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java index 15e1674b11..0583d3cfc3 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java +++ b/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java @@ -4,11 +4,9 @@ import com.fr.log.FineLoggerFactory; import com.fr.stable.AssistUtils; import com.fr.stable.FCloneable; import com.fr.stable.StringUtils; - -import java.net.MalformedURLException; import java.net.URI; import java.net.URISyntaxException; -import java.net.URL; + /** * @author yaohwu From b8c2d337a87429c9ac0c91ceeabcaa271a80a17c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvan-=E6=AC=A7=E9=98=B3=E5=B8=86?= Date: Tue, 11 Oct 2022 22:05:59 +0800 Subject: [PATCH 074/310] =?UTF-8?q?REPORT-75091=20-=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=84=B1=E6=95=8F=EF=BC=88=E6=8A=A5=E8=A1=A8=EF=BC=89=20?= =?UTF-8?q?=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91rt=20?= =?UTF-8?q?=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E8=AF=A6?= =?UTF-8?q?=E8=A7=81=E5=BC=80=E5=8F=91=E6=96=87=E6=A1=A3=EF=BC=9Ahttps://k?= =?UTF-8?q?ms.fineres.com/pages/viewpage.action=3FpageId=3D504469104=20?= =?UTF-8?q?=E3=80=90review=E5=BB=BA=E8=AE=AE=E3=80=91=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=99=9A=E6=98=AF=E5=9B=A0=E4=B8=BA=E8=99=BD=E7=84=B6=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=98=AF=E4=B8=80=E6=9C=9F=EF=BC=8C=E4=BD=86=E6=98=AF?= =?UTF-8?q?=E6=94=BE=E5=88=B0=E4=BA=8C=E6=9C=9F=E5=8F=91=E5=B8=83=EF=BC=8C?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E5=9C=A8=E5=90=88=E5=B9=B6release/11.0?= =?UTF-8?q?=E5=90=8E=E6=89=8D=E6=8F=90=E4=BA=A4feature?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/actions/UpdateAction.java | 14 +- .../com/fr/design/constants/UIConstants.java | 1 + .../datapane/preview/PreviewTableModel.java | 2 + .../datapane/preview/PreviewTablePane.java | 421 ++++++++++++---- .../TableDataPreviewDesensitizeManager.java | 178 +++++++ .../model/DesensitizedPreviewTableModel.java | 113 +++++ .../rule/DesensitizationRuleChoosePane.java | 308 ++++++++++++ .../rule/DesensitizationRuleDebugPane.java | 127 +++++ .../rule/DesensitizationRuleEditPane.java | 296 +++++++++++ .../view/rule/DesensitizationRulePane.java | 80 +++ .../DesensitizationRuleSourceChoosePane.java | 48 ++ .../TableDataDesensitizationSettingPane.java | 110 +++++ .../TableDataDesensitizationTableModel.java | 459 ++++++++++++++++++ .../TableDataDesensitizationTablePane.java | 64 +++ .../design/images/control/refresh_normal.svg | 7 + .../design/standard/add/add_black_normal.svg | 3 + .../design/standard/debug/debug_disabled.svg | 6 + .../fr/design/standard/debug/debug_normal.svg | 4 + .../fr/design/standard/edit/edit_disabled.svg | 5 + .../fr/design/standard/edit/edit_normal.svg | 3 + .../standard/remove/remove_red_normal.svg | 7 + 21 files changed, 2167 insertions(+), 89 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java create mode 100644 designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/model/DesensitizedPreviewTableModel.java create mode 100644 designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java create mode 100644 designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleDebugPane.java create mode 100644 designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleEditPane.java create mode 100644 designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRulePane.java create mode 100644 designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleSourceChoosePane.java create mode 100644 designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationSettingPane.java create mode 100644 designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java create mode 100644 designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTablePane.java create mode 100644 designer-base/src/main/resources/com/fr/design/images/control/refresh_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/standard/add/add_black_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/standard/debug/debug_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/standard/debug/debug_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/standard/edit/edit_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/standard/edit/edit_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/standard/remove/remove_red_normal.svg diff --git a/designer-base/src/main/java/com/fr/design/actions/UpdateAction.java b/designer-base/src/main/java/com/fr/design/actions/UpdateAction.java index 048f233373..d33c04eb15 100644 --- a/designer-base/src/main/java/com/fr/design/actions/UpdateAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/UpdateAction.java @@ -185,12 +185,24 @@ public abstract class UpdateAction extends ShortCut implements Action { * @param resource 图标资源路径 */ public void setSmallIcon(String resource) { + setSmallIcon(resource, true); + } + + /** + * 使用传入资源url的方式设置Icon,会自动设置_normal.svg,然后通过needDisable参数判断是否需要自动设置_disable.svg + * 因为有些地方是不需要设置灰化图标的,所以不存在灰化图标资源,这边如果一并设置,就会报错文件找不到 + * @param resource + * @param needDisable + */ + public void setSmallIcon(String resource, boolean needDisable) { if (StringUtils.equals(resource, StringUtils.EMPTY)) { this.putValue(Action.SMALL_ICON, null); return; } this.putValue(Action.SMALL_ICON, IconUtils.readIcon(resource)); - this.putValue(UpdateAction.DISABLED_ICON, IconUtils.readSVGIcon(resource, IconUtils.ICON_TYPE_DISABLED)); + if (needDisable) { + this.putValue(UpdateAction.DISABLED_ICON, IconUtils.readSVGIcon(resource, IconUtils.ICON_TYPE_DISABLED)); + } } public void setSmallIcon(Icon[] smallIcon, boolean white) { diff --git a/designer-base/src/main/java/com/fr/design/constants/UIConstants.java b/designer-base/src/main/java/com/fr/design/constants/UIConstants.java index b10d3f9e52..850a6b5aac 100644 --- a/designer-base/src/main/java/com/fr/design/constants/UIConstants.java +++ b/designer-base/src/main/java/com/fr/design/constants/UIConstants.java @@ -150,6 +150,7 @@ public interface UIConstants { public static final Color LIST_ITEM_SPLIT_LINE = new Color(0xf0f0f3); public static final Color DESIGNER_LOGIN_BACKGROUND = new Color(0xf1ad14); public static final Color DESIGNER_LOGIN_BACKGROUND_ONCLICK = new Color(0xd89600); + public static final Color CHECK_BOX_TIP_FONT_COLOR = new Color(51, 51, 52, (int)Math.round(0.5 * 255)); public static final BufferedImage DRAG_BAR = IOUtils.readImage("com/fr/design/images/control/bar.png"); public static final BufferedImage DRAG_BAR_LIGHT = IOUtils.readImage("com/fr/design/images/control/bar-light.png"); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTableModel.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTableModel.java index abbe3a7e08..91c8506b79 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTableModel.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTableModel.java @@ -26,6 +26,8 @@ public class PreviewTableModel extends AbstractTableModel { public IntList dateIndexs = new IntList(4); + public PreviewTableModel() {} + public PreviewTableModel(int maxRowCount) { // peter:默认必须显示错误的数据源. this(new ErrorResultSet(), maxRowCount); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java index 5926dcb2df..6665c6f772 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java @@ -3,28 +3,39 @@ */ package com.fr.design.data.datapane.preview; -import com.fr.base.BaseUtils; import com.fr.base.TableData; +import com.fr.base.svg.IconUtils; import com.fr.data.TableDataSource; +import com.fr.data.desensitize.base.AbstractDesensitizationTableData; import com.fr.data.impl.DBTableData; import com.fr.data.impl.EmbeddedTableData; import com.fr.data.impl.NameDataModel; import com.fr.data.operator.DataOperator; import com.fr.design.DesignerEnvManager; +import com.fr.design.constants.UIConstants; import com.fr.design.data.DesignTableDataManager; +import com.fr.design.data.datapane.preview.desensitization.TableDataPreviewDesensitizeManager; +import com.fr.design.data.datapane.preview.desensitization.model.DesensitizedPreviewTableModel; +import com.fr.design.data.datapane.preview.desensitization.view.setting.TableDataDesensitizationSettingPane; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicPane; +import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.frpane.UITabbedPane; +import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.iprogressbar.AutoProgressBar; import com.fr.design.gui.itable.SortableJTable; import com.fr.design.gui.itable.TableSorter; import com.fr.design.gui.itextfield.UINumberField; +import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.JTemplate; +import com.fr.design.menu.SeparatorDef; +import com.fr.design.menu.ToolBarDef; import com.fr.design.ui.util.UIUtil; import com.fr.function.TIME; import com.fr.general.FRFont; @@ -39,6 +50,7 @@ import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; +import javax.swing.SwingUtilities; import javax.swing.SwingWorker; import javax.swing.UIManager; import javax.swing.table.DefaultTableCellRenderer; @@ -57,12 +69,19 @@ import java.sql.Timestamp; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.Objects; import java.util.concurrent.CancellationException; /** * august: PreviewTablePane一共提供5个共有的静态方法,用来预览。 */ public class PreviewTablePane extends BasicPane { + + private static final String DATA_DESENSITIZATION_CONFIG = Toolkit.i18nText("Fine-Design_Report_Desensitization_Config"); + private static final String LEFT_BRACKET = "("; + private static final String RIGHT_BRACKET = ")"; + private static final String COUNT = Toolkit.i18nText("Fine-Design_Report_Desensitization_Count"); + private TableData tableData; private DataModel dataModel; private UINumberField maxPreviewNumberField; @@ -78,6 +97,54 @@ public class PreviewTablePane extends BasicPane { private static PreviewTablePane THIS; private EmbeddedTableData previewTableData; + private UILabel desensitizationLabel; + + /** + * 用于refreshLabel的鼠标监听 + */ + private final MouseAdapter refreshLabelMouseAdapter = new MouseAdapter() { + boolean mouseEntered = false; + boolean buttonPressed = false; + + @Override + public void mouseEntered(MouseEvent e) { // 当鼠标进入时候调用. + mouseEntered = true; + if (!buttonPressed) { + refreshLabel.setBackground(java.awt.Color.WHITE); + refreshLabel.setOpaque(true); + refreshLabel.setBorder(BorderFactory.createLineBorder(java.awt.Color.GRAY)); + } + } + + @Override + public void mouseExited(MouseEvent e) { + mouseEntered = false; + refreshLabel.setOpaque(false); + refreshLabel.setBorder(BorderFactory.createEmptyBorder()); + } + + @Override + public void mousePressed(MouseEvent e) { + buttonPressed = true; + refreshLabel.setBackground(java.awt.Color.lightGray); + } + + @Override + public void mouseReleased(MouseEvent e) { + buttonPressed = false; + if (mouseEntered) { + refreshLabel.setBackground(java.awt.Color.WHITE); + try { + populate(tableData); + if (dataModel != null) { + setRowsLimitTableModel(); + } + } catch (Exception ignore) { + } + } + } + }; + public static final PreviewTablePane getInstance() { if (THIS == null) { THIS = new PreviewTablePane(); @@ -87,91 +154,175 @@ public class PreviewTablePane extends BasicPane { private PreviewTablePane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); + // northPane + this.add(initNorthPane(), BorderLayout.NORTH); + // centerPane + this.add(initCenterPane(), BorderLayout.CENTER); + // dialog + initDialog(); + // progressBar + initProgressBar(); + } - // elalke:预览行数 - JPanel previewNumberPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - this.add(previewNumberPanel, BorderLayout.NORTH); + /** + * 初始化northPane + * + * @return + */ + private JComponent initNorthPane() { + JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + // 预览行数面板 + northPane.add(initPreviewNumberPane(), BorderLayout.CENTER); + // 脱敏预览设置面板 + northPane.add(initDesensitizationPane(), BorderLayout.EAST); + return northPane; + } + /** + * 初始化预览行数面板 + * + * @return + */ + private JComponent initPreviewNumberPane() { + JPanel previewNumberPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + // 当前行数 JPanel currentPreviewPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - previewNumberPanel.add(currentPreviewPanel); currentPreviewPanel.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Current_Preview_Rows") + ":")); - currentRowsField = new UINumberField(); currentPreviewPanel.add(currentRowsField); currentRowsField.setEditable(false); currentRowsField.setColumns(4); currentRowsField.setInteger(true); - + // 最大行数 JPanel maxPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - previewNumberPanel.add(maxPanel); maxPanel.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Datasource_Maximum_Number_of_Preview_Rows") + ":")); - maxPreviewNumberField = new UINumberField(); maxPanel.add(maxPreviewNumberField); maxPreviewNumberField.setColumns(4); maxPreviewNumberField.setInteger(true); - - DesignerEnvManager designerEnvManager = DesignerEnvManager.getEnvManager(); - maxPreviewNumberField.setValue(designerEnvManager.getMaxNumberOrPreviewRow()); - + maxPreviewNumberField.setValue(DesignerEnvManager.getEnvManager().getMaxNumberOrPreviewRow()); maxPreviewNumberField.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent evt) { DesignerEnvManager designerEnvManager = DesignerEnvManager.getEnvManager(); designerEnvManager.setMaxNumberOrPreviewRow((int) ((UINumberField) evt.getSource()).getValue()); } }); + // 刷新按钮 + initRefreshLabel(); - Icon refreshImage = BaseUtils.readIcon("/com/fr/design/images/control/refresh.png"); - refreshLabel = new UILabel(refreshImage); + previewNumberPanel.add(currentPreviewPanel); + previewNumberPanel.add(maxPanel); previewNumberPanel.add(refreshLabel); - refreshLabel.addMouseListener(new MouseAdapter() { - boolean mouseEntered = false; - boolean buttonPressed = false; - - public void mouseEntered(MouseEvent e) { // 当鼠标进入时候调用. - mouseEntered = true; - if (!buttonPressed) { - refreshLabel.setBackground(java.awt.Color.WHITE); - refreshLabel.setOpaque(true); - refreshLabel.setBorder(BorderFactory.createLineBorder(java.awt.Color.GRAY)); - } - } - - public void mouseExited(MouseEvent e) { - mouseEntered = false; - refreshLabel.setOpaque(false); - refreshLabel.setBorder(BorderFactory.createEmptyBorder()); - } + return previewNumberPanel; + } - public void mousePressed(MouseEvent e) { - buttonPressed = true; - refreshLabel.setBackground(java.awt.Color.lightGray); - } + private void initRefreshLabel() { + Icon refreshImage = IconUtils.readIcon("/com/fr/design/images/control/refresh"); + refreshLabel = new UILabel(refreshImage); + refreshLabel.addMouseListener(refreshLabelMouseAdapter); + } - public void mouseReleased(MouseEvent e) { - buttonPressed = false; - if (mouseEntered) { - refreshLabel.setBackground(java.awt.Color.WHITE); - try { - populate(tableData); - if (dataModel != null) { - setRowsLimitTableModel(); + /** + * 初始化脱敏设置面板 + * + * @return + */ + private JComponent initDesensitizationPane() { + JPanel desensitizationPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + // 初始化Label + desensitizationLabel = new UILabel(DATA_DESENSITIZATION_CONFIG); + desensitizationLabel.setForeground(UIConstants.NORMAL_BLUE); + desensitizationLabel.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + TableDataDesensitizationSettingPane settingPane = new TableDataDesensitizationSettingPane((AbstractDesensitizationTableData) tableData); + settingPane.populateBean((AbstractDesensitizationTableData) tableData); + BasicDialog dialog = settingPane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(PreviewTablePane.this), new DialogActionAdapter() { + @Override + public void doOk() { + // 保存脱敏规则配置 + settingPane.updateBean(); + // 改变模板保存状态 + JTemplate editingTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + if (Objects.nonNull(editingTemplate)) { + editingTemplate.fireTargetModified(true); } - } catch (Exception e1) { + // 刷新预览页面 + refreshTable(); } - } + + @Override + public void doCancel() { + + } + }, BasicDialog.DEFAULT); + dialog.setVisible(true); } }); + // 初始化分隔符 + ToolBarDef toolbarDef = new ToolBarDef(); + toolbarDef.addShortCut(SeparatorDef.DEFAULT); + UIToolbar toolBar = ToolBarDef.createJToolBar(); + toolBar.setBorderPainted(false); + toolbarDef.updateToolBar(toolBar); + + // 初始化预览按钮 + UIToggleButton previewToggle = new UIToggleButton(new Icon[]{IconUtils.readIcon("/com/fr/design/images/m_file/preview"), IconUtils.readIcon("/com/fr/design/images/m_file/preview")}, true); + previewToggle.setToolTipText(Toolkit.i18nText("Fine-Design_Report_Desensitization_Preview")); + previewToggle.setSelected(false); + previewToggle.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + // 切换TableModel的脱敏状态 + togglePreviewTableModelDesensitizeStatus(); + // 刷新页面,展示 + refreshTable(); + } + }); + + desensitizationPane.add(desensitizationLabel); + desensitizationPane.add(toolBar); + desensitizationPane.add(previewToggle); + return desensitizationPane; + } + + /** + * 设置脱敏设置的个数 + * + * @param model + */ + private void setDesensitizationCount(TableModel model) { + if (isDesensitizeOpened()) { + int count = model instanceof DesensitizedPreviewTableModel ? ((DesensitizedPreviewTableModel) model).getDesensitizeColumnsCount() : 0; + desensitizationLabel.setText(DATA_DESENSITIZATION_CONFIG + LEFT_BRACKET + count + RIGHT_BRACKET + COUNT); + } else { + desensitizationLabel.setText(DATA_DESENSITIZATION_CONFIG); + } + } + + /** + * 初始化centerPane + * + * @return + */ + private JComponent initCenterPane() { preveiwTable = new CopyableJTable(new TableSorter()); preveiwTable.setRowSelectionAllowed(false); preveiwTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); + return new JScrollPane(preveiwTable); + } - this.add(new JScrollPane(preveiwTable), BorderLayout.CENTER); + private void initDialog() { if (this.dialog == null) { this.dialog = this.showWindow(new JFrame()); } + } + + private void initProgressBar() { progressBar = new AutoProgressBar(this, Toolkit.i18nText("Fine-Design_Basic_Loading_Data"), "", 0, 100) { + @Override public void doMonitorCanceled() { if (getWorker() != null) { getWorker().cancel(true); @@ -182,7 +333,7 @@ public class PreviewTablePane extends BasicPane { } public AutoProgressBar getProgressBar() { - return this.progressBar; + return PreviewTablePane.progressBar; } @Override @@ -222,13 +373,19 @@ public class PreviewTablePane extends BasicPane { return this.worker; } - // elake:为预览表的columnIndex列着c色. + /** + * 为预览表的columnIndex列着色. + * + * @param columnIndex 列索引值 + * @param c 颜色 + */ private void setPreviewTableColumnColor(final int columnIndex, final Color c) { addLoadedListener(new LoadedEventListener() { @Override public void fireLoaded() { TableColumn column = preveiwTable.getColumnModel().getColumn(columnIndex); DefaultTableCellRenderer cellRenderer = new DefaultTableCellRenderer() { + @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { JComponent comp = (JComponent) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); comp.setBackground(c); @@ -249,7 +406,7 @@ public class PreviewTablePane extends BasicPane { getInstance().preveiwTable = new SortableJTable(new TableSorter()); getInstance().preveiwTable.setRowSelectionAllowed(false); getInstance().preveiwTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); - getInstance().progressBar.close(); + PreviewTablePane.progressBar.close(); getInstance().repaint(); } @@ -331,6 +488,7 @@ public class PreviewTablePane extends BasicPane { private void previewTableDataSQL() throws Exception { connectionBar = new AutoProgressBar(this, Toolkit.i18nText("Fine-Design_Basic_Utils_Now_Create_Connection"), "", 0, 100) { + @Override public void doMonitorCanceled() { getWorker().cancel(true); getDialog().setVisible(false); @@ -345,42 +503,49 @@ public class PreviewTablePane extends BasicPane { private void setPreviewTableColumnValue(final Graphics g) { for (int i = 0; i < preveiwTable.getColumnModel().getColumnCount(); i++) { TableColumn column = preveiwTable.getColumnModel().getColumn(i); - DefaultTableCellRenderer cellRenderer = new DefaultTableCellRenderer() { - public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { - JComponent comp = (JComponent) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); - Font f = table.getFont(); - - //默认在系统不支持 无法显示时 如自造的字 ,字体设置为空. - Font defaultShowFont = FRFont.getInstance("", f.getStyle(), f.getSize()); - if (value instanceof String) { - String str = (String) value; - for (int j = 0; j < str.length(); j++) { - char c = str.charAt(j); - if (!f.canDisplay(c)) { - table.setFont(defaultShowFont); - } + DefaultTableCellRenderer cellRenderer = getDefaultTableCellRenderer(); + column.setCellRenderer(cellRenderer); + } + } + + /** + * 默认表格格子渲染器 + * + * @return + */ + private DefaultTableCellRenderer getDefaultTableCellRenderer() { + return new DefaultTableCellRenderer() { + @Override + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { + JComponent comp = (JComponent) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); + Font f = table.getFont(); + + //默认在系统不支持 无法显示时 如自造的字 ,字体设置为空. + Font defaultShowFont = FRFont.getInstance("", f.getStyle(), f.getSize()); + if (value instanceof String) { + String str = (String) value; + for (int j = 0; j < str.length(); j++) { + char c = str.charAt(j); + if (!f.canDisplay(c)) { + table.setFont(defaultShowFont); } } - return comp; } - }; - column.setCellRenderer(cellRenderer); - } + return comp; + } + }; } private void setWorker() { - worker = new SwingWorker() { - protected PreviewTableModel doInBackground() throws Exception { + worker = new SwingWorker() { + + @Override + protected TableModel doInBackground() throws Exception { connectionBar.start(); try { - if (tableData instanceof DBTableData) { - boolean status = DataOperator.getInstance().testConnection(((DBTableData) tableData).getDatabase()); - if (!status) { - throw new Exception(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed")); - } - } + testDBTableDataConnection(tableData); } finally { // 将close操作放到EDT线程中 UIUtil.invokeLaterIfNeeded(() -> connectionBar.close()); @@ -390,22 +555,20 @@ public class PreviewTablePane extends BasicPane { // parameterInputDialog // update之后的parameters,转成一个parameterMap,用于预览TableData PreviewTableModel previewModel = new PreviewTableModel(previewTableData.createDataModel(null), (int) maxPreviewNumberField.getValue()); - for (int i = 0; i < previewTableData.getColumnCount(); i++) { - Class cls = previewTableData.getColumnClass(i); - if (cls == Date.class || cls == TIME.class || cls == Timestamp.class) { - previewModel.dateIndexs.add(i); - } + if (TableDataPreviewDesensitizeManager.getInstance().needDesensitize(tableData)) { + // 数据集预览脱敏 + previewModel = TableDataPreviewDesensitizeManager.getInstance().desensitizeTableModel(tableData, previewModel); } + dealWithPreviewTableModelColumnClass(previewModel, previewTableData); return previewModel; } + @Override public void done() { try { - PreviewTableModel model = get(); - setModel(model); - setCurrentRows(model.getRowCount()); + TableModel model = get(); + setPreviewTableModel(model); setPreviewTableColumnValue(getParent().getGraphics()); - fireLoadedListener(); } catch (Exception e) { if (!(e instanceof CancellationException)) { FineLoggerFactory.getLogger().error(e.getMessage(), e); @@ -420,6 +583,36 @@ public class PreviewTablePane extends BasicPane { }; } + /** + * 检查DBTableData连接 + * + * @param tableData + * @throws Exception + */ + private void testDBTableDataConnection(TableData tableData) throws Exception { + if (tableData instanceof DBTableData) { + boolean status = DataOperator.getInstance().testConnection(((DBTableData) tableData).getDatabase()); + if (!status) { + throw new Exception(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed")); + } + } + } + + /** + * 处理预览Model的列类型 + * + * @param previewModel + * @param previewTableData + */ + private void dealWithPreviewTableModelColumnClass(PreviewTableModel previewModel, EmbeddedTableData previewTableData) { + for (int i = 0; i < previewTableData.getColumnCount(); i++) { + Class cls = previewTableData.getColumnClass(i); + if (cls == Date.class || cls == TIME.class || cls == Timestamp.class) { + previewModel.dateIndexs.add(i); + } + } + } + /** * 直接预览存储过程的一个返回数据集,没有实际值和显示值 * @@ -528,9 +721,61 @@ public class PreviewTablePane extends BasicPane { } catch (Exception e) { previewModel = new PreviewTableModel((int) maxPreviewNumberField.getValue()); } - setModel(previewModel); - setCurrentRows(previewModel.getRowCount()); + setPreviewTableModel(previewModel); + + } + + /** + * 切换TableModel的展示状态 + */ + private void togglePreviewTableModelDesensitizeStatus() { + if (!isDesensitizeOpened()) { + // 未启用数据脱敏时,不需要切换 + return; + } + TableSorter tableSorter = (TableSorter) preveiwTable.getModel(); + TableModel originTableModel = tableSorter.getTableModel(); + if (originTableModel instanceof DesensitizedPreviewTableModel) { + ((DesensitizedPreviewTableModel) originTableModel).toggleNeedDesensite(); + } + } + + /** + * 刷新一下预览页面,用于切换脱敏和非脱敏时的显示 + */ + private void refreshTable() { + TableModel originTableModel = getCurrentTableModel(); + setPreviewTableModel(originTableModel); + } + + /** + * 获取当前的TableModel,已经除掉了TableSorter的包装 + * + * @return + */ + private TableModel getCurrentTableModel() { + TableSorter tableSorter = (TableSorter) preveiwTable.getModel(); + return tableSorter.getTableModel(); + } + + /** + * 设置预览TableModel + * + * @param previewTableModel + */ + private void setPreviewTableModel(TableModel previewTableModel) { + setDesensitizationCount(previewTableModel); + setModel(previewTableModel); + setCurrentRows(previewTableModel.getRowCount()); fireLoadedListener(); + } + /** + * 数据脱敏是否启用 + * @return + */ + private boolean isDesensitizeOpened() { + return tableData instanceof AbstractDesensitizationTableData && + ((AbstractDesensitizationTableData) tableData).getDesensitizeOpen(); } } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java new file mode 100644 index 0000000000..c8cdae8e72 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java @@ -0,0 +1,178 @@ +package com.fr.design.data.datapane.preview.desensitization; + + +import com.fr.base.TableData; +import com.fr.data.desensitize.base.AbstractDesensitizationTableData; +import com.fr.data.desensitize.base.TableDataDesensitizationBean; +import com.fr.data.desensitize.manage.DesensitizationManager; +import com.fr.data.desensitize.util.DesentizationUtils; +import com.fr.decision.webservice.bean.user.DepartmentPostBean; +import com.fr.decision.webservice.bean.user.RoleBean; +import com.fr.decision.webservice.utils.DecisionServiceConstants; +import com.fr.decision.webservice.v10.user.CustomRoleService; +import com.fr.decision.webservice.v10.user.PositionService; +import com.fr.design.data.DesignTableDataManager; +import com.fr.design.data.datapane.preview.PreviewTableModel; +import com.fr.design.data.datapane.preview.desensitization.model.DesensitizedPreviewTableModel; +import com.fr.design.data.tabledata.wrapper.TableDataWrapper; +import com.fr.general.ComparatorUtils; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.StringUtils; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Comparator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + + +/** + * 管理所有数据集预览过程中的脱敏计算 + * @author Yvan + * @version 11.0 + * Created by Yvan on 2022/9/14 + */ +public class TableDataPreviewDesensitizeManager implements DesensitizationManager { + + private static final String CONNECTOR = "_"; + + private TableDataPreviewDesensitizeManager() { + } + + private static class Holder { + private static final TableDataPreviewDesensitizeManager INSTANCE = new TableDataPreviewDesensitizeManager(); + } + + public static TableDataPreviewDesensitizeManager getInstance() { + return TableDataPreviewDesensitizeManager.Holder.INSTANCE; + } + + /** + * 判断数据集预览时是否需要脱敏,这里不需要判断roleIds,因为默认有权限编辑的人一定有权限看脱敏前后字段值 + * + * @param tableData + * @return + */ + public boolean needDesensitize(TableData tableData) { + return tableData instanceof AbstractDesensitizationTableData && + DesentizationUtils.isCollectionNotEmpty(((AbstractDesensitizationTableData) tableData).getDesensitizationBeans()) && + ((AbstractDesensitizationTableData) tableData).getDesensitizationBeans().stream().noneMatch(TableDataDesensitizationBean::invalid); + } + + /** + * 数据集预览脱敏,使用DesensitizedPreviewTableModel对当前的预览TableModel做包装 + * + * @param model + * @return + */ + public PreviewTableModel desensitizeTableModel(TableData tableData, PreviewTableModel model) { + if (needDesensitize(tableData)) { + Map desensitizationBeanMap = new LinkedHashMap<>(); + // 获取此数据集的所有脱敏信息 + Collection desensitizationBeans = ((AbstractDesensitizationTableData) tableData).getDesensitizationBeans(); + // 排个序 + List sortedBeans = desensitizationBeans.stream().sorted(Comparator.comparingInt(TableDataDesensitizationBean::getColumnIndex)).collect(Collectors.toList()); + int columnIndex = 0; + for (TableDataDesensitizationBean sortedBean : sortedBeans) { + // 当map中已包含列序号时,代表对这一列设置了不同的脱敏规则,将key + 1 + if (desensitizationBeanMap.containsKey(columnIndex)) { + columnIndex++; + } + desensitizationBeanMap.put(columnIndex, sortedBean); + } + // 包装TableModel + return new DesensitizedPreviewTableModel(model, desensitizationBeanMap); + } + return model; + } + + /** + * 通过TableData获取其列名 + * 实现逻辑有点绕,TableData本身并不能返回列名集合,只能先去获取当前模板所有数据集,然后匹配名称拿到TableDataWrapper再获取列名 + * @param tableData + * @return + */ + public List getColumnNamesByTableData(TableData tableData) { + List> editingDataSet = DesignTableDataManager.getEditingDataSet(DesignTableDataManager.getEditingTableDataSource()); + // 当前所有模板数据集Wrapper,不包括存储过程 + Map templeteDataMap = editingDataSet.get(0); + // 当前所有模板数据集Wrapper,包括存储过程 + Map dataWrapperMap = DesignTableDataManager.getAllDataSetIncludingProcedure(templeteDataMap); + // 找到匹配当前数据集名称的Wrapper + TableDataWrapper tableDataWrapper = dataWrapperMap.get(tableData.getName()); + return tableDataWrapper == null ? + new ArrayList<>() : + tableDataWrapper.calculateColumnNameList(); + } + + /** + * 这个api会返回 部门职位 + 自定义角色 的Map + * 其中 key为 "pid" + "_" + "id",value为 "ptext" + "text" + * @return + */ + public Map getAllRoles() { + Map rolesMap = new LinkedHashMap<>(); + // 处理部门职位相关的用户组 + addDepartmentAndPositionRoles2Map(rolesMap); + // 处理自定义角色相关的用户组 + addCustomRoles2Map(rolesMap); + return rolesMap; + } + + /** + * 获取所有的部门职位,按照 key为 "pid" + "_" + "id",value为 "ptext" + "text"的格式添加到参数Map中 + * @param rolesMap + */ + private void addDepartmentAndPositionRoles2Map(Map rolesMap) { + try { + List postBeans = PositionService.getInstance().getDepartmentPostNameList(); + for (DepartmentPostBean postBean : postBeans) { + String department = postBean.getpText(); + String position = postBean.getText(); + String departmentId = postBean.getpId(); + String positionId = postBean.getId(); + if (!ComparatorUtils.equals(DecisionServiceConstants.DECISION_DEP_ROOT, postBean.getId()) && StringUtils.isNotEmpty(position)) { + // 只添加部门和职位同时存在的 + rolesMap.put(mergeRoleId(departmentId, positionId), mergeRoleText(department, position)); + } + } + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e, "[Desensitization] failed to add department and position roles to map for {}", e.getMessage()); + } + } + + /** + * 获取所有的自定义角色,按照 id - name添加到参数map里 + * @param rolesMap + */ + private void addCustomRoles2Map(Map rolesMap) { + try { + List allCustomRole = CustomRoleService.getInstance().getAllCustomRoleNameList(null); + allCustomRole.forEach(roleBean -> rolesMap.put(roleBean.getId(), roleBean.getText())); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e, "[Desensitization] failed to add custom role to map for {}", e.getMessage()); + } + } + + /** + * 合并部门 + 职位的名称 + * @param departmentName + * @param positionName + * @return + */ + public String mergeRoleText(String departmentName, String positionName) { + return departmentName + positionName; + } + + /** + * 合并部门 + 职位的id + * @param departmentId + * @param positionId + * @return + */ + public String mergeRoleId(String departmentId, String positionId) { + return departmentId + CONNECTOR + positionId; + } +} diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/model/DesensitizedPreviewTableModel.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/model/DesensitizedPreviewTableModel.java new file mode 100644 index 0000000000..066f11374b --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/model/DesensitizedPreviewTableModel.java @@ -0,0 +1,113 @@ +package com.fr.design.data.datapane.preview.desensitization.model; + + +import com.fr.data.desensitize.base.TableDataDesensitizationBean; +import com.fr.data.desensitize.calculate.DesensitizationCalculator; +import com.fr.data.desensitize.rule.base.DesensitizationRule; +import com.fr.design.data.datapane.preview.PreviewTableModel; + +import java.util.Map; +import java.util.Objects; + +/** + * 数据集预览TableModel的脱敏实现 + * + * @author Yvan + * @version 11.0 + * Created by Yvan on 2022/9/14 + */ +public class DesensitizedPreviewTableModel extends PreviewTableModel { + + /** + * 原始数据Model + */ + private PreviewTableModel previewTableModel; + + /** + * 脱敏后新组装的TableModel中,列序号 - 脱敏信息 对应的Map + */ + private Map desensitizationBeanMap; + + private boolean needDesensitize = false; + + public DesensitizedPreviewTableModel(PreviewTableModel previewTableModel, Map desensitizationBeanMap) { + this.previewTableModel = previewTableModel; + this.desensitizationBeanMap = desensitizationBeanMap; + } + + @Override + public String getColumnName(int column) { + int originIndex = needDesensitize && Objects.nonNull(desensitizationBeanMap.get(column)) ? + desensitizationBeanMap.get(column).getColumnIndex() : column; + return previewTableModel.getColumnName(originIndex); + } + + @Override + public int getRowCount() { + return previewTableModel.getRowCount(); + } + + @Override + public int getColumnCount() { + return needDesensitize ? + getDesensitizeColumnsCount() : + previewTableModel.getColumnCount(); + } + + @Override + public Object getValueAt(int rowIndex, int columnIndex) { + return needDesensitize && Objects.nonNull(desensitizationBeanMap.get(columnIndex)) ? + getDesensitizedValue(rowIndex, columnIndex) : + previewTableModel.getValueAt(rowIndex, columnIndex); + } + + /** + * 返回脱敏后的数据值 + * + * @param rowIndex + * @param columnIndex + * @return + */ + private Object getDesensitizedValue(int rowIndex, int columnIndex) { + // 先通过columnIndex找到对应原TableModel的列序号 + int originColumnIndex = desensitizationBeanMap.get(columnIndex).getColumnIndex(); + // 获取原值 + Object value = previewTableModel.getValueAt(rowIndex, originColumnIndex); + // 判空 + if (Objects.isNull(value)) { + return value; + } + // 脱敏 + String strValue = String.valueOf(value); + value = desensitizeValue(strValue, columnIndex); + return value; + } + + /** + * 计算脱敏后的value,此时columnIndex对应的脱敏信息一定不为空 + * + * @param strValue + * @param columnIndex + * @return + */ + private String desensitizeValue(String strValue, int columnIndex) { + TableDataDesensitizationBean desensitizationBean = desensitizationBeanMap.get(columnIndex); + DesensitizationRule desensitizationRule = desensitizationBean.getDesensitizationRule(); + return DesensitizationCalculator.getInstance().desensitize(strValue, desensitizationRule); + } + + /** + * 获取当前有效的脱敏字段个数 + * @return + */ + public int getDesensitizeColumnsCount() { + return desensitizationBeanMap.size(); + } + + /** + * 切换脱敏状态 + */ + public void toggleNeedDesensite() { + this.needDesensitize = !needDesensitize; + } +} diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java new file mode 100644 index 0000000000..35901ff4b8 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java @@ -0,0 +1,308 @@ +package com.fr.design.data.datapane.preview.desensitization.view.rule; + +import com.fr.base.svg.IconUtils; +import com.fr.data.desensitize.rule.DesensitizationRuleManager; +import com.fr.data.desensitize.rule.base.DesensitizationRule; +import com.fr.data.desensitize.rule.base.DesensitizationRuleSource; +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.gui.ibutton.UIRadioButton; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itableeditorpane.UITableEditAction; +import com.fr.design.gui.itableeditorpane.UITableEditorPane; +import com.fr.design.gui.itableeditorpane.UITableModelAdapter; +import com.fr.design.i18n.Toolkit; +import com.fr.stable.StringUtils; +import com.fr.stable.collections.CollectionUtils; + +import javax.swing.AbstractCellEditor; +import javax.swing.JPanel; +import javax.swing.JTable; +import javax.swing.SwingUtilities; +import javax.swing.table.TableCellEditor; +import javax.swing.table.TableCellRenderer; +import java.awt.CardLayout; +import java.awt.Component; +import java.awt.event.ActionEvent; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * 脱敏规则选择页面 + * + * @author Yvan + * @version 11.0 + * Created by Yvan on 2022/9/26 + */ +public class DesensitizationRuleChoosePane extends JPanel { + + private CardLayout cardLayout; + + private UITableEditorPane serverRuleEditPane; + + private UITableEditorPane customRuleEditPane; + + private DesensitizationRuleSource currentRuleSource; + + public DesensitizationRuleChoosePane() { + this.cardLayout = new CardLayout(); + this.setLayout(cardLayout); + serverRuleEditPane = new UITableEditorPane<>(new DesensitizationRuleChooseTableModel(this, true)); + customRuleEditPane = new UITableEditorPane<>(new DesensitizationRuleChooseTableModel(this, false)); + serverRuleEditPane.setHeaderResizing(false); + customRuleEditPane.setHeaderResizing(false); + populateDesensitizationRules(); + this.add(serverRuleEditPane, DesensitizationRuleSource.SERVER.name()); + this.add(customRuleEditPane, DesensitizationRuleSource.CUSTOM.name()); + // 默认显示平台规则 + switchPaneByRuleSource(DesensitizationRuleSource.SERVER); + } + + public void switchPaneByRuleSource(DesensitizationRuleSource ruleSource) { + this.currentRuleSource = ruleSource; + this.cardLayout.show(this, ruleSource.name()); + } + + /** + * 展示当前规则 + */ + private void populateDesensitizationRules() { + serverRuleEditPane.populate(DesensitizationRuleManager.getInstance().getRules(DesensitizationRuleSource.SERVER)); + customRuleEditPane.populate(DesensitizationRuleManager.getInstance().getRules(DesensitizationRuleSource.CUSTOM)); + } + + /** + * 获取当前选中的规则 + * + * @return + */ + public DesensitizationRule getSelectedDesensitizationRule() { + switch (currentRuleSource) { + case SERVER: + return serverRuleEditPane.getTableModel().getSelectedValue(); + case CUSTOM: + return customRuleEditPane.getTableModel().getSelectedValue(); + default: + return null; + } + } + + /** + * 规则选择Table的TableModel + */ + private class DesensitizationRuleChooseTableModel extends UITableModelAdapter { + + private Component parent; + + private boolean debugActionOnly; + + protected DesensitizationRuleChooseTableModel(Component parent, boolean debugActionOnly) { + super(new String[]{ + StringUtils.EMPTY, + Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Name"), + Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Description") + }); + this.parent = parent; + this.debugActionOnly = debugActionOnly; + this.setColumnClass(new Class[]{ + RuleChoosePane.class, + UILabel.class, + UILabel.class + }); + this.setDefaultEditor(RuleChoosePane.class, new RuleChoosePane()); + this.setDefaultRenderer(RuleChoosePane.class, new RuleChoosePane()); + this.createTable().getColumnModel().getColumn(0).setMaxWidth(20); + } + + @Override + public Object getValueAt(int rowIndex, int columnIndex) { + DesensitizationRule rule = getList().get(rowIndex); + switch (columnIndex) { + case 0: + return rule.equals(getSelectedValue()); + case 1: + return rule.getRuleName(); + case 2: + return DesensitizationRule.getDescription(rule); + default: + return StringUtils.EMPTY; + } + } + + @Override + public boolean isCellEditable(int row, int col) { + return true; + } + + @Override + public UITableEditAction[] createAction() { + return debugActionOnly ? + new UITableEditAction[]{new DebugRuleAction(parent)} : + new UITableEditAction[]{new AddRuleAction(), new EditRuleAction(), new DeleteRuleAction(parent), new DebugRuleAction(parent)}; + } + + private Set getCurrentExistRuleNames(String excludeName) { + List rules = getList(); + return CollectionUtils.isEmpty(rules) ? + new LinkedHashSet<>() : + rules.stream() + .map(DesensitizationRule::getRuleName) + .filter(name -> !StringUtils.equals(name, excludeName)) + .collect(Collectors.toSet()); + } + + private class RuleChoosePane extends AbstractCellEditor implements TableCellEditor, TableCellRenderer { + + private UIRadioButton selectedButton; + + public RuleChoosePane() { + this.selectedButton = new UIRadioButton(); + } + + @Override + public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { + selectedButton.setSelected(isSelected); + return selectedButton; + } + + @Override + public Object getCellEditorValue() { + return selectedButton.isSelected(); + } + + @Override + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { + selectedButton.setSelected(isSelected); + return selectedButton; + } + } + + /** + * 添加规则 + */ + private class AddRuleAction extends AddTableRowAction { + + public AddRuleAction() { + this.setName(Toolkit.i18nText("Fine-Design_Report_Desensitization_Add")); + this.setSmallIcon("/com/fr/design/standard/add/add_black", false); + } + + @Override + public void actionPerformed(ActionEvent e) { + // 新增一条规则 + DesensitizationRuleEditPane editPane = new DesensitizationRuleEditPane(getCurrentExistRuleNames(StringUtils.EMPTY)); + BasicDialog basicDialog = editPane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(parent), new DialogActionAdapter() { + @Override + public void doOk() { + DesensitizationRule rule = editPane.updateBean(); + // 添加到Rule Manager中 + if (DesensitizationRule.valid(rule)) { + DesensitizationRuleManager.getInstance().addRule(rule); + } + // 添加到Table中 + addRow(rule); + fireTableDataChanged(); + } + + @Override + public void doCancel() { + super.doCancel(); + } + }, BasicDialog.DEFAULT); + basicDialog.setVisible(true); + } + } + + private class EditRuleAction extends UITableEditAction { + + public EditRuleAction() { + this.setName(Toolkit.i18nText("Fine-Design_Basic_Edit")); + this.setSmallIcon(IconUtils.readIcon("/com/fr/design/standard/edit/edit")); + } + + @Override + public void checkEnabled() { + setEnabled(table.getSelectedRow() != -1); + } + + @Override + public void actionPerformed(ActionEvent e) { + // 获取当前选中规则 + DesensitizationRule selectedValue = getSelectedValue(); + DesensitizationRuleEditPane editPane = new DesensitizationRuleEditPane(getCurrentExistRuleNames(selectedValue.getRuleName())); + editPane.populateBean(selectedValue); + BasicDialog basicDialog = editPane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(parent), new DialogActionAdapter() { + @Override + public void doOk() { + DesensitizationRule rule = editPane.updateBean(); + // 修改同步到RuleManager中 + if (DesensitizationRule.valid(rule)) { + DesensitizationRuleManager.getInstance().updateRule(rule); + } + fireTableDataChanged(); + } + + @Override + public void doCancel() { + super.doCancel(); + } + }, BasicDialog.DEFAULT); + basicDialog.setVisible(true); + } + } + + private class DeleteRuleAction extends DeleteAction { + + public DeleteRuleAction(Component parent) { + super(parent); + this.setName(Toolkit.i18nText("Fine-Design_Basic_Base_Remove")); + this.setSmallIcon("/com/fr/design/images/control/remove"); + } + + @Override + public void checkEnabled() { + setEnabled(table.getSelectedRow() != -1); + } + + @Override + public void actionPerformed(ActionEvent e) { + // 获取当前选中规则 + DesensitizationRule selectedRule = getSelectedValue(); + // 删除同步到RuleManager中 + if (DesensitizationRule.valid(selectedRule)) { + DesensitizationRuleManager.getInstance().removeRule(selectedRule); + } + super.actionPerformed(e); + } + } + + private class DebugRuleAction extends UITableEditAction { + + private Component parent; + + public DebugRuleAction(Component parent) { + this.parent = parent; + this.setName(Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Debug")); + this.setSmallIcon("/com/fr/design/standard/debug/debug"); + } + + @Override + public void checkEnabled() { + setEnabled(table.getSelectedRow() != -1); + } + + @Override + public void actionPerformed(ActionEvent e) { + // 获取当前选中规则 + DesensitizationRule selectedRule = getSelectedValue(); + DesensitizationRuleDebugPane ruleDebugPane = new DesensitizationRuleDebugPane(selectedRule); + BasicDialog ruleDebugDialog = ruleDebugPane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(parent), null, BasicDialog.DEFAULT); + ruleDebugDialog.setVisible(true); + } + } + } + + +} diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleDebugPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleDebugPane.java new file mode 100644 index 0000000000..71998b7bee --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleDebugPane.java @@ -0,0 +1,127 @@ +package com.fr.design.data.datapane.preview.desensitization.view.rule; + +import com.fr.data.desensitize.calculate.DesensitizationCalculator; +import com.fr.data.desensitize.rule.base.DesensitizationRule; +import com.fr.design.dialog.BasicPane; +import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.stable.StringUtils; + +import javax.swing.BorderFactory; +import javax.swing.JComponent; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; + +/** + * 脱敏规则调试页 + * @author Yvan + * @version 11.0 + * Created by Yvan on 2022/9/8 + */ +public class DesensitizationRuleDebugPane extends BasicPane { + + /** + * 脱敏规则 + */ + private DesensitizationRule rule; + + public DesensitizationRuleDebugPane(DesensitizationRule rule) { + this.rule = rule; + initComponent(); + } + + private void initComponent() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.add(initNorthPane(), BorderLayout.NORTH); + this.add(initCenterPane(), BorderLayout.CENTER); + } + + private JPanel initNorthPane() { + JPanel northPane = FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Description")); + JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + panel.setBorder(BorderFactory.createEmptyBorder(20, 10, 0, 0)); + UILabel desensitizationRule = new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Algorithm")); + UILabel characterReplace = new UILabel(rule.getRuleType().getTypeName()); + UILabel description = new UILabel(DesensitizationRule.getDescription(rule)); + JComponent[][] components = new JComponent[][] { + {desensitizationRule, characterReplace}, + {new UILabel(), description} + }; + panel.add( + TableLayoutHelper.createCommonTableLayoutPane( + components, + new double[]{TableLayout.PREFERRED, TableLayout.PREFERRED}, + new double[]{TableLayout.PREFERRED, TableLayout.PREFERRED}, + 20), + BorderLayout.CENTER); + northPane.add(panel); + return northPane; + } + + private JPanel initCenterPane() { + JPanel centerPane = FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Debug")); + JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + panel.setBorder(BorderFactory.createEmptyBorder(20, 10, 0, 0)); + + UILabel beforeDesensitize = new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_Before")); + UITextField beforeDesensitizeText = new UITextField(20); + beforeDesensitizeText.setPlaceholder(Toolkit.i18nText("Fine-Design_Report_Desensitization_Enter_Content")); + UILabel afterDesensitize = new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_After")); + UITextField afterDesensitizeText = new UITextField(20); + afterDesensitizeText.setEditable(false); + UIButton desensitizeButton = new UIButton(Toolkit.i18nText("Fine-Design_Report_Desensitization_Debug")); + beforeDesensitizeText.addFocusListener(new FocusListener() { + @Override + public void focusGained(FocusEvent e) { + afterDesensitizeText.setText(StringUtils.EMPTY); + } + + @Override + public void focusLost(FocusEvent e) { + + } + }); + desensitizeButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + String text = beforeDesensitizeText.getText(); + if (StringUtils.isEmpty(text)) { + FineJOptionPane.showMessageDialog(DesensitizationRuleDebugPane.this, + Toolkit.i18nText("Fine-Design_Report_Desensitization_Please_Enter_Valid_Content")); + } + String desensitizedText = DesensitizationCalculator.getInstance().desensitize(text, rule); + afterDesensitizeText.setText(desensitizedText); + } + }); + + JComponent[][] components = new JComponent[][] { + {beforeDesensitize, beforeDesensitizeText, desensitizeButton}, + {afterDesensitize, afterDesensitizeText, new UILabel()} + }; + panel.add( + TableLayoutHelper.createCommonTableLayoutPane( + components, + new double[]{TableLayout.PREFERRED, TableLayout.PREFERRED}, + new double[]{TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED}, + 20), + BorderLayout.CENTER); + + centerPane.add(panel); + return centerPane; + } + + @Override + protected String title4PopupWindow() { + return Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Debug"); + } +} diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleEditPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleEditPane.java new file mode 100644 index 0000000000..9c2c467fe3 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleEditPane.java @@ -0,0 +1,296 @@ +package com.fr.design.data.datapane.preview.desensitization.view.rule; + +import com.fr.data.desensitize.rule.base.DesensitizationCondition; +import com.fr.data.desensitize.rule.base.DesensitizationRule; +import com.fr.data.desensitize.rule.base.DesensitizationRuleType; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.constants.UIConstants; +import com.fr.design.event.UIObserverListener; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itextfield.UINumberField; +import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.stable.StringUtils; + +import javax.swing.BorderFactory; +import javax.swing.JComponent; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Insets; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; +import java.util.Arrays; +import java.util.Set; + +/** + * 脱敏规则编辑页 + * + * @author Yvan + * @version 11.0 + * Created by Yvan on 2022/9/8 + */ +public class DesensitizationRuleEditPane extends BasicBeanPane { + /** + * 已经存在的规则名称,用于检测重名 + */ + private Set existRuleNames; + + private UITextField ruleNameTextField; + private UIComboBox ruleTypeComboBox; + private UINumberField retainFrontTextField; + private UINumberField retainBackTextField; + private UITextField firstSymbolTextField; + private UITextField secondSymbolTextField; + private CardLayout cardLayout; + private JPanel ruleConditionPane; + + + private DesensitizationRule rule = DesensitizationRule.createDefaultEmptyRule(); + + private final FocusListener retainFrontListener = new FocusListener() { + @Override + public void focusGained(FocusEvent e) { + } + + @Override + public void focusLost(FocusEvent e) { + rule.getCondition().setRetainFront((int) retainFrontTextField.getValue()); + } + }; + + private final FocusListener retainBackListener = new FocusListener() { + @Override + public void focusGained(FocusEvent e) { + } + + @Override + public void focusLost(FocusEvent e) { + rule.getCondition().setRetainBack((int) retainBackTextField.getValue()); + } + }; + + private final FocusListener firstSymbolListener = new FocusListener() { + @Override + public void focusGained(FocusEvent e) { + } + + @Override + public void focusLost(FocusEvent e) { + rule.getCondition().setSymbol(firstSymbolTextField.getText()); + } + }; + + private final FocusListener secondSymbolListener = new FocusListener() { + @Override + public void focusGained(FocusEvent e) { + } + + @Override + public void focusLost(FocusEvent e) { + rule.getCondition().setRetainFront(0); + rule.getCondition().setRetainBack(0); + rule.getCondition().setSymbol(secondSymbolTextField.getText()); + } + }; + + public DesensitizationRuleEditPane(Set existRuleNames) { + this.existRuleNames = existRuleNames; + initComponent(); + } + + /** + * 初始化面板 + */ + private void initComponent() { + this.setLayout(FRGUIPaneFactory.createLeftZeroVgapNormalHgapLayout()); + JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + panel.setBorder(BorderFactory.createEmptyBorder(20, 10, 0, 0)); + UILabel ruleNameLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Name")); + // 规则名称输入框 + initRuleNameTextField(); + UILabel ruleTypeLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Algorithm")); + // 脱敏算法Type设置 + JPanel ruleTypePane = initRuleTypePane(); + // 脱敏算法Condition设置 + JPanel ruleConditionPane = initRuleConditionPane(); + JComponent[][] components = { + {ruleNameLabel, ruleNameTextField}, + {ruleTypeLabel, ruleTypePane}, + {new UILabel(), ruleConditionPane} + }; + panel.add( + TableLayoutHelper.createGapTableLayoutPane( + components, + new double[]{TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.FILL}, + new double[]{TableLayout.FILL, TableLayout.PREFERRED}, + 20, + 20), + BorderLayout.CENTER); + this.add(panel); + } + + /** + * 初始化规则类型面板 + * @return + */ + private JPanel initRuleTypePane() { + JPanel ruleTypePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + // 脱敏算法类型下拉框 + initRuleTypeComboBox(); + ruleTypePane.add(ruleTypeComboBox, BorderLayout.CENTER); + return ruleTypePane; + } + + /** + * 初始化规则条件面板 + * @return + */ + private JPanel initRuleConditionPane() { + JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + cardLayout = new CardLayout(); + ruleConditionPane = new JPanel(cardLayout); + // 字符替换 + JPanel characterReplacePane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); + UILabel retainFrontLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_Retain_Front") + StringUtils.BLANK); + retainFrontTextField = new UINumberField(5); + retainFrontTextField.addFocusListener(retainFrontListener); + + UILabel retainBackLabel = new UILabel(StringUtils.BLANK + Toolkit.i18nText("Fine-Design_Report_Desensitization_Count_And_Back") + StringUtils.BLANK); + retainBackTextField = new UINumberField(5); + retainBackTextField.addFocusListener(retainBackListener); + + UILabel replaceLabel = new UILabel(StringUtils.BLANK + Toolkit.i18nText("Fine-Design_Report_Desensitization_Count_And_Other_Character_Replace_By") + StringUtils.BLANK); + firstSymbolTextField = new UITextField(10); + firstSymbolTextField.addFocusListener(firstSymbolListener); + + characterReplacePane.add(retainFrontLabel); + characterReplacePane.add(retainFrontTextField); + characterReplacePane.add(retainBackLabel); + characterReplacePane.add(retainBackTextField); + characterReplacePane.add(replaceLabel); + characterReplacePane.add(firstSymbolTextField); + // 整体替换 + JPanel characterAllReplacePane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); + UILabel allReplaceLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_All_Character_Replace_By") + StringUtils.BLANK); + secondSymbolTextField = new UITextField(10); + secondSymbolTextField.addFocusListener(secondSymbolListener); + + characterAllReplacePane.add(allReplaceLabel); + characterAllReplacePane.add(secondSymbolTextField); + + ruleConditionPane.add(characterReplacePane, DesensitizationRuleType.CHARACTER_REPLACE.getTypeName()); + ruleConditionPane.add(characterAllReplacePane, DesensitizationRuleType.ALL_CHARACTERS_REPLACE.getTypeName()); + // 初始化状态为字符替换 + switchRuleConditionPane(DesensitizationRuleType.CHARACTER_REPLACE); + + panel.add(ruleConditionPane, BorderLayout.CENTER); + return panel; + } + + /** + * 切换规则类型面板 + * @param ruleType + */ + private void switchRuleConditionPane(DesensitizationRuleType ruleType) { + this.cardLayout.show(ruleConditionPane, ruleType.getTypeName()); + } + + /** + * 初始化规则类型下拉框 + */ + private void initRuleTypeComboBox() { + ruleTypeComboBox = new UIComboBox(Arrays.stream(DesensitizationRuleType.values()).map(DesensitizationRuleType::getTypeName).toArray()); + ruleTypeComboBox.setSelectedIndex(0); + ruleTypeComboBox.registerChangeListener(new UIObserverListener() { + @Override + public void doChange() { + DesensitizationRuleType ruleType = DesensitizationRuleType.matchByTypeName((String) ruleTypeComboBox.getSelectedItem()); + rule.setRuleType(ruleType); + // 修改底下的conditionPane + switchRuleConditionPane(ruleType); + } + }); + } + + /** + * 初始化规则名称输入框 + */ + private void initRuleNameTextField() { + ruleNameTextField = new UITextField(20) { + @Override + public Insets getInsets() { + return new Insets(2, 4, 0, 4); + } + }; + ruleNameTextField.setPlaceholder(Toolkit.i18nText("Fine-Design_Report_Desensitization_Please_Enter_Rule_Name")); + ruleNameTextField.setBorderPainted(true); + ruleNameTextField.addFocusListener(new FocusListener() { + @Override + public void focusGained(FocusEvent e) { + ruleNameTextField.setBorder(BorderFactory.createLineBorder(UIConstants.NORMAL_BLUE)); + ruleNameTextField.repaint(); + } + + @Override + public void focusLost(FocusEvent e) { + ruleNameTextField.setBorder(BorderFactory.createLineBorder(UIConstants.TOOLBAR_BORDER_COLOR)); + rule.setRuleName(ruleNameTextField.getText()); + ruleNameTextField.repaint(); + } + }); + } + + + @Override + public void populateBean(DesensitizationRule ob) { + this.rule = ob; + this.ruleNameTextField.setText(rule.getRuleName()); + String typeName = rule.getRuleType().getTypeName(); + this.ruleTypeComboBox.setSelectedItem(typeName); + switch (DesensitizationRuleType.matchByTypeName(typeName)) { + case CHARACTER_REPLACE: + this.retainFrontTextField.setValue(rule.getCondition().getRetainFront()); + this.retainBackTextField.setValue(rule.getCondition().getRetainBack()); + this.firstSymbolTextField.setText(rule.getCondition().getSymbol()); + break; + case ALL_CHARACTERS_REPLACE: + this.secondSymbolTextField.setText(rule.getCondition().getSymbol()); + break; + default: + } + + } + + @Override + public DesensitizationRule updateBean() { + rule.setEnable(true); + return rule; + } + + @Override + protected String title4PopupWindow() { + return Toolkit.i18nText("Fine-Design_Report_Desensitization_Custom_Config_Rules"); + } + + @Override + public void checkValid() throws Exception { + // 保存rule前检查下 + String checkMessage = StringUtils.EMPTY; + if (StringUtils.isEmpty(rule.getRuleName())) { + checkMessage = Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Name_Cannot_Be_Empty"); + } else if (existRuleNames.contains(rule.getRuleName())) { + checkMessage = Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Name_Cannot_Repeat"); + } else if (DesensitizationCondition.invalid(rule.getCondition())) { + checkMessage = Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Wrong_Condition"); + } + if (StringUtils.isNotEmpty(checkMessage)) { + throw new Exception(checkMessage); + } + } + +} diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRulePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRulePane.java new file mode 100644 index 0000000000..4fd8f5fef4 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRulePane.java @@ -0,0 +1,80 @@ +package com.fr.design.data.datapane.preview.desensitization.view.rule; + +import com.fr.data.desensitize.rule.base.DesensitizationRule; +import com.fr.data.desensitize.rule.base.DesensitizationRuleSource; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.border.UITitledBorder; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; + +import javax.swing.JPanel; +import java.awt.BorderLayout; + +/** + * 脱敏规则展示页 + * @author Yvan + * @version 11.0 + * Created by Yvan on 2022/9/8 + */ +public class DesensitizationRulePane extends BasicBeanPane { + + /** + * 规则来源选择面板 + */ + private DesensitizationRuleSourceChoosePane ruleSourceChoosePane; + + /** + * 规则选择面板 + */ + private DesensitizationRuleChoosePane ruleChoosePane; + + /** + * 内容面板 + */ + private JPanel contentPane; + + public DesensitizationRulePane() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + initPane(); + } + + private void initPane() { + // 内容面板 + contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + contentPane.setBorder(UITitledBorder.createBorderWithTitle(Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Choose"))); + this.add(contentPane, BorderLayout.CENTER); + // 规则来源选择Pane + ruleSourceChoosePane = new DesensitizationRuleSourceChoosePane(this); + // 规则选择Pane + ruleChoosePane = new DesensitizationRuleChoosePane(); + contentPane.add(ruleSourceChoosePane, BorderLayout.NORTH); + contentPane.add(ruleChoosePane, BorderLayout.CENTER); + } + + /** + * 处理规则来源选择面板中改动来源的事件 + * @param newRuleSource + */ + public void dealWithRuleSourceChanged(DesensitizationRuleSource newRuleSource) { + ruleChoosePane.switchPaneByRuleSource(newRuleSource); + } + + + @Override + public void populateBean(DesensitizationRule ob) { + // 这边展示当前所有规则时,不依靠外界传值,初始化的时候,从规则管理中心去获取 + } + + @Override + public DesensitizationRule updateBean() { + DesensitizationRule desensitizationRule = ruleChoosePane.getSelectedDesensitizationRule(); + return DesensitizationRule.valid(desensitizationRule) ? + desensitizationRule : + DesensitizationRule.createDefaultEmptyRule(); + } + + @Override + protected String title4PopupWindow() { + return Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule"); + } +} diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleSourceChoosePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleSourceChoosePane.java new file mode 100644 index 0000000000..f67512164e --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleSourceChoosePane.java @@ -0,0 +1,48 @@ +package com.fr.design.data.datapane.preview.desensitization.view.rule; + +import com.fr.data.desensitize.rule.base.DesensitizationRuleSource; +import com.fr.design.gui.ibutton.UIRadioButton; +import com.fr.design.i18n.Toolkit; + +import javax.swing.BorderFactory; +import javax.swing.ButtonGroup; +import javax.swing.JPanel; +import java.awt.FlowLayout; + +/** + * 脱敏规则来源选择页面 + * @author Yvan + * @version 11.0 + * Created by Yvan on 2022/9/26 + */ +public class DesensitizationRuleSourceChoosePane extends JPanel { + + /** + * 来源平台的按钮 + */ + private UIRadioButton serverSource; + + /** + * 来源本地的按钮 + */ + private UIRadioButton customSource; + + public DesensitizationRuleSourceChoosePane(DesensitizationRulePane desensitizationRulePane) { + this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + this.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); + + serverSource = new UIRadioButton(Toolkit.i18nText("Fine-Design_Report_Desensitization_Server_Config_Rules")); + customSource = new UIRadioButton(Toolkit.i18nText("Fine-Design_Report_Desensitization_Custom_Config_Rules")); + + ButtonGroup buttonGroup = new ButtonGroup(); + buttonGroup.add(serverSource); + buttonGroup.add(customSource); + serverSource.setSelected(true); + + serverSource.registerChangeListener(() -> desensitizationRulePane.dealWithRuleSourceChanged(DesensitizationRuleSource.SERVER)); + customSource.registerChangeListener(() -> desensitizationRulePane.dealWithRuleSourceChanged(DesensitizationRuleSource.CUSTOM)); + + this.add(serverSource); + this.add(customSource); + } +} diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationSettingPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationSettingPane.java new file mode 100644 index 0000000000..f63bcdacc3 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationSettingPane.java @@ -0,0 +1,110 @@ +package com.fr.design.data.datapane.preview.desensitization.view.setting; + +import com.fr.data.desensitize.base.AbstractDesensitizationTableData; +import com.fr.data.desensitize.base.TableDataDesensitizationBean; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.constants.UIConstants; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; + +import javax.swing.JComponent; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.util.List; + +/** + * 数据集脱敏字段设置页面 + * @author Yvan + * @version 11.0 + * Created by Yvan on 2022/9/8 + */ +public class TableDataDesensitizationSettingPane extends BasicBeanPane { + + /** + * 设置针对的数据集 + */ + private AbstractDesensitizationTableData tableData; + + private UICheckBox desensitizeOpen; + + private TableDataDesensitizationTablePane tableDataDesensitizationTablePane; + + + public TableDataDesensitizationSettingPane(AbstractDesensitizationTableData tableData) { + this.tableData = tableData; + initComponents(); + } + + private void initComponents() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.add(initNorthPane(), BorderLayout.NORTH); + this.add(initCenterPane(), BorderLayout.CENTER); + } + + /** + * 初始化启用数据脱敏面板 + * @return + */ + private JComponent initNorthPane() { + JPanel northPane = FRGUIPaneFactory.createTopVerticalTitledBorderPane(Toolkit.i18nText("Fine-Design_Report_Desensitization_Config")); + this.desensitizeOpen = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Desensitization_Opened")); + northPane.add(desensitizeOpen); + UILabel tipLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_Opened_Tooltips")); + tipLabel.setForeground(UIConstants.CHECK_BOX_TIP_FONT_COLOR); + northPane.add(tipLabel); + return northPane; + } + + /** + * 初始化数据脱敏规则表面板 + * @return + */ + private JComponent initCenterPane() { + this.tableDataDesensitizationTablePane = new TableDataDesensitizationTablePane(tableData, this); + return tableDataDesensitizationTablePane; + } + + /** + * 是否启用脱敏 + * @return + */ + public boolean isDesensitizeOpened() { + return desensitizeOpen.isSelected(); + } + + @Override + protected String title4PopupWindow() { + return Toolkit.i18nText("Fine-Design_Report_Desensitization_Config"); + } + + @Override + public void populateBean(AbstractDesensitizationTableData tableData) { + this.tableData = tableData; + this.desensitizeOpen.setSelected(tableData.getDesensitizeOpen()); + tableDataDesensitizationTablePane.populateDesensitizationSetting(tableData); + } + + @Override + public AbstractDesensitizationTableData updateBean() { + saveDesensitizeOpened(); + saveDesensitizationBeans(tableDataDesensitizationTablePane.updateDesensitizationSetting()); + return tableData; + } + + /** + * 保存脱敏启用状态 + */ + public void saveDesensitizeOpened() { + tableData.setDesensitizeOpen(desensitizeOpen.isSelected()); + } + + /** + * 保存脱敏规则配置信息 + * @param tableDataDesensitizationBeans + */ + public void saveDesensitizationBeans(List tableDataDesensitizationBeans) { + tableData.setDesensitizationBeans(tableDataDesensitizationBeans); + } +} diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java new file mode 100644 index 0000000000..36322c3980 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java @@ -0,0 +1,459 @@ +package com.fr.design.data.datapane.preview.desensitization.view.setting; + +import com.fr.data.desensitize.base.AbstractDesensitizationTableData; +import com.fr.data.desensitize.base.TableDataDesensitizationBean; +import com.fr.data.desensitize.rule.base.DesensitizationRule; +import com.fr.design.data.datapane.preview.desensitization.TableDataPreviewDesensitizeManager; +import com.fr.design.data.datapane.preview.desensitization.view.rule.DesensitizationRulePane; +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.icombocheckbox.UIComboCheckBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itableeditorpane.UITableEditAction; +import com.fr.design.gui.itableeditorpane.UITableModelAdapter; +import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.stable.StringUtils; +import com.fr.stable.collections.CollectionUtils; +import org.jetbrains.annotations.Nullable; + +import javax.swing.AbstractCellEditor; +import javax.swing.JPanel; +import javax.swing.JTable; +import javax.swing.SwingUtilities; +import javax.swing.event.CellEditorListener; +import javax.swing.event.ChangeEvent; +import javax.swing.table.TableCellEditor; +import javax.swing.table.TableCellRenderer; +import java.awt.Component; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; + +/** + * 处理TableDataDesensitizationTablePane中TableEditPane的Model + * + * @author Yvan + * @version 11.0 + * Created by Yvan on 2022/9/23 + */ +public class TableDataDesensitizationTableModel extends UITableModelAdapter { + + private static final String APOSTROPHE = "..."; + + private AbstractDesensitizationTableData tableData; + + /** + * 当前数据集的所有列名 + */ + private List columnNames; + + /** + * key为用户组唯一标识(id拼接),value为用户组名称 + */ + private Map roleMap; + + private Component parent; + + private DesensitizationRuleChooser ruleChooser; + + private DesensitizationRuleDescriptionPane descriptionPane; + + public TableDataDesensitizationTableModel(AbstractDesensitizationTableData tableData, Component parent) { + // table相关 + super(new String[]{ + Toolkit.i18nText("Fine-Design_Report_Desensitization_Column"), + Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule"), + StringUtils.EMPTY, + Toolkit.i18nText("Fine-Design_Report_Desensitization_Effected_Roles") + }); + // 一些数据相关 + this.tableData = tableData; + // 获取当前数据集的所有列名 + this.columnNames = TableDataPreviewDesensitizeManager.getInstance().getColumnNamesByTableData(tableData); + // 获取当前所有用户组 + this.roleMap = TableDataPreviewDesensitizeManager.getInstance().getAllRoles(); + this.parent = parent; + this.setColumnClass(new Class[]{ + // 列名选择 + ColumnNamesComboBox.class, + // 规则选择 + DesensitizationRuleChooser.class, + // 规则详情展示 + DesensitizationRuleDescriptionPane.class, + // 生效用户组选择 + EffectedRolesChooser.class + }); + this.setDefaultEditor(ColumnNamesComboBox.class, new ColumnNamesComboBox()); + this.ruleChooser = new DesensitizationRuleChooser(); + this.setDefaultEditor(DesensitizationRuleChooser.class, ruleChooser); + this.setDefaultRenderer(DesensitizationRuleChooser.class, ruleChooser); + this.descriptionPane = new DesensitizationRuleDescriptionPane(); + this.setDefaultEditor(DesensitizationRuleDescriptionPane.class, new DesensitizationRuleDescriptionPane()); + this.setDefaultEditor(EffectedRolesChooser.class, new EffectedRolesChooser()); + } + + @Override + public Object getValueAt(int rowIndex, int columnIndex) { + TableDataDesensitizationBean desensitizationBean = this.getList().get(rowIndex); + switch (columnIndex) { + case 0: + return getColumnNameValue(desensitizationBean); + case 1: + return desensitizationBean.getDesensitizationRule().getRuleName(); + case 2: + return DesensitizationRule.getDescription(desensitizationBean.getDesensitizationRule()); + case 3: + return matchRoleNamesByIds(desensitizationBean.getRoleIds()); + default: + return StringUtils.EMPTY; + } + } + + /** + * 根据当前选中的Bean,获取其对应的列名字段 + * @param desensitizationBean + * @return + */ + private Object getColumnNameValue(TableDataDesensitizationBean desensitizationBean) { + // 内部列名list为空时直接返回空字符串 + if (CollectionUtils.isEmpty(columnNames)) { + return StringUtils.EMPTY; + } + // bean的列字段index不对劲时,返回空字符串 + return validColumnIndex(desensitizationBean.getColumnIndex()) ? + columnNames.get(desensitizationBean.getColumnIndex()) : + StringUtils.EMPTY; + } + + /** + * 判断字段索引是否越界 + * @param columnIndex + * @return + */ + private boolean validColumnIndex(int columnIndex) { + return columnIndex >= 0 && columnIndex < columnNames.size(); + } + + /** + * 通过id匹配此用户组对应的部门职位名称(或者说自定义角色名称) + * + * @param roleIds + * @return + */ + private List matchRoleNamesByIds(Set roleIds) { + List result = new ArrayList<>(); + for (String roleId : roleIds) { + if (roleMap != null && roleMap.containsKey(roleId)) { + result.add(roleMap.get(roleId)); + } + } + return result; + } + + @Override + public boolean isCellEditable(int row, int col) { + return true; + } + + @Override + public UITableEditAction[] createAction() { + return new UITableEditAction[]{new AddDesensitizationAction(), new RemoveDesensitizationAction(parent)}; + } + + /** + * 获取当前选中的item,可能为null + * + * @return + */ + @Nullable + private TableDataDesensitizationBean getCurrentSelectBean() { + return table.getSelectedRow() == -1 ? + null : + getList().get(table.getSelectedRow()); + } + + /** + * 列名选择下拉框 + */ + private class ColumnNamesComboBox extends AbstractCellEditor implements TableCellEditor, TableCellRenderer { + + private UIComboBox columnNameComboBox; + + ColumnNamesComboBox() { + columnNameComboBox = new UIComboBox(columnNames.toArray(new String[0])); + this.addCellEditorListener(new CellEditorListener() { + @Override + public void editingStopped(ChangeEvent e) { + + TableDataDesensitizationBean desensitizationBean = getCurrentSelectBean(); + if (Objects.nonNull(desensitizationBean)) { + desensitizationBean.setColumnIndex(columnNameComboBox.getSelectedIndex()); + fireTableDataChanged(); + } + } + + @Override + public void editingCanceled(ChangeEvent e) { + + } + }); + } + + + @Override + public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { + columnNameComboBox.setSelectedIndex(getList().get(row).getColumnIndex()); + return columnNameComboBox; + } + + @Override + public Object getCellEditorValue() { + Object selectedItem = columnNameComboBox.getSelectedItem(); + return Objects.isNull(selectedItem) ? StringUtils.EMPTY : selectedItem.toString(); + } + + @Override + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { + columnNameComboBox.setSelectedIndex(getList().get(row).getColumnIndex()); + return columnNameComboBox; + } + } + + private class DesensitizationRuleChooser extends AbstractCellEditor implements TableCellEditor, TableCellRenderer { + /** + * 规则选择页面 + */ + private JPanel choosePane; + /** + * 规则名称 + */ + private UITextField ruleNameTextField; + /** + * 规则选择按钮 + */ + private UIButton chooseButton; + /** + * 规则 + */ + private DesensitizationRule rule; + + private ActionListener chooseRuleListener = new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + DesensitizationRulePane rulePane = new DesensitizationRulePane(); + BasicDialog ruleDialog = rulePane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(parent), new DialogActionAdapter() { + @Override + public void doOk() { + rule = rulePane.updateBean(); + TableDataDesensitizationBean desensitizationBean = getCurrentSelectBean(); + if (Objects.nonNull(desensitizationBean) && Objects.nonNull(rule)) { + desensitizationBean.setDesensitizationRule(rule); + fireTableDataChanged(); + } + rule = null; + } + }, BasicDialog.DEFAULT); + ruleDialog.setVisible(true); + } + }; + + DesensitizationRuleChooser() { + // 规则名称展示 + ruleNameTextField = new UITextField(); + ruleNameTextField.setEnabled(false); + // 规则选择按钮 + chooseButton = new UIButton(APOSTROPHE); + chooseButton.addActionListener(chooseRuleListener); + // 规则选择页面 + Component[][] templateChooserComponent = {{ruleNameTextField, chooseButton}}; + double[] rowSize = {TableLayout.PREFERRED}; + double[] columnSize = {TableLayout.FILL, 22}; + choosePane = TableLayoutHelper.createCommonTableLayoutPane(templateChooserComponent, rowSize, columnSize, 0); + this.addCellEditorListener(new CellEditorListener() { + + @Override + public void editingCanceled(ChangeEvent e) { + + } + + @Override + public void editingStopped(ChangeEvent e) { + TableDataDesensitizationBean desensitizationBean = getCurrentSelectBean(); + if (Objects.nonNull(desensitizationBean) && Objects.nonNull(rule)) { + desensitizationBean.setDesensitizationRule(rule); + fireTableDataChanged(); + } + } + }); + } + + @Override + public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { + ruleNameTextField.setText(getList().get(row).getDesensitizationRule().getRuleName()); + return choosePane; + } + + @Override + public Object getCellEditorValue() { + return ruleNameTextField.getText(); + } + + @Override + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { + ruleNameTextField.setText((String) value); + return choosePane; + } + } + + private class DesensitizationRuleDescriptionPane extends AbstractCellEditor implements TableCellEditor { + + private UILabel descriptionLabel; + + DesensitizationRuleDescriptionPane() { + // 规则描述 + this.descriptionLabel = new UILabel(); + } + + /** + * 根据脱敏规则信息,刷新下规则描述文字,主要用于与规则选择器的联动 + * + * @param desensitizationRule + */ + public void refreshDescription(DesensitizationRule desensitizationRule) { + this.descriptionLabel.setText(DesensitizationRule.getDescription(desensitizationRule)); + } + + @Override + public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { + refreshDescription(getList().get(row).getDesensitizationRule()); + return descriptionLabel; + } + + @Override + public Object getCellEditorValue() { + return this.descriptionLabel.getText(); + } + } + + private class EffectedRolesChooser extends AbstractCellEditor implements TableCellEditor, TableCellRenderer { + + private UIComboCheckBox rolesCheckBox; + + EffectedRolesChooser() { + this.rolesCheckBox = new UIComboCheckBox(roleMap.values().toArray(), true); + this.addCellEditorListener(new CellEditorListener() { + @Override + public void editingStopped(ChangeEvent e) { + TableDataDesensitizationBean desensitizationBean = getCurrentSelectBean(); + if (Objects.nonNull(desensitizationBean)) { + desensitizationBean.setRoleIds(generateRolesIdsBySelectedValues()); + fireTableDataChanged(); + } + } + + @Override + public void editingCanceled(ChangeEvent e) { + + } + }); + } + + @Override + public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { + rolesCheckBox.setSelectedValues(generateRolesCheckBoxSelectedValues(getList().get(row))); + return rolesCheckBox; + } + + /** + * 根据当前的规则配置信息,生成选中的rolesMap用来展示 + * @param desensitizationBean + * @return + */ + private Map generateRolesCheckBoxSelectedValues(TableDataDesensitizationBean desensitizationBean) { + Map result = new HashMap<>(roleMap.size()); + for (Map.Entry roleEntry : roleMap.entrySet()) { + String roleId = roleEntry.getKey(); + String roleName = roleEntry.getValue(); + if (desensitizationBean.getRoleIds().contains(roleId)) { + result.put(roleName, true); + } else { + result.put(roleName, false); + } + } + return result; + } + + /** + * 根据当前的RoleName选择项,生成其对应的RoleId的set存入规则配置信息 + * @return + */ + private Set generateRolesIdsBySelectedValues() { + Set result = new LinkedHashSet<>(); + Object[] selectedValues = rolesCheckBox.getSelectedValues(); + for (Object selectedValue : selectedValues) { + String selectedRoleName = (String) selectedValue; + if (roleMap.containsValue(selectedRoleName)) { + Optional> matchedEntry = roleMap.entrySet().stream().filter(entry -> StringUtils.equals(entry.getValue(), selectedRoleName)).findFirst(); + matchedEntry.ifPresent(stringStringEntry -> result.add(stringStringEntry.getKey())); + } + } + return result; + } + + @Override + public Object getCellEditorValue() { + return rolesCheckBox.getSelectedValues(); + } + + @Override + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { + rolesCheckBox.setSelectedValues(generateRolesCheckBoxSelectedValues(getList().get(row))); + return rolesCheckBox; + } + } + + + private class AddDesensitizationAction extends AddTableRowAction { + + public AddDesensitizationAction() { + this.setName(Toolkit.i18nText("Fine-Design_Report_Desensitization_Add")); + this.setSmallIcon("/com/fr/design/standard/add/add_black", false); + } + + @Override + public void actionPerformed(ActionEvent e) { + super.actionPerformed(e); + // 添加一条空白数据 + addRow(TableDataDesensitizationBean.createEmyptBean()); + fireTableDataChanged(); + table.getSelectionModel().setSelectionInterval(table.getRowCount() - 1, table.getRowCount() - 1); + } + } + + private class RemoveDesensitizationAction extends DeleteAction { + + public RemoveDesensitizationAction(Component component) { + super(component); + this.setName(Toolkit.i18nText("Fine-Design_Basic_Base_Remove")); + this.setSmallIcon("/com/fr/design/standard/remove/remove_red", false); + } + + @Override + public void actionPerformed(ActionEvent e) { + super.actionPerformed(e); + } + } + +} diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTablePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTablePane.java new file mode 100644 index 0000000000..77546b9ef1 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTablePane.java @@ -0,0 +1,64 @@ +package com.fr.design.data.datapane.preview.desensitization.view.setting; + +import com.fr.data.desensitize.base.AbstractDesensitizationTableData; +import com.fr.data.desensitize.base.TableDataDesensitizationBean; +import com.fr.design.gui.itableeditorpane.UITableEditorPane; +import com.fr.design.layout.FRGUIPaneFactory; + +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; +import java.util.List; + +/** + * 脱敏字段设置页面中的Table + * @author Yvan + * @version 11.0 + * Created by Yvan on 2022/9/14 + */ +public class TableDataDesensitizationTablePane extends JPanel { + + /** + * 脱敏数据集 + */ + private AbstractDesensitizationTableData tableData; + + /** + * 父页面 + */ + private Component parent; + + /** + * 脱敏信息Table + */ + private UITableEditorPane editorPane; + + public TableDataDesensitizationTablePane(AbstractDesensitizationTableData tableData, Component parent) { + this.tableData = tableData; + this.parent = parent; + initComponent(); + } + + private void initComponent() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.editorPane = new UITableEditorPane<>(new TableDataDesensitizationTableModel(tableData, parent)); + this.editorPane.setHeaderResizing(false); + this.add(editorPane, BorderLayout.CENTER); + } + + /** + * 展示此TableData中已配置的脱敏规则信息 + * @param tableData + */ + public void populateDesensitizationSetting(AbstractDesensitizationTableData tableData) { + this.tableData = tableData; + editorPane.populate(tableData.getDesensitizationBeans().toArray(new TableDataDesensitizationBean[0])); + } + + /** + * 获取当前对TableData的配置脱敏规则信息 + */ + public List updateDesensitizationSetting() { + return editorPane.update(); + } +} diff --git a/designer-base/src/main/resources/com/fr/design/images/control/refresh_normal.svg b/designer-base/src/main/resources/com/fr/design/images/control/refresh_normal.svg new file mode 100644 index 0000000000..e83a52740e --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/control/refresh_normal.svg @@ -0,0 +1,7 @@ + + + icon_刷新_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/standard/add/add_black_normal.svg b/designer-base/src/main/resources/com/fr/design/standard/add/add_black_normal.svg new file mode 100644 index 0000000000..2c63e640bc --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/standard/add/add_black_normal.svg @@ -0,0 +1,3 @@ + + + diff --git a/designer-base/src/main/resources/com/fr/design/standard/debug/debug_disabled.svg b/designer-base/src/main/resources/com/fr/design/standard/debug/debug_disabled.svg new file mode 100644 index 0000000000..520d126a0f --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/standard/debug/debug_disabled.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/standard/debug/debug_normal.svg b/designer-base/src/main/resources/com/fr/design/standard/debug/debug_normal.svg new file mode 100644 index 0000000000..80abccaba9 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/standard/debug/debug_normal.svg @@ -0,0 +1,4 @@ + + + + diff --git a/designer-base/src/main/resources/com/fr/design/standard/edit/edit_disabled.svg b/designer-base/src/main/resources/com/fr/design/standard/edit/edit_disabled.svg new file mode 100644 index 0000000000..6ac7d0b932 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/standard/edit/edit_disabled.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/standard/edit/edit_normal.svg b/designer-base/src/main/resources/com/fr/design/standard/edit/edit_normal.svg new file mode 100644 index 0000000000..3ab4c0b297 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/standard/edit/edit_normal.svg @@ -0,0 +1,3 @@ + + + diff --git a/designer-base/src/main/resources/com/fr/design/standard/remove/remove_red_normal.svg b/designer-base/src/main/resources/com/fr/design/standard/remove/remove_red_normal.svg new file mode 100644 index 0000000000..74ff5ab385 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/standard/remove/remove_red_normal.svg @@ -0,0 +1,7 @@ + + + icon_关闭_red + + + + From d65ce99715b72a6e958df756efe31393668a3c60 Mon Sep 17 00:00:00 2001 From: "Link.Zhao" Date: Tue, 11 Oct 2022 22:15:44 +0800 Subject: [PATCH 075/310] =?UTF-8?q?REPORT-81583=E3=80=90=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=8E=92=E5=BA=8F=E4=BD=BF=E7=94=A8=E5=90=91?= =?UTF-8?q?=E4=B8=8A=E6=88=96=E5=90=91=E4=B8=8B=E5=88=B0=E6=9C=80=E9=A1=B6?= =?UTF-8?q?=E6=88=96=E6=9C=80=E5=BA=95=E4=BA=A4=E4=BA=92=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=9C=89=E9=97=AE=E9=A2=98=EF=BC=9BREPORT-80117=20alphafine?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E9=85=8D=E7=BD=AE=E6=B2=A1=E6=9C=89=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E5=95=86=E5=9F=8E=EF=BC=8C=E9=A6=96=E6=AC=A1=E6=89=93?= =?UTF-8?q?=E5=BC=80=E5=8D=B4=E6=9C=89=E6=A8=A1=E6=9D=BF=E5=95=86=E5=9F=8E?= =?UTF-8?q?=201=E3=80=81=E4=BF=AE=E6=94=B9=E4=BA=A4=E4=BA=92=202=E3=80=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8D=87=E7=BA=A7=E5=85=BC=E5=AE=B9=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/AlphaFineConfigManager.java | 3 ++ .../alphafine/component/CustomSortPane.java | 28 ++++++++++++++++--- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java index 2e78d1062d..7d02c03864 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java @@ -108,6 +108,7 @@ public class AlphaFineConfigManager implements XMLable { private Map actionSearchTextCache = new HashMap<>(8); private String cacheBuildNO; + private static final String CONTAIN_TEMPLATE_SHOP = "isContainTemplateShop"; /** * key: 登录的bbs用户 @@ -151,6 +152,7 @@ public class AlphaFineConfigManager implements XMLable { this.setContainPlugin(reader.getAttrAsBoolean("isContainDocument", true)); this.setContainDocument(reader.getAttrAsBoolean("isContainDocument", true)); this.setContainRecommend(reader.getAttrAsBoolean("isContainRecommend", true)); + this.setShowTemplateShop(reader.getAttrAsBoolean(CONTAIN_TEMPLATE_SHOP, true)); this.setContainAction(reader.getAttrAsBoolean("isContainAction", true)); this.setContainTemplate(reader.getAttrAsBoolean("isContainTemplate", true)); this.setContainFileContent(reader.getAttrAsBoolean("isContainFileContent", false)); @@ -258,6 +260,7 @@ public class AlphaFineConfigManager implements XMLable { .attr("needSegmentationCheckbox", this.isNeedSegmentationCheckbox()) .attr("needIntelligentCustomerService", this.isNeedIntelligentCustomerService()) .attr("productDynamics", this.isProductDynamics()) + .attr(CONTAIN_TEMPLATE_SHOP, this.showTemplateShop) .attr("tabOrder", this.getTabOrderString()); writeActionSearchTextCacheXML(writer); writeSearchHistory(writer); diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java index c544bbac0b..9e2af09379 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java @@ -85,7 +85,7 @@ public class CustomSortPane extends JPanel { top.addActionListener(e -> { SwingUtilities.invokeLater(() -> { sortItemPane.setComponentZOrder(selectedLabel, 0); - setToolbarEnable(false, false, true, true); + setToolbarEnable(sortItemPane.getComponentZOrder(selectedLabel), sortItemPane.getComponentCount()); CustomSortPane.this.revalidate(); CustomSortPane.this.repaint(); refreshCurrentOrder(); @@ -95,7 +95,7 @@ public class CustomSortPane extends JPanel { bottom.addActionListener(e -> { SwingUtilities.invokeLater(() -> { sortItemPane.setComponentZOrder(selectedLabel, sortItemPane.getComponentCount() - 1); - setToolbarEnable(true, true, false, false); + setToolbarEnable(sortItemPane.getComponentZOrder(selectedLabel), sortItemPane.getComponentCount()); CustomSortPane.this.revalidate(); CustomSortPane.this.repaint(); refreshCurrentOrder(); @@ -105,7 +105,7 @@ public class CustomSortPane extends JPanel { up.addActionListener(e -> { SwingUtilities.invokeLater(() -> { sortItemPane.setComponentZOrder(selectedLabel, sortItemPane.getComponentZOrder(selectedLabel) - 1); - setToolbarEnable(true, true, true, true); + setToolbarEnable(sortItemPane.getComponentZOrder(selectedLabel), sortItemPane.getComponentCount()); CustomSortPane.this.revalidate(); CustomSortPane.this.repaint(); refreshCurrentOrder(); @@ -115,7 +115,7 @@ public class CustomSortPane extends JPanel { down.addActionListener(e -> { SwingUtilities.invokeLater(() -> { sortItemPane.setComponentZOrder(selectedLabel, sortItemPane.getComponentZOrder(selectedLabel) + 1); - setToolbarEnable(true, true, true, true); + setToolbarEnable(sortItemPane.getComponentZOrder(selectedLabel), sortItemPane.getComponentCount()); CustomSortPane.this.revalidate(); CustomSortPane.this.repaint(); refreshCurrentOrder(); @@ -175,6 +175,26 @@ public class CustomSortPane extends JPanel { this.bottom.setEnabled(bottom); } + /** + * 根据选项当前位置以及菜单大小设置 置顶,上移,下移,置底 按钮的状态 + */ + private void setToolbarEnable(int order, int maxOrder) { + this.top.setEnabled(true); + this.up.setEnabled(true); + this.down.setEnabled(true); + this.bottom.setEnabled(true); + // 选项处于顶端,则置灰上移和置顶按钮 + if (order == 0) { + this.top.setEnabled(false); + this.up.setEnabled(false); + } + // 选项处于底端,则置灰下移和置底按钮 + if (order == maxOrder - 1) { + this.down.setEnabled(false); + this.bottom.setEnabled(false); + } + } + private void refreshCurrentOrder() { String[] currentTabOrder = parentPane.getCurrentOrder(); HashSet selectedTab = new HashSet<>(); From 10bcd9acdece78afedb635299765b7a4c2bd02b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvan-=E6=AC=A7=E9=98=B3=E5=B8=86?= Date: Tue, 11 Oct 2022 22:37:08 +0800 Subject: [PATCH 076/310] =?UTF-8?q?REPORT-75091=20-=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=84=B1=E6=95=8F=EF=BC=88=E6=8A=A5=E8=A1=A8=EF=BC=89=20?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B4=A8=E9=87=8F=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../desensitization/TableDataPreviewDesensitizeManager.java | 4 ++++ .../view/rule/DesensitizationRuleChoosePane.java | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java index c8cdae8e72..e2d79fbf70 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java @@ -45,6 +45,10 @@ public class TableDataPreviewDesensitizeManager implements DesensitizationManage private static final TableDataPreviewDesensitizeManager INSTANCE = new TableDataPreviewDesensitizeManager(); } + /** + * 获取TableDataPreviewDesensitizeManager单例 + * @return + */ public static TableDataPreviewDesensitizeManager getInstance() { return TableDataPreviewDesensitizeManager.Holder.INSTANCE; } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java index 35901ff4b8..3f8485ffa5 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java @@ -60,6 +60,10 @@ public class DesensitizationRuleChoosePane extends JPanel { switchPaneByRuleSource(DesensitizationRuleSource.SERVER); } + /** + * 通过脱敏规则来源,切换显示不同的脱敏规则Table面板 + * @param ruleSource + */ public void switchPaneByRuleSource(DesensitizationRuleSource ruleSource) { this.currentRuleSource = ruleSource; this.cardLayout.show(this, ruleSource.name()); From f9e6aa55203923238b5595d1bc9f2a04e4eca6f5 Mon Sep 17 00:00:00 2001 From: "John.Ying" Date: Wed, 12 Oct 2022 10:02:06 +0800 Subject: [PATCH 077/310] =?UTF-8?q?REPORT-81270=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E9=85=8D=E7=BD=AE=E7=95=8C=E9=9D=A2=E5=A4=84?= =?UTF-8?q?=E7=90=86IPV6=E6=A0=BC=E5=BC=8F=E7=9A=84url--=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/env/RemoteEnvPane.java | 8 -------- .../java/com/fr/env/RemoteWorkspaceURL.java | 17 +++++++++++++++-- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java index 63854dc713..31bdaa979b 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java +++ b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java @@ -75,7 +75,6 @@ public class RemoteEnvPane extends BasicBeanPane { private UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Report_OK")); private UIButton cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel")); private UILabel uiLabel = new UILabel(); - private static final String IPV6_JUDGE_SYMBOL = "["; /** * 是否启用 https 勾选框 @@ -210,9 +209,6 @@ public class RemoteEnvPane extends BasicBeanPane { private void actionURLInputChange() { remoteWorkspaceURL = new RemoteWorkspaceURL(remoteEnvURLInput.getText()); - if (remoteWorkspaceURL.getURL().contains(IPV6_JUDGE_SYMBOL)) { - remoteWorkspaceURL.refreshIPV6Format(); - } fillIndividualField(); httpsCheckbox.setSelected(remoteWorkspaceURL.getHttps()); @@ -329,10 +325,6 @@ public class RemoteEnvPane extends BasicBeanPane { this.remoteWorkspaceURL = Strings.isNullOrEmpty(connection.getUrl()) ? RemoteWorkspaceURL.createDefaultURL() : new RemoteWorkspaceURL(connection.getUrl()); - //判断一下IP地址是不是IPV6的格式,如果是的话在拆分地址和端口的时候需要调整一下格式,用[ 或者 ] 判断 - if (!Strings.isNullOrEmpty(connection.getUrl()) && connection.getUrl().contains(IPV6_JUDGE_SYMBOL)) { - this.remoteWorkspaceURL.refreshIPV6Format(); - } String username = fromNullable(connection.getUserName()).or(StringUtils.EMPTY); String pwd = fromNullable(connection.getPassword()).or(StringUtils.EMPTY); String certPath = fromNullable(connection.getCertPath()).or(StringUtils.EMPTY); diff --git a/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java b/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java index 0583d3cfc3..9b019caa91 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java +++ b/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java @@ -6,12 +6,15 @@ import com.fr.stable.FCloneable; import com.fr.stable.StringUtils; import java.net.URI; import java.net.URISyntaxException; - +import com.fr.third.guava.base.Strings; /** * @author yaohwu */ public class RemoteWorkspaceURL implements FCloneable { + private static final String IPV6_JUDGE_SYMBOL = "["; + + private static final String IPV6_JUDGE_SYMBOL2 = "]"; public static final String SYSTEM_LOGIN_PATH = "#management/system/login"; @@ -102,6 +105,7 @@ public class RemoteWorkspaceURL implements FCloneable { parserWebAndServlet(lefts); } } + this.refreshIPV6Format(); } public boolean hasDefaultHostName() { @@ -139,12 +143,18 @@ public class RemoteWorkspaceURL implements FCloneable { */ public void refreshIPV6Format() { String url = this.url; + if (Strings.isNullOrEmpty(url)) { + return; + } + if (!url.contains(IPV6_JUDGE_SYMBOL) || !url.contains(IPV6_JUDGE_SYMBOL2)) { + return; + } try { URI uri = new URI(url); this.host = uri.getHost(); this.port = String.valueOf(uri.getPort()); } catch (URISyntaxException e) { - FineLoggerFactory.getLogger().info("error request url"); + FineLoggerFactory.getLogger().info("error request url format"); } } @@ -249,4 +259,7 @@ public class RemoteWorkspaceURL implements FCloneable { } } + public static void main(String[] args) { + System.out.println("".contains("/")); + } } \ No newline at end of file From 58aee59400e8058abd2b5eecd39efaf45c67b3ed Mon Sep 17 00:00:00 2001 From: "John.Ying" Date: Wed, 12 Oct 2022 10:03:47 +0800 Subject: [PATCH 078/310] =?UTF-8?q?REPORT-81270=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E9=85=8D=E7=BD=AE=E7=95=8C=E9=9D=A2=E5=A4=84?= =?UTF-8?q?=E7=90=86IPV6=E6=A0=BC=E5=BC=8F=E7=9A=84url--=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/env/RemoteWorkspaceURL.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java b/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java index 9b019caa91..fb10a3200a 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java +++ b/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java @@ -258,8 +258,4 @@ public class RemoteWorkspaceURL implements FCloneable { } } } - - public static void main(String[] args) { - System.out.println("".contains("/")); - } } \ No newline at end of file From fb314c80639e3167b481228f69eaab0b3a5febb5 Mon Sep 17 00:00:00 2001 From: "John.Ying" Date: Wed, 12 Oct 2022 11:36:21 +0800 Subject: [PATCH 079/310] =?UTF-8?q?REPORT-81270=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E9=85=8D=E7=BD=AE=E7=95=8C=E9=9D=A2=E5=A4=84?= =?UTF-8?q?=E7=90=86IPV6=E6=A0=BC=E5=BC=8F=E7=9A=84url--=E5=BF=BD=E7=95=A5?= =?UTF-8?q?=E5=BC=82=E5=B8=B8+=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/env/RemoteWorkspaceURL.java | 8 +++++--- .../test/java/com/fr/env/RemoteWorkspaceURLTest.java | 10 ++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java b/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java index fb10a3200a..1dcd2220f6 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java +++ b/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java @@ -105,6 +105,7 @@ public class RemoteWorkspaceURL implements FCloneable { parserWebAndServlet(lefts); } } + //判断一下IPV6 this.refreshIPV6Format(); } @@ -149,12 +150,13 @@ public class RemoteWorkspaceURL implements FCloneable { if (!url.contains(IPV6_JUDGE_SYMBOL) || !url.contains(IPV6_JUDGE_SYMBOL2)) { return; } + URI uri = null; try { - URI uri = new URI(url); + uri = new URI(url); this.host = uri.getHost(); this.port = String.valueOf(uri.getPort()); - } catch (URISyntaxException e) { - FineLoggerFactory.getLogger().info("error request url format"); + } catch (URISyntaxException ignored) { + } } diff --git a/designer-base/src/test/java/com/fr/env/RemoteWorkspaceURLTest.java b/designer-base/src/test/java/com/fr/env/RemoteWorkspaceURLTest.java index f066ae6896..b9412a93d5 100644 --- a/designer-base/src/test/java/com/fr/env/RemoteWorkspaceURLTest.java +++ b/designer-base/src/test/java/com/fr/env/RemoteWorkspaceURLTest.java @@ -242,4 +242,14 @@ public class RemoteWorkspaceURLTest { assertEquals("servlet", b.getServlet()); //others begin } + + @Test + public void testIPV6Url() { + String trueUrl = "http://[fe80::4d83:cc10:9f6f:3303]:8080/webroot/decision"; + RemoteWorkspaceURL remoteWorkspaceURL1 = new RemoteWorkspaceURL(trueUrl); + assertEquals("[fe80::4d83:cc10:9f6f:3303]", remoteWorkspaceURL1.getHost()); + assertEquals("8080", remoteWorkspaceURL1.getPort()); + assertEquals("webroot", remoteWorkspaceURL1.getWeb()); + assertEquals("decision", remoteWorkspaceURL1.getServlet()); + } } From 16b56bb8ee42a2851d9344ff1e8be755f6b6345d Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 12 Oct 2022 21:16:51 +0800 Subject: [PATCH 080/310] =?UTF-8?q?REPORT-81416=20=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E7=9A=84=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/carton/EventDispatchThreadHangMonitor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/carton/EventDispatchThreadHangMonitor.java b/designer-base/src/main/java/com/fr/design/carton/EventDispatchThreadHangMonitor.java index f472d901a1..56ccaa2c48 100644 --- a/designer-base/src/main/java/com/fr/design/carton/EventDispatchThreadHangMonitor.java +++ b/designer-base/src/main/java/com/fr/design/carton/EventDispatchThreadHangMonitor.java @@ -7,7 +7,6 @@ import com.fr.stable.ArrayUtils; import com.fr.stable.ProductConstantsBase; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; -import com.fr.third.ibm.icu.text.SimpleDateFormat; import org.jetbrains.annotations.NotNull; import javax.swing.SwingUtilities; @@ -22,6 +21,7 @@ import java.io.IOException; import java.lang.management.ManagementFactory; import java.lang.management.ThreadInfo; import java.lang.management.ThreadMXBean; +import java.text.SimpleDateFormat; import java.util.LinkedList; import java.util.Timer; import java.util.TimerTask; From 52a7153ff0d45420cad706ba4d90b1a47a3cb945 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 13 Oct 2022 11:22:34 +0800 Subject: [PATCH 081/310] =?UTF-8?q?REPORT-81880=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=AE=9A=E4=BD=8D=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/replace/ui/ITTableButton.java | 40 +++++++++++++++++-- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java index 1a73d3fcb3..40e05e615d 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java @@ -6,10 +6,12 @@ import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.JTemplate; +import com.fr.file.FILE; import com.fr.file.FILEFactory; import com.fr.general.GeneralUtils; import com.fr.stable.StringUtils; -import com.fr.stable.project.ProjectConstants; + import javax.swing.AbstractCellEditor; @@ -44,11 +46,43 @@ public class ITTableButton extends AbstractCellEditor implements TableCellEditor if (StringUtils.isNotEmpty(GeneralUtils.objectToString(content.getTrlString()))) { ITReplaceMainDialog.setITReplaceFlag(true); TRL trl = new TRL(GeneralUtils.objectToString(content.getTrlString())); - DesignerContext.getDesignerFrame().openTemplate(FILEFactory.createFILE(content.getTemplatePath())); - HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().navigate(trl); + FILE tplFile = FILEFactory.createFILE(content.getTemplatePath()); + if (tplFile != null && tplFile.exists()) { + //模板已保存 + navigate2ExistedTemplate(tplFile, trl); + } else { + //模板未保存 + navigate2NotExistedTemplate(content, trl); + } } ITReplaceMainDialog.setITReplaceFlag(false); } + + /** + * 模板未保存的跳转逻辑 + * @param content 存储模板名称的数据结构 + * @param trl 跳转链接 + */ + private void navigate2NotExistedTemplate(ITContent content, TRL trl) { + java.util.List> openTemplates = HistoryTemplateListCache.getInstance().getHistoryList(); + for (int i = 0, len = openTemplates.size(); i < len; i++) { + if (StringUtils.equals(openTemplates.get(i).getTemplateName(), content.getTemplateName())) { + DesignerContext.getDesignerFrame().activateJTemplate(openTemplates.get(i)); + HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().navigate(trl); + break; + } + } + } + + /** + * 模板已保存的跳转逻辑 + * @param tplFile 模板的FILE文件 + * @param trl 跳转链接 + */ + private void navigate2ExistedTemplate(FILE tplFile, TRL trl) { + DesignerContext.getDesignerFrame().openTemplate(tplFile); + HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().navigate(trl); + } }); From 59001462ddae74c01d8cbb7cd45b3ccb677948e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvan-=E6=AC=A7=E9=98=B3=E5=B8=86?= Date: Thu, 13 Oct 2022 11:38:47 +0800 Subject: [PATCH 082/310] =?UTF-8?q?REPORT-75091=20-=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=84=B1=E6=95=8F=EF=BC=88=E6=8A=A5=E8=A1=A8=EF=BC=89=20?= =?UTF-8?q?=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=20?= =?UTF-8?q?=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E8=AF=84=E5=AE=A1=E6=84=8F=E8=A7=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=8B=E4=BB=A3=E7=A0=81=EF=BC=8C=E6=B7=BB=E5=8A=A0=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E3=80=81=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F=E5=8C=96?= =?UTF-8?q?=E7=AD=89=EF=BC=9B=E5=8F=A6=E8=A1=A5=E4=BA=86=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E6=BC=8F=E5=81=9A=E7=9A=84UI=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datapane/preview/PreviewTableModel.java | 8 +- .../TableDataPreviewDesensitizeManager.java | 42 +++++---- .../model/DesensitizedPreviewTableModel.java | 1 + .../view/common/DesensitizationOpenPane.java | 94 +++++++++++++++++++ .../rule/DesensitizationRuleChoosePane.java | 4 + .../rule/DesensitizationRuleDebugPane.java | 5 +- .../rule/DesensitizationRuleEditPane.java | 3 + .../view/rule/DesensitizationRulePane.java | 2 + .../DesensitizationRuleSourceChoosePane.java | 1 + .../TableDataDesensitizationSettingPane.java | 32 ++----- .../TableDataDesensitizationTableModel.java | 8 ++ .../TableDataDesensitizationTablePane.java | 2 + .../fr/design/standard/tip/tips_normal.svg | 3 + 13 files changed, 164 insertions(+), 41 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/common/DesensitizationOpenPane.java create mode 100644 designer-base/src/main/resources/com/fr/design/standard/tip/tips_normal.svg diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTableModel.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTableModel.java index 91c8506b79..49ce4ba420 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTableModel.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTableModel.java @@ -20,13 +20,19 @@ public class PreviewTableModel extends AbstractTableModel { private static final int LEN_LIMIT = 1000; private static final String THREE_DOT = "..."; + private static final int DEFAULT_MAX_ROW_COUNT = 10000; private DataModel dataModel; private String erroMessage = null; public IntList dateIndexs = new IntList(4); - public PreviewTableModel() {} + /** + * 为了兼容子类的空参构造,一般不主动使用 + */ + public PreviewTableModel() { + this(new ErrorResultSet(), DEFAULT_MAX_ROW_COUNT); + } public PreviewTableModel(int maxRowCount) { // peter:默认必须显示错误的数据源. diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java index e2d79fbf70..9cc82dfdda 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java @@ -30,6 +30,7 @@ import java.util.stream.Collectors; /** * 管理所有数据集预览过程中的脱敏计算 + * * @author Yvan * @version 11.0 * Created by Yvan on 2022/9/14 @@ -47,6 +48,7 @@ public class TableDataPreviewDesensitizeManager implements DesensitizationManage /** * 获取TableDataPreviewDesensitizeManager单例 + * * @return */ public static TableDataPreviewDesensitizeManager getInstance() { @@ -72,29 +74,32 @@ public class TableDataPreviewDesensitizeManager implements DesensitizationManage * @return */ public PreviewTableModel desensitizeTableModel(TableData tableData, PreviewTableModel model) { - if (needDesensitize(tableData)) { - Map desensitizationBeanMap = new LinkedHashMap<>(); - // 获取此数据集的所有脱敏信息 - Collection desensitizationBeans = ((AbstractDesensitizationTableData) tableData).getDesensitizationBeans(); - // 排个序 - List sortedBeans = desensitizationBeans.stream().sorted(Comparator.comparingInt(TableDataDesensitizationBean::getColumnIndex)).collect(Collectors.toList()); - int columnIndex = 0; - for (TableDataDesensitizationBean sortedBean : sortedBeans) { - // 当map中已包含列序号时,代表对这一列设置了不同的脱敏规则,将key + 1 - if (desensitizationBeanMap.containsKey(columnIndex)) { - columnIndex++; - } - desensitizationBeanMap.put(columnIndex, sortedBean); + + Map desensitizationBeanMap = new LinkedHashMap<>(); + // 获取此数据集的所有脱敏信息 + Collection desensitizationBeans = ((AbstractDesensitizationTableData) tableData).getDesensitizationBeans(); + // 去除被禁用的规则 + 排序 + List sortedBeans = desensitizationBeans + .stream() + .filter(bean -> bean.getDesensitizationRule().isEnable()) + .sorted(Comparator.comparingInt(TableDataDesensitizationBean::getColumnIndex)) + .collect(Collectors.toList()); + int columnIndex = 0; + for (TableDataDesensitizationBean sortedBean : sortedBeans) { + // 当map中已包含列序号时,代表对这一列设置了不同的脱敏规则,将key + 1 + if (desensitizationBeanMap.containsKey(columnIndex)) { + columnIndex++; } - // 包装TableModel - return new DesensitizedPreviewTableModel(model, desensitizationBeanMap); + desensitizationBeanMap.put(columnIndex, sortedBean); } - return model; + // 包装TableModel + return new DesensitizedPreviewTableModel(model, desensitizationBeanMap); } /** * 通过TableData获取其列名 * 实现逻辑有点绕,TableData本身并不能返回列名集合,只能先去获取当前模板所有数据集,然后匹配名称拿到TableDataWrapper再获取列名 + * * @param tableData * @return */ @@ -114,6 +119,7 @@ public class TableDataPreviewDesensitizeManager implements DesensitizationManage /** * 这个api会返回 部门职位 + 自定义角色 的Map * 其中 key为 "pid" + "_" + "id",value为 "ptext" + "text" + * * @return */ public Map getAllRoles() { @@ -127,6 +133,7 @@ public class TableDataPreviewDesensitizeManager implements DesensitizationManage /** * 获取所有的部门职位,按照 key为 "pid" + "_" + "id",value为 "ptext" + "text"的格式添加到参数Map中 + * * @param rolesMap */ private void addDepartmentAndPositionRoles2Map(Map rolesMap) { @@ -149,6 +156,7 @@ public class TableDataPreviewDesensitizeManager implements DesensitizationManage /** * 获取所有的自定义角色,按照 id - name添加到参数map里 + * * @param rolesMap */ private void addCustomRoles2Map(Map rolesMap) { @@ -162,6 +170,7 @@ public class TableDataPreviewDesensitizeManager implements DesensitizationManage /** * 合并部门 + 职位的名称 + * * @param departmentName * @param positionName * @return @@ -172,6 +181,7 @@ public class TableDataPreviewDesensitizeManager implements DesensitizationManage /** * 合并部门 + 职位的id + * * @param departmentId * @param positionId * @return diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/model/DesensitizedPreviewTableModel.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/model/DesensitizedPreviewTableModel.java index 066f11374b..e3598e39c0 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/model/DesensitizedPreviewTableModel.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/model/DesensitizedPreviewTableModel.java @@ -98,6 +98,7 @@ public class DesensitizedPreviewTableModel extends PreviewTableModel { /** * 获取当前有效的脱敏字段个数 + * * @return */ public int getDesensitizeColumnsCount() { diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/common/DesensitizationOpenPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/common/DesensitizationOpenPane.java new file mode 100644 index 0000000000..949069aaa8 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/common/DesensitizationOpenPane.java @@ -0,0 +1,94 @@ +package com.fr.design.data.datapane.preview.desensitization.view.common; + +import com.fr.base.svg.IconUtils; +import com.fr.design.border.UITitledBorder; +import com.fr.design.constants.UIConstants; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.VerticalFlowLayout; +import com.fr.log.FineLoggerFactory; + +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Desktop; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.net.URL; + +/** + * 启用数据脱敏的面板 + * + * @author Yvan + * @version 11.0 + * Created by Yvan on 2022/10/12 + */ +public class DesensitizationOpenPane extends JPanel { + + /** + * 数据脱敏启用框 + */ + private UICheckBox desensitizeOpenCheckBox; + + /** + * 跳转帮助文档Label + */ + private UILabel hyperlinkLabel; + + /** + * 启用提示Label + */ + private UILabel tipsLabel; + + + public DesensitizationOpenPane() { + VerticalFlowLayout layout = new VerticalFlowLayout(VerticalFlowLayout.TOP); + layout.setAlignLeft(true); + this.setLayout(layout); + this.setBorder(UITitledBorder.createBorderWithTitle(Toolkit.i18nText("Fine-Design_Report_Desensitization_Config"))); + + JPanel panel = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); + // 启用数据脱敏的勾选框 + desensitizeOpenCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Desensitization_Opened")); + // 跳转帮助文档Label + hyperlinkLabel = new UILabel(IconUtils.readIcon("/com/fr/design/standard/tip/tips")); + hyperlinkLabel.setToolTipText(Toolkit.i18nText("Fine-Design_Report_Desensitization_Open_Tips")); + hyperlinkLabel.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent event) { + try { + URL url = new URL(Toolkit.i18nText("Fine-Design_Report_Desensitization_Help_Document_Url")); + Desktop.getDesktop().browse(url.toURI()); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e, "open browse of table data desensitization help document failed for {}", e.getMessage()); + } + } + }); + panel.add(desensitizeOpenCheckBox); + panel.add(hyperlinkLabel); + + // 提示Label + tipsLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_Opened_Tooltips")); + tipsLabel.setForeground(UIConstants.CHECK_BOX_TIP_FONT_COLOR); + + this.add(panel); + this.add(tipsLabel); + } + + /** + * 数据脱敏启用状态 + * @return + */ + public boolean isDesensitizationOpened() { + return desensitizeOpenCheckBox.isSelected(); + } + + /** + * 设置数据脱敏启用状态 + * @param opened + */ + public void setDesensitizationOpened(boolean opened) { + desensitizeOpenCheckBox.setSelected(opened); + } +} diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java index 3f8485ffa5..16900defa4 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java @@ -62,6 +62,7 @@ public class DesensitizationRuleChoosePane extends JPanel { /** * 通过脱敏规则来源,切换显示不同的脱敏规则Table面板 + * * @param ruleSource */ public void switchPaneByRuleSource(DesensitizationRuleSource ruleSource) { @@ -125,10 +126,13 @@ public class DesensitizationRuleChoosePane extends JPanel { DesensitizationRule rule = getList().get(rowIndex); switch (columnIndex) { case 0: + // 选中状态 return rule.equals(getSelectedValue()); case 1: + // 脱敏规则名称 return rule.getRuleName(); case 2: + // 脱敏规则描述 return DesensitizationRule.getDescription(rule); default: return StringUtils.EMPTY; diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleDebugPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleDebugPane.java index 71998b7bee..5f74dee9c0 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleDebugPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleDebugPane.java @@ -24,6 +24,7 @@ import java.awt.event.FocusListener; /** * 脱敏规则调试页 + * * @author Yvan * @version 11.0 * Created by Yvan on 2022/9/8 @@ -53,7 +54,7 @@ public class DesensitizationRuleDebugPane extends BasicPane { UILabel desensitizationRule = new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Algorithm")); UILabel characterReplace = new UILabel(rule.getRuleType().getTypeName()); UILabel description = new UILabel(DesensitizationRule.getDescription(rule)); - JComponent[][] components = new JComponent[][] { + JComponent[][] components = new JComponent[][]{ {desensitizationRule, characterReplace}, {new UILabel(), description} }; @@ -104,7 +105,7 @@ public class DesensitizationRuleDebugPane extends BasicPane { } }); - JComponent[][] components = new JComponent[][] { + JComponent[][] components = new JComponent[][]{ {beforeDesensitize, beforeDesensitizeText, desensitizeButton}, {afterDesensitize, afterDesensitizeText, new UILabel()} }; diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleEditPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleEditPane.java index 9c2c467fe3..2f526f4b8f 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleEditPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleEditPane.java @@ -136,6 +136,7 @@ public class DesensitizationRuleEditPane extends BasicBeanPane /** * 处理规则来源选择面板中改动来源的事件 + * * @param newRuleSource */ public void dealWithRuleSourceChanged(DesensitizationRuleSource newRuleSource) { diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleSourceChoosePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleSourceChoosePane.java index f67512164e..05ace32bdd 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleSourceChoosePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleSourceChoosePane.java @@ -11,6 +11,7 @@ import java.awt.FlowLayout; /** * 脱敏规则来源选择页面 + * * @author Yvan * @version 11.0 * Created by Yvan on 2022/9/26 diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationSettingPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationSettingPane.java index f63bcdacc3..91119b4083 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationSettingPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationSettingPane.java @@ -3,19 +3,17 @@ package com.fr.design.data.datapane.preview.desensitization.view.setting; import com.fr.data.desensitize.base.AbstractDesensitizationTableData; import com.fr.data.desensitize.base.TableDataDesensitizationBean; import com.fr.design.beans.BasicBeanPane; -import com.fr.design.constants.UIConstants; -import com.fr.design.gui.icheckbox.UICheckBox; -import com.fr.design.gui.ilable.UILabel; +import com.fr.design.data.datapane.preview.desensitization.view.common.DesensitizationOpenPane; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import javax.swing.JComponent; -import javax.swing.JPanel; import java.awt.BorderLayout; import java.util.List; /** * 数据集脱敏字段设置页面 + * * @author Yvan * @version 11.0 * Created by Yvan on 2022/9/8 @@ -27,7 +25,7 @@ public class TableDataDesensitizationSettingPane extends BasicBeanPane tableDataDesensitizationBeans) { diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java index 36322c3980..099f5d0b1b 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java @@ -109,12 +109,16 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter generateRolesIdsBySelectedValues() { diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTablePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTablePane.java index 77546b9ef1..b9311f0c4b 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTablePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTablePane.java @@ -12,6 +12,7 @@ import java.util.List; /** * 脱敏字段设置页面中的Table + * * @author Yvan * @version 11.0 * Created by Yvan on 2022/9/14 @@ -48,6 +49,7 @@ public class TableDataDesensitizationTablePane extends JPanel { /** * 展示此TableData中已配置的脱敏规则信息 + * * @param tableData */ public void populateDesensitizationSetting(AbstractDesensitizationTableData tableData) { diff --git a/designer-base/src/main/resources/com/fr/design/standard/tip/tips_normal.svg b/designer-base/src/main/resources/com/fr/design/standard/tip/tips_normal.svg new file mode 100644 index 0000000000..cfc3370a66 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/standard/tip/tips_normal.svg @@ -0,0 +1,3 @@ + + + From 5b503ffba630dc6c9189702a0cb601762c3a3113 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 13 Oct 2022 16:07:40 +0800 Subject: [PATCH 083/310] =?UTF-8?q?REPORT-81880=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=AE=9A=E4=BD=8D=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/DesignerFrame.java | 35 ++++++++++++++++++ .../actions/replace/ui/ITTableButton.java | 37 +------------------ 2 files changed, 37 insertions(+), 35 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index dfd2a20cd0..a18cd724d7 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -886,6 +886,39 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta layeredPane.repaint(); } + /** + * 激活模板 + *

+ * activateJTemplate需要模板存在,openTemplate需要模板保存过,该方法模板保存与未保存皆可激活,模板如果关闭,并且保存过,会重新打开 + * + * @param templatePath 模板路径 template.getPath() + * @param templateName 模板名称 + */ + public void openOrActiveTemplate(String templatePath, String templateName) { + //没保存过的模板如果要激活就要从当前历史模板列表里面找 + if (isTemplateNeverSaved(templatePath)) { + int index = HistoryTemplateListCache.getInstance().contains(templateName); + //如果历史模板列表中存在则激活 + if (index != -1) { + DesignerContext.getDesignerFrame().activateJTemplate(HistoryTemplateListCache.getInstance().getTemplate(index)); + } + } else { + DesignerContext.getDesignerFrame().openTemplate(FILEFactory.createFILE(templatePath)); + } + } + + /** + * 指定路径的模板是否保存过 + * + * @param templatePath 模板路径 template.getPath() + * @return 如果模板没保存过则返回true + */ + private boolean isTemplateNeverSaved(String templatePath) { + FILE tplFile = FILEFactory.createFILE(templatePath); + //没保存过的模板获取到的templatePath所生成的FILE文件会不存在 + return tplFile == null || !tplFile.exists() || StringUtils.isEmpty(templatePath); + } + /** * 当前模板 停用失败 * @@ -1231,6 +1264,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta /** * 判断是否正在进行服务器配置 + * * @return boolean */ public boolean isServerConfig() { @@ -1239,6 +1273,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta /** * 设置是否正在进行服务器配置 + * * @param serverConfig */ public void setServerConfig(boolean serverConfig) { diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java index 40e05e615d..35ebedc72a 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java @@ -46,46 +46,13 @@ public class ITTableButton extends AbstractCellEditor implements TableCellEditor if (StringUtils.isNotEmpty(GeneralUtils.objectToString(content.getTrlString()))) { ITReplaceMainDialog.setITReplaceFlag(true); TRL trl = new TRL(GeneralUtils.objectToString(content.getTrlString())); - FILE tplFile = FILEFactory.createFILE(content.getTemplatePath()); - if (tplFile != null && tplFile.exists()) { - //模板已保存 - navigate2ExistedTemplate(tplFile, trl); - } else { - //模板未保存 - navigate2NotExistedTemplate(content, trl); - } + DesignerContext.getDesignerFrame().openOrActiveTemplate(content.getTemplatePath(), content.getTemplateName()); + HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().navigate(trl); } ITReplaceMainDialog.setITReplaceFlag(false); } - - /** - * 模板未保存的跳转逻辑 - * @param content 存储模板名称的数据结构 - * @param trl 跳转链接 - */ - private void navigate2NotExistedTemplate(ITContent content, TRL trl) { - java.util.List> openTemplates = HistoryTemplateListCache.getInstance().getHistoryList(); - for (int i = 0, len = openTemplates.size(); i < len; i++) { - if (StringUtils.equals(openTemplates.get(i).getTemplateName(), content.getTemplateName())) { - DesignerContext.getDesignerFrame().activateJTemplate(openTemplates.get(i)); - HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().navigate(trl); - break; - } - } - } - - /** - * 模板已保存的跳转逻辑 - * @param tplFile 模板的FILE文件 - * @param trl 跳转链接 - */ - private void navigate2ExistedTemplate(FILE tplFile, TRL trl) { - DesignerContext.getDesignerFrame().openTemplate(tplFile); - HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().navigate(trl); - } }); - } /** From 6fef48938c09950fc802a268d3b819c9437747b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvan-=E6=AC=A7=E9=98=B3=E5=B8=86?= Date: Thu, 13 Oct 2022 16:32:11 +0800 Subject: [PATCH 084/310] =?UTF-8?q?REPORT-75091=20-=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=84=B1=E6=95=8F=EF=BC=88=E6=8A=A5=E8=A1=A8=EF=BC=89=20?= =?UTF-8?q?=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E4=B9=8B?= =?UTF-8?q?=E5=89=8D=E7=94=A8AbstractDesensitizationTabledata=E6=8A=BD?= =?UTF-8?q?=E8=B1=A1=E7=B1=BB=E4=BD=9C=E4=B8=BA=E6=89=80=E6=9C=89=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E7=9A=84=E9=A1=B6=E5=B1=82=E6=8A=BD=E8=B1=A1?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=EF=BC=8C=E5=9C=A8=E8=AF=BB=E5=86=99=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=E6=9C=89=E7=82=B9=E8=86=88=E5=BA=94=EF=BC=8C?= =?UTF-8?q?=E4=B8=BB=E8=A6=81=E6=98=AF=E5=8F=AF=E8=83=BD=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E5=86=97=E4=BD=99=EF=BC=8C=E6=88=96=E8=80=85?= =?UTF-8?q?=E7=A0=B4=E5=9D=8F=E5=8E=9F=E6=9C=89=E8=AF=BB=E5=86=99=E5=A7=94?= =?UTF-8?q?=E6=89=98=E7=9A=84=E5=B1=82=E7=BA=A7=20=E3=80=90=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E7=8E=B0=E5=9C=A8=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E4=B8=BADesensitizationTableData=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=EF=BC=8CAbstractTableData=E5=AE=9E=E7=8E=B0=E6=AD=A4=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=EF=BC=8C=E5=B9=B6=E5=9C=A8=E5=86=85=E9=83=A8=E6=8F=90?= =?UTF-8?q?=E4=BE=9B=E8=AF=BB=E5=86=99=E7=9A=84=E5=B7=A5=E5=85=B7=E6=96=B9?= =?UTF-8?q?=E6=B3=95=EF=BC=8C=E5=AD=90=E7=B1=BB=E7=BB=9F=E4=B8=80=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E8=B0=83=E7=94=A8=E5=B7=A5=E5=85=B7=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E7=9A=84=E6=96=B9=E5=BC=8F=E6=9D=A5=E8=AF=BB=E5=8F=96=E8=84=B1?= =?UTF-8?q?=E6=95=8F=E8=A7=84=E5=88=99=E4=BF=A1=E6=81=AF=20=E3=80=90review?= =?UTF-8?q?=E5=BB=BA=E8=AE=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/preview/PreviewTablePane.java | 10 +++++----- .../TableDataPreviewDesensitizeManager.java | 10 +++++----- .../TableDataDesensitizationSettingPane.java | 14 +++++++------- .../TableDataDesensitizationTableModel.java | 6 +++--- .../setting/TableDataDesensitizationTablePane.java | 8 ++++---- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java index 6665c6f772..dc3bc6ed8d 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java @@ -6,7 +6,7 @@ package com.fr.design.data.datapane.preview; import com.fr.base.TableData; import com.fr.base.svg.IconUtils; import com.fr.data.TableDataSource; -import com.fr.data.desensitize.base.AbstractDesensitizationTableData; +import com.fr.data.desensitize.base.DesensitizationTableData; import com.fr.data.impl.DBTableData; import com.fr.data.impl.EmbeddedTableData; import com.fr.data.impl.NameDataModel; @@ -236,8 +236,8 @@ public class PreviewTablePane extends BasicPane { desensitizationLabel.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { - TableDataDesensitizationSettingPane settingPane = new TableDataDesensitizationSettingPane((AbstractDesensitizationTableData) tableData); - settingPane.populateBean((AbstractDesensitizationTableData) tableData); + TableDataDesensitizationSettingPane settingPane = new TableDataDesensitizationSettingPane((DesensitizationTableData) tableData); + settingPane.populateBean((DesensitizationTableData) tableData); BasicDialog dialog = settingPane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(PreviewTablePane.this), new DialogActionAdapter() { @Override public void doOk() { @@ -775,7 +775,7 @@ public class PreviewTablePane extends BasicPane { * @return */ private boolean isDesensitizeOpened() { - return tableData instanceof AbstractDesensitizationTableData && - ((AbstractDesensitizationTableData) tableData).getDesensitizeOpen(); + return tableData instanceof DesensitizationTableData && + ((DesensitizationTableData) tableData).isDesensitizeOpen(); } } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java index 9cc82dfdda..0632de3e65 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java @@ -2,7 +2,7 @@ package com.fr.design.data.datapane.preview.desensitization; import com.fr.base.TableData; -import com.fr.data.desensitize.base.AbstractDesensitizationTableData; +import com.fr.data.desensitize.base.DesensitizationTableData; import com.fr.data.desensitize.base.TableDataDesensitizationBean; import com.fr.data.desensitize.manage.DesensitizationManager; import com.fr.data.desensitize.util.DesentizationUtils; @@ -62,9 +62,9 @@ public class TableDataPreviewDesensitizeManager implements DesensitizationManage * @return */ public boolean needDesensitize(TableData tableData) { - return tableData instanceof AbstractDesensitizationTableData && - DesentizationUtils.isCollectionNotEmpty(((AbstractDesensitizationTableData) tableData).getDesensitizationBeans()) && - ((AbstractDesensitizationTableData) tableData).getDesensitizationBeans().stream().noneMatch(TableDataDesensitizationBean::invalid); + return tableData instanceof DesensitizationTableData && + DesentizationUtils.isCollectionNotEmpty(((DesensitizationTableData) tableData).getDesensitizationBeans()) && + ((DesensitizationTableData) tableData).getDesensitizationBeans().stream().noneMatch(TableDataDesensitizationBean::invalid); } /** @@ -77,7 +77,7 @@ public class TableDataPreviewDesensitizeManager implements DesensitizationManage Map desensitizationBeanMap = new LinkedHashMap<>(); // 获取此数据集的所有脱敏信息 - Collection desensitizationBeans = ((AbstractDesensitizationTableData) tableData).getDesensitizationBeans(); + Collection desensitizationBeans = ((DesensitizationTableData) tableData).getDesensitizationBeans(); // 去除被禁用的规则 + 排序 List sortedBeans = desensitizationBeans .stream() diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationSettingPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationSettingPane.java index 91119b4083..a706efb2fb 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationSettingPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationSettingPane.java @@ -1,6 +1,6 @@ package com.fr.design.data.datapane.preview.desensitization.view.setting; -import com.fr.data.desensitize.base.AbstractDesensitizationTableData; +import com.fr.data.desensitize.base.DesensitizationTableData; import com.fr.data.desensitize.base.TableDataDesensitizationBean; import com.fr.design.beans.BasicBeanPane; import com.fr.design.data.datapane.preview.desensitization.view.common.DesensitizationOpenPane; @@ -18,19 +18,19 @@ import java.util.List; * @version 11.0 * Created by Yvan on 2022/9/8 */ -public class TableDataDesensitizationSettingPane extends BasicBeanPane { +public class TableDataDesensitizationSettingPane extends BasicBeanPane { /** * 设置针对的数据集 */ - private AbstractDesensitizationTableData tableData; + private DesensitizationTableData tableData; private DesensitizationOpenPane desensitizationOpenPane; private TableDataDesensitizationTablePane tableDataDesensitizationTablePane; - public TableDataDesensitizationSettingPane(AbstractDesensitizationTableData tableData) { + public TableDataDesensitizationSettingPane(DesensitizationTableData tableData) { this.tableData = tableData; initComponents(); } @@ -67,14 +67,14 @@ public class TableDataDesensitizationSettingPane extends BasicBeanPane editorPane; - public TableDataDesensitizationTablePane(AbstractDesensitizationTableData tableData, Component parent) { + public TableDataDesensitizationTablePane(DesensitizationTableData tableData, Component parent) { this.tableData = tableData; this.parent = parent; initComponent(); @@ -52,7 +52,7 @@ public class TableDataDesensitizationTablePane extends JPanel { * * @param tableData */ - public void populateDesensitizationSetting(AbstractDesensitizationTableData tableData) { + public void populateDesensitizationSetting(DesensitizationTableData tableData) { this.tableData = tableData; editorPane.populate(tableData.getDesensitizationBeans().toArray(new TableDataDesensitizationBean[0])); } From 8c49d129f865cd7880615733944cfb6d9c42bf79 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 13 Oct 2022 18:47:14 +0800 Subject: [PATCH 085/310] =?UTF-8?q?REPORT-81880=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=AE=9A=E4=BD=8D=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/DesignerFrame.java | 19 +++++++++++++++++-- .../actions/replace/ui/ITTableButton.java | 2 +- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index a18cd724d7..5040a5cbd4 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -892,10 +892,10 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta * activateJTemplate需要模板存在,openTemplate需要模板保存过,该方法模板保存与未保存皆可激活,模板如果关闭,并且保存过,会重新打开 * * @param templatePath 模板路径 template.getPath() - * @param templateName 模板名称 */ - public void openOrActiveTemplate(String templatePath, String templateName) { + public void openOrActiveTemplate(String templatePath) { //没保存过的模板如果要激活就要从当前历史模板列表里面找 + String templateName = getTemplateNameFromPath(templatePath); if (isTemplateNeverSaved(templatePath)) { int index = HistoryTemplateListCache.getInstance().contains(templateName); //如果历史模板列表中存在则激活 @@ -919,6 +919,21 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta return tplFile == null || !tplFile.exists() || StringUtils.isEmpty(templatePath); } + /** + * 根据模板路径获取模板名称 + * @param templatePath 模板路径 template.getPath() + * @return 模板名 + */ + private String getTemplateNameFromPath(String templatePath) { + FILE tplFile = FILEFactory.createFILE(templatePath); + String templateName = StringUtils.EMPTY; + if (tplFile != null) { + templateName = tplFile.getName(); + } + return templateName; + } + + /** * 当前模板 停用失败 * diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java index 35ebedc72a..c4cf47f592 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java @@ -46,7 +46,7 @@ public class ITTableButton extends AbstractCellEditor implements TableCellEditor if (StringUtils.isNotEmpty(GeneralUtils.objectToString(content.getTrlString()))) { ITReplaceMainDialog.setITReplaceFlag(true); TRL trl = new TRL(GeneralUtils.objectToString(content.getTrlString())); - DesignerContext.getDesignerFrame().openOrActiveTemplate(content.getTemplatePath(), content.getTemplateName()); + DesignerContext.getDesignerFrame().openOrActiveTemplate(content.getTemplatePath()); HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().navigate(trl); } ITReplaceMainDialog.setITReplaceFlag(false); From f6c6f15f628971dc7d618f847f114addd449ad7e Mon Sep 17 00:00:00 2001 From: Harrison Date: Thu, 13 Oct 2022 20:32:34 +0800 Subject: [PATCH 086/310] =?UTF-8?q?REPORT-76857=20=E4=BA=91=E7=AB=AF?= =?UTF-8?q?=E8=BF=90=E7=BB=B4=E6=8F=92=E4=BB=B6=E4=B9=9F=E4=BC=9A=E8=A2=AB?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E6=A3=80=E6=B5=8B=E6=A3=80=E6=B5=8B=E5=88=B0?= =?UTF-8?q?=20=E5=8F=AA=E6=A3=80=E6=B5=8B=20web-inf/lib=20=E5=92=8C=20desi?= =?UTF-8?q?gner/lib=20=E4=B8=8B=E9=9D=A2=E7=9A=84=E3=80=82=20=E5=BF=BD?= =?UTF-8?q?=E8=A7=86=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/env/detect/impl/converter/ClassConflictConvertor.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/designer-base/src/main/java/com/fr/env/detect/impl/converter/ClassConflictConvertor.java b/designer-base/src/main/java/com/fr/env/detect/impl/converter/ClassConflictConvertor.java index 57c97326e5..6cd92e4039 100644 --- a/designer-base/src/main/java/com/fr/env/detect/impl/converter/ClassConflictConvertor.java +++ b/designer-base/src/main/java/com/fr/env/detect/impl/converter/ClassConflictConvertor.java @@ -48,6 +48,7 @@ public class ClassConflictConvertor implements ThrowableConverter { private static final String JAR_URL_SUFFIX = ".jar!"; private static final String JAR_FILE_SUFFIX = ".jar"; private static final String FILE_URL_PREFIX = "file:"; + private static final String PLUGINS_DIR_NAME = "plugins"; private final Map, ClassNameConverter> throwableMap = new HashMap<>(); @@ -108,6 +109,9 @@ public class ClassConflictConvertor implements ThrowableConverter { for (URL url : urlList) { String file = url.getFile(); String decodeFileStr = URLDecoder.decode(file, EncodeConstants.ENCODING_UTF_8); + if (decodeFileStr.contains(PLUGINS_DIR_NAME)) { + continue; + } if (decodeFileStr.contains(JAR_URL_SUFFIX)) { String jarPath = decodeFileStr.substring(FILE_URL_PREFIX.length(), decodeFileStr.indexOf(JAR_URL_SUFFIX) + JAR_FILE_SUFFIX.length()); String jar = new File(jarPath).getName(); From e6b332b9736bcf45edce6785a1875d5d5a9145c3 Mon Sep 17 00:00:00 2001 From: Harrison Date: Thu, 13 Oct 2022 20:37:25 +0800 Subject: [PATCH 087/310] =?UTF-8?q?REPORT-76857=20=E4=BA=91=E7=AB=AF?= =?UTF-8?q?=E8=BF=90=E7=BB=B4=E6=8F=92=E4=BB=B6=E4=B9=9F=E4=BC=9A=E8=A2=AB?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E6=A3=80=E6=B5=8B=E6=A3=80=E6=B5=8B=E5=88=B0?= =?UTF-8?q?=20=E5=88=A0=E6=8E=89=E4=B8=80=E4=B8=AA=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E3=80=82=E4=BE=9D=E8=B5=96=E4=BA=8E=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=EF=BC=8C=E4=B8=8D=E7=A8=B3=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/converter/ClassConflictConvertorTest.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/designer-base/src/test/java/com/fr/env/detect/impl/converter/ClassConflictConvertorTest.java b/designer-base/src/test/java/com/fr/env/detect/impl/converter/ClassConflictConvertorTest.java index cdc789b015..20f370b7b1 100644 --- a/designer-base/src/test/java/com/fr/env/detect/impl/converter/ClassConflictConvertorTest.java +++ b/designer-base/src/test/java/com/fr/env/detect/impl/converter/ClassConflictConvertorTest.java @@ -1,5 +1,6 @@ package com.fr.env.detect.impl.converter; +import org.junit.Assert; import org.junit.Test; public class ClassConflictConvertorTest { @@ -10,14 +11,7 @@ public class ClassConflictConvertorTest { ClassNotFoundException ex1 = new ClassNotFoundException("Class 111.222.333 not found"); Iterable names = ClassConflictConvertor.Converter.CLASS.converter(ex1); - System.out.println(); - } - - @Test - public void testConverter() { - - ClassNotFoundException ex1 = new ClassNotFoundException("com.zaxxer.hikari.HikariConfig"); - ClassConflictConvertor convertor = new ClassConflictConvertor(); - convertor.convert(ex1); + String next = names.iterator().next(); + Assert.assertEquals("111.222.333", next); } } \ No newline at end of file From fe43d69d1f69a6a338fcbaed41b7f346b1c2a43b Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Fri, 14 Oct 2022 10:19:37 +0800 Subject: [PATCH 088/310] =?UTF-8?q?REPORT-75998=20=E6=9B=B4=E6=8D=A2?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E4=BD=8D=E7=BD=AE=E5=88=B0=E2=80=9C=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/JTemplate.java | 5 +++++ .../mainframe/toolbar/ToolBarMenuDock.java | 8 +------- .../fr/design/module/DesignModuleFactory.java | 18 ++++++++++++++++-- .../com/fr/design/images/replace/replace.png | Bin 0 -> 418 bytes .../design/images/replace/replace_normal.svg | 3 +++ .../actions/replace/ITReplaceAction.java | 1 + 6 files changed, 26 insertions(+), 9 deletions(-) create mode 100644 designer-base/src/main/resources/com/fr/design/images/replace/replace.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/replace/replace_normal.svg 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 fe0e4ee4ff..844b8d0144 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 @@ -54,6 +54,7 @@ import com.fr.design.mainframe.toolbar.VcsScene; import com.fr.design.menu.MenuDef; import com.fr.design.menu.NameSeparator; import com.fr.design.menu.ShortCut; +import com.fr.design.module.DesignModuleFactory; import com.fr.design.preview.PagePreview; import com.fr.design.ui.util.UIUtil; import com.fr.design.utils.DesignUtils; @@ -1109,6 +1110,10 @@ public abstract class JTemplate> tplMenu.addShortCut(shortCuts4Authority()); } + //查找替换 + tplMenu.addShortCut(new NameSeparator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Replace_Name_Separate"))); + tplMenu.addShortCut((ShortCut) DesignModuleFactory.getITReplaceAction()); + return new MenuDef[]{tplMenu}; } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index 6a83a159b8..904c281560 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -580,13 +580,7 @@ public abstract class ToolBarMenuDock { } shortCuts.add(new AboutAction()); - try { - if (DesignModuleFactory.getITReplaceAction() != null) { - shortCuts.add((ShortCut) DesignModuleFactory.getITReplaceAction().newInstance()); - } - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } + return shortCuts.toArray(new ShortCut[0]); } diff --git a/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java b/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java index bab9bb1ac8..cccd6f71e6 100644 --- a/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java +++ b/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java @@ -19,6 +19,7 @@ import com.fr.log.FineLoggerFactory; import com.fr.plugin.solution.sandbox.collection.PluginSandboxCollections; import com.fr.stable.StableUtils; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import java.lang.reflect.Constructor; import java.awt.Dialog; @@ -129,8 +130,21 @@ public class DesignModuleFactory { instance.ITReplaceAction = r; } - public static Class getITReplaceAction() { - return instance.ITReplaceAction; + /** + * 获取查找替换 + * + * @return ITReplaceAction + */ + @Nullable + public static Object getITReplaceAction() { + try { + if (instance.ITReplaceAction != null) { + return instance.ITReplaceAction.newInstance(); + } + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + return null; } /** diff --git a/designer-base/src/main/resources/com/fr/design/images/replace/replace.png b/designer-base/src/main/resources/com/fr/design/images/replace/replace.png new file mode 100644 index 0000000000000000000000000000000000000000..e736042724c17a037500b250aaeb5802acdb5366 GIT binary patch literal 418 zcmV;T0bTxyP)ve zv+>o~pP!Zo!ySw)VL-#Vp(0d++;7MXE+1 zB>|*FoG>&r34&tKkiq#TkIb}3zvEM%c@p@0s1fA(`x0BM^=Q!MtdyCe1d*m`QX_EA zz2P_~%2!RJVtq&{7HHzC`u0Oe#*C&&^bX5GKrEy#k>CdR8N+>o^PDHrNbpT$pgtHq)$ literal 0 HcmV?d00001 diff --git a/designer-base/src/main/resources/com/fr/design/images/replace/replace_normal.svg b/designer-base/src/main/resources/com/fr/design/images/replace/replace_normal.svg new file mode 100644 index 0000000000..efe176ceab --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/replace/replace_normal.svg @@ -0,0 +1,3 @@ + + + diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ITReplaceAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ITReplaceAction.java index 358dc19652..6d085cbbdf 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ITReplaceAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ITReplaceAction.java @@ -29,6 +29,7 @@ public class ITReplaceAction extends UpdateAction { this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setAccelerator(getMenuKeySet().getKeyStroke()); + this.setSmallIcon("/com/fr/design/images/replace/replace"); } private static final MenuKeySet IT_REPLACE = new MenuKeySet() { From c0823d9ce88d2d58ada4ca4ea2cc2554ab44eb10 Mon Sep 17 00:00:00 2001 From: "John.Ying" Date: Fri, 14 Oct 2022 10:24:10 +0800 Subject: [PATCH 089/310] =?UTF-8?q?REPORT-81973=20=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E6=97=B6=E6=B2=A1=E9=A2=84=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E5=AE=8C=E5=B0=B1=E5=BC=80=E5=A7=8B=E6=90=9C=E7=B4=A2,?= =?UTF-8?q?=E6=B2=A1=E6=9E=84=E5=BB=BA=E5=87=BA=E6=A8=A1=E6=9D=BF=E6=A0=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/itree/filetree/TemplateFileTree.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java index 0a0d6c5d33..f273fa2092 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java @@ -306,8 +306,7 @@ public class TemplateFileTree extends EnvFileTree { if (interceptRefresh(root)) { return; } - - if (!TemplateTreeSearchManager.getInstance().isRefreshing()) { + if (!TemplateTreeSearchManager.getInstance().isRefreshing() || TemplateTreeSearchManager.getInstance().allFileNodes().size() != allTreeNode.size()) { currentTreeMode.clear(); calculateNode.clear(); allTreeNode = TemplateTreeSearchManager.getInstance().allFileNodes().entrySet().stream().collect( From a1e3c0027038e589b5b3ec8f45e924f955d9001f Mon Sep 17 00:00:00 2001 From: "John.Ying" Date: Fri, 14 Oct 2022 15:16:39 +0800 Subject: [PATCH 090/310] =?UTF-8?q?REPORT-82112=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E9=94=81=E5=AE=9A=EF=BC=8C=E8=B6=85=E7=AE=A1=E5=BC=BA=E5=88=B6?= =?UTF-8?q?=E8=A7=A3=E9=94=81=E7=9A=84=E6=8C=89=E9=92=AE=E6=B2=A1=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignerFrameFileDealerPane.java | 21 ++++++++++++++++--- .../pane/TemplateTreeSearchToolbarPane.java | 6 ++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index 04a513d5b6..bdf0aa56c6 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java @@ -172,8 +172,8 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt tooBarPane.add(new UIMenuHighLight(), BorderLayout.SOUTH); searchToolbarPane = new TemplateTreeSearchToolbarPane(toolBar); + searchToolbarPane.add(createUpToolBarPane(), BorderLayout.EAST); searchToolbarPane.setPreferredSize(new Dimension(this.getWidth(), 23)); - add(searchToolbarPane, BorderLayout.NORTH); CardLayout card; JPanel cardPane = new JPanel(card = new CardLayout()); @@ -183,7 +183,6 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt card.show(cardPane, FILE); TemplateTreePane.getInstance().setToolbarStateChangeListener(this); - add(cardPane, BorderLayout.CENTER); stateChange(); } @@ -219,7 +218,6 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt private JPanel createUpToolBarPane() { JPanel panel = new JPanel(new BorderLayout()); - panel.add(toolBar, BorderLayout.CENTER); if (WorkContext.getCurrent().isRoot()) { rightToolBar = new UIToolbar(FlowLayout.RIGHT); rightToolBar.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.TOOLBAR_BORDER_COLOR)); @@ -461,6 +459,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt public void actionPerformed(ActionEvent e) { // 交换层级 searchToolbarPane.switchPane(TemplateTreeSearchToolbarPane.SEARCH_PANE); + refreshRightToolBarByContentPaneType(); TemplateTreePane.getInstance().refreshDockingView(); TemplateTreeSearchManager.getInstance().switchToSearch(TemplateTreePane.getInstance().getTemplateFileTree()); } @@ -595,8 +594,24 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt } } + /** + * 搜索状态下不显示rightToolBar + */ + public void refreshRightToolBarByContentPaneType() { + if (rightToolBar != null) { + if (StringUtils.equals(TemplateTreeSearchToolbarPane.CONTENT_PANE_TYPE, TemplateTreeSearchToolbarPane.SEARCH_PANE)) { + rightToolBar.setVisible(false); + } + } + } + public void refreshRightToolBarBy(FileNode fileNode) { + if (rightToolBar != null) { + if (StringUtils.equals(TemplateTreeSearchToolbarPane.CONTENT_PANE_TYPE, TemplateTreeSearchToolbarPane.SEARCH_PANE)) { + rightToolBar.setVisible(false); + return; + } boolean locked = fileNode != null && StringUtils.isNotEmpty(fileNode.getLock()) && !ComparatorUtils.equals(fileNode.getLock(), fileNode.getUserID()); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/control/pane/TemplateTreeSearchToolbarPane.java b/designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/control/pane/TemplateTreeSearchToolbarPane.java index bb98561bf9..2154c9f933 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/control/pane/TemplateTreeSearchToolbarPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/control/pane/TemplateTreeSearchToolbarPane.java @@ -39,6 +39,11 @@ public class TemplateTreeSearchToolbarPane extends JPanel implements TreeSearchS public static final String SEARCH_PANE = "searchPane"; + /** + * 判断工具栏是处于搜索栏还是非搜索栏 + */ + public static String CONTENT_PANE_TYPE = "toolbarPane"; + /** * 工具栏 */ @@ -187,6 +192,7 @@ public class TemplateTreeSearchToolbarPane extends JPanel implements TreeSearchS */ public void switchPane(String name) { cardLayout.show(contentPane, name); + CONTENT_PANE_TYPE = name; } public void setPlaceHolder(String placeHolder) { From 55de66b7b2eece2ba7bfdca20caaa7d49f9cee7b Mon Sep 17 00:00:00 2001 From: "John.Ying" Date: Fri, 14 Oct 2022 15:30:12 +0800 Subject: [PATCH 091/310] =?UTF-8?q?REPORT-82112=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E9=94=81=E5=AE=9A=EF=BC=8C=E8=B6=85=E7=AE=A1=E5=BC=BA=E5=88=B6?= =?UTF-8?q?=E8=A7=A3=E9=94=81=E7=9A=84=E6=8C=89=E9=92=AE=E6=B2=A1=E4=BA=86?= =?UTF-8?q?--=E6=94=B9=E4=BA=86=E4=B8=80=E4=B8=8B=E9=9D=9Efinal=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E6=94=B9=E5=9B=9E=E5=B0=8F=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../searcher/control/pane/TemplateTreeSearchToolbarPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/control/pane/TemplateTreeSearchToolbarPane.java b/designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/control/pane/TemplateTreeSearchToolbarPane.java index 2154c9f933..e2deb13254 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/control/pane/TemplateTreeSearchToolbarPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/control/pane/TemplateTreeSearchToolbarPane.java @@ -42,7 +42,7 @@ public class TemplateTreeSearchToolbarPane extends JPanel implements TreeSearchS /** * 判断工具栏是处于搜索栏还是非搜索栏 */ - public static String CONTENT_PANE_TYPE = "toolbarPane"; + public static String contentPaneType = "toolbarPane"; /** * 工具栏 @@ -192,7 +192,7 @@ public class TemplateTreeSearchToolbarPane extends JPanel implements TreeSearchS */ public void switchPane(String name) { cardLayout.show(contentPane, name); - CONTENT_PANE_TYPE = name; + contentPaneType = name; } public void setPlaceHolder(String placeHolder) { From cd6e94613eefa0e30a554ef4aaa3d00d244944d0 Mon Sep 17 00:00:00 2001 From: "John.Ying" Date: Fri, 14 Oct 2022 15:41:25 +0800 Subject: [PATCH 092/310] =?UTF-8?q?REPORT-82112=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E9=94=81=E5=AE=9A=EF=BC=8C=E8=B6=85=E7=AE=A1=E5=BC=BA=E5=88=B6?= =?UTF-8?q?=E8=A7=A3=E9=94=81=E7=9A=84=E6=8C=89=E9=92=AE=E6=B2=A1=E4=BA=86?= =?UTF-8?q?--=E6=8A=BD=E6=96=B9=E6=B3=95=EF=BC=8C=E7=9C=8B=E8=B5=B7?= =?UTF-8?q?=E6=9D=A5=E6=9B=B4=E6=95=B4=E6=B4=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignerFrameFileDealerPane.java | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index bdf0aa56c6..b3086ce7b8 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java @@ -599,26 +599,31 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt */ public void refreshRightToolBarByContentPaneType() { if (rightToolBar != null) { - if (StringUtils.equals(TemplateTreeSearchToolbarPane.CONTENT_PANE_TYPE, TemplateTreeSearchToolbarPane.SEARCH_PANE)) { + if (StringUtils.equals(TemplateTreeSearchToolbarPane.contentPaneType, TemplateTreeSearchToolbarPane.SEARCH_PANE)) { rightToolBar.setVisible(false); } } } public void refreshRightToolBarBy(FileNode fileNode) { + refreshRightToolBarByNode(fileNode); + refreshRightToolBarByContentPaneType(); + } + /** + * 根据当前选中节点判断是否锁定状态 + * + * @param fileNode 选中文件节点 + */ + public void refreshRightToolBarByNode(FileNode fileNode) { if (rightToolBar != null) { - if (StringUtils.equals(TemplateTreeSearchToolbarPane.CONTENT_PANE_TYPE, TemplateTreeSearchToolbarPane.SEARCH_PANE)) { - rightToolBar.setVisible(false); - return; - } boolean locked = fileNode != null - && StringUtils.isNotEmpty(fileNode.getLock()) - && !ComparatorUtils.equals(fileNode.getLock(), fileNode.getUserID()); + && StringUtils.isNotEmpty(fileNode.getLock()) + && !ComparatorUtils.equals(fileNode.getLock(), fileNode.getUserID()); boolean visible = locked - && WorkContext.getCurrent().isRoot() - && WorkContext.getCurrent().get(LockInfoOperator.class).isUnLockable() - && !WorkContext.getCurrent().get(LockInfoOperator.class).isTplUnLocked(fileNode.getEnvPath()); + && WorkContext.getCurrent().isRoot() + && WorkContext.getCurrent().get(LockInfoOperator.class).isUnLockable() + && !WorkContext.getCurrent().get(LockInfoOperator.class).isTplUnLocked(fileNode.getEnvPath()); rightToolBar.setVisible(visible); } } From ac1a14dbec338fafde33da86d2549a244874bcb8 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 18 Oct 2022 18:22:16 +0800 Subject: [PATCH 093/310] =?UTF-8?q?REPORT-75998=20=E4=BF=AE=E6=94=B9UI?= =?UTF-8?q?=E4=B8=8E=E9=80=82=E9=85=8D=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/images/replace/change_normal.svg | 3 + .../com/fr/design/images/replace/replace.png | Bin 418 -> 437 bytes .../design/images/replace/replace_normal.svg | 5 +- .../replace/ui/ITReplaceMainDialog.java | 8 +- .../replace/ui/ITReplaceNorthPanel.java | 152 ++++++++++-------- .../replace/ui/ITReplaceSouthPanel.java | 8 + .../replace/ui/ITReplaceWestPanel.java | 24 ++- 7 files changed, 129 insertions(+), 71 deletions(-) create mode 100644 designer-base/src/main/resources/com/fr/design/images/replace/change_normal.svg diff --git a/designer-base/src/main/resources/com/fr/design/images/replace/change_normal.svg b/designer-base/src/main/resources/com/fr/design/images/replace/change_normal.svg new file mode 100644 index 0000000000..88d9e7772b --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/replace/change_normal.svg @@ -0,0 +1,3 @@ + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/replace/replace.png b/designer-base/src/main/resources/com/fr/design/images/replace/replace.png index e736042724c17a037500b250aaeb5802acdb5366..b9a41125c56b58c9d71f27677bf6f951f453466a 100644 GIT binary patch delta 395 zcmV;60d)SN1GNJoiBL{Q4GJ0x0000DNk~Le0000E0000E2nGNE03S##(UBoFe@aP2 zK~#7Fl~PMm!axx184_16@C3#aFd<4=uHp^2fp`Mu2I39m26}^V0<&@c*INWAsQVwQOp9 z&ER)9Z!H+35c%x7&W%l+9~t9>e_qz@-o9)xg2_We;rce8C$GD*EC2&WHAK#4({afN z5E?w%2eR_53LN7qO<2M$TdU@Zqznj({3w*DzM2yae+7AWrz_EoOxEo@@vUx#kCet*T>;my~VLX8|Pm<}R zTt`u?KJ1bq*+V1R2dZ}|wRXc&@><3{WE7uZw$~V}QN=<6mJIA*)cQ(&|7-!92!bBu p=spY(l^HBE#tyn1r)m7}{vUt!e|(l%aLoV!002ovPDHLkV1gCat@{7~ delta 376 zcmV-;0f+vz1EK>ViBL{Q4GJ0x0000DNk~Le0000G0000G2nGNE03Y-JVUZyX`) zK~#7Fty0@j0x=ZL%~AjzKnEmbmk)p34xj_D0x7`~umYt6I&k^%Lv~3z04mUbXE&a^ z=s50UP~^^JlAPq8`#M7W)2Ip5I=c40P~``b&f3lTR|M=xR6G*V9?LQ2y_kRudl6e} z4{bz3sc>vevJZ{05Q?~ZGHN`C3 z+ - + + + + diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index 9a2f5c8de7..6ea30d9896 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -20,6 +20,7 @@ import com.fr.general.GeneralUtils; import com.fr.stable.StringUtils; +import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import java.awt.BorderLayout; @@ -55,6 +56,7 @@ public class ITReplaceMainDialog extends UIDialog { private String searchStr; private static final int FIRST_ROW = 0; public static int selectCount = 0; + public static int MAIN_PANEL_WIDTH = 929 ; public ITReplaceMainDialog() { super(DesignerContext.getDesignerFrame()); @@ -97,8 +99,8 @@ public class ITReplaceMainDialog extends UIDialog { int width = jTemplate.getWidth(); Point point = jTemplate.getLocationOnScreen(); setModal(false); - setMaximumSize(new Dimension(jTemplate.getWidth(), jTemplate.getHeight())); - setMinimumSize(new Dimension(jTemplate.getWidth(), 240)); + setMaximumSize(new Dimension(width, jTemplate.getHeight())); + setMinimumSize(new Dimension(width, 240)); setSize(width, height); setLocation(new Point(point.x, point.y + jTemplate.getHeight() / 2 + jTemplate.getHeight() / 2 - 385)); @@ -124,7 +126,7 @@ public class ITReplaceMainDialog extends UIDialog { replaceComboBox.setEnabled(false); replaceComboBox.setEditable(true); northPane.getReplaceButton().setEnabled(false); - + westPanel.getLeftPanel().setPreferredSize(new Dimension(ITReplaceWestPanel.LEFT_WIDTH,this.getHeight())); ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).setPlaceholder(Toolkit.i18nText("Fine-Design_Replace_Search_Input")); ((UITextField) (northPane.getReplaceInputCombobox().getEditor().getEditorComponent())).setPlaceholder(Toolkit.i18nText("Fine-Design_Replace_Input")); ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).addActionListener(new ActionListener() { diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java index a4fe1fef0f..909ce7112a 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java @@ -1,5 +1,6 @@ package com.fr.design.actions.replace.ui; +import com.fr.base.svg.IconUtils; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icontainer.UIScrollPane; @@ -9,7 +10,9 @@ import com.fr.design.i18n.Toolkit; import com.fr.stable.StringUtils; +import javax.swing.BorderFactory; import javax.swing.ComboBoxEditor; +import javax.swing.Icon; import javax.swing.JCheckBox; import javax.swing.JPanel; import javax.swing.ScrollPaneConstants; @@ -34,20 +37,28 @@ public class ITReplaceNorthPanel { private UIComboBox findCombobox; private UIComboBox rangeCombobox; private JCheckBox matchRadioButton; + private UILabel iconLabel; private UIComboBox findInputCombobox; private UIComboBox replaceInputCombobox; private UIScrollPane scrollPane; private UIButton replaceButton; private UIButton searchButton; + private static double rate = 1.00; //存储的5次最近输入 private int maxItemCount = 5; - private static final int LIMIT_WIDTH = 1250; + private static int limit_width = 800; private static final int HEIGHT = 161; - private static final int BUTTON_WIDTH = 60; - private static final int BUTTON_GAP = 20; + private static final int BUTTON_WIDTH = 44; + private static final int GAP = 20; + private static final int BUTTON_GAP = 10; private static final int MATCH_WIDTH = 70; + private static final int COMPONENT_HEIGHT = 25; + private static final int FIRST_Y = 15, SECOND_Y = 50, THIRD_Y = 85, FOURTH_Y = 120; + private static final int FIRST_X = 20, SECOND_X = 80; + private static final int LABEL_WIDTH = 60; + private static final Icon CHANGE_ICON = IconUtils.readIcon("/com/fr/design/images/replace/change_normal.svg"); private int findLabelX, findLabelY, findLabelWidth, findLabelHeight; @@ -60,7 +71,8 @@ public class ITReplaceNorthPanel { private int replaceInputComboBoxX, replaceInputComboBoxY, replaceInputComboBoxWidth, replaceInputComboBoxHeight; private int replaceButtonX, replaceButtonY, replaceButtonHeight; private int searchButtonX, searchButtonY, searchButtonHeight; - + private int iconX, iconY, iconWidth, iconHeight; + private int inputLength; public static ArrayList findItems = new ArrayList<>(); public static ArrayList findInputItems = new ArrayList<>(); @@ -81,6 +93,7 @@ public class ITReplaceNorthPanel { findLabel = new UILabel(Toolkit.i18nText("Fine-Design_Replace_Search_Element")); rangeLabel = new UILabel(Toolkit.i18nText("Fine-Design_Replace_Search_Range")); + iconLabel = new UILabel(CHANGE_ICON); resultLabel = new UILabel(); String[] rangeItems = new String[]{Toolkit.i18nText("Fine-Design_Basic_Export_JS_Template_Current")}; @@ -109,7 +122,7 @@ public class ITReplaceNorthPanel { replaceButton = new UIButton(Toolkit.i18nText("Fine-Design_Replace_Button")); searchButton = new UIButton(Toolkit.i18nText("Fine-Design_Search_Button")); - upPanel.setPreferredSize(new Dimension(LIMIT_WIDTH, HEIGHT)); + upPanel.setPreferredSize(new Dimension(limit_width, HEIGHT)); scrollPane = new UIScrollPane(upPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); upPanel.add(findLabel); upPanel.add(rangeLabel); @@ -121,6 +134,8 @@ public class ITReplaceNorthPanel { upPanel.add(matchRadioButton); upPanel.add(replaceButton); upPanel.add(searchButton); + upPanel.add(iconLabel); + scrollPane.setBorder(BorderFactory.createEmptyBorder()); } /** @@ -129,9 +144,8 @@ public class ITReplaceNorthPanel { * @param width */ public void setLimitSize(int width) { - width = Math.max(LIMIT_WIDTH, width); - upPanel.setMaximumSize(new Dimension(width, 161)); - upPanel.setPreferredSize(new Dimension(width, 161)); + upPanel.setMaximumSize(new Dimension(limit_width, 161)); + upPanel.setPreferredSize(new Dimension(limit_width, 161)); } @@ -144,21 +158,22 @@ public class ITReplaceNorthPanel { */ public void fitScreen(int x, int y, int templateWidth) { - templateWidth = Math.max(templateWidth, LIMIT_WIDTH); - - setFindLabelBounds(x, y, templateWidth); - setRangeLabelBounds(x, y, templateWidth); - setResultLabelBounds(x, y, templateWidth); + templateWidth = Math.max(ITReplaceMainDialog.MAIN_PANEL_WIDTH, templateWidth); + templateWidth = templateWidth - ITReplaceWestPanel.LEFT_WIDTH; + inputLength = (templateWidth - GAP * 5) / 2; - setFindComboboxBounds(x, y, templateWidth); - setRangeComboboxBounds(x, y, templateWidth); - setFindInputComboboxBounds(x, y, templateWidth); - setReplaceInputComboboxBounds(x, y, templateWidth); - - setUIRadioButtonBounds(x, y, templateWidth); - setReplaceButtonBounds(x, y, templateWidth); - setSearchButtonBounds(x, y, templateWidth); + setFindLabelBounds(); + setResultLabelBounds(templateWidth); + setFindComboboxBounds(); + setFindInputComboboxBounds(); + setReplaceInputComboboxBounds(templateWidth); + setRangeLabelBounds(); + setRangeComboboxBounds(); + setUIRadioButtonBounds(); + setReplaceButtonBounds(); + setSearchButtonBounds(); + setIconLabelBounds(); } @@ -214,87 +229,94 @@ public class ITReplaceNorthPanel { this.scrollPane = scrollPane; } + private void setIconLabelBounds() { + iconX = inputLength + GAP; + iconY = SECOND_Y; + iconWidth = GAP; + iconHeight = COMPONENT_HEIGHT; + iconLabel.setBounds(iconX, iconY, iconWidth, iconHeight); + } - private void setSearchButtonBounds(int x, int y, int templateWidth) { - searchButtonHeight = 25; - searchButtonY = resultLabelY; + private void setSearchButtonBounds() { + searchButtonHeight = COMPONENT_HEIGHT; + searchButtonY = FOURTH_Y; searchButtonX = replaceInputComboBoxX + replaceInputComboBoxWidth - BUTTON_WIDTH * 2 - BUTTON_GAP; searchButton.setBounds(searchButtonX, searchButtonY, BUTTON_WIDTH, searchButtonHeight); } - private void setReplaceButtonBounds(int x, int y, int templateWidth) { - replaceButtonHeight = 25; - replaceButtonY = resultLabelY; + private void setReplaceButtonBounds() { + replaceButtonHeight = COMPONENT_HEIGHT; + replaceButtonY = FOURTH_Y; replaceButtonX = replaceInputComboBoxX + replaceInputComboBoxWidth - BUTTON_WIDTH; replaceButton.setBounds(replaceButtonX, replaceButtonY, BUTTON_WIDTH, replaceButtonHeight); } - private void setReplaceInputComboboxBounds(int x, int y, int templateWidth) { - replaceInputComboBoxX = x + templateWidth / 2 + templateWidth / 60; - replaceInputComboBoxY = y + 55; - replaceInputComboBoxWidth = templateWidth / 3 + templateWidth / 30 * 2; - replaceInputComboBoxHeight = 25; + private void setReplaceInputComboboxBounds(int templateWidth) { + replaceInputComboBoxX = templateWidth - inputLength - GAP * 2; + replaceInputComboBoxY = SECOND_Y; + replaceInputComboBoxWidth = inputLength; + replaceInputComboBoxHeight = COMPONENT_HEIGHT; replaceInputCombobox.setBounds(replaceInputComboBoxX, replaceInputComboBoxY, replaceInputComboBoxWidth, replaceInputComboBoxHeight); } - private void setFindInputComboboxBounds(int x, int y, int templateWidth) { - findInputComboBoxX = x + templateWidth / 60; - findInputComboBoxY = y + 55; - findInputComboBoxWidth = templateWidth / 3 + templateWidth / 30 * 2; - findInputComboBoxHeight = 25; + private void setFindInputComboboxBounds() { + findInputComboBoxX = FIRST_X; + findInputComboBoxY = SECOND_Y; + findInputComboBoxWidth = inputLength - GAP; + findInputComboBoxHeight = COMPONENT_HEIGHT; findInputCombobox.setBounds(findInputComboBoxX, findInputComboBoxY, findInputComboBoxWidth, findInputComboBoxHeight); } - private void setUIRadioButtonBounds(int x, int y, int templateWidth) { - matchX = x + templateWidth / 60; - matchY = y + 90; + private void setUIRadioButtonBounds() { + matchX = FIRST_X; + matchY = THIRD_Y; matchWidth = MATCH_WIDTH; - matchHeight = 25; + matchHeight = COMPONENT_HEIGHT; matchRadioButton.setBounds(matchX, matchY, matchWidth, matchHeight); } - private void setRangeComboboxBounds(int x, int y, int templateWidth) { - rangeComboBoxX = x + templateWidth / 2 + templateWidth / 15; - rangeComboBoxY = y + 20; - rangeComboBoxWidth = templateWidth / 3 + templateWidth / 60; - rangeComboBoxHeight = 25; + private void setRangeComboboxBounds() { + rangeComboBoxX = rangeLabelX + rangeLabelWidth; + rangeComboBoxY = FIRST_Y; + rangeComboBoxWidth = inputLength - 3 * GAP; + rangeComboBoxHeight = COMPONENT_HEIGHT; rangeCombobox.setBounds(rangeComboBoxX, rangeComboBoxY, rangeComboBoxWidth, rangeComboBoxHeight); } - private void setFindComboboxBounds(int x, int y, int templateWidth) { - findComboBoxX = x + templateWidth / 30 * 2; - findComboBoxY = y + 20; - findComboBoxWidth = templateWidth / 3 + templateWidth / 60; - findComboBoxHeight = 25; + private void setFindComboboxBounds() { + findComboBoxX = SECOND_X; + findComboBoxY = FIRST_Y; + findComboBoxWidth = inputLength - 4 * GAP; + findComboBoxHeight = COMPONENT_HEIGHT; findCombobox.setBounds(findComboBoxX, findComboBoxY, findComboBoxWidth, findComboBoxHeight); } - private void setResultLabelBounds(int x, int y, int templateWidth) { - resultLabelX = findLabelX; - resultLabelY = y + 125; + private void setResultLabelBounds(int templateWidth) { + resultLabelX = FIRST_X; + resultLabelY = FOURTH_Y; resultLabelWidth = templateWidth; - resultLabelHeight = 25; + resultLabelHeight = COMPONENT_HEIGHT; resultLabel.setBounds(resultLabelX, resultLabelY, resultLabelWidth, resultLabelHeight); } - private void setRangeLabelBounds(int x, int y, int templateWidth) { - rangeLabelX = x + templateWidth / 2 + templateWidth / 60; - rangeLabelY = y + 20; - rangeLabelWidth = findLabelWidth; - rangeLabelHeight = 25; + private void setRangeLabelBounds() { + rangeLabelX = replaceInputComboBoxX; + rangeLabelY = FIRST_Y; + rangeLabelWidth = LABEL_WIDTH; + rangeLabelHeight = COMPONENT_HEIGHT; rangeLabel.setBounds(rangeLabelX, rangeLabelY, rangeLabelWidth, rangeLabelHeight); } - private void setFindLabelBounds(int x, int y, int templateWidth) { - findLabelX = x + templateWidth / 60; - findLabelY = y + 20; - findLabelWidth = templateWidth / 20; - findLabelHeight = 25; + private void setFindLabelBounds() { + findLabelX = FIRST_X; + findLabelY = FIRST_Y; + findLabelWidth = LABEL_WIDTH; + findLabelHeight = COMPONENT_HEIGHT; findLabel.setBounds(findLabelX, findLabelY, findLabelWidth, findLabelHeight); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java index a240eba967..ef27f7e47e 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java @@ -1,8 +1,12 @@ package com.fr.design.actions.replace.ui; +import javax.swing.BorderFactory; +import javax.swing.JPanel; import javax.swing.RowSorter; +import javax.swing.border.EmptyBorder; import javax.swing.table.TableRowSorter; import java.awt.Color; +import java.awt.Label; /** * 下面板 @@ -18,10 +22,13 @@ public class ITReplaceSouthPanel { public static final int CHECKBOX_INDEX = 0; //ITContent在表格的列索引 public static final int CONTENT_INDEX = 6; + public static final int TABLE_GAP = 20; public ITReplaceSouthPanel() { itTableEditor = new ITTableEditor(); tableEditorPane = new ITTableEditorPane<>(itTableEditor); + //左右两边间距20 + tableEditorPane.setBorder(BorderFactory.createEmptyBorder(0,TABLE_GAP,0,TABLE_GAP)); RowSorter sorter = new TableRowSorter(itTableEditor){ @Override public boolean isSortable(int column) { @@ -29,6 +36,7 @@ public class ITReplaceSouthPanel { } }; tableEditorPane.getEditTable().setRowSorter(sorter); + tableEditorPane.getEditTable().setBorder(BorderFactory.createEmptyBorder()); tableEditorPane.getEditTable().setSelectionBackground(new Color(217, 235, 254)); tableEditorPane.getEditTable().setRowHeight(tableEditorPane.getEditTable().getRowHeight() / 2 + tableEditorPane.getEditTable().getRowHeight()); tableEditorPane.makeFace(tableEditorPane.getEditTable()); diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java index a58091a06a..d64cd4efd4 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java @@ -7,14 +7,20 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.share.ui.base.MouseClickListener; import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; +import com.fr.general.FRFont; import com.fr.stable.StringUtils; +import com.fr.third.com.lowagie.text.FontFactory; import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.JPanel; +import javax.swing.SwingConstants; import java.awt.Color; import java.awt.Cursor; +import java.awt.Font; import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; import java.awt.event.MouseEvent; /** @@ -29,7 +35,8 @@ public class ITReplaceWestPanel { private UILabel iconLabel; private static final Icon HELP_ICON = IconUtils.readIcon("com/fr/design/images/buttonicon/replace_help.svg"); private static final String HELP_URL = CloudCenter.getInstance().acquireUrlByKind("design.replace.help", "https://help.fanruan.com/finereport/doc-view-4954.html?source=3"); - private static final int FILL_COUNT = 13; + private static final int FILL_COUNT = 12; + public static final int LEFT_WIDTH = 100; public ITReplaceWestPanel() { @@ -37,6 +44,18 @@ public class ITReplaceWestPanel { iconLabel = new UILabel("" + Toolkit.i18nText("Fine-Design_Report_Community_Help") + ""); UIToggleButton contentButton = new UIToggleButton(Toolkit.i18nText("Fine-Design_Basic_Templates_Content")); + contentButton.setText(""+Toolkit.i18nText("Fine-Design_Basic_Templates_Content")+ ""); + contentButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + if (!contentButton.isSelected()) { + contentButton.setText(""+Toolkit.i18nText("Fine-Design_Basic_Templates_Content")+ ""); + } else { + contentButton.setText(Toolkit.i18nText("Fine-Design_Basic_Templates_Content")); + } + } + }); + leftPanel.setBackground(Color.WHITE); contentButton.setSelected(true); contentButton.setBorderPainted(false); leftPanel.add(contentButton); @@ -47,8 +66,8 @@ public class ITReplaceWestPanel { } //添加帮助文档按钮及超链 - iconLabel.setIcon(HELP_ICON); iconLabel.setToolTipText(Toolkit.i18nText("Fine-Design_Replace_Tooltip")); + iconLabel.setHorizontalAlignment(SwingConstants.CENTER); //设置游标 iconLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); iconLabel.addMouseListener(new MouseClickListener() { @@ -58,6 +77,7 @@ public class ITReplaceWestPanel { } }); leftPanel.add(iconLabel); + leftPanel.add(new UILabel(StringUtils.EMPTY)); } public JPanel getLeftPanel() { From 8b4065e774318c10ff85c7de65a1f7fcd8ffda01 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 18 Oct 2022 18:27:31 +0800 Subject: [PATCH 094/310] =?UTF-8?q?REPORT-75998=20=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/actions/replace/ui/ITReplaceMainDialog.java | 4 ++-- .../com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java | 4 ++-- .../com/fr/design/actions/replace/ui/ITReplaceWestPanel.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index 6ea30d9896..d0ae2d13cc 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -56,7 +56,7 @@ public class ITReplaceMainDialog extends UIDialog { private String searchStr; private static final int FIRST_ROW = 0; public static int selectCount = 0; - public static int MAIN_PANEL_WIDTH = 929 ; + public static int MAIN_PANEL_WIDTH = 929; public ITReplaceMainDialog() { super(DesignerContext.getDesignerFrame()); @@ -126,7 +126,7 @@ public class ITReplaceMainDialog extends UIDialog { replaceComboBox.setEnabled(false); replaceComboBox.setEditable(true); northPane.getReplaceButton().setEnabled(false); - westPanel.getLeftPanel().setPreferredSize(new Dimension(ITReplaceWestPanel.LEFT_WIDTH,this.getHeight())); + westPanel.getLeftPanel().setPreferredSize(new Dimension(ITReplaceWestPanel.LEFT_WIDTH, this.getHeight())); ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).setPlaceholder(Toolkit.i18nText("Fine-Design_Replace_Search_Input")); ((UITextField) (northPane.getReplaceInputCombobox().getEditor().getEditorComponent())).setPlaceholder(Toolkit.i18nText("Fine-Design_Replace_Input")); ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).addActionListener(new ActionListener() { diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java index ef27f7e47e..f3dc6296ec 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java @@ -28,8 +28,8 @@ public class ITReplaceSouthPanel { itTableEditor = new ITTableEditor(); tableEditorPane = new ITTableEditorPane<>(itTableEditor); //左右两边间距20 - tableEditorPane.setBorder(BorderFactory.createEmptyBorder(0,TABLE_GAP,0,TABLE_GAP)); - RowSorter sorter = new TableRowSorter(itTableEditor){ + tableEditorPane.setBorder(BorderFactory.createEmptyBorder(0, TABLE_GAP, 0, TABLE_GAP)); + RowSorter sorter = new TableRowSorter(itTableEditor) { @Override public boolean isSortable(int column) { return column != CHECKBOX_INDEX || column != CONTENT_INDEX; diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java index d64cd4efd4..344a37f9b0 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java @@ -44,12 +44,12 @@ public class ITReplaceWestPanel { iconLabel = new UILabel("" + Toolkit.i18nText("Fine-Design_Report_Community_Help") + ""); UIToggleButton contentButton = new UIToggleButton(Toolkit.i18nText("Fine-Design_Basic_Templates_Content")); - contentButton.setText(""+Toolkit.i18nText("Fine-Design_Basic_Templates_Content")+ ""); + contentButton.setText("" + Toolkit.i18nText("Fine-Design_Basic_Templates_Content") + ""); contentButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (!contentButton.isSelected()) { - contentButton.setText(""+Toolkit.i18nText("Fine-Design_Basic_Templates_Content")+ ""); + contentButton.setText("" + Toolkit.i18nText("Fine-Design_Basic_Templates_Content") + ""); } else { contentButton.setText(Toolkit.i18nText("Fine-Design_Basic_Templates_Content")); } From 8f657a3d85d13a78f2e9309979508cb2021acb89 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 18 Oct 2022 18:29:32 +0800 Subject: [PATCH 095/310] =?UTF-8?q?REPORT-75998=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/actions/replace/ui/ITReplaceWestPanel.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java index 344a37f9b0..5497169e90 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java @@ -37,6 +37,7 @@ public class ITReplaceWestPanel { private static final String HELP_URL = CloudCenter.getInstance().acquireUrlByKind("design.replace.help", "https://help.fanruan.com/finereport/doc-view-4954.html?source=3"); private static final int FILL_COUNT = 12; public static final int LEFT_WIDTH = 100; + public static final String CONTENT_TEXT = "" + Toolkit.i18nText("Fine-Design_Basic_Templates_Content") + ""; public ITReplaceWestPanel() { @@ -44,12 +45,12 @@ public class ITReplaceWestPanel { iconLabel = new UILabel("" + Toolkit.i18nText("Fine-Design_Report_Community_Help") + ""); UIToggleButton contentButton = new UIToggleButton(Toolkit.i18nText("Fine-Design_Basic_Templates_Content")); - contentButton.setText("" + Toolkit.i18nText("Fine-Design_Basic_Templates_Content") + ""); + contentButton.setText(CONTENT_TEXT); contentButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (!contentButton.isSelected()) { - contentButton.setText("" + Toolkit.i18nText("Fine-Design_Basic_Templates_Content") + ""); + contentButton.setText(CONTENT_TEXT); } else { contentButton.setText(Toolkit.i18nText("Fine-Design_Basic_Templates_Content")); } From 79cfbaee26ac9b29a61b8a621e9b2d3d4f661520 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 19 Oct 2022 09:14:02 +0800 Subject: [PATCH 096/310] =?UTF-8?q?REPORT-75998=20=E5=8E=BB=E9=99=A4?= =?UTF-8?q?=E5=A4=9A=E4=BD=99=E7=9A=84=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/actions/replace/ui/ITReplaceMainDialog.java | 1 - .../com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java | 3 --- .../com/fr/design/actions/replace/ui/ITReplaceWestPanel.java | 3 --- 3 files changed, 7 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index d0ae2d13cc..4e31314e4e 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -20,7 +20,6 @@ import com.fr.general.GeneralUtils; import com.fr.stable.StringUtils; -import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import java.awt.BorderLayout; diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java index f3dc6296ec..997013592d 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java @@ -1,12 +1,9 @@ package com.fr.design.actions.replace.ui; import javax.swing.BorderFactory; -import javax.swing.JPanel; import javax.swing.RowSorter; -import javax.swing.border.EmptyBorder; import javax.swing.table.TableRowSorter; import java.awt.Color; -import java.awt.Label; /** * 下面板 diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java index 5497169e90..0804efa23b 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java @@ -7,9 +7,7 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.share.ui.base.MouseClickListener; import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; -import com.fr.general.FRFont; import com.fr.stable.StringUtils; -import com.fr.third.com.lowagie.text.FontFactory; import javax.swing.BorderFactory; import javax.swing.Icon; @@ -17,7 +15,6 @@ import javax.swing.JPanel; import javax.swing.SwingConstants; import java.awt.Color; import java.awt.Cursor; -import java.awt.Font; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; From bfd6b9d984c80e713198575feadf048cf6d43be2 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 20 Oct 2022 10:30:05 +0800 Subject: [PATCH 097/310] =?UTF-8?q?REPORT-75998=20=E4=BF=AE=E6=94=B9UI?= =?UTF-8?q?=E4=B8=8E=E9=80=82=E9=85=8D=E9=80=BB=E8=BE=91(=E5=90=8C?= =?UTF-8?q?=E6=AD=A5final)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/images/replace/change_normal.svg | 3 + .../com/fr/design/images/replace/replace.png | Bin 418 -> 437 bytes .../design/images/replace/replace_normal.svg | 5 +- .../replace/ui/ITReplaceMainDialog.java | 7 +- .../replace/ui/ITReplaceNorthPanel.java | 152 ++++++++++-------- .../replace/ui/ITReplaceSouthPanel.java | 7 +- .../replace/ui/ITReplaceWestPanel.java | 22 ++- 7 files changed, 124 insertions(+), 72 deletions(-) create mode 100644 designer-base/src/main/resources/com/fr/design/images/replace/change_normal.svg diff --git a/designer-base/src/main/resources/com/fr/design/images/replace/change_normal.svg b/designer-base/src/main/resources/com/fr/design/images/replace/change_normal.svg new file mode 100644 index 0000000000..88d9e7772b --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/replace/change_normal.svg @@ -0,0 +1,3 @@ + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/replace/replace.png b/designer-base/src/main/resources/com/fr/design/images/replace/replace.png index e736042724c17a037500b250aaeb5802acdb5366..b9a41125c56b58c9d71f27677bf6f951f453466a 100644 GIT binary patch delta 395 zcmV;60d)SN1GNJoiBL{Q4GJ0x0000DNk~Le0000E0000E2nGNE03S##(UBoFe@aP2 zK~#7Fl~PMm!axx184_16@C3#aFd<4=uHp^2fp`Mu2I39m26}^V0<&@c*INWAsQVwQOp9 z&ER)9Z!H+35c%x7&W%l+9~t9>e_qz@-o9)xg2_We;rce8C$GD*EC2&WHAK#4({afN z5E?w%2eR_53LN7qO<2M$TdU@Zqznj({3w*DzM2yae+7AWrz_EoOxEo@@vUx#kCet*T>;my~VLX8|Pm<}R zTt`u?KJ1bq*+V1R2dZ}|wRXc&@><3{WE7uZw$~V}QN=<6mJIA*)cQ(&|7-!92!bBu p=spY(l^HBE#tyn1r)m7}{vUt!e|(l%aLoV!002ovPDHLkV1gCat@{7~ delta 376 zcmV-;0f+vz1EK>ViBL{Q4GJ0x0000DNk~Le0000G0000G2nGNE03Y-JVUZyX`) zK~#7Fty0@j0x=ZL%~AjzKnEmbmk)p34xj_D0x7`~umYt6I&k^%Lv~3z04mUbXE&a^ z=s50UP~^^JlAPq8`#M7W)2Ip5I=c40P~``b&f3lTR|M=xR6G*V9?LQ2y_kRudl6e} z4{bz3sc>vevJZ{05Q?~ZGHN`C3 z+ - + + + + diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index 9a2f5c8de7..4e31314e4e 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -55,6 +55,7 @@ public class ITReplaceMainDialog extends UIDialog { private String searchStr; private static final int FIRST_ROW = 0; public static int selectCount = 0; + public static int MAIN_PANEL_WIDTH = 929; public ITReplaceMainDialog() { super(DesignerContext.getDesignerFrame()); @@ -97,8 +98,8 @@ public class ITReplaceMainDialog extends UIDialog { int width = jTemplate.getWidth(); Point point = jTemplate.getLocationOnScreen(); setModal(false); - setMaximumSize(new Dimension(jTemplate.getWidth(), jTemplate.getHeight())); - setMinimumSize(new Dimension(jTemplate.getWidth(), 240)); + setMaximumSize(new Dimension(width, jTemplate.getHeight())); + setMinimumSize(new Dimension(width, 240)); setSize(width, height); setLocation(new Point(point.x, point.y + jTemplate.getHeight() / 2 + jTemplate.getHeight() / 2 - 385)); @@ -124,7 +125,7 @@ public class ITReplaceMainDialog extends UIDialog { replaceComboBox.setEnabled(false); replaceComboBox.setEditable(true); northPane.getReplaceButton().setEnabled(false); - + westPanel.getLeftPanel().setPreferredSize(new Dimension(ITReplaceWestPanel.LEFT_WIDTH, this.getHeight())); ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).setPlaceholder(Toolkit.i18nText("Fine-Design_Replace_Search_Input")); ((UITextField) (northPane.getReplaceInputCombobox().getEditor().getEditorComponent())).setPlaceholder(Toolkit.i18nText("Fine-Design_Replace_Input")); ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).addActionListener(new ActionListener() { diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java index a4fe1fef0f..909ce7112a 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java @@ -1,5 +1,6 @@ package com.fr.design.actions.replace.ui; +import com.fr.base.svg.IconUtils; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icontainer.UIScrollPane; @@ -9,7 +10,9 @@ import com.fr.design.i18n.Toolkit; import com.fr.stable.StringUtils; +import javax.swing.BorderFactory; import javax.swing.ComboBoxEditor; +import javax.swing.Icon; import javax.swing.JCheckBox; import javax.swing.JPanel; import javax.swing.ScrollPaneConstants; @@ -34,20 +37,28 @@ public class ITReplaceNorthPanel { private UIComboBox findCombobox; private UIComboBox rangeCombobox; private JCheckBox matchRadioButton; + private UILabel iconLabel; private UIComboBox findInputCombobox; private UIComboBox replaceInputCombobox; private UIScrollPane scrollPane; private UIButton replaceButton; private UIButton searchButton; + private static double rate = 1.00; //存储的5次最近输入 private int maxItemCount = 5; - private static final int LIMIT_WIDTH = 1250; + private static int limit_width = 800; private static final int HEIGHT = 161; - private static final int BUTTON_WIDTH = 60; - private static final int BUTTON_GAP = 20; + private static final int BUTTON_WIDTH = 44; + private static final int GAP = 20; + private static final int BUTTON_GAP = 10; private static final int MATCH_WIDTH = 70; + private static final int COMPONENT_HEIGHT = 25; + private static final int FIRST_Y = 15, SECOND_Y = 50, THIRD_Y = 85, FOURTH_Y = 120; + private static final int FIRST_X = 20, SECOND_X = 80; + private static final int LABEL_WIDTH = 60; + private static final Icon CHANGE_ICON = IconUtils.readIcon("/com/fr/design/images/replace/change_normal.svg"); private int findLabelX, findLabelY, findLabelWidth, findLabelHeight; @@ -60,7 +71,8 @@ public class ITReplaceNorthPanel { private int replaceInputComboBoxX, replaceInputComboBoxY, replaceInputComboBoxWidth, replaceInputComboBoxHeight; private int replaceButtonX, replaceButtonY, replaceButtonHeight; private int searchButtonX, searchButtonY, searchButtonHeight; - + private int iconX, iconY, iconWidth, iconHeight; + private int inputLength; public static ArrayList findItems = new ArrayList<>(); public static ArrayList findInputItems = new ArrayList<>(); @@ -81,6 +93,7 @@ public class ITReplaceNorthPanel { findLabel = new UILabel(Toolkit.i18nText("Fine-Design_Replace_Search_Element")); rangeLabel = new UILabel(Toolkit.i18nText("Fine-Design_Replace_Search_Range")); + iconLabel = new UILabel(CHANGE_ICON); resultLabel = new UILabel(); String[] rangeItems = new String[]{Toolkit.i18nText("Fine-Design_Basic_Export_JS_Template_Current")}; @@ -109,7 +122,7 @@ public class ITReplaceNorthPanel { replaceButton = new UIButton(Toolkit.i18nText("Fine-Design_Replace_Button")); searchButton = new UIButton(Toolkit.i18nText("Fine-Design_Search_Button")); - upPanel.setPreferredSize(new Dimension(LIMIT_WIDTH, HEIGHT)); + upPanel.setPreferredSize(new Dimension(limit_width, HEIGHT)); scrollPane = new UIScrollPane(upPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); upPanel.add(findLabel); upPanel.add(rangeLabel); @@ -121,6 +134,8 @@ public class ITReplaceNorthPanel { upPanel.add(matchRadioButton); upPanel.add(replaceButton); upPanel.add(searchButton); + upPanel.add(iconLabel); + scrollPane.setBorder(BorderFactory.createEmptyBorder()); } /** @@ -129,9 +144,8 @@ public class ITReplaceNorthPanel { * @param width */ public void setLimitSize(int width) { - width = Math.max(LIMIT_WIDTH, width); - upPanel.setMaximumSize(new Dimension(width, 161)); - upPanel.setPreferredSize(new Dimension(width, 161)); + upPanel.setMaximumSize(new Dimension(limit_width, 161)); + upPanel.setPreferredSize(new Dimension(limit_width, 161)); } @@ -144,21 +158,22 @@ public class ITReplaceNorthPanel { */ public void fitScreen(int x, int y, int templateWidth) { - templateWidth = Math.max(templateWidth, LIMIT_WIDTH); - - setFindLabelBounds(x, y, templateWidth); - setRangeLabelBounds(x, y, templateWidth); - setResultLabelBounds(x, y, templateWidth); + templateWidth = Math.max(ITReplaceMainDialog.MAIN_PANEL_WIDTH, templateWidth); + templateWidth = templateWidth - ITReplaceWestPanel.LEFT_WIDTH; + inputLength = (templateWidth - GAP * 5) / 2; - setFindComboboxBounds(x, y, templateWidth); - setRangeComboboxBounds(x, y, templateWidth); - setFindInputComboboxBounds(x, y, templateWidth); - setReplaceInputComboboxBounds(x, y, templateWidth); - - setUIRadioButtonBounds(x, y, templateWidth); - setReplaceButtonBounds(x, y, templateWidth); - setSearchButtonBounds(x, y, templateWidth); + setFindLabelBounds(); + setResultLabelBounds(templateWidth); + setFindComboboxBounds(); + setFindInputComboboxBounds(); + setReplaceInputComboboxBounds(templateWidth); + setRangeLabelBounds(); + setRangeComboboxBounds(); + setUIRadioButtonBounds(); + setReplaceButtonBounds(); + setSearchButtonBounds(); + setIconLabelBounds(); } @@ -214,87 +229,94 @@ public class ITReplaceNorthPanel { this.scrollPane = scrollPane; } + private void setIconLabelBounds() { + iconX = inputLength + GAP; + iconY = SECOND_Y; + iconWidth = GAP; + iconHeight = COMPONENT_HEIGHT; + iconLabel.setBounds(iconX, iconY, iconWidth, iconHeight); + } - private void setSearchButtonBounds(int x, int y, int templateWidth) { - searchButtonHeight = 25; - searchButtonY = resultLabelY; + private void setSearchButtonBounds() { + searchButtonHeight = COMPONENT_HEIGHT; + searchButtonY = FOURTH_Y; searchButtonX = replaceInputComboBoxX + replaceInputComboBoxWidth - BUTTON_WIDTH * 2 - BUTTON_GAP; searchButton.setBounds(searchButtonX, searchButtonY, BUTTON_WIDTH, searchButtonHeight); } - private void setReplaceButtonBounds(int x, int y, int templateWidth) { - replaceButtonHeight = 25; - replaceButtonY = resultLabelY; + private void setReplaceButtonBounds() { + replaceButtonHeight = COMPONENT_HEIGHT; + replaceButtonY = FOURTH_Y; replaceButtonX = replaceInputComboBoxX + replaceInputComboBoxWidth - BUTTON_WIDTH; replaceButton.setBounds(replaceButtonX, replaceButtonY, BUTTON_WIDTH, replaceButtonHeight); } - private void setReplaceInputComboboxBounds(int x, int y, int templateWidth) { - replaceInputComboBoxX = x + templateWidth / 2 + templateWidth / 60; - replaceInputComboBoxY = y + 55; - replaceInputComboBoxWidth = templateWidth / 3 + templateWidth / 30 * 2; - replaceInputComboBoxHeight = 25; + private void setReplaceInputComboboxBounds(int templateWidth) { + replaceInputComboBoxX = templateWidth - inputLength - GAP * 2; + replaceInputComboBoxY = SECOND_Y; + replaceInputComboBoxWidth = inputLength; + replaceInputComboBoxHeight = COMPONENT_HEIGHT; replaceInputCombobox.setBounds(replaceInputComboBoxX, replaceInputComboBoxY, replaceInputComboBoxWidth, replaceInputComboBoxHeight); } - private void setFindInputComboboxBounds(int x, int y, int templateWidth) { - findInputComboBoxX = x + templateWidth / 60; - findInputComboBoxY = y + 55; - findInputComboBoxWidth = templateWidth / 3 + templateWidth / 30 * 2; - findInputComboBoxHeight = 25; + private void setFindInputComboboxBounds() { + findInputComboBoxX = FIRST_X; + findInputComboBoxY = SECOND_Y; + findInputComboBoxWidth = inputLength - GAP; + findInputComboBoxHeight = COMPONENT_HEIGHT; findInputCombobox.setBounds(findInputComboBoxX, findInputComboBoxY, findInputComboBoxWidth, findInputComboBoxHeight); } - private void setUIRadioButtonBounds(int x, int y, int templateWidth) { - matchX = x + templateWidth / 60; - matchY = y + 90; + private void setUIRadioButtonBounds() { + matchX = FIRST_X; + matchY = THIRD_Y; matchWidth = MATCH_WIDTH; - matchHeight = 25; + matchHeight = COMPONENT_HEIGHT; matchRadioButton.setBounds(matchX, matchY, matchWidth, matchHeight); } - private void setRangeComboboxBounds(int x, int y, int templateWidth) { - rangeComboBoxX = x + templateWidth / 2 + templateWidth / 15; - rangeComboBoxY = y + 20; - rangeComboBoxWidth = templateWidth / 3 + templateWidth / 60; - rangeComboBoxHeight = 25; + private void setRangeComboboxBounds() { + rangeComboBoxX = rangeLabelX + rangeLabelWidth; + rangeComboBoxY = FIRST_Y; + rangeComboBoxWidth = inputLength - 3 * GAP; + rangeComboBoxHeight = COMPONENT_HEIGHT; rangeCombobox.setBounds(rangeComboBoxX, rangeComboBoxY, rangeComboBoxWidth, rangeComboBoxHeight); } - private void setFindComboboxBounds(int x, int y, int templateWidth) { - findComboBoxX = x + templateWidth / 30 * 2; - findComboBoxY = y + 20; - findComboBoxWidth = templateWidth / 3 + templateWidth / 60; - findComboBoxHeight = 25; + private void setFindComboboxBounds() { + findComboBoxX = SECOND_X; + findComboBoxY = FIRST_Y; + findComboBoxWidth = inputLength - 4 * GAP; + findComboBoxHeight = COMPONENT_HEIGHT; findCombobox.setBounds(findComboBoxX, findComboBoxY, findComboBoxWidth, findComboBoxHeight); } - private void setResultLabelBounds(int x, int y, int templateWidth) { - resultLabelX = findLabelX; - resultLabelY = y + 125; + private void setResultLabelBounds(int templateWidth) { + resultLabelX = FIRST_X; + resultLabelY = FOURTH_Y; resultLabelWidth = templateWidth; - resultLabelHeight = 25; + resultLabelHeight = COMPONENT_HEIGHT; resultLabel.setBounds(resultLabelX, resultLabelY, resultLabelWidth, resultLabelHeight); } - private void setRangeLabelBounds(int x, int y, int templateWidth) { - rangeLabelX = x + templateWidth / 2 + templateWidth / 60; - rangeLabelY = y + 20; - rangeLabelWidth = findLabelWidth; - rangeLabelHeight = 25; + private void setRangeLabelBounds() { + rangeLabelX = replaceInputComboBoxX; + rangeLabelY = FIRST_Y; + rangeLabelWidth = LABEL_WIDTH; + rangeLabelHeight = COMPONENT_HEIGHT; rangeLabel.setBounds(rangeLabelX, rangeLabelY, rangeLabelWidth, rangeLabelHeight); } - private void setFindLabelBounds(int x, int y, int templateWidth) { - findLabelX = x + templateWidth / 60; - findLabelY = y + 20; - findLabelWidth = templateWidth / 20; - findLabelHeight = 25; + private void setFindLabelBounds() { + findLabelX = FIRST_X; + findLabelY = FIRST_Y; + findLabelWidth = LABEL_WIDTH; + findLabelHeight = COMPONENT_HEIGHT; findLabel.setBounds(findLabelX, findLabelY, findLabelWidth, findLabelHeight); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java index a240eba967..997013592d 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java @@ -1,5 +1,6 @@ package com.fr.design.actions.replace.ui; +import javax.swing.BorderFactory; import javax.swing.RowSorter; import javax.swing.table.TableRowSorter; import java.awt.Color; @@ -18,17 +19,21 @@ public class ITReplaceSouthPanel { public static final int CHECKBOX_INDEX = 0; //ITContent在表格的列索引 public static final int CONTENT_INDEX = 6; + public static final int TABLE_GAP = 20; public ITReplaceSouthPanel() { itTableEditor = new ITTableEditor(); tableEditorPane = new ITTableEditorPane<>(itTableEditor); - RowSorter sorter = new TableRowSorter(itTableEditor){ + //左右两边间距20 + tableEditorPane.setBorder(BorderFactory.createEmptyBorder(0, TABLE_GAP, 0, TABLE_GAP)); + RowSorter sorter = new TableRowSorter(itTableEditor) { @Override public boolean isSortable(int column) { return column != CHECKBOX_INDEX || column != CONTENT_INDEX; } }; tableEditorPane.getEditTable().setRowSorter(sorter); + tableEditorPane.getEditTable().setBorder(BorderFactory.createEmptyBorder()); tableEditorPane.getEditTable().setSelectionBackground(new Color(217, 235, 254)); tableEditorPane.getEditTable().setRowHeight(tableEditorPane.getEditTable().getRowHeight() / 2 + tableEditorPane.getEditTable().getRowHeight()); tableEditorPane.makeFace(tableEditorPane.getEditTable()); diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java index a58091a06a..0804efa23b 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java @@ -12,9 +12,12 @@ import com.fr.stable.StringUtils; import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.JPanel; +import javax.swing.SwingConstants; import java.awt.Color; import java.awt.Cursor; import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; import java.awt.event.MouseEvent; /** @@ -29,7 +32,9 @@ public class ITReplaceWestPanel { private UILabel iconLabel; private static final Icon HELP_ICON = IconUtils.readIcon("com/fr/design/images/buttonicon/replace_help.svg"); private static final String HELP_URL = CloudCenter.getInstance().acquireUrlByKind("design.replace.help", "https://help.fanruan.com/finereport/doc-view-4954.html?source=3"); - private static final int FILL_COUNT = 13; + private static final int FILL_COUNT = 12; + public static final int LEFT_WIDTH = 100; + public static final String CONTENT_TEXT = "" + Toolkit.i18nText("Fine-Design_Basic_Templates_Content") + ""; public ITReplaceWestPanel() { @@ -37,6 +42,18 @@ public class ITReplaceWestPanel { iconLabel = new UILabel("" + Toolkit.i18nText("Fine-Design_Report_Community_Help") + ""); UIToggleButton contentButton = new UIToggleButton(Toolkit.i18nText("Fine-Design_Basic_Templates_Content")); + contentButton.setText(CONTENT_TEXT); + contentButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + if (!contentButton.isSelected()) { + contentButton.setText(CONTENT_TEXT); + } else { + contentButton.setText(Toolkit.i18nText("Fine-Design_Basic_Templates_Content")); + } + } + }); + leftPanel.setBackground(Color.WHITE); contentButton.setSelected(true); contentButton.setBorderPainted(false); leftPanel.add(contentButton); @@ -47,8 +64,8 @@ public class ITReplaceWestPanel { } //添加帮助文档按钮及超链 - iconLabel.setIcon(HELP_ICON); iconLabel.setToolTipText(Toolkit.i18nText("Fine-Design_Replace_Tooltip")); + iconLabel.setHorizontalAlignment(SwingConstants.CENTER); //设置游标 iconLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); iconLabel.addMouseListener(new MouseClickListener() { @@ -58,6 +75,7 @@ public class ITReplaceWestPanel { } }); leftPanel.add(iconLabel); + leftPanel.add(new UILabel(StringUtils.EMPTY)); } public JPanel getLeftPanel() { From bbd4658c0a6e6403c26c122d2e277505e701c2a3 Mon Sep 17 00:00:00 2001 From: Carlson Date: Thu, 20 Oct 2022 20:09:21 +0800 Subject: [PATCH 098/310] =?UTF-8?q?REPORT-79287=20fix:=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E7=BC=96=E8=BE=91=E7=95=8C=E9=9D=A2=E6=9B=B4?= =?UTF-8?q?=E6=8D=A2=E6=95=B0=E6=8D=AE=E9=9B=86=E5=90=8E=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E7=9A=84=E5=8C=B9=E9=85=8D=E6=B8=85=E7=A9=BA=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E6=B8=85=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/chart/gui/data/TableDataPane.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java index 8863977740..55745cd1d2 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java @@ -15,10 +15,10 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.utils.gui.UIComponentUtils; +import com.fr.stable.StringUtils; -import javax.swing.BorderFactory; -import java.awt.BorderLayout; -import java.awt.Dimension; +import javax.swing.*; +import java.awt.*; public class TableDataPane extends FurtherBasicBeanPane{ private static final long serialVersionUID = 4740461028440155147L; @@ -74,6 +74,10 @@ public class TableDataPane extends FurtherBasicBeanPane{ return; } if(dataContentPane != null) { + // 如果属性编辑画板中选中的数据集发生改变,则清空之前的匹配项 + if (!StringUtils.equals(dataContentPane.getTableName(), dataWrap.getTableDataName())) { + dataContentPane.clearAllBoxList(); + } dataContentPane.onSelectTableData(dataWrap); dataContentPane.setTableName(dataWrap.getTableDataName()); } From 1128719f38515e29c583ce82b68b3fff81d0f49e Mon Sep 17 00:00:00 2001 From: Carlson Date: Fri, 21 Oct 2022 14:37:12 +0800 Subject: [PATCH 099/310] =?UTF-8?q?REPORT-79287=20import=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/chart/gui/data/TableDataPane.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java index 55745cd1d2..82240bc6d2 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java @@ -17,8 +17,9 @@ import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane import com.fr.design.utils.gui.UIComponentUtils; import com.fr.stable.StringUtils; -import javax.swing.*; -import java.awt.*; +import javax.swing.BorderFactory; +import java.awt.BorderLayout; +import java.awt.Dimension; public class TableDataPane extends FurtherBasicBeanPane{ private static final long serialVersionUID = 4740461028440155147L; From b9e8b5227a7e96c76b9220947ab8b02c62f18ce5 Mon Sep 17 00:00:00 2001 From: levy Date: Fri, 21 Oct 2022 18:13:37 +0800 Subject: [PATCH 100/310] =?UTF-8?q?REPORT-82110=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=8F=96=E8=89=B2bug=20=E3=80=90=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=E3=80=91=E5=8F=96=E8=89=B2=E5=99=A8ColorPick?= =?UTF-8?q?er=E5=8F=96=E8=89=B2=E6=98=AF=E5=9F=BA=E4=BA=8E=E6=88=AA?= =?UTF-8?q?=E5=B1=8F=E5=90=8E=E8=AF=BB=E5=8F=96=E9=A2=9C=E8=89=B2=E7=9A=84?= =?UTF-8?q?=EF=BC=8C=E5=9B=A0=E6=AD=A4=E9=9C=80=E7=A1=AE=E4=BF=9D=E5=BC=B9?= =?UTF-8?q?=E5=87=BA=E6=A1=86=E5=85=A8=E9=83=A8=E5=85=B3=E9=97=AD=E5=90=8E?= =?UTF-8?q?=E6=88=AA=E5=B1=8F=E3=80=82=20=E3=80=90=E6=94=B9=E5=8A=A8?= =?UTF-8?q?=E6=80=9D=E8=B7=AF=E3=80=911=E3=80=81=E5=8F=96=E8=89=B2?= =?UTF-8?q?=E5=89=8D=E6=B7=BB=E5=8A=A0hidePopupMenu=E7=9A=84=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=202=E3=80=81=E4=BD=BF=E7=94=A8invokeLater=E7=A1=AE?= =?UTF-8?q?=E4=BF=9D=E5=BC=82=E6=AD=A5=E4=BB=BB=E5=8A=A1=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=90=8E=E6=88=AA=E5=B1=8F=203=E3=80=81?= =?UTF-8?q?=E4=B8=BA=E9=81=BF=E5=85=8DREPORT-25645=E7=9A=84macOS=E9=80=82?= =?UTF-8?q?=E9=85=8D=E9=97=AE=E9=A2=98,=E6=96=B0=E5=A2=9EhidePopupMenu4Pic?= =?UTF-8?q?kColor=E7=9A=84=E6=96=B9=E6=B3=95=20=E3=80=90Review=E5=BB=BA?= =?UTF-8?q?=E8=AE=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/style/color/ColorPicker.java | 11 ++++------- .../fr/design/style/color/UIToolbarColorButton.java | 10 ++++++++++ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java b/designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java index 2e5f56981d..baf7920e14 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java @@ -70,13 +70,10 @@ public class ColorPicker extends JDialog implements ActionListener { // 主要针对"图案"选项卡中的"前景"、"背景" if (this.setColorRealTime) { colorSelectable.setColor(Color.WHITE); // setColor 可以关闭弹窗 - try { - Thread.sleep(100); // 等待弹窗关闭 - } catch (InterruptedException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - Thread.currentThread().interrupt(); - } - colorPickerPanel.captureScreen(); + // REPORT-82110 确保关闭所有弹窗后截屏 + SwingUtilities.invokeLater(() -> { + colorPickerPanel.captureScreen(); + }); } } diff --git a/designer-base/src/main/java/com/fr/design/style/color/UIToolbarColorButton.java b/designer-base/src/main/java/com/fr/design/style/color/UIToolbarColorButton.java index 9a8640f627..11fe154469 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/UIToolbarColorButton.java +++ b/designer-base/src/main/java/com/fr/design/style/color/UIToolbarColorButton.java @@ -153,12 +153,22 @@ public class UIToolbarColorButton extends UICombinationButton implements PopupHi popupWin = null; } + // 取色器取色时,隐藏弹出框,无需经过macOS的判断 + public void hidePopupMenu4PickColor() { + if (popupWin != null) { + popupWin.setVisible(false); + } + + popupWin = null; + } + private ColorControlWindow getColorControlWindow() { //find parant. if (this.popupWin == null) { this.popupWin = new ColorControlWindow(this.isCanBeNull(), UIToolbarColorButton.this) { @Override protected void colorChanged() { + hidePopupMenu4PickColor(); UIToolbarColorButton.this.setColor(this.getColor()); } From 828671fce4d3f9d67203d6474450d0019aaf8a9f Mon Sep 17 00:00:00 2001 From: levy Date: Mon, 24 Oct 2022 18:33:07 +0800 Subject: [PATCH 101/310] =?UTF-8?q?REPORT-82110=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=8F=96=E8=89=B2bug=20=E3=80=90=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=E3=80=91=E5=8F=96=E8=89=B2=E5=99=A8ColorPick?= =?UTF-8?q?er=E5=8F=96=E8=89=B2=E6=98=AF=E5=9F=BA=E4=BA=8E=E6=88=AA?= =?UTF-8?q?=E5=B1=8F=E5=90=8E=E8=AF=BB=E5=8F=96=E9=A2=9C=E8=89=B2=E7=9A=84?= =?UTF-8?q?=EF=BC=8C=E5=9B=A0=E6=AD=A4=E9=9C=80=E7=A1=AE=E4=BF=9D=E5=BC=B9?= =?UTF-8?q?=E5=87=BA=E6=A1=86=E5=85=A8=E9=83=A8=E5=85=B3=E9=97=AD=E5=90=8E?= =?UTF-8?q?=E6=88=AA=E5=B1=8F=E3=80=82=20=E3=80=90=E6=94=B9=E5=8A=A8?= =?UTF-8?q?=E6=80=9D=E8=B7=AF=E3=80=911=E3=80=81=E5=8F=96=E8=89=B2?= =?UTF-8?q?=E5=89=8D=E6=B7=BB=E5=8A=A0hidePopupMenu=E7=9A=84=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=202=E3=80=81=E4=BD=BF=E7=94=A8invokeLater=E7=A1=AE?= =?UTF-8?q?=E4=BF=9D=E5=BC=82=E6=AD=A5=E4=BB=BB=E5=8A=A1=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=90=8E=E6=88=AA=E5=B1=8F=203=E3=80=81?= =?UTF-8?q?=E4=B8=BA=E8=A7=84=E9=81=BFREPORT-25645=E7=9A=84macOS=E9=80=82?= =?UTF-8?q?=E9=85=8D=E9=97=AE=E9=A2=98,=E6=96=B0=E5=A2=9EhidePopupMenu4Pic?= =?UTF-8?q?kColor=E7=9A=84=E6=96=B9=E6=B3=95=20=E3=80=90Review=E5=BB=BA?= =?UTF-8?q?=E8=AE=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/style/color/ColorPicker.java | 5 +---- .../java/com/fr/design/style/color/UIToolbarColorButton.java | 5 +++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java b/designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java index baf7920e14..067d82f9ce 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java @@ -67,13 +67,10 @@ public class ColorPicker extends JDialog implements ActionListener { hideCursor(); // 如果要求实时变化,确保先关闭弹窗,再截屏 - // 主要针对"图案"选项卡中的"前景"、"背景" if (this.setColorRealTime) { colorSelectable.setColor(Color.WHITE); // setColor 可以关闭弹窗 // REPORT-82110 确保关闭所有弹窗后截屏 - SwingUtilities.invokeLater(() -> { - colorPickerPanel.captureScreen(); - }); + SwingUtilities.invokeLater(colorPickerPanel :: captureScreen); } } diff --git a/designer-base/src/main/java/com/fr/design/style/color/UIToolbarColorButton.java b/designer-base/src/main/java/com/fr/design/style/color/UIToolbarColorButton.java index 11fe154469..8627f27a5f 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/UIToolbarColorButton.java +++ b/designer-base/src/main/java/com/fr/design/style/color/UIToolbarColorButton.java @@ -153,12 +153,13 @@ public class UIToolbarColorButton extends UICombinationButton implements PopupHi popupWin = null; } - // 取色器取色时,隐藏弹出框,无需经过macOS的判断 + /** + * 取色器取色时隐藏弹出框,与另一个hide的区别是无需经过macOS的判断,以规避REPORT-25645的mac适配bug + */ public void hidePopupMenu4PickColor() { if (popupWin != null) { popupWin.setVisible(false); } - popupWin = null; } From 88790a4fec33864193006bf7e2e4908804133656 Mon Sep 17 00:00:00 2001 From: levy Date: Mon, 24 Oct 2022 18:53:38 +0800 Subject: [PATCH 102/310] =?UTF-8?q?REPORT-79296=20=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E5=BC=95=E6=93=8E=E5=B1=9E=E6=80=A7=E6=98=BE=E7=A4=BA=E4=B8=8D?= =?UTF-8?q?=E5=85=A8=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0?= =?UTF-8?q?=E3=80=91=E6=9C=AA=E8=80=83=E8=99=91i8n=E8=8B=B1=E6=96=87?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E4=B8=8B=E7=9A=84Label=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=8D=A2=E8=A1=8C=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D?= =?UTF-8?q?=E8=B7=AF=E3=80=91=E5=B0=86=E6=B6=89=E5=8F=8A=E5=88=B0=E7=9A=84?= =?UTF-8?q?Label=E8=87=AA=E5=8A=A8=E6=8D=A2=E8=A1=8C=E5=A4=84=E7=90=86?= =?UTF-8?q?=EF=BC=8C=E7=95=A5=E4=BF=AE=E6=94=B9=E4=BA=86=E5=8E=9F=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=88=9B=E5=BB=BApanel=E7=9A=84=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=EF=BC=8C=E5=AE=9E=E9=99=85=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=95=88=E6=9E=9C=E6=97=A0=E5=8F=98=E5=8C=96=E3=80=82=20?= =?UTF-8?q?=E3=80=90Review=E5=BB=BA=E8=AE=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/report/ReportEnginePane.java | 79 ++++++++++--------- 1 file changed, 41 insertions(+), 38 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java b/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java index b29de8855f..15dd2a3ea3 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java @@ -12,12 +12,14 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.DesignerContext; +import com.fr.design.widget.FRWidgetFactory; import com.fr.general.SiteCenter; import com.fr.log.FineLoggerFactory; import com.fr.report.core.ReportUtils; import com.fr.report.stable.LayerReportAttr; import com.fr.report.worksheet.WorkSheet; import com.fr.stable.ProductConstants; + import javax.swing.AbstractButton; import javax.swing.BorderFactory; import javax.swing.ButtonGroup; @@ -26,13 +28,11 @@ import javax.swing.JLayeredPane; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JRadioButton; -import javax.swing.SwingConstants; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; import java.awt.Desktop; import java.awt.Dimension; -import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; @@ -86,7 +86,7 @@ public class ReportEnginePane extends BasicBeanPane { outAdvicePane.add(createAdvicePane()); } - private JPanel createReportEnginePane(){ + private JPanel createReportEnginePane() { JPanel reportEnginePane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane(); JPanel clientPagingPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); clientPaging = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Enable_Client_Page")); @@ -102,7 +102,7 @@ public class ReportEnginePane extends BasicBeanPane { return reportEnginePane; } - private JPanel createPagingEngineSelectPane(){ + private JPanel createPagingEngineSelectPane() { engineSettingPane = new JLayeredPane(); engineSettingPane.setPreferredSize(new Dimension(570, 240)); engineSettingPane.setBounds(0, 0, 570, 240); @@ -121,8 +121,8 @@ public class ReportEnginePane extends BasicBeanPane { /** * 目前先屏蔽,后面新引擎显示页码再加上相关代码 - * */ - private void createEngineXSettingPane(){ + */ + private void createEngineXSettingPane() { outEngineXSettingPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_New_Engine")); outEngineXSettingPane.setBounds(0, 0, 570, 240); JPanel engineXSettingPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane(); @@ -146,7 +146,7 @@ public class ReportEnginePane extends BasicBeanPane { outEngineXSettingPane.add(engineXSettingPane); } - private void createLineEngineSettingPane(){ + private void createLineEngineSettingPane() { outLineEngineSettingPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Line_Engine")); outLineEngineSettingPane.setBounds(0, 0, 570, 240); JPanel lineEngineSettingPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane(); @@ -166,9 +166,9 @@ public class ReportEnginePane extends BasicBeanPane { outLineEngineSettingPane.add(lineEngineSettingPane); } - private JPanel createTipPane(String tipText){ + private JPanel createTipPane(String tipText) { JPanel tipPane = new JPanel(); - UILabel tip = new UILabel(tipText, SwingConstants.LEFT); + UILabel tip = FRWidgetFactory.createLineWrapLabel(tipText, 420); tip.setForeground(new Color(128, 128, 128)); tipPane.add(tip); return tipPane; @@ -184,20 +184,19 @@ public class ReportEnginePane extends BasicBeanPane { return pageQueryPane; } - private JPanel createAdvicePane(){ - JPanel advicePane = new JPanel(new BorderLayout()); - FRExplainLabel topExplainLabel = new FRExplainLabel(Toolkit.i18nText("Fine-Design_Report_Report_Engine_Warnning_Info")); - advicePane.add(topExplainLabel, BorderLayout.NORTH); + private JPanel createAdvicePane() { + JPanel advicePane = new JPanel(FRGUIPaneFactory.create1ColumnGridLayout()); + // 上侧文字 + UILabel topExplainLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Report_Report_Engine_Warnning_Info"), 480); topExplainLabel.setForeground(new Color(0, 0, 0)); - FlowLayout flowLayout = new FlowLayout(FlowLayout.LEADING); - flowLayout.setHgap(0); - flowLayout.setVgap(0); - JPanel adviceDownPane = new JPanel(flowLayout); - advicePane.add(adviceDownPane, BorderLayout.CENTER); - FRExplainLabel downExplainLabel = new FRExplainLabel(Toolkit.i18nText("Fine-Design_Report_Report_Detail_Reference")); + advicePane.add(topExplainLabel); + // 下侧文字及链接 + JPanel adviceDownPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); + advicePane.add(adviceDownPane); + UILabel downExplainLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Report_Detail_Reference")); adviceDownPane.add(downExplainLabel); downExplainLabel.setForeground(new Color(0, 0, 0)); - JLabel helper = new FRExplainLabel( com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Community_Help")); + JLabel helper = new FRExplainLabel(Toolkit.i18nText("Fine-Design_Report_Community_Help")); helper.setForeground(new Color(1, 159, 222)); adviceDownPane.add(helper); helper.addMouseListener(new MouseAdapter() { @@ -213,7 +212,7 @@ public class ReportEnginePane extends BasicBeanPane { return advicePane; } - private JPanel createPagingEngineRadioPanel(){ + private JPanel createPagingEngineRadioPanel() { UIRadioButton newEngine = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_New_Engine"), true); UIRadioButton lineEngine = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Line_Engine"), false); ButtonGroup buttonGroup = new ButtonGroup(); @@ -225,7 +224,7 @@ public class ReportEnginePane extends BasicBeanPane { double[] rowSize = {p}; double[] columnSize = {p, p, p, p, p}; Component[][] components = new Component[][]{ - new Component[] { + new Component[]{ newEngine, lineEngine } @@ -243,7 +242,7 @@ public class ReportEnginePane extends BasicBeanPane { @Override public void populateBean(LayerReportAttr ob) { - if (ob == null){ + if (ob == null) { setDefaultAttr(); return; } @@ -252,14 +251,14 @@ public class ReportEnginePane extends BasicBeanPane { engineSettingPane.setVisible(true); radioButtons.get(0).setSelected(ob.getEngineState() == LayerReportAttr.ENGINE_X); radioButtons.get(1).setSelected(ob.getEngineState() == LayerReportAttr.LINE_ENGINE); - if (ob.getEngineState() == LayerReportAttr.ENGINE_X){ + if (ob.getEngineState() == LayerReportAttr.ENGINE_X) { engineSettingPane.moveToFront(outEngineXSettingPane); outEngineXSettingPane.setVisible(true); outLineEngineSettingPane.setVisible(false); engineXCountPerPageEditor.setValue(new Integer(ob.getCountPerPage())); engineXPageQueryBox.setSelected(ob.isPageQuery()); engineXPageQueryPane.setVisible(ob.isPageQuery()); - }else { + } else { engineSettingPane.moveToFront(outLineEngineSettingPane); outEngineXSettingPane.setVisible(false); outLineEngineSettingPane.setVisible(true); @@ -275,16 +274,16 @@ public class ReportEnginePane extends BasicBeanPane { //这里注意一下怎么更新的,后续可能存在判断为空的调用,从而对老引擎造成影响。 LayerReportAttr attr = new LayerReportAttr(); attr.setClientPaging(clientPaging.isSelected()); - for (int i = 0; i < radioButtons.size(); i++){ - if (radioButtons.get(i).isSelected()){ + for (int i = 0; i < radioButtons.size(); i++) { + if (radioButtons.get(i).isSelected()) { attr.setEngineState(i); } } - if (attr.getEngineState() == LayerReportAttr.ENGINE_X){ + if (attr.getEngineState() == LayerReportAttr.ENGINE_X) { attr.setEnableRowCount(rowCountBox.isSelected()); attr.setCountPerPage(engineXCountPerPageEditor.getValue().intValue()); attr.setPageQuery(engineXPageQueryBox.isSelected()); - }else { + } else { attr.setPageQuery(lineEnginePageQueryBox.isSelected()); attr.setCountPerPage(lineEngineCountPerPageEditor.getValue()); } @@ -304,7 +303,8 @@ public class ReportEnginePane extends BasicBeanPane { } } } - public void setDefaultAttr(){ + + public void setDefaultAttr() { clientPaging.setSelected(false); lineEngineCountPerPageEditor.setValue(30); lineEnginePageQueryBox.setSelected(false); @@ -315,26 +315,29 @@ public class ReportEnginePane extends BasicBeanPane { private class SelectActionListener implements ActionListener { private AbstractButton source; private JPanel target; - private SelectActionListener(AbstractButton source, JPanel target){ + + private SelectActionListener(AbstractButton source, JPanel target) { this.source = source; this.target = target; } + @Override public void actionPerformed(ActionEvent e) { - if (source.isSelected()){ + if (source.isSelected()) { target.setVisible(true); - }else { + } else { target.setVisible(false); } } } - private class EngineSelectActionListener implements ActionListener{ + private class EngineSelectActionListener implements ActionListener { private AbstractButton source; private JLayeredPane target; private JPanel showTarget; private JPanel notShowTarget; - private EngineSelectActionListener(AbstractButton source, JLayeredPane target, JPanel showTarget, JPanel notShowTarget){ + + private EngineSelectActionListener(AbstractButton source, JLayeredPane target, JPanel showTarget, JPanel notShowTarget) { this.source = source; this.target = target; this.showTarget = showTarget; @@ -344,15 +347,15 @@ public class ReportEnginePane extends BasicBeanPane { /** * 由于屏蔽了新引擎设置,由于新引擎设置界面是空的,行式引擎的设置界面会显示出来,因此每次界面转换时,将不需要显示的界面屏蔽。 * 不需要屏蔽新引擎设置时,就不需要showTarget.setVisible(true);notShowTarget.setVisible(false);这两行代码了 - * **/ + **/ @Override public void actionPerformed(ActionEvent e) { - if (source.isSelected()){ + if (source.isSelected()) { target.setVisible(true); showTarget.setVisible(true); notShowTarget.setVisible(false); target.moveToFront(showTarget); - }else { + } else { target.setVisible(false); } } From 37961dbec685c18cb8d66ac8d6e9bfd2d8f8728e Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 27 Oct 2022 15:33:37 +0800 Subject: [PATCH 103/310] =?UTF-8?q?REPORT-80695=20=E3=80=90=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E5=85=A8=E5=B1=80=E7=BA=A7=E5=88=AB=E6=9F=A5=E6=89=BE?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E4=BA=8C=E6=9C=9F=E3=80=91UI=E7=95=8C?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/icheckbox/UICheckBox.java | 15 +- .../replace/ui/ITReplaceMainDialog.java | 254 +++++++++- .../replace/ui/ITReplaceNorthPanel.java | 442 ++++++++++++++++-- .../replace/ui/ITReplaceSouthPanel.java | 6 +- .../replace/ui/ITReplaceWestPanel.java | 62 ++- .../actions/replace/ui/ITTableButton.java | 7 +- .../actions/replace/ui/ITTableEditor.java | 77 ++- .../actions/replace/ui/ITTableEditorPane.java | 46 +- 8 files changed, 805 insertions(+), 104 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/icheckbox/UICheckBox.java b/designer-base/src/main/java/com/fr/design/gui/icheckbox/UICheckBox.java index 0ddd3e22d2..8162c7ba86 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icheckbox/UICheckBox.java +++ b/designer-base/src/main/java/com/fr/design/gui/icheckbox/UICheckBox.java @@ -139,6 +139,15 @@ public class UICheckBox extends JCheckBox implements UIObserver, GlobalNameObser return true; } + /** + * 获取UICheckBox的UI层,可以用于设置UI + * + * @return UICheckBoxUI + */ + public UICheckBoxUI getUICheckBoxUI(){ + return new UICheckBoxUI(); + } + private class UICheckBoxUI extends MetalCheckBoxUI { @Override public synchronized void paint(Graphics g, JComponent c) { @@ -186,9 +195,9 @@ public class UICheckBox extends JCheckBox implements UIObserver, GlobalNameObser g2d.drawRoundRect(iconRect.x, iconRect.y, iconRect.width - 1, iconRect.height - 1, UIConstants.ARC, UIConstants.ARC); } - if (model.isSelected()) { - UIConstants.YES_ICON.paintIcon(c, g, iconRect.x + 2, iconRect.y + 2); - } + if (model.isSelected()) { + UIConstants.YES_ICON.paintIcon(c, g, iconRect.x + 2, iconRect.y + 2); + } g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); // Draw the Text diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index 4e31314e4e..f80609e39d 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -3,6 +3,7 @@ package com.fr.design.actions.replace.ui; import com.fr.design.actions.replace.action.ShowSearchResultAction; +import com.fr.design.actions.replace.action.setting.SettingController; import com.fr.design.actions.replace.info.Info; import com.fr.design.actions.replace.utils.ShowValueUtils; @@ -42,7 +43,8 @@ import static com.fr.design.actions.replace.ui.ITTableEditorPane.getEditTable; * created by Destiny.Lin on 2022-08-10 */ public class ITReplaceMainDialog extends UIDialog { - List searchResultList = new ArrayList<>(); + private static List searchContentResultList = new ArrayList<>(); + private static List searchSettingResultList = new ArrayList<>(); private static boolean ITReplaceFlag = false; private static boolean matched = false; private static volatile ITReplaceMainDialog instance = null; @@ -53,9 +55,19 @@ public class ITReplaceMainDialog extends UIDialog { private ITReplaceWestPanel westPanel; private boolean searchFlag; private String searchStr; + private String settingInputStr; + private String settingExtraStr; private static final int FIRST_ROW = 0; + private static final int NONE = 0; public static int selectCount = 0; public static int MAIN_PANEL_WIDTH = 929; + public static int replaceContentNum = 0; + public static int replaceSettingNum = 0; + public static int contentReplaceCount = 0; + public static int contentReplaceFailedCount = 0; + public static int settingReplaceCount = 0; + public static int settingReplaceFailedCount = 0; + public ITReplaceMainDialog() { super(DesignerContext.getDesignerFrame()); @@ -131,15 +143,14 @@ public class ITReplaceMainDialog extends UIDialog { ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - search(); + search4Content(); } }); northPane.getSearchButton().addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - search(); - + search4Content(); } }); @@ -147,11 +158,24 @@ public class ITReplaceMainDialog extends UIDialog { @Override public void actionPerformed(ActionEvent e) { if (isSearchFlag()) { - replace(); + replace4Content(); } } }); - center.add(northPane.getScrollPane(), BorderLayout.NORTH); + + northPane.getSearchSettingButton().addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + search4Setting(); + } + }); + northPane.getReplaceSettingButton().addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + replace4Setting(); + } + }); + center.add(ITReplaceNorthPanel.getCardPanel(), BorderLayout.NORTH); center.add(southPanel.getTableEditorPane(), BorderLayout.CENTER); add(westPanel.getLeftPanel(), BorderLayout.WEST); //主体部分 @@ -162,24 +186,27 @@ public class ITReplaceMainDialog extends UIDialog { /** * 替换 */ - private void replace() { + private void replace4Content() { String searchStr = ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).getText(); String replaceStr = ((UITextField) (northPane.getReplaceInputCombobox().getEditor().getEditorComponent())).getText(); - //替换内容为空需要触发搜索 - if (isITReplaceValid() && checkTemplateChanged(searchResultList)) { + clearContentCount(); + if (isITReplaceValid() && checkTemplateChanged(searchContentResultList)) { if (StringUtils.equals(getSearchStr(), searchStr) && StringUtils.isNotEmpty(replaceStr)) { HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(true); - for (Info info : searchResultList) { - if (info.getContent().isSelected()) { + for (Info info : searchContentResultList) { + if (isAllow2Replace(info)) { info.setValue(info, searchStr, replaceStr, info.getContent().getOperatorArray()); + info.getContent().setReplaced(true); + contentReplaceCount++; } } + northPane.getResultLabel().setText(ShowValueUtils.getResultTip(searchContentResultList.size(), contentReplaceCount, contentReplaceFailedCount)); southPanel.getTableEditorPane().update(); northPane.refreshReplaceInputComboBoxItems(); ITTableEditorPane.getEditTable().repaint(); - setSearchFlag(false); + } else { + search4Content(); } - search(); } else { Object[] options = new Object[]{Toolkit.i18nText("Fine-Design_Replace_Search_Again"), Toolkit.i18nText("Fine-Design_Basic_Cancel")}; int optionSelected = FineJOptionPane.showOptionDialog( @@ -195,16 +222,25 @@ public class ITReplaceMainDialog extends UIDialog { ); //如果选择了重新查找,则再查找一遍 if (optionSelected == 0) { - search(); + search4Content(); } } + } - + /** + * 是否能够替换 + * + * @param info 存储信息的数据结构 + * @return 能则返回true + */ + private boolean isAllow2Replace(Info info) { + return info.getContent().isSelected() && !info.getContent().isReplaced(); } + private Boolean checkTemplateChanged(List searchResultList) { for (Info info : searchResultList) { - if (!info.checkValid()) { + if (!info.getContent().isReplaced() && !info.checkValid()) { return false; } } @@ -281,10 +317,11 @@ public class ITReplaceMainDialog extends UIDialog { } /** - * 搜索 + * 搜索模板内容 */ - public void search() { + public void search4Content() { ITTableEditor itTableEditor = southPanel.getItTableEditor(); + clearContentCount(); if (JTemplate.isValid(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate())) { JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); templateID = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTarget().getTemplateID(); @@ -299,24 +336,25 @@ public class ITReplaceMainDialog extends UIDialog { ShowSearchResultAction searchAction = ShowSearchResultAction.match(GeneralUtils.objectToString(northPane.getFindCombobox().getSelectedItem())); //搜索 if (searchAction != null) { - searchResultList = searchAction.addMatchResult(searchStr, searchAction.showSearchValue(jTemplate)); - itTableEditor.add(searchResultList); - northPane.getResultLabel().setText("" + Toolkit.i18nText("Fine-Design_Replace_Search_Finish") + "" + searchResultList.size() + "" + Toolkit.i18nText("Fine-Design_Replace_Result")); + searchContentResultList = searchAction.addMatchResult(searchStr, searchAction.showSearchValue(jTemplate)); + itTableEditor.add(searchContentResultList); + northPane.getResultLabel().setText(ShowValueUtils.getResultTip(searchContentResultList.size(), contentReplaceCount, contentReplaceFailedCount)); } + replaceContentNum = 0; ITTableEditorPane.ITHeaderRenderer renderer = (ITTableEditorPane.ITHeaderRenderer) getEditTable().getTableHeader().getDefaultRenderer(); //刷新表头,并且重新勾选中表头全选框 renderer.refreshHeader(getEditTable(), true); itTableEditor.fireTableDataChanged(); northPane.refreshFindInputComboBoxItems(); setSearchFlag(true); - selectCount = searchResultList.size(); + selectCount = searchContentResultList.size(); //如果有结果,默认选中第一行 - if (searchResultList.size() > 0) { + if (searchContentResultList.size() > 0) { getEditTable().addRowSelectionInterval(FIRST_ROW, FIRST_ROW); } //更新替换按钮可用性 - if (StringUtils.isEmpty(searchStr) || searchResultList.size() == 0) { + if (StringUtils.isEmpty(searchStr) || searchContentResultList.size() == 0) { northPane.getReplaceButton().setEnabled(false); } else { northPane.getReplaceButton().setEnabled(true); @@ -330,6 +368,126 @@ public class ITReplaceMainDialog extends UIDialog { } + /** + * 搜索设置项 + */ + public void search4Setting() { + ITTableEditor settingEditor = southPanel.getItTableEditor(); + templateID = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTarget().getTemplateID(); + templateName = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplateName(); + clearSettingCount(); + if (JTemplate.isValid(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate())) { + String firstStr = GeneralUtils.objectToString(northPane.getFindSettingComboBox().getSelectedItem()); + String secondStr = GeneralUtils.objectToString(northPane.getFindSettingInputComboBox().getSelectedItem()); + String thirdStr = GeneralUtils.objectToString(northPane.getFindExtraSettingComboBox().getSelectedItem()); + setSettingInputStr(secondStr); + setSettingExtraStr(thirdStr); + SettingController controller = SettingController.match(firstStr); + if (controller != null) { + searchSettingResultList = controller.addMatchResult(controller.showSearchValue(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate()), secondStr, thirdStr); + settingEditor.clear(); + settingEditor.add(searchSettingResultList); + ITTableEditorPane.ITHeaderRenderer renderer = (ITTableEditorPane.ITHeaderRenderer) getEditTable().getTableHeader().getDefaultRenderer(); + renderer.refreshHeader(getEditTable(), true); + settingEditor.fireTableDataChanged(); + } + //如果有结果,默认选中第一行 + if (searchSettingResultList.size() > 0) { + getEditTable().addRowSelectionInterval(FIRST_ROW, FIRST_ROW); + } + northPane.getSettingResultLabel().setText(ShowValueUtils.getResultTip(searchSettingResultList.size(), settingReplaceCount, settingReplaceFailedCount)); + + } + } + + /** + * 替换设置项 + */ + public void replace4Setting() { + String firstStr = GeneralUtils.objectToString(northPane.getFindSettingComboBox().getSelectedItem()); + String inputStr = GeneralUtils.objectToString(northPane.getFindSettingInputComboBox().getSelectedItem()); + String extraStr = GeneralUtils.objectToString(northPane.getFindExtraSettingComboBox().getSelectedItem()); + clearSettingCount(); + if (isITReplaceValid() && !isSettingEverChanged(searchSettingResultList, firstStr, inputStr, extraStr)) { + if (isInputStrValid(inputStr, extraStr)) { + String secondStr = GeneralUtils.objectToString(northPane.getReplaceSettingInputComboBox().getSelectedItem()); + String thirdStr = GeneralUtils.objectToString(northPane.getReplaceExtraSettingComboBox().getSelectedItem()); + HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(true); + for (Info info : searchSettingResultList) { + if (info.getContent().isSelected()) { + SettingController controller = SettingController.match(firstStr); + if (controller != null) { + controller.replace(info, secondStr, thirdStr); + info.getContent().setReplaced(true); + settingReplaceCount++; + } + } + } + northPane.getSettingResultLabel().setText(ShowValueUtils.getResultTip(searchSettingResultList.size(), settingReplaceCount, settingReplaceFailedCount)); + southPanel.getTableEditorPane().update(); + ITTableEditorPane.getEditTable().repaint(); + HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(); + } else { + search4Setting(); + } + } else { + Object[] options = new Object[]{Toolkit.i18nText("Fine-Design_Replace_Search_Again"), Toolkit.i18nText("Fine-Design_Basic_Cancel")}; + int optionSelected = FineJOptionPane.showOptionDialog( + ITReplaceMainDialog.this, + Toolkit.i18nText("Fine-Design_Replace_Message"), + Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), + JOptionPane.YES_NO_CANCEL_OPTION, + JOptionPane.ERROR_MESSAGE, + null, + // 如果传null, 则按钮为 optionType 类型所表示的按钮(也就是确认对话框) + options, + options[0] + ); + //如果选择了重新查找,则再查找一遍 + if (isSelectSearch(optionSelected)) { + search4Setting(); + } + } + } + + private boolean isSelectSearch(int optionSelected) { + return optionSelected == NONE; + } + + + /** + * 用户的输入是否更改 + * + * @param inputStr 用户的一级输入框 + * @param extraStr 用户的二级输入框 + * @return 没更改过返回true + */ + public boolean isInputStrValid(String inputStr, String extraStr) { + return StringUtils.equals(inputStr, getSettingInputStr()) && StringUtils.equals(extraStr, getSettingExtraStr()); + } + + /** + * 设置项的内容是否更改过 + * + * @param searchSettingResultList 数据 + * @param controllerMatch controller的类型 + * @param inputStr 用户的一级输入框 + * @param extraStr 用户的二级输入框 + * @return 更改过返回true + */ + public boolean isSettingEverChanged(List searchSettingResultList, String controllerMatch, String inputStr, String extraStr) { + for (Info info : searchSettingResultList) { + if (info.getContent().isSelected() && !info.getContent().isReplaced()) { + SettingController controller = SettingController.match(controllerMatch); + if (controller != null && controller.isEverChanged(info, inputStr, extraStr)) { + return true; + } + } + } + return false; + } + + public ITReplaceSouthPanel getSouthPanel() { return southPanel; } @@ -346,10 +504,58 @@ public class ITReplaceMainDialog extends UIDialog { this.northPane = northPane; } + public String getSettingInputStr() { + return settingInputStr; + } + + public void setSettingInputStr(String settingInputStr) { + this.settingInputStr = settingInputStr; + } + + public String getSettingExtraStr() { + return settingExtraStr; + } + + public void setSettingExtraStr(String settingExtraStr) { + this.settingExtraStr = settingExtraStr; + } + /** * 检测结果是否合法 */ @Override public void checkValid() throws Exception { } + + public static List getSearchContentResultList() { + return searchContentResultList; + } + + public void setSearchContentResultList(List searchContentResultList) { + this.searchContentResultList = searchContentResultList; + } + + public static List getSearchSettingResultList() { + return searchSettingResultList; + } + + public void setSearchSettingResultList(List searchSettingResultList) { + this.searchSettingResultList = searchSettingResultList; + } + + /** + * 重置计数 + */ + public void clearContentCount() { + contentReplaceCount = NONE; + contentReplaceFailedCount = NONE; + } + + /** + * 重置计数 + */ + public void clearSettingCount() { + settingReplaceCount = NONE; + settingReplaceFailedCount = NONE; + } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java index 909ce7112a..60300de2a9 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java @@ -1,12 +1,16 @@ package com.fr.design.actions.replace.ui; import com.fr.base.svg.IconUtils; +import com.fr.design.actions.replace.action.setting.SettingContent; +import com.fr.design.actions.replace.action.setting.SettingController; +import com.fr.design.data.datapane.TableDataComboBox; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.i18n.Toolkit; +import com.fr.general.GeneralUtils; import com.fr.stable.StringUtils; @@ -16,11 +20,15 @@ import javax.swing.Icon; import javax.swing.JCheckBox; import javax.swing.JPanel; import javax.swing.ScrollPaneConstants; +import java.awt.CardLayout; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; import java.util.ArrayList; import java.util.Collections; +import java.util.List; /** * 上面板 @@ -30,7 +38,12 @@ import java.util.Collections; * created by Destiny.Lin on 2022-09-01 */ public class ITReplaceNorthPanel { - private JPanel upPanel; + private JPanel upContentPanel; + private JPanel upSettingPanel; + private static JPanel cardPanel; + private static CardLayout cardLayout; + + //content private UILabel findLabel; private UILabel rangeLabel; private UILabel resultLabel; @@ -38,12 +51,28 @@ public class ITReplaceNorthPanel { private UIComboBox rangeCombobox; private JCheckBox matchRadioButton; private UILabel iconLabel; - private UIComboBox findInputCombobox; private UIComboBox replaceInputCombobox; - private UIScrollPane scrollPane; + private UIScrollPane contentScrollPane; + private UIScrollPane settingScrollPane; private UIButton replaceButton; private UIButton searchButton; + + //setting + private UILabel iconSettingLabel; + private UILabel findSettingLabel; + private UILabel rangeSettingLabel; + private UILabel settingResultLabel; + private UIComboBox rangeSettingComboBox; + private UIComboBox findSettingComboBox; + private UIComboBox findSettingInputComboBox; + private UIComboBox replaceSettingInputComboBox; + private UIComboBox findExtraSettingComboBox; + private UIComboBox replaceExtraSettingComboBox; + private TableDataComboBox tableDataComboBox; + private UIButton replaceSettingButton; + private UIButton searchSettingButton; + private static double rate = 1.00; //存储的5次最近输入 @@ -59,6 +88,10 @@ public class ITReplaceNorthPanel { private static final int FIRST_X = 20, SECOND_X = 80; private static final int LABEL_WIDTH = 60; private static final Icon CHANGE_ICON = IconUtils.readIcon("/com/fr/design/images/replace/change_normal.svg"); + private static final String[] rangeItems = new String[]{Toolkit.i18nText("Fine-Design_Basic_Export_JS_Template_Current")}; + + public static final String CARD_CONTENT = "Content"; + public static final String CARD_SETTING = "setting"; private int findLabelX, findLabelY, findLabelWidth, findLabelHeight; @@ -74,9 +107,14 @@ public class ITReplaceNorthPanel { private int iconX, iconY, iconWidth, iconHeight; private int inputLength; - public static ArrayList findItems = new ArrayList<>(); - public static ArrayList findInputItems = new ArrayList<>(); - public static ArrayList replaceInputItems = new ArrayList<>(); + public static List findItems = new ArrayList<>(); + public static List findSettingItems = new ArrayList<>(); + public static List findInputItems = new ArrayList<>(); + public static List replaceInputItems = new ArrayList<>(); + public static List formatItems = new ArrayList<>(); + public static List digitItems = new ArrayList<>(); + public static List groupItems = new ArrayList<>(); + public static List dsColumnItems = new ArrayList<>(); static { findItems.add(Toolkit.i18nText("Fine-Design_Basic_Cell")); @@ -86,17 +124,66 @@ public class ITReplaceNorthPanel { findItems.add(Toolkit.i18nText("Fine-Design_Replace_Component")); findItems.add(Toolkit.i18nText("Fine-Design_Basic_Widget")); findItems.add(Toolkit.i18nText("Fine-Design_Basic_Formula")); + + + findSettingItems.add(SettingContent.CELL_FORMAT_NAME); + findSettingItems.add(SettingContent.CELL_DATA_SETTING_NAME); + findSettingItems.add(SettingContent.CELL_DS_COLUMN_NAME); + findSettingItems.add(SettingContent.DATASOURCE_CONNECTION_NAME); + findSettingItems.add(SettingContent.DATASOURCE_COLLECT_NAME); + + formatItems.add(SettingContent.FORMAT_COMMON); + formatItems.add(SettingContent.FORMAT_NUMBER); + formatItems.add(SettingContent.FORMAT_MONEY); + formatItems.add(SettingContent.FORMAT_PERCENT); + formatItems.add(SettingContent.FORMAT_PERMILLAGE); + formatItems.add(SettingContent.FORMAT_SCIENCE); + formatItems.add(SettingContent.FORMAT_DATE); + formatItems.add(SettingContent.FORMAT_TIME); + formatItems.add(SettingContent.FORMAT_TEXT); + + digitItems.add(SettingContent.DIGIT_SETTING_GROUP); + digitItems.add(SettingContent.DIGIT_SETTING_LIST); + digitItems.add(SettingContent.DIGIT_SETTING_SUM); + + groupItems.add(SettingContent.GROUP_COMMON); + groupItems.add(SettingContent.GROUP_CONTINUUM); + + dsColumnItems.add(SettingContent.CONNECTION_TEMPLATE); } public ITReplaceNorthPanel() { - upPanel = new JPanel(null); + cardLayout = new CardLayout(); + cardPanel = new JPanel(cardLayout); + upContentPanel = new JPanel(null); + upSettingPanel = new JPanel(null); + + initContentPanel(); + initSettingPanel(); + + + cardPanel.add(contentScrollPane, CARD_CONTENT); + cardPanel.add(upSettingPanel, CARD_SETTING); + } + + /** + * 限制尺寸 + * + * @param width + */ + public void setLimitSize(int width) { + upContentPanel.setMaximumSize(new Dimension(limit_width, HEIGHT)); + upContentPanel.setPreferredSize(new Dimension(limit_width, HEIGHT)); + } + /** + * 初始化模板内容查找面板 + */ + public void initContentPanel() { findLabel = new UILabel(Toolkit.i18nText("Fine-Design_Replace_Search_Element")); rangeLabel = new UILabel(Toolkit.i18nText("Fine-Design_Replace_Search_Range")); iconLabel = new UILabel(CHANGE_ICON); resultLabel = new UILabel(); - - String[] rangeItems = new String[]{Toolkit.i18nText("Fine-Design_Basic_Export_JS_Template_Current")}; String[] replaceInputItems = new String[]{StringUtils.EMPTY}; findCombobox = new UIComboBox(findItems.toArray()); rangeCombobox = new UIComboBox(rangeItems); @@ -122,32 +209,198 @@ public class ITReplaceNorthPanel { replaceButton = new UIButton(Toolkit.i18nText("Fine-Design_Replace_Button")); searchButton = new UIButton(Toolkit.i18nText("Fine-Design_Search_Button")); - upPanel.setPreferredSize(new Dimension(limit_width, HEIGHT)); - scrollPane = new UIScrollPane(upPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); - upPanel.add(findLabel); - upPanel.add(rangeLabel); - upPanel.add(resultLabel); - upPanel.add(findCombobox); - upPanel.add(rangeCombobox); - upPanel.add(findInputCombobox); - upPanel.add(replaceInputCombobox); - upPanel.add(matchRadioButton); - upPanel.add(replaceButton); - upPanel.add(searchButton); - upPanel.add(iconLabel); - scrollPane.setBorder(BorderFactory.createEmptyBorder()); + upContentPanel.setPreferredSize(new Dimension(limit_width, HEIGHT)); + contentScrollPane = new UIScrollPane(upContentPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); + upContentPanel.add(findLabel); + upContentPanel.add(rangeLabel); + upContentPanel.add(resultLabel); + upContentPanel.add(findCombobox); + upContentPanel.add(rangeCombobox); + upContentPanel.add(findInputCombobox); + upContentPanel.add(replaceInputCombobox); + upContentPanel.add(matchRadioButton); + upContentPanel.add(replaceButton); + upContentPanel.add(searchButton); + upContentPanel.add(iconLabel); + contentScrollPane.setBorder(BorderFactory.createEmptyBorder()); } /** - * 限制尺寸 + * 初始化设置项查找面板 + */ + public void initSettingPanel() { + findSettingLabel = new UILabel(Toolkit.i18nText("Fine-Design_Replace_Search_Element")); + rangeSettingLabel = new UILabel(Toolkit.i18nText("Fine-Design_Replace_Search_Range")); + settingResultLabel = new UILabel(); + findSettingComboBox = new UIComboBox(findSettingItems.toArray()); + rangeSettingComboBox = new UIComboBox(rangeItems); + findSettingInputComboBox = new UIComboBox(formatItems.toArray()) { + @Override + public void setEditor(ComboBoxEditor anEditor) { + super.setEditor(new ITComboBoxEditor()); + } + }; + findSettingInputComboBox.setSelectedIndex(-1); + replaceSettingInputComboBox = new UIComboBox(formatItems.toArray()) { + @Override + public void setEditor(ComboBoxEditor anEditor) { + super.setEditor(new ITComboBoxEditor()); + } + }; + replaceSettingInputComboBox.setSelectedIndex(-1); + + + ((UITextField) (findSettingInputComboBox.getEditor().getEditorComponent())).setPlaceholder(Toolkit.i18nText("Fine-Design_Replace_Choose_Search") + SettingContent.CELL_FORMAT_NAME); + findSettingInputComboBox.setEditable(true); + ((UITextField) (findSettingInputComboBox.getEditor().getEditorComponent())).setEditable(false); + ((UITextField) (replaceSettingInputComboBox.getEditor().getEditorComponent())).setPlaceholder(Toolkit.i18nText("Fine-Design_Replace_Choose_Replace") + SettingContent.CELL_FORMAT_NAME); + replaceSettingInputComboBox.setEditable(true); + ((UITextField) (replaceSettingInputComboBox.getEditor().getEditorComponent())).setEditable(false); + + + iconSettingLabel = new UILabel(CHANGE_ICON); + findExtraSettingComboBox = new UIComboBox(groupItems.toArray()); + findExtraSettingComboBox.setVisible(false); + replaceExtraSettingComboBox = new UIComboBox(groupItems.toArray()); + replaceExtraSettingComboBox.setVisible(false); + searchSettingButton = new UIButton(Toolkit.i18nText("Fine-Design_Search_Button")); + replaceSettingButton = new UIButton(Toolkit.i18nText("Fine-Design_Replace_Button")); + + replaceSettingButton.setEnabled(false); + + upSettingPanel.add(findSettingLabel); + upSettingPanel.add(rangeSettingLabel); + upSettingPanel.add(findSettingComboBox); + upSettingPanel.add(rangeSettingComboBox); + upSettingPanel.add(findSettingInputComboBox); + upSettingPanel.add(replaceSettingInputComboBox); + upSettingPanel.add(iconSettingLabel); + upSettingPanel.add(findExtraSettingComboBox); + upSettingPanel.add(replaceExtraSettingComboBox); + upSettingPanel.add(searchSettingButton); + upSettingPanel.add(replaceSettingButton); + upSettingPanel.add(settingResultLabel); + settingScrollPane = new UIScrollPane(upSettingPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); + settingScrollPane.setBorder(BorderFactory.createEmptyBorder()); + + initListener(); + + } + + /** + * 初始化事件 + */ + private void initListener() { + findSettingComboBox.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + replaceSettingInputComboBox.clearBoxItems(); + findSettingInputComboBox.clearBoxItems(); + String str = GeneralUtils.objectToString(findSettingComboBox.getSelectedItem()); + ((UITextField) findSettingInputComboBox.getEditor().getEditorComponent()).setText(StringUtils.EMPTY); + refreshSettingComboBox(SettingController.getSettingRefreshItems(str)); + setDataSourceComboBoxStatus(isAllow2Replace()); + replaceSettingButton.setEnabled(false); + + } + }); + + findSettingInputComboBox.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + refreshExtraComboBox(findSettingInputComboBox, findExtraSettingComboBox); + + } + }); + + replaceSettingInputComboBox.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + refreshExtraComboBox(replaceSettingInputComboBox, replaceExtraSettingComboBox); + } + }); + } + + /** + * 刷新替换按钮状态 + */ + public void refreshSettingReplaceButtonStatus() { + replaceSettingButton.setEnabled(isAllChoose()); + } + + /** + * 是否各个选项都有选中内容 * - * @param width + * @return 是则返回true */ - public void setLimitSize(int width) { - upPanel.setMaximumSize(new Dimension(limit_width, 161)); - upPanel.setPreferredSize(new Dimension(limit_width, 161)); + public boolean isAllChoose() { + String str = GeneralUtils.objectToString(findSettingComboBox.getSelectedItem()); + String findInputStr = GeneralUtils.objectToString(findSettingInputComboBox.getSelectedItem()); + String replaceInputStr = GeneralUtils.objectToString(replaceSettingInputComboBox.getSelectedItem()); + String findExtraStr = GeneralUtils.objectToString(findExtraSettingComboBox.getSelectedItem()); + String replaceExtraStr = GeneralUtils.objectToString(replaceExtraSettingComboBox.getSelectedItem()); + return (!StringUtils.equals(str, SettingContent.DATASOURCE_COLLECT_NAME) && !StringUtils.equals(str, SettingContent.DATASOURCE_CONNECTION_NAME)) + && StringUtils.isNotEmpty(findInputStr) + && StringUtils.isNotEmpty(replaceInputStr) + && StringUtils.isNotEmpty(findExtraStr) + && StringUtils.isNotEmpty(replaceExtraStr); } + /** + * 是否支持替换 + * + * @return 支持返回true + */ + public boolean isAllow2Replace() { + String str = GeneralUtils.objectToString(findSettingComboBox.getSelectedItem()); + return !StringUtils.equals(str, SettingContent.DATASOURCE_CONNECTION_NAME) && !StringUtils.equals(str, SettingContent.DATASOURCE_COLLECT_NAME); + } + + /** + * 设置数据集相关情况下的替换框的状态 + * + * @param status + */ + public void setDataSourceComboBoxStatus(boolean status) { + replaceSettingButton.setEnabled(status); + replaceSettingInputComboBox.setEnabled(status); + replaceExtraSettingComboBox.setEnabled(status); + } + + /** + * 刷新延展出的下拉框(第三层) + * + * @param settingComboBox + * @param extraComboBox + */ + public void refreshExtraComboBox(UIComboBox settingComboBox, UIComboBox extraComboBox) { + String str = GeneralUtils.objectToString(findSettingComboBox.getSelectedItem()); + String parent = GeneralUtils.objectToString(settingComboBox.getSelectedItem()); + if (StringUtils.isNotEmpty(parent) && SettingController.match(str) != null && SettingController.match(str).hasExpand(str, parent)) { + extraComboBox.clearBoxItems(); + extraComboBox.setVisible(true); + extraComboBox.refreshBoxItems(SettingController.getSettingExtraRefreshItems(str, parent)); + extraComboBox.setSelectedIndex(0); + } else { + extraComboBox.setVisible(false); + } + refreshSettingReplaceButtonStatus(); + } + + /** + * 刷新用户选择的输入框(第二层) + * + * @param list + */ + public void refreshSettingComboBox(List list) { + findSettingInputComboBox.clearBoxItems(); + findSettingInputComboBox.refreshBoxItems(list); + replaceSettingInputComboBox.clearBoxItems(); + replaceSettingInputComboBox.refreshBoxItems(list); + replaceExtraSettingComboBox.setVisible(false); + findExtraSettingComboBox.setVisible(false); + + } /** * 适配屏幕 @@ -162,7 +415,50 @@ public class ITReplaceNorthPanel { templateWidth = templateWidth - ITReplaceWestPanel.LEFT_WIDTH; inputLength = (templateWidth - GAP * 5) / 2; + fitContentScreen(templateWidth); + fitSettingScreen(templateWidth); + + + } + /** + * 适配屏幕 + * + * @param templateWidth 当前设计器宽度 + */ + private void fitSettingScreen(int templateWidth) { + findSettingLabel.setBounds(FIRST_X, FIRST_Y, LABEL_WIDTH, COMPONENT_HEIGHT); + findSettingComboBox.setBounds(SECOND_X, FIRST_Y, inputLength - 4 * GAP, COMPONENT_HEIGHT); + rangeSettingLabel.setBounds(replaceInputComboBoxX, FIRST_Y, LABEL_WIDTH, COMPONENT_HEIGHT); + rangeSettingComboBox.setBounds(rangeLabelX + rangeLabelWidth, FIRST_Y, inputLength - 3 * GAP, COMPONENT_HEIGHT); + findSettingInputComboBox.setBounds(FIRST_X, SECOND_Y, inputLength - GAP, COMPONENT_HEIGHT); + replaceSettingInputComboBox.setBounds(templateWidth - inputLength - GAP * 2, SECOND_Y, inputLength, COMPONENT_HEIGHT); + iconSettingLabel.setBounds(iconX, iconY, iconWidth, iconHeight); + searchSettingButton.setBounds(searchButtonX, searchButtonY, BUTTON_WIDTH, searchButtonHeight); + replaceSettingButton.setBounds(replaceButtonX, replaceButtonY, BUTTON_WIDTH, replaceButtonHeight); + settingResultLabel.setBounds(resultLabelX, resultLabelY, resultLabelWidth, resultLabelHeight); + setExtraBounds(templateWidth); + + + } + + /** + * 设置额外的输入框 + * + * @param templateWidth 当前设计器宽度 + */ + private void setExtraBounds(int templateWidth) { + findExtraSettingComboBox.setBounds(FIRST_X, THIRD_Y, inputLength - GAP, COMPONENT_HEIGHT); + replaceExtraSettingComboBox.setBounds(templateWidth - inputLength - GAP * 2, THIRD_Y, inputLength, COMPONENT_HEIGHT); + } + + + /** + * 模板内容查找面板适配屏幕 + * + * @param templateWidth 当前设计器宽度 + */ + private void fitContentScreen(int templateWidth) { setFindLabelBounds(); setResultLabelBounds(templateWidth); setFindComboboxBounds(); @@ -174,7 +470,6 @@ public class ITReplaceNorthPanel { setReplaceButtonBounds(); setSearchButtonBounds(); setIconLabelBounds(); - } @@ -221,12 +516,12 @@ public class ITReplaceNorthPanel { } - public UIScrollPane getScrollPane() { - return scrollPane; + public UIScrollPane getContentScrollPane() { + return contentScrollPane; } - public void setScrollPane(UIScrollPane scrollPane) { - this.scrollPane = scrollPane; + public void setContentScrollPane(UIScrollPane contentScrollPane) { + this.contentScrollPane = contentScrollPane; } private void setIconLabelBounds() { @@ -320,12 +615,12 @@ public class ITReplaceNorthPanel { findLabel.setBounds(findLabelX, findLabelY, findLabelWidth, findLabelHeight); } - public JPanel getUpPanel() { - return upPanel; + public JPanel getUpContentPanel() { + return upContentPanel; } - public void setUpPanel(JPanel upPanel) { - this.upPanel = upPanel; + public void setUpContentPanel(JPanel upContentPanel) { + this.upContentPanel = upContentPanel; } public UILabel getFindLabel() { @@ -407,4 +702,77 @@ public class ITReplaceNorthPanel { public void setSearchButton(UIButton searchButton) { this.searchButton = searchButton; } + + public static CardLayout getCardLayout() { + return cardLayout; + } + + public static JPanel getCardPanel() { + return cardPanel; + } + + + public UIButton getReplaceSettingButton() { + return replaceSettingButton; + } + + public void setReplaceSettingButton(UIButton replaceSettingButton) { + this.replaceSettingButton = replaceSettingButton; + } + + public UIButton getSearchSettingButton() { + return searchSettingButton; + } + + public void setSearchSettingButton(UIButton searchSettingButton) { + this.searchSettingButton = searchSettingButton; + } + + public UIComboBox getFindSettingInputComboBox() { + return findSettingInputComboBox; + } + + public void setFindSettingInputComboBox(UIComboBox findSettingInputComboBox) { + this.findSettingInputComboBox = findSettingInputComboBox; + } + + public UIComboBox getReplaceSettingInputComboBox() { + return replaceSettingInputComboBox; + } + + public void setReplaceSettingInputComboBox(UIComboBox replaceSettingInputComboBox) { + this.replaceSettingInputComboBox = replaceSettingInputComboBox; + } + + public UIComboBox getFindExtraSettingComboBox() { + return findExtraSettingComboBox; + } + + public void setFindExtraSettingComboBox(UIComboBox findExtraSettingComboBox) { + this.findExtraSettingComboBox = findExtraSettingComboBox; + } + + public UIComboBox getReplaceExtraSettingComboBox() { + return replaceExtraSettingComboBox; + } + + public void setReplaceExtraSettingComboBox(UIComboBox replaceExtraSettingComboBox) { + this.replaceExtraSettingComboBox = replaceExtraSettingComboBox; + } + + public UIComboBox getFindSettingComboBox() { + return findSettingComboBox; + } + + public void setFindSettingComboBox(UIComboBox findSettingComboBox) { + this.findSettingComboBox = findSettingComboBox; + } + + public UILabel getSettingResultLabel() { + return settingResultLabel; + } + + public void setSettingResultLabel(UILabel settingResultLabel) { + this.settingResultLabel = settingResultLabel; + } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java index 997013592d..24c441b9a3 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java @@ -14,11 +14,11 @@ import java.awt.Color; */ public class ITReplaceSouthPanel { ITTableEditorPane tableEditorPane; - ITTableEditor itTableEditor; + public static ITTableEditor itTableEditor; //勾选框索引 public static final int CHECKBOX_INDEX = 0; //ITContent在表格的列索引 - public static final int CONTENT_INDEX = 6; + public static final int CONTENT_INDEX = 7; public static final int TABLE_GAP = 20; public ITReplaceSouthPanel() { @@ -47,7 +47,7 @@ public class ITReplaceSouthPanel { this.tableEditorPane = tableEditorPane; } - public ITTableEditor getItTableEditor() { + public static ITTableEditor getItTableEditor() { return itTableEditor; } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java index 0804efa23b..1c9ed16523 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java @@ -1,6 +1,7 @@ package com.fr.design.actions.replace.ui; import com.fr.base.svg.IconUtils; +import com.fr.design.actions.replace.info.Info; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; @@ -19,6 +20,7 @@ import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseEvent; +import java.util.List; /** * 左侧面板 @@ -30,33 +32,59 @@ import java.awt.event.MouseEvent; public class ITReplaceWestPanel { private JPanel leftPanel; private UILabel iconLabel; + private UIToggleButton contentButton; + private UIToggleButton settingButton; private static final Icon HELP_ICON = IconUtils.readIcon("com/fr/design/images/buttonicon/replace_help.svg"); private static final String HELP_URL = CloudCenter.getInstance().acquireUrlByKind("design.replace.help", "https://help.fanruan.com/finereport/doc-view-4954.html?source=3"); - private static final int FILL_COUNT = 12; + private static final int FILL_COUNT = 11; public static final int LEFT_WIDTH = 100; public static final String CONTENT_TEXT = "" + Toolkit.i18nText("Fine-Design_Basic_Templates_Content") + ""; + public static final String SETTING_TEXT = "" + Toolkit.i18nText("Fine-Design_Replace_Setting") + ""; public ITReplaceWestPanel() { leftPanel = new JPanel(new GridLayout(15, 1, 0, 0)); iconLabel = new UILabel("" + Toolkit.i18nText("Fine-Design_Report_Community_Help") + ""); - UIToggleButton contentButton = new UIToggleButton(Toolkit.i18nText("Fine-Design_Basic_Templates_Content")); + contentButton = new UIToggleButton(Toolkit.i18nText("Fine-Design_Basic_Templates_Content")); + settingButton = new UIToggleButton(Toolkit.i18nText("Fine-Design_Replace_Setting")); contentButton.setText(CONTENT_TEXT); contentButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (!contentButton.isSelected()) { - contentButton.setText(CONTENT_TEXT); + showSelectPanel(ITReplaceNorthPanel.CARD_CONTENT, ITReplaceMainDialog.getSearchContentResultList()); } else { - contentButton.setText(Toolkit.i18nText("Fine-Design_Basic_Templates_Content")); + showSelectPanel(ITReplaceNorthPanel.CARD_SETTING, ITReplaceMainDialog.getSearchSettingResultList()); } + changeColor4SelectContent(); + settingButton.setSelected(contentButton.isSelected()); + + } + }); + + settingButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + if (!settingButton.isSelected()) { + showSelectPanel(ITReplaceNorthPanel.CARD_SETTING, ITReplaceMainDialog.getSearchSettingResultList()); + } else { + showSelectPanel(ITReplaceNorthPanel.CARD_CONTENT, ITReplaceMainDialog.getSearchContentResultList()); + } + changeColor4SelectContent(); + contentButton.setSelected(settingButton.isSelected()); + } }); leftPanel.setBackground(Color.WHITE); + //默认选中模板内容 contentButton.setSelected(true); + settingButton.setSelected(false); + //去除按钮的边框 contentButton.setBorderPainted(false); + settingButton.setBorderPainted(false); leftPanel.add(contentButton); + leftPanel.add(settingButton); leftPanel.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, new Color(218, 218, 221))); //填充一下面板 for (int i = 0; i < FILL_COUNT; i++) { @@ -85,4 +113,30 @@ public class ITReplaceWestPanel { public void setLeftPanel(JPanel leftPanel) { this.leftPanel = leftPanel; } + + /** + * 切换面板时改变颜色 + */ + public void changeColor4SelectContent() { + if (!contentButton.isSelected()) { + contentButton.setText(CONTENT_TEXT); + settingButton.setText(Toolkit.i18nText("Fine-Design_Replace_Setting")); + } else { + contentButton.setText(Toolkit.i18nText("Fine-Design_Basic_Templates_Content")); + settingButton.setText(SETTING_TEXT); + } + } + + /** + * 展示指定的面板 + * + * @param str card面板的标签 + * @param list 对应的表格数据 + */ + public void showSelectPanel(String str, List list) { + ITReplaceNorthPanel.getCardLayout().show(ITReplaceNorthPanel.getCardPanel(), str); + ITReplaceSouthPanel.getItTableEditor().clear(); + ITReplaceSouthPanel.getItTableEditor().add(list); + ITReplaceSouthPanel.getItTableEditor().fireTableDataChanged(); + } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java index c4cf47f592..ce11d184d0 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java @@ -13,7 +13,6 @@ import com.fr.general.GeneralUtils; import com.fr.stable.StringUtils; - import javax.swing.AbstractCellEditor; import javax.swing.JTable; import javax.swing.table.TableCellEditor; @@ -42,7 +41,7 @@ public class ITTableButton extends AbstractCellEditor implements TableCellEditor paraButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - ITContent content = (ITContent) getEditTable().getValueAt(getEditTable().getEditingRow(), 6); + ITContent content = (ITContent) getEditTable().getValueAt(getEditTable().getEditingRow(), ITReplaceSouthPanel.CONTENT_INDEX); if (StringUtils.isNotEmpty(GeneralUtils.objectToString(content.getTrlString()))) { ITReplaceMainDialog.setITReplaceFlag(true); TRL trl = new TRL(GeneralUtils.objectToString(content.getTrlString())); @@ -67,7 +66,7 @@ public class ITTableButton extends AbstractCellEditor implements TableCellEditor */ @Override public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { - ITContent content = (ITContent) table.getValueAt(row, 6); + ITContent content = (ITContent) table.getValueAt(row, ITReplaceSouthPanel.CONTENT_INDEX); paraButton.setEnabled(content.isJumpAble()); return paraButton; } @@ -85,7 +84,7 @@ public class ITTableButton extends AbstractCellEditor implements TableCellEditor */ @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { - ITContent content = (ITContent) table.getValueAt(row, 6); + ITContent content = (ITContent) table.getValueAt(row, ITReplaceSouthPanel.CONTENT_INDEX); paraButton.setEnabled(content.isJumpAble()); return paraButton; } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java index 0c8819abff..7f4960d21b 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java @@ -3,6 +3,7 @@ package com.fr.design.actions.replace.ui; import com.fr.design.actions.replace.info.Info; import com.fr.design.actions.replace.info.base.ITContent; +import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itableeditorpane.UITableEditAction; import com.fr.design.gui.itableeditorpane.UITableModelAdapter; @@ -12,6 +13,14 @@ import com.fr.stable.StringUtils; import org.jetbrains.annotations.Nullable; +import javax.swing.BorderFactory; +import javax.swing.DefaultCellEditor; +import javax.swing.JLabel; +import javax.swing.JTable; +import javax.swing.plaf.UIResource; +import javax.swing.table.TableCellRenderer; +import java.awt.Color; +import java.awt.Component; import java.util.List; /** @@ -28,6 +37,7 @@ public class ITTableEditor extends UITableModelAdapter { super(new String[]{ StringUtils.BLANK, Toolkit.i18nText("Fine-Design_Replace_Search_Content"), + Toolkit.i18nText("Fine-Design_After_Replace"), Toolkit.i18nText("Fine-Design_Replace_Template_Name"), Toolkit.i18nText("Fine-Design_Replace_Sheet_Name"), Toolkit.i18nText("Fine-Design_Replace_Block_Name"), @@ -42,11 +52,14 @@ public class ITTableEditor extends UITableModelAdapter { UILabel.class, UILabel.class, UILabel.class, + UILabel.class, ITTableButton.class, }); this.setDefaultEditor(ITTableButton.class, new ITTableButton()); this.setDefaultRenderer(ITTableButton.class, new ITTableButton()); + this.setDefaultEditor(Boolean.class, new ITBooleanEditor()); + this.setDefaultRenderer(Boolean.class, new ITBooleanRenderer()); this.createTable().getColumnModel().getColumn(ITReplaceSouthPanel.CONTENT_INDEX).setMaxWidth(50); this.createTable().getColumnModel().getColumn(ITReplaceSouthPanel.CHECKBOX_INDEX).setMaxWidth(50); @@ -106,6 +119,9 @@ public class ITTableEditor extends UITableModelAdapter { fireTableDataChanged(); } + /** + * 选择的索引 + */ public enum ChooseIndex { /** * 第一列,返回选中情况 @@ -127,9 +143,18 @@ public class ITTableEditor extends UITableModelAdapter { } }, /** - * 第三列,展示模板名 + * 第三列,展示替换后内容 */ INDEX_2(2) { + @Override + public @Nullable Object returnContentObject(ITContent content) { + return content.getAfterReplaceStr(); + } + }, + /** + * 第四列,展示模板名 + */ + INDEX_3(3) { @Override public Object returnContentObject(ITContent content) { return " " + content.getTemplateName(); @@ -137,9 +162,9 @@ public class ITTableEditor extends UITableModelAdapter { }, /** - * 第四列,展示Sheet + * 第五列,展示Sheet */ - INDEX_3(3) { + INDEX_4(4) { @Override public Object returnContentObject(ITContent content) { return " " + content.getSheetName(); @@ -147,18 +172,18 @@ public class ITTableEditor extends UITableModelAdapter { }, /** - * 第五列,展示块名、组件名 + * 第六列,展示块名、组件名 */ - INDEX_4(4) { + INDEX_5(5) { @Override public Object returnContentObject(ITContent content) { return " " + content.getBlockName(); } }, /** - * 第六列,展示路径 + * 第七列,展示路径 */ - INDEX_5(5) { + INDEX_6(6) { @Override public Object returnContentObject(ITContent content) { return " " + content.getOtherPos(); @@ -166,9 +191,9 @@ public class ITTableEditor extends UITableModelAdapter { }, /** - * 第七列,展示定位按钮 + * 第八列,展示定位按钮 */ - INDEX_6(6) { + INDEX_7(7) { @Override public Object returnContentObject(ITContent content) { return content; @@ -209,4 +234,38 @@ public class ITTableEditor extends UITableModelAdapter { return null; } } + + /** + * 用于展示指定风格的checkbox的Editor + */ + public class ITBooleanEditor extends DefaultCellEditor { + public ITBooleanEditor() { + super(new UICheckBox()); + UICheckBox checkBox = (UICheckBox) getComponent(); + checkBox.setHorizontalAlignment(UICheckBox.CENTER); + } + } + + /** + * 用于展示指定风格的checkbox的渲染器 + */ + public class ITBooleanRenderer extends UICheckBox implements TableCellRenderer, UIResource { + public ITBooleanRenderer() { + super(); + setHorizontalAlignment(JLabel.CENTER); + setBorderPainted(true); + } + + @Override + public Component getTableCellRendererComponent(JTable table, Object value, + boolean isSelected, boolean hasFocus, int row, int column) { + ITContent content = (ITContent) table.getValueAt(row, ITReplaceSouthPanel.CONTENT_INDEX); + setEnabled(!content.isReplaced()); + setSelected((value != null && ((Boolean) value).booleanValue())); + setUI(getUICheckBoxUI()); + setBorder(BorderFactory.createEmptyBorder()); + setBackground(Color.WHITE); + return this; + } + } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java index 0a743d34eb..f46ea95ac4 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java @@ -5,6 +5,7 @@ import com.fr.design.border.UIRoundedBorder; import com.fr.design.constants.UIConstants; import com.fr.design.dialog.BasicPane; +import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itableeditorpane.UITableEditAction; @@ -14,7 +15,6 @@ import com.fr.design.mainframe.share.ui.base.MouseClickListener; import com.fr.stable.StringUtils; -import javax.swing.JCheckBox; import javax.swing.JComponent; import javax.swing.JLabel; import javax.swing.JPanel; @@ -85,27 +85,30 @@ public class ITTableEditorPane extends BasicPane { /** * 改变面板的各个状态(替换按钮、表头勾选框) + * * @param content * @param row * @param col */ public void changeComponentStatus(ITContent content, int row, int col) { - if (content.isSelected()) { - content.setSelected(false); - editTable.setValueAt(content.isSelected(), row, col); - ITReplaceMainDialog.selectCount--; - //如果没有选中,替换按钮需要置灰 - ITReplaceMainDialog.getInstance().getNorthPane().getReplaceButton().setEnabled(ITReplaceMainDialog.selectCount > 0); - } else { - content.setSelected(true); - editTable.setValueAt(content.isSelected(), row, col); - ITReplaceMainDialog.selectCount++; - ITReplaceMainDialog.getInstance().getNorthPane().getReplaceButton().setEnabled(true); - } - //更新表头的勾选框状态 - if (editTable.getTableHeader().getDefaultRenderer() instanceof ITHeaderRenderer) { - ITHeaderRenderer renderer = (ITHeaderRenderer) editTable.getTableHeader().getDefaultRenderer(); - renderer.refreshHeader(editTable, ITReplaceMainDialog.selectCount >= editTable.getRowCount()); + if (!content.isReplaced()) { + if (content.isSelected()) { + content.setSelected(false); + editTable.setValueAt(content.isSelected(), row, col); + ITReplaceMainDialog.selectCount--; + //如果没有选中,替换按钮需要置灰 + ITReplaceMainDialog.getInstance().getNorthPane().getReplaceButton().setEnabled(ITReplaceMainDialog.selectCount > 0); + } else { + content.setSelected(true); + editTable.setValueAt(content.isSelected(), row, col); + ITReplaceMainDialog.selectCount++; + ITReplaceMainDialog.getInstance().getNorthPane().getReplaceButton().setEnabled(true); + } + //更新表头的勾选框状态 + if (editTable.getTableHeader().getDefaultRenderer() instanceof ITHeaderRenderer) { + ITHeaderRenderer renderer = (ITHeaderRenderer) editTable.getTableHeader().getDefaultRenderer(); + renderer.refreshHeader(editTable, ITReplaceMainDialog.selectCount >= editTable.getRowCount()); + } } } @@ -125,11 +128,11 @@ public class ITTableEditorPane extends BasicPane { */ public static class ITHeaderRenderer implements TableCellRenderer { JTableHeader tableHeader; - final JCheckBox selectBox; + final UICheckBox selectBox; public ITHeaderRenderer(JTable table) { this.tableHeader = table.getTableHeader(); - selectBox = new JCheckBox(); + selectBox = new UICheckBox(); selectBox.setSelected(true); tableHeader.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { @@ -217,7 +220,10 @@ public class ITTableEditorPane extends BasicPane { ITReplaceMainDialog.getInstance().getNorthPane().getReplaceButton().setEnabled(value); } for (int i = 0; i < len; i++) { - ((ITContent) (getEditTable().getValueAt(i, ITReplaceSouthPanel.CONTENT_INDEX))).setSelected(value); + ITContent content = ((ITContent) (getEditTable().getValueAt(i, ITReplaceSouthPanel.CONTENT_INDEX))); + if (!content.isReplaced()) { + content.setSelected(value); + } } } From 0f010b22ca539f2fba8588b85d858d81e1c63ddb Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 27 Oct 2022 15:34:07 +0800 Subject: [PATCH 104/310] =?UTF-8?q?REPORT-80695=20=E3=80=90=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E5=85=A8=E5=B1=80=E7=BA=A7=E5=88=AB=E6=9F=A5=E6=89=BE?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E4=BA=8C=E6=9C=9F=E3=80=91=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/replace/utils/SearchJSUtils.java | 7 +- .../actions/replace/utils/ShowValueUtils.java | 86 +++++++++++++++++++ 2 files changed, 91 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java index 5bb27c6686..ef2909db6b 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java @@ -5,6 +5,7 @@ import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartglyph.ConditionAttr; import com.fr.chart.chartglyph.ConditionCollection; import com.fr.chart.web.ChartHyperPoplink; +import com.fr.design.actions.replace.action.content.js.JSCheckTag; import com.fr.design.actions.replace.action.content.js.SearchChartJSAction; import com.fr.design.actions.replace.info.JSInfo; import com.fr.design.actions.replace.info.base.ITContent; @@ -68,7 +69,7 @@ public class SearchJSUtils { ITContent newContent = ITContent.copy(content); newContent.setReplaceObject(listener); SearchJSUtils.addJSInfos(jsInfos, new JSInfo(newContent)); - } else if (javaScript instanceof Commit2DBJavaScript){ + } else if (javaScript instanceof Commit2DBJavaScript) { dealCommit2DBJS(jsInfos, content, (Commit2DBJavaScript) javaScript); } } @@ -90,7 +91,7 @@ public class SearchJSUtils { if (javaScript instanceof JavaScriptImpl) { newContent.setReplaceObject(javaScript); jsInfos.add(new JSInfo(newContent)); - } else if (javaScript instanceof Commit2DBJavaScript){ + } else if (javaScript instanceof Commit2DBJavaScript) { dealCommit2DBJS(jsInfos, newContent, (Commit2DBJavaScript) javaScript); } } @@ -362,6 +363,8 @@ public class SearchJSUtils { newContent.addOtherPos(Toolkit.i18nText("Fine-Design_Report_Hyperlink")); newContent.setReplaceObject(nameJavaScript); newContent.addOtherPos(nameJavaScript.getName()); + newContent.setHoldObject(elem); + newContent.setTag(JSCheckTag.CELL_HYPERLINK); SearchJSUtils.addJSInfos(jsInfos, new JSInfo(newContent)); } else if (isChartHyperPopLinkValid(javaScript)) { ITContent chartContent = ITContent.copy(content); diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java index 191a08eefc..8f1174e8fc 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java @@ -1,7 +1,9 @@ package com.fr.design.actions.replace.utils; +import com.fr.design.actions.replace.info.Info; import com.fr.design.actions.replace.ui.ITReplaceMainDialog; +import com.fr.design.i18n.Toolkit; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.collections.combination.Pair; @@ -97,6 +99,22 @@ public class ShowValueUtils { } } + /** + * 获取高亮后用于展示的搜索后内容 + * + * @param str 原内容 + * @param searchStr 搜索内容 + * @param replaceStr 替换内容 + * @return 处理完的文本 + */ + public static String getReplaceString(String str, String searchStr, String replaceStr) { + if (StringUtils.isEmpty(searchStr)) { + return str; + } else { + return updateReplaceHighlight(str, searchStr, replaceStr); + } + } + /** * 替换策略 * @@ -187,6 +205,40 @@ public class ShowValueUtils { } } + /** + * 更新替换后的高亮 + * + * @param str + * @param searchStr + * @param replaceStr + * @return + */ + public static String updateReplaceHighlight(String str, String searchStr, String replaceStr) { + if (ITReplaceMainDialog.isMatched()) { + String result = str; + Pattern pattern = containPattern; + Matcher matcher = pattern.matcher(str); + int size = FONT_HEAD.length() + FONT_TAIL.length(); + int different = getDifferent(searchStr.length(), replaceStr.length()); + int index = 0; + StringBuilder builder = new StringBuilder(str); + while (matcher.find()) { + builder.replace(matcher.start() + index, matcher.end() + index, FONT_HEAD + changeHtmlStr(replaceStr) + FONT_TAIL); + index += getDifferent(size, different); + index += getIncreaseCount(replaceStr); + } + + return changeOriginHtmlStr(HEAD + builder.toString() + TAIL); + } else { + String ans = HEAD + replaceAll(str, searchStr, FONT_HEAD + changeHtmlStr(replaceStr) + FONT_TAIL) + TAIL; + return changeOriginHtmlStr(ans); + } + } + + private static int getDifferent(int searchLength, int replaceLength) { + return searchLength - replaceLength; + } + /** * 用于处理原字符串中的尖括号 */ @@ -315,4 +367,38 @@ public class ShowValueUtils { public static String joinStr4Position(String... strings) { return StableUtils.join(strings, JOIN_GAP_STRING); } + + /** + * 更新替换后内容的高亮 + * + * @param info 存储信息的数据结构 + * @param str 原内容 + * @param searchStr 搜索内容 + * @param replacedStr 替换内容 + */ + public static void updateAfterReplaceStr(Info info, String str, String searchStr, String replacedStr) { + info.getContent().setAfterReplaceStr(ShowValueUtils.getReplaceString(str, searchStr, replacedStr)); + } + + + /** + * 获取搜索或替换后的提示 + * + * @param findCount + * @param replaceCount + * @param failedCount + * @return + */ + public static String getResultTip(int findCount, int replaceCount, int failedCount) { + StringBuilder str = new StringBuilder(); + str.append("").append(Toolkit.i18nText("Fine-Design_Replace_Search_Finish")).append("").append(findCount).append("").append(Toolkit.i18nText("Fine-Design_Replace_Result")); + if (replaceCount != 0) { + str.append(Toolkit.i18nText("Fine-Design_Replace_Also_Finish")).append("").append(replaceCount).append("").append(Toolkit.i18nText("Fine-Design_Replace_Result_Count")); + if (failedCount != 0) { + str.append(Toolkit.i18nText("Fine-Design_Replace_Have")).append("").append(replaceCount).append("").append(Toolkit.i18nText("Fine-Design_Replace_Can_Not_Replace")); + } + } + + return str.toString(); + } } From 45b448ca4188d12ee426180bc0e0659068ec3671 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 27 Oct 2022 15:35:09 +0800 Subject: [PATCH 105/310] =?UTF-8?q?REPORT-80695=20=E3=80=90=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E5=85=A8=E5=B1=80=E7=BA=A7=E5=88=AB=E6=9F=A5=E6=89=BE?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E4=BA=8C=E6=9C=9F=E3=80=91=E5=9F=BA=E7=A1=80?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=93=E6=9E=84=E4=BF=AE=E6=94=B9=EF=BC=8C?= =?UTF-8?q?=E9=80=82=E9=85=8D=E5=A4=9A=E5=87=BA=E6=9D=A5=E7=9A=84=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E5=90=8E=E5=86=85=E5=AE=B9=E8=BF=99=E4=B8=80=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/replace/info/CellInfo.java | 29 ++++++++++++----- .../actions/replace/info/ConnectionInfo.java | 28 +++++++++++++++++ .../actions/replace/info/DSColumnInfo.java | 28 +++++++++++++++++ .../actions/replace/info/FloatInfo.java | 14 ++++++--- .../fr/design/actions/replace/info/Info.java | 2 -- .../design/actions/replace/info/JSInfo.java | 1 + .../actions/replace/info/ReplaceObject.java | 31 ++++++++++++++++--- .../actions/replace/info/WidgetInfo.java | 7 +++-- .../actions/replace/info/base/ITContent.java | 31 ++++++++++++++++++- 9 files changed, 150 insertions(+), 21 deletions(-) create mode 100644 designer-realize/src/main/java/com/fr/design/actions/replace/info/ConnectionInfo.java create mode 100644 designer-realize/src/main/java/com/fr/design/actions/replace/info/DSColumnInfo.java diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/CellInfo.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/CellInfo.java index e5a6ce4fa2..9f83b99234 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/CellInfo.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/CellInfo.java @@ -99,10 +99,13 @@ public class CellInfo implements Info { if (title.getTextObject() instanceof Formula) { Formula formula = (Formula) title.getTextObject(); updateOldStr(formula.getContent(), findStr); + ShowValueUtils.updateAfterReplaceStr(info, formula.getContent(), findStr, replaceStr); formula.setContent(ShowValueUtils.replaceAll(formula.getContent(), findStr, replaceStr)); } else { updateOldStr(GeneralUtils.objectToString(title.getTextObject()), findStr); - title.setTextObject(ShowValueUtils.replaceAll(GeneralUtils.objectToString(title.getTextObject()), findStr, replaceStr)); + String str = GeneralUtils.objectToString(title.getTextObject()); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + title.setTextObject(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } } else { CellValueType cellValueType = CellValueType.match(cellElement.getValue().getClass().getSimpleName()); @@ -110,7 +113,9 @@ public class CellInfo implements Info { cellValueType.setValue(this, cellElement.getValue(), findStr, replaceStr); } else { updateOldStr(GeneralUtils.objectToString(cellElement.getValue()), findStr); - cellElement.setValue(ShowValueUtils.replaceAll(GeneralUtils.objectToString(cellElement.getValue()), findStr, replaceStr)); + String str = GeneralUtils.objectToString(cellElement.getValue()); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + cellElement.setValue(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } } @@ -205,7 +210,9 @@ public class CellInfo implements Info { @Override public void setValue(CellInfo cellInfo, Object o, String findStr, String replaceStr) { cellInfo.updateOldStr(GeneralUtils.objectToString(((DSColumn) o).getDSName()), findStr); - ((DSColumn) o).setDSName(ShowValueUtils.replaceAll(((DSColumn) o).getDSName(), findStr, replaceStr)); + String str = ((DSColumn) o).getDSName(); + ShowValueUtils.updateAfterReplaceStr(cellInfo, str, findStr, replaceStr); + ((DSColumn) o).setDSName(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } @Override @@ -226,7 +233,9 @@ public class CellInfo implements Info { @Override public void setValue(CellInfo cellInfo, Object o, String findStr, String replaceStr) { cellInfo.updateOldStr(GeneralUtils.objectToString(o), findStr); - ((Formula) o).setContent(ShowValueUtils.replaceAll(((Formula) o).getContent(), findStr, replaceStr)); + String str = ((Formula) o).getContent(); + ShowValueUtils.updateAfterReplaceStr(cellInfo, str, findStr, replaceStr); + ((Formula) o).setContent(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } @Override @@ -243,8 +252,10 @@ public class CellInfo implements Info { @Override public void setValue(CellInfo cellInfo, Object o, String findStr, String replaceStr) { LinkWorkBookTemplate workBookTemplate = (LinkWorkBookTemplate) ((SubReport) o).getPackee(); - cellInfo.updateOldStr(workBookTemplate.getTemplatePath(), findStr); - workBookTemplate.setTemplatePath(ShowValueUtils.replaceAll(workBookTemplate.getTemplatePath(), findStr, replaceStr)); + String str = workBookTemplate.getTemplatePath(); + cellInfo.updateOldStr(str, findStr); + ShowValueUtils.updateAfterReplaceStr(cellInfo, str, findStr, replaceStr); + workBookTemplate.setTemplatePath(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } @Override @@ -267,8 +278,10 @@ public class CellInfo implements Info { BIAS_TEXT_PAINTER("BiasTextPainter") { @Override public void setValue(CellInfo cellInfo, Object o, String findStr, String replaceStr) { - cellInfo.updateOldStr(((BiasTextPainter) o).getText(), findStr); - ((BiasTextPainter) o).setText(ShowValueUtils.replaceAll(((BiasTextPainter) o).getText(), findStr, replaceStr)); + String str = ((BiasTextPainter) o).getText(); + cellInfo.updateOldStr(str, findStr); + ShowValueUtils.updateAfterReplaceStr(cellInfo, str, findStr, replaceStr); + ((BiasTextPainter) o).setText(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } @Override diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ConnectionInfo.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ConnectionInfo.java new file mode 100644 index 0000000000..b88c8c6e07 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ConnectionInfo.java @@ -0,0 +1,28 @@ +package com.fr.design.actions.replace.info; + +import com.fr.design.actions.replace.info.base.ITContent; + +/** + * 存储数据连接 + * + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-10-26 + */ +public class ConnectionInfo implements Info { + private ITContent content; + + + public ConnectionInfo(ITContent content) { + this.content = content; + } + + @Override + public ITContent getContent() { + return content; + } + + public void setContent(ITContent content) { + this.content = content; + } +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/DSColumnInfo.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/DSColumnInfo.java new file mode 100644 index 0000000000..f51a75fe5c --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/DSColumnInfo.java @@ -0,0 +1,28 @@ +package com.fr.design.actions.replace.info; + +import com.fr.design.actions.replace.info.base.ITContent; + +/** + * 存储数据列 + * + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-10-26 + */ +public class DSColumnInfo implements Info { + private ITContent content; + + + public DSColumnInfo(ITContent content) { + this.content = content; + } + + @Override + public ITContent getContent() { + return content; + } + + public void setContent(ITContent content) { + this.content = content; + } +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/FloatInfo.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/FloatInfo.java index 2bf794ab80..187b5c4f8a 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/FloatInfo.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/FloatInfo.java @@ -92,20 +92,26 @@ public class FloatInfo implements Info { if (title.getTextObject() instanceof Formula) { Formula formula = (Formula) title.getTextObject(); updateOldStr(formula.getContent(), findStr); + ShowValueUtils.updateAfterReplaceStr(info, formula.getContent(), findStr, replaceStr); formula.setContent(ShowValueUtils.replaceAll(formula.getContent(), findStr, replaceStr)); } else { - updateOldStr(GeneralUtils.objectToString(title.getTextObject()), findStr); - title.setTextObject(ShowValueUtils.replaceAll(GeneralUtils.objectToString(title.getTextObject()), findStr, replaceStr)); + String str = GeneralUtils.objectToString(title.getTextObject()); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + updateOldStr(str, findStr); + title.setTextObject(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } } else { FloatElement floatElement = ((FloatElement) this.getContent().getReplaceObject()); if (floatElement.getValue() instanceof Formula) { Formula formula = (Formula) floatElement.getValue(); updateOldStr(formula.getContent(), findStr); + ShowValueUtils.updateAfterReplaceStr(info, formula.getContent(), findStr, replaceStr); formula.setContent(ShowValueUtils.replaceAll(formula.getContent(), findStr, replaceStr)); } else { - updateOldStr(GeneralUtils.objectToString(floatElement.getValue()), findStr); - floatElement.setValue(ShowValueUtils.replaceAll(GeneralUtils.objectToString(floatElement.getValue()), findStr, replaceStr)); + String str = GeneralUtils.objectToString(floatElement.getValue()); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + updateOldStr(str, findStr); + floatElement.setValue(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/Info.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/Info.java index 3f5a30d860..6f26be2595 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/Info.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/Info.java @@ -40,6 +40,4 @@ public interface Info extends DealWithInfoValue { //todo 完善所有类型的校验 return true; } - - ; } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/JSInfo.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/JSInfo.java index 3f0632fe84..3718381f12 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/JSInfo.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/JSInfo.java @@ -1,6 +1,7 @@ package com.fr.design.actions.replace.info; +import com.fr.design.actions.replace.action.content.js.JSCheckType; import com.fr.design.actions.replace.info.base.ITContent; import com.fr.stable.AssistUtils; diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java index 48a4dbf644..140245cc9b 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java @@ -2,6 +2,7 @@ package com.fr.design.actions.replace.info; import com.fr.data.impl.DBTableData; import com.fr.design.DesignModelAdapter; +import com.fr.design.actions.replace.action.content.js.JSCheckType; import com.fr.design.actions.replace.utils.ShowValueUtils; import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.datapane.TableDataTreePane; @@ -47,10 +48,12 @@ public enum ReplaceObject implements DealWithInfoValue { if (((JSInfo) info).isContent()) { JavaScriptImpl javaScript = (JavaScriptImpl) ((NameJavaScript) (info.getContent().getReplaceObject())).getJavaScript(); info.updateOldStr(javaScript.getContent(), findStr); + ShowValueUtils.updateAfterReplaceStr(info, javaScript.getContent(), findStr, replaceStr); javaScript.setContent(ShowValueUtils.replaceAll(javaScript.getContent(), findStr, replaceStr)); } else { NameJavaScript javaScript = ((NameJavaScript) (info.getContent().getReplaceObject())); info.updateOldStr(javaScript.getName(), findStr); + ShowValueUtils.updateAfterReplaceStr(info, javaScript.getName(), findStr, replaceStr); javaScript.setName(ShowValueUtils.replaceAll(javaScript.getName(), findStr, replaceStr)); } } @@ -94,10 +97,12 @@ public enum ReplaceObject implements DealWithInfoValue { if (((JSInfo) info).isContent()) { JavaScriptImpl javaScript = (JavaScriptImpl) ((Listener) (info.getContent().getReplaceObject())).getAction(); info.updateOldStr(javaScript.getContent(), findStr); + ShowValueUtils.updateAfterReplaceStr(info, javaScript.getContent(), findStr, replaceStr); javaScript.setContent(ShowValueUtils.replaceAll(javaScript.getContent(), findStr, replaceStr)); } else { Listener listener = ((Listener) ((info.getContent().getReplaceObject()))); info.updateOldStr(listener.getName(), findStr); + ShowValueUtils.updateAfterReplaceStr(info, listener.getName(), findStr, replaceStr); listener.setName(ShowValueUtils.replaceAll(listener.getName(), findStr, replaceStr)); } } @@ -141,6 +146,7 @@ public enum ReplaceObject implements DealWithInfoValue { VanChartHtmlLabel htmlLabel = ((VanChartHtmlLabel) (info.getContent().getReplaceObject())); StringBuilder stringBuilder = new StringBuilder(htmlLabel.getCustomText()); info.updateOldStr(htmlLabel.getCustomText(), findStr); + ShowValueUtils.updateAfterReplaceStr(info, htmlLabel.getCustomText(), findStr, replaceStr); htmlLabel.setCustomText(ShowValueUtils.replaceAll(htmlLabel.getCustomText(), findStr, replaceStr)); } } @@ -175,6 +181,7 @@ public enum ReplaceObject implements DealWithInfoValue { public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { JavaScriptImpl javaScript = (JavaScriptImpl) (info.getContent().getReplaceObject()); info.updateOldStr(javaScript.getContent(), findStr); + ShowValueUtils.updateAfterReplaceStr(info, javaScript.getContent(), findStr, replaceStr); javaScript.setContent(ShowValueUtils.replaceAll(javaScript.getContent(), findStr, replaceStr)); } @@ -209,6 +216,7 @@ public enum ReplaceObject implements DealWithInfoValue { String jsName = GeneralUtils.objectToString(info.getContent().getReplaceObject()); for (int i = 0, len = jsImports.size(); i < len; i++) { if (StringUtils.equals(jsImports.get(i), jsName)) { + ShowValueUtils.updateAfterReplaceStr(info, jsName, findStr, replaceStr); jsImports.set(i, ShowValueUtils.replaceAll(jsName, findStr, replaceStr)); } } @@ -234,22 +242,23 @@ public enum ReplaceObject implements DealWithInfoValue { */ DB_TABLE_DATA("DBTableData") { @Override - boolean check (Info info){ + boolean check(Info info) { DBTableData dbTableData = (DBTableData) info.getContent().getReplaceObject(); return StringUtils.equals(dbTableData.getQuery(), info.getContent().getOldShowStr()); } @Override - public Map getValue (Object...o){ + public Map getValue(Object... o) { HashMap map = new HashMap<>(); addValue2Map(contentKey, ((DBTableData) o[0]).getQuery(), map); return map; } @Override - public void setValue (Info info, String findStr, String replaceStr, List < Pair < Integer, Integer >> operatorArray){ + public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { DBTableData dbTableData = (DBTableData) info.getContent().getReplaceObject(); info.updateOldStr(dbTableData.getQuery(), findStr); + ShowValueUtils.updateAfterReplaceStr(info, dbTableData.getQuery(), findStr, replaceStr); dbTableData.setQuery(ShowValueUtils.replaceAll(dbTableData.getQuery(), findStr, replaceStr)); //清除缓存 DesignTableDataManager.removeSelectedColumnNames(dbTableData.getName()); @@ -258,7 +267,7 @@ public enum ReplaceObject implements DealWithInfoValue { } @Override - public String getInfoShowStr (Info info){ + public String getInfoShowStr(Info info) { return info.getInfoShowStr(info); } }; @@ -304,4 +313,18 @@ public enum ReplaceObject implements DealWithInfoValue { abstract boolean check(Info info); + + /** + * 修改会引入新对象的放入这里检查 + * + * @param info + * @return + */ + public boolean checkQuote(Info info) { + JSCheckType o = JSCheckType.match(info.getContent().getTag()); + if (o != null) { + return o.check(info); + } + return true; } +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/WidgetInfo.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/WidgetInfo.java index 8f44967a9c..afdf098028 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/WidgetInfo.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/WidgetInfo.java @@ -66,10 +66,13 @@ public class WidgetInfo implements Info, DealWithInfoValue { } } else { if (isWaterMark()) { - updateOldStr(((WaterMark) widget).getWaterMark(), findStr); - ((WaterMark) widget).setWaterMark(ShowValueUtils.replaceAll(((WaterMark) widget).getWaterMark(), findStr, replaceStr)); + String str = ((WaterMark) widget).getWaterMark(); + updateOldStr(str, findStr); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + ((WaterMark) widget).setWaterMark(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } else { updateOldStr(widget.getWidgetName(), findStr); + ShowValueUtils.updateAfterReplaceStr(info, widget.getWidgetName(), findStr, replaceStr); widget.setWidgetName(ShowValueUtils.replaceAll(widget.getWidgetName(), findStr, replaceStr)); } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/ITContent.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/ITContent.java index ee83e77534..aecbe2ed10 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/ITContent.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/ITContent.java @@ -77,6 +77,16 @@ public class ITContent implements Cloneable { */ private int tag = -1; + /** + * 替换后内容 + */ + private String afterReplaceStr; + + /** + * 是否替换过 + */ + private boolean replaced = false; + public ITContent() { this.sheetID = StringUtils.EMPTY; this.sheetName = StringUtils.EMPTY; @@ -92,6 +102,7 @@ public class ITContent implements Cloneable { this.operatorArray = new ArrayList<>(); this.holdObject = new Object(); this.templatePath = StringUtils.EMPTY; + this.afterReplaceStr = StringUtils.EMPTY; } @@ -102,7 +113,7 @@ public class ITContent implements Cloneable { */ public static ITContent copy(ITContent content) { ITContent result = new ITContent(); - if (content != null){ + if (content != null) { result.setSheetID(content.getSheetID()); result.setSheetName(content.getSheetName()); result.setTemplateName(content.getTemplateName()); @@ -120,6 +131,8 @@ public class ITContent implements Cloneable { result.setHoldObject(content.getHoldObject()); result.setTag(content.getTag()); result.setTemplatePath(content.getTemplatePath()); + result.setAfterReplaceStr(content.getAfterReplaceStr()); + result.setReplaced(content.isReplaced()); } return result; } @@ -216,6 +229,22 @@ public class ITContent implements Cloneable { this.templatePath = templatePath; } + public String getAfterReplaceStr() { + return afterReplaceStr; + } + + public void setAfterReplaceStr(String afterReplaceStr) { + this.afterReplaceStr = afterReplaceStr; + } + + public boolean isReplaced() { + return replaced; + } + + public void setReplaced(boolean replaced) { + this.replaced = replaced; + } + /** * 添加位置信息 * From bdb3e25edeb355538b396dfa94744504ce9351a4 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 27 Oct 2022 15:38:25 +0800 Subject: [PATCH 106/310] =?UTF-8?q?REPORT-80695=20=E3=80=90=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E5=85=A8=E5=B1=80=E7=BA=A7=E5=88=AB=E6=9F=A5=E6=89=BE?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E4=BA=8C=E6=9C=9F=E3=80=91=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=A1=B9=E4=B8=BB=E8=A6=81=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/replace/action/ShowValue.java | 22 +- .../action/setting/CellFormatType.java | 257 ++++++++++++ .../replace/action/setting/CellGroupType.java | 246 ++++++++++++ .../action/setting/SettingContent.java | 72 ++++ .../action/setting/SettingController.java | 374 ++++++++++++++++++ .../action/SearchCellDSColumnAction.java | 82 ++++ .../action/SearchCellFormatAction.java | 92 +++++ .../action/SearchConnectionAction.java | 108 +++++ .../setting/action/SearchDSColumnAction.java | 87 ++++ 9 files changed, 1338 insertions(+), 2 deletions(-) create mode 100644 designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellFormatType.java create mode 100644 designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellGroupType.java create mode 100644 designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingContent.java create mode 100644 designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingController.java create mode 100644 designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchCellDSColumnAction.java create mode 100644 designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchCellFormatAction.java create mode 100644 designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchConnectionAction.java create mode 100644 designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchDSColumnAction.java diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/ShowValue.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/ShowValue.java index 02ded341eb..34211f1f8a 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/ShowValue.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/ShowValue.java @@ -3,6 +3,7 @@ package com.fr.design.actions.replace.action; import com.fr.design.actions.replace.info.Info; import com.fr.design.mainframe.JTemplate; +import java.util.ArrayList; import java.util.List; /** @@ -20,7 +21,9 @@ public interface ShowValue { * @param jTemplate * @return */ - List showSearchValue(JTemplate jTemplate); + default List showSearchValue(JTemplate jTemplate) { + return new ArrayList<>(); + } /** * 对搜索结果进行过滤 @@ -29,6 +32,21 @@ public interface ShowValue { * @param list * @return */ - List addMatchResult(String str, List list); + default List addMatchResult(String str, List list) { + return new ArrayList<>(); + } + + /** + * 对搜索结果进行过滤(多个过滤条件,主要针对设置项) + * + * @param list + * @param settingStr + * @param extraStr + * @return + */ + default List addMatchResult(List list, String settingStr, String extraStr) { + return new ArrayList<>(); + } + } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellFormatType.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellFormatType.java new file mode 100644 index 0000000000..9f77d7d2b4 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellFormatType.java @@ -0,0 +1,257 @@ +package com.fr.design.actions.replace.action.setting; + +import com.fr.base.CoreDecimalFormat; +import com.fr.base.NameStyle; +import com.fr.base.TextFormat; +import com.fr.data.core.FormatField; +import com.fr.design.actions.replace.info.Info; +import com.fr.general.date.FineDateFormat; +import com.fr.report.cell.CellElement; +import com.fr.stable.StringUtils; +import org.jetbrains.annotations.Nullable; + +import java.text.Format; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-10-25 + */ +public enum CellFormatType { + + /** + * 单元格-格式-数字 + */ + CELL_FORMAT_NUMBER(SettingContent.FORMAT_NUMBER) { + @Override + public boolean hasExpand(String parentStr) { + return true; + } + + @Override + public List getItems() { + return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_NUMBER))); + } + + @Override + public boolean isNeed(CellElement cellElement, String firstStr, String secondStr) { + Format format = cellElement.getStyle().getFormat(); + return format instanceof CoreDecimalFormat && StringUtils.equals(((CoreDecimalFormat) format).toPattern(), secondStr); + } + }, + /** + * 单元格-格式-常规 + */ + CELL_FORMAT_COMMON(SettingContent.FORMAT_COMMON) { + @Override + public List getItems() { + return super.getItems(); + } + + @Override + public boolean isNeed(CellElement cellElement, String firstStr, String secondStr) { + return cellElement.getStyle().getFormat() == null; + } + }, + /** + * 单元格-格式-货币 + */ + CELL_FORMAT_MONEY(SettingContent.FORMAT_MONEY) { + @Override + public boolean hasExpand(String parentStr) { + return true; + } + + @Override + public List getItems() { + return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_MONEY))); + } + + @Override + public boolean isNeed(CellElement cellElement, String firstStr, String secondStr) { + Format format = cellElement.getStyle().getFormat(); + return format instanceof CoreDecimalFormat && StringUtils.equals(((CoreDecimalFormat) format).toPattern(), secondStr); + } + }, + /** + * 单元格-格式-日期 + */ + CELL_FORMAT_DATE(SettingContent.FORMAT_DATE) { + @Override + public boolean hasExpand(String parentStr) { + return true; + } + + @Override + public List getItems() { + return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_DATE))); + } + + @Override + public boolean isNeed(CellElement cellElement, String firstStr, String secondStr) { + Format format = cellElement.getStyle().getFormat(); + return format instanceof FineDateFormat && StringUtils.equals(((FineDateFormat) format).toPattern(), secondStr); + } + }, + /** + * 单元格-格式-时间 + */ + CELL_FORMAT_TIME(SettingContent.FORMAT_TIME) { + @Override + public boolean hasExpand(String parentStr) { + return true; + } + + @Override + public List getItems() { + return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_TIME))); + } + + @Override + public boolean isNeed(CellElement cellElement, String firstStr, String secondStr) { + Format format = cellElement.getStyle().getFormat(); + return format instanceof FineDateFormat && StringUtils.equals(((FineDateFormat) format).toPattern(), secondStr); + } + }, + /** + * 单元格-格式-科学计数 + */ + CELL_FORMAT_SCIENCE(SettingContent.FORMAT_SCIENCE) { + @Override + public boolean hasExpand(String parentStr) { + return true; + } + + @Override + public List getItems() { + return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_SCIENCE))); + } + + @Override + public boolean isNeed(CellElement cellElement, String firstStr, String secondStr) { + Format format = cellElement.getStyle().getFormat(); + return format instanceof CoreDecimalFormat && StringUtils.equals(((CoreDecimalFormat) format).toPattern(), secondStr); + } + }, + /** + * 单元格-格式-百分比 + */ + CELL_FORMAT_PERCENT(SettingContent.FORMAT_PERCENT) { + @Override + public boolean hasExpand(String parentStr) { + return true; + } + + @Override + public List getItems() { + return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_PERCENT))); + } + + @Override + public boolean isNeed(CellElement cellElement, String firstStr, String secondStr) { + Format format = cellElement.getStyle().getFormat(); + return format instanceof CoreDecimalFormat && StringUtils.equals(((CoreDecimalFormat) format).toPattern(), secondStr); + } + }, + /** + * 单元格-格式-千分比 + */ + CELL_FORMAT_PERMILLAGE(SettingContent.FORMAT_PERMILLAGE) { + @Override + public boolean hasExpand(String parentStr) { + return true; + } + + @Override + public List getItems() { + return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_PERMILLAGE))); + } + + @Override + public boolean isNeed(CellElement cellElement, String firstStr, String secondStr) { + Format format = cellElement.getStyle().getFormat(); + return format instanceof CoreDecimalFormat && StringUtils.equals(((CoreDecimalFormat) format).toPattern(), secondStr); + } + }, + /** + * 单元格-格式-文本 + */ + CELL_FORMAT_TEXT(SettingContent.FORMAT_TEXT) { + @Override + public boolean isNeed(CellElement cellElement, String firstStr, String secondStr) { + Format format = cellElement.getStyle().getFormat(); + return format instanceof TextFormat; + } + }; + + + private String name; + + CellFormatType(String name) { + this.name = name; + } + + + /** + * 匹配 + * + * @param name + * @return + */ + @Nullable + public static CellFormatType match(String name) { + CellFormatType[] values = CellFormatType.values(); + for (CellFormatType value : values) { + if (StringUtils.equals(value.name, name)) { + return value; + } + } + return null; + } + + /** + * 是否能扩展选项 + * + * @return 能扩展则返回true + */ + public boolean hasExpand(String parentStr) { + return false; + } + + /** + * 获取界面数据 + */ + public List getItems() { + return new ArrayList<>(); + } + + /** + * 是否是要查找的内容 + * + * @param cellElement + * @param firstStr + * @param secondStr + * @return + */ + public boolean isNeed(CellElement cellElement, String firstStr, String secondStr) { + return false; + } + + /** + * 替换 + * + * @param info 存储信息的数据结构 + * @param firstStr 用户输入的第一级下拉框内容 + * @param secondStr 用户输入的第二级下拉框内容 + */ + public void replace(Info info, String firstStr, String secondStr) { + CellElement cellElement = (CellElement) info.getContent().getReplaceObject(); + cellElement.setStyle(cellElement.getStyle().deriveFormat(FormatField.getInstance().getFormat(FormatField.getInstance().getContents(firstStr), secondStr))); + if (cellElement.getStyle() instanceof NameStyle) { + ((NameStyle) cellElement.getStyle()).refreshStyle(); + } + } +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellGroupType.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellGroupType.java new file mode 100644 index 0000000000..8e769b4715 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellGroupType.java @@ -0,0 +1,246 @@ +package com.fr.design.actions.replace.action.setting; + + +import com.fr.data.util.function.AverageFunction; +import com.fr.data.util.function.CountFunction; +import com.fr.data.util.function.DataFunction; +import com.fr.data.util.function.MaxFunction; +import com.fr.data.util.function.MinFunction; +import com.fr.data.util.function.NoneFunction; +import com.fr.data.util.function.SumFunction; +import com.fr.design.actions.replace.info.Info; +import com.fr.report.cell.CellElement; +import com.fr.report.cell.cellattr.core.group.DSColumn; +import com.fr.report.cell.cellattr.core.group.FunctionGrouper; +import com.fr.report.cell.cellattr.core.group.RecordGrouper; +import com.fr.report.cell.cellattr.core.group.SummaryGrouper; +import com.fr.stable.StringUtils; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 处理单元格的格式(对于高级,由于需要自定义,不加入处理范围) + * + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-10-26 + */ +public enum CellGroupType { + + /** + * 分组 + */ + GROUP(SettingContent.DIGIT_SETTING_GROUP) { + @Override + public List getItems() { + List items = new ArrayList() { + { + add(SettingContent.GROUP_COMMON); + add(SettingContent.GROUP_CONTINUUM); + } + }; + return items; + } + + + @Override + public boolean isNeed(CellElement cellElement, String firstStr, String secondStr) { + DSColumn column = (DSColumn) cellElement.getValue(); + RecordGrouper grouper = column.getGrouper(); + return grouper instanceof FunctionGrouper && grouper.getDivideMode() == getGroupType(secondStr); + } + + }, + /** + * 列表 + */ + LIST(SettingContent.DIGIT_SETTING_LIST) { + @Override + public boolean hasExpand(String parentStr) { + return false; + } + + + @Override + public boolean isNeed(CellElement cellElement, String firstStr, String secondStr) { + DSColumn column = (DSColumn) cellElement.getValue(); + RecordGrouper grouper = column.getGrouper(); + return grouper instanceof FunctionGrouper && grouper.getDivideMode() == getGroupType(firstStr); + } + }, + /** + * 汇总 + */ + SUM(SettingContent.DIGIT_SETTING_SUM) { + @Override + public List getItems() { + List items = new ArrayList() { + { + add(SettingContent.SUMMARY_SUM); + add(SettingContent.SUMMARY_AVERAGE); + add(SettingContent.SUMMARY_MAX); + add(SettingContent.SUMMARY_MIN); + add(SettingContent.SUMMARY_COUNT); + add(SettingContent.SUMMARY_NONE); + } + }; + return items; + } + + @Override + public boolean isNeed(CellElement cellElement, String firstStr, String secondStr) { + DSColumn column = (DSColumn) cellElement.getValue(); + RecordGrouper grouper = column.getGrouper(); + return grouper instanceof SummaryGrouper && ((SummaryGrouper) grouper).getFunction() != null && StringUtils.equals(((SummaryGrouper) grouper).getFunction().getClass().getSimpleName(), getSummaryType(secondStr)); + } + + @Override + public void replace(Info info, String firstStr, String secondStr) { + SummaryGrouper grouper = new SummaryGrouper(); + grouper.setFunction(createDataFunction(secondStr)); + CellElement cellElement = (CellElement) info.getContent().getReplaceObject(); + DSColumn column = (DSColumn) cellElement.getValue(); + column.setGrouper(grouper); + } + }; + + private String name; + + private Map groupMap = new HashMap() { + { + put(SettingContent.GROUP_COMMON, FunctionGrouper.GROUPING_MODE); + put(SettingContent.GROUP_CONTINUUM, FunctionGrouper.CONTINUUM_MODE); + put(SettingContent.DIGIT_LIST, FunctionGrouper.LIST_MODE); + } + }; + private Map summaryMap = new HashMap() { + { + put(SettingContent.SUMMARY_SUM, SUM_FUNCTION); + put(SettingContent.SUMMARY_AVERAGE, AVERAGE_FUNCTION); + put(SettingContent.SUMMARY_MAX, MAX_FUNCTION); + put(SettingContent.SUMMARY_MIN, MIN_FUNCTION); + put(SettingContent.SUMMARY_COUNT, COUNT_FUNCTION); + put(SettingContent.SUMMARY_NONE, NONE_FUNCTION); + } + }; + + public static final String SUM_FUNCTION = "SumFunction"; + public static final String AVERAGE_FUNCTION = "AverageFunction"; + public static final String MAX_FUNCTION = "MaxFunction"; + public static final String MIN_FUNCTION = "MinFunction"; + public static final String COUNT_FUNCTION = "CountFunction"; + public static final String NONE_FUNCTION = "NoneFunction"; + + + CellGroupType(String name) { + this.name = name; + } + + + /** + * 匹配 + * + * @param name + * @return + */ + @Nullable + public static CellGroupType match(String name) { + CellGroupType[] values = CellGroupType.values(); + for (CellGroupType value : values) { + if (StringUtils.equals(value.name, name)) { + return value; + } + } + return null; + } + + /** + * 是否是要查找的内容 + * + * @param cellElement + * @param firstStr + * @param secondStr + * @return + */ + public boolean isNeed(CellElement cellElement, String firstStr, String secondStr) { + DSColumn column = (DSColumn) cellElement.getValue(); + RecordGrouper recordGrouper = column.getGrouper(); + return recordGrouper instanceof FunctionGrouper && recordGrouper.getDivideMode() == getGroupType(secondStr); + } + + /** + * 匹配分组 + * + * @param str + * @return + */ + public Integer getGroupType(String str) { + return groupMap.getOrDefault(str, -1); + } + + /** + * 匹配汇总 + */ + public String getSummaryType(String str) { + return summaryMap.getOrDefault(str, StringUtils.EMPTY); + } + + /** + * 创建对应汇总的DataFunction + * + * @param str 汇总子级下拉框的内容 + * @return 指定类型的DataFunction + */ + public DataFunction createDataFunction(String str) { + switch (getSummaryType(str)) { + case SUM_FUNCTION: + return new SumFunction(); + case AVERAGE_FUNCTION: + return new AverageFunction(); + case MAX_FUNCTION: + return new MaxFunction(); + case MIN_FUNCTION: + return new MinFunction(); + case COUNT_FUNCTION: + return new CountFunction(); + case NONE_FUNCTION: + return new NoneFunction(); + } + return new NoneFunction(); + } + + /** + * 是否能扩展选项 + * + * @return 能扩展则返回true + */ + public boolean hasExpand(String parentStr) { + return true; + } + + /** + * 获取界面数据 + */ + public List getItems() { + return new ArrayList<>(); + } + + /** + * 替换 + * + * @param info 存储信息的数据结构 + * @param firstStr 用户输入的第一级下拉框 + * @param secondStr 用户输入的第二级下拉框 + */ + public void replace(Info info, String firstStr, String secondStr) { + FunctionGrouper grouper = new FunctionGrouper(); + grouper.setDivideMode(getGroupType(secondStr)); + CellElement cellElement = (CellElement) info.getContent().getReplaceObject(); + DSColumn column = (DSColumn) cellElement.getValue(); + column.setGrouper(grouper); + } +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingContent.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingContent.java new file mode 100644 index 0000000000..67211b77e9 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingContent.java @@ -0,0 +1,72 @@ +package com.fr.design.actions.replace.action.setting; + +import com.fr.design.actions.replace.utils.ShowValueUtils; +import com.fr.design.i18n.Toolkit; + +/** + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-10-24 + */ +public class SettingContent { + + public static final String CELL_FORMAT_NAME = ShowValueUtils.joinStr4Position(Toolkit.i18nText("Fine-Design_Basic_Cell"), Toolkit.i18nText("Fine-Design_Report_Base_Format")); + public static final String CELL_DATA_SETTING_NAME = ShowValueUtils.joinStr4Position(Toolkit.i18nText("Fine-Design_Basic_Cell"), Toolkit.i18nText("Fine-Design_Chart_Data_Setting")); + public static final String CELL_DS_COLUMN_NAME = ShowValueUtils.joinStr4Position(Toolkit.i18nText("Fine-Design_Basic_Cell"), Toolkit.i18nText("Fine-Design_Basic_DS_Column")); + public static final String DATASOURCE_CONNECTION_NAME = ShowValueUtils.joinStr4Position(Toolkit.i18nText("Fine-Design_Replace_Data_Source"), Toolkit.i18nText("Fine-Design_Replace_Data_Connection")); + public static final String DATASOURCE_COLLECT_NAME = ShowValueUtils.joinStr4Position(Toolkit.i18nText("Fine-Design_Replace_Data_Source"), Toolkit.i18nText("Fine-Design_Replace_Data_Collect")); + + /** + * 单元格-格式 + */ + public static final String FORMAT_COMMON = Toolkit.i18nText("Fine-Design_Replace_Common"); + public static final String FORMAT_NUMBER = Toolkit.i18nText("Fine-Design_Replace_Number"); + public static final String FORMAT_MONEY = Toolkit.i18nText("Fine-Design_Replace_Money"); + public static final String FORMAT_PERCENT = Toolkit.i18nText("Fine-Design_Replace_Percent"); + public static final String FORMAT_PERMILLAGE = Toolkit.i18nText("Fine-Design_Replace_Permillage"); + public static final String FORMAT_SCIENCE = Toolkit.i18nText("Fine-Design_Replace_Science"); + public static final String FORMAT_DATE = Toolkit.i18nText("Fine-Design_Replace_Date"); + public static final String FORMAT_TIME = Toolkit.i18nText("Fine-Design_Replace_Time"); + public static final String FORMAT_TEXT = Toolkit.i18nText("Fine-Design_Replace_Text"); + + + /** + * 单元格-数据设置 + */ + public static final String DIGIT_SETTING_GROUP = Toolkit.i18nText("Fine-Design_Replace_Group"); + public static final String DIGIT_SETTING_LIST = Toolkit.i18nText("Fine-Design_Replace_List"); + public static final String DIGIT_SETTING_SUM = Toolkit.i18nText("Fine-Design_Replace_Sum"); + + /** + * 单元格-数据设置-分组 + */ + public static final String GROUP_COMMON = Toolkit.i18nText("Fine-Design_Report_Common"); + public static final String GROUP_CONTINUUM = Toolkit.i18nText("Fine-Design_Report_Continuum"); + + /** + * 单元格-数据设置-列表 + */ + public static final String DIGIT_LIST = Toolkit.i18nText("Fine-Design_Report_Bind_Column_Select"); + + /** + * 单元格-数据设置-汇总 + */ + public static final String SUMMARY_SUM = Toolkit.i18nText("Fine-Design_DataFunction_Sum"); + public static final String SUMMARY_AVERAGE = Toolkit.i18nText("Fine-Design_DataFunction_Average"); + public static final String SUMMARY_MAX = Toolkit.i18nText("Fine-Design_DataFunction_Max"); + public static final String SUMMARY_MIN = Toolkit.i18nText("Fine-Design_DataFunction_Min"); + public static final String SUMMARY_COUNT = Toolkit.i18nText("Fine-Design_DataFunction_Count"); + public static final String SUMMARY_NONE = Toolkit.i18nText("Fine-Design_DataFunction_None"); + + /** + * 数据连接 + */ + public static final String CONNECTION_TEMPLATE = Toolkit.i18nText("Fine-Design_Basic_DS_Report_TableData"); + + /** + * 扩展出来的可能的选项 + */ + public static final String DS_COLUMN_EXPEND = "DS_COLUMN_EXPEND"; + + +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingController.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingController.java new file mode 100644 index 0000000000..fa7fcc0b09 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingController.java @@ -0,0 +1,374 @@ +package com.fr.design.actions.replace.action.setting; + + +import com.fr.data.TableDataSource; +import com.fr.design.actions.replace.action.ShowValue; +import com.fr.design.actions.replace.action.setting.action.SearchCellDSColumnAction; +import com.fr.design.actions.replace.action.setting.action.SearchCellFormatAction; +import com.fr.design.actions.replace.action.setting.action.SearchConnectionAction; +import com.fr.design.actions.replace.action.setting.action.SearchDSColumnAction; +import com.fr.design.actions.replace.info.CellInfo; +import com.fr.design.actions.replace.info.ConnectionInfo; +import com.fr.design.actions.replace.info.Info; +import com.fr.design.actions.replace.ui.ITReplaceNorthPanel; +import com.fr.design.data.DesignTableDataManager; +import com.fr.design.file.HistoryTemplateListCache; +import com.fr.design.mainframe.JTemplate; +import com.fr.file.ConnectionConfig; +import com.fr.general.data.TableDataColumn; +import com.fr.report.cell.CellElement; +import com.fr.report.cell.cellattr.core.group.DSColumn; +import com.fr.stable.StringUtils; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; + +/** + * 设置项的查找内容 + * + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-10-24 + */ +public enum SettingController implements ShowValue { + + /** + * 单元格-格式 + */ + CELL_FORMAT(SettingContent.CELL_FORMAT_NAME) { + @Override + public List getItems() { + return ITReplaceNorthPanel.formatItems; + } + + @Override + public List showSearchValue(JTemplate jTemplate) { + SearchCellFormatAction.getInstance().search4Infos(jTemplate); + return SearchCellFormatAction.getInstance().getCellInfos(); + } + + @Override + public List addMatchResult(List list, String settingStr, String extraStr) { + List cellInfos = new ArrayList<>(); + for (Info info : list) { + CellElement cellElement = (CellElement) info.getContent().getReplaceObject(); + CellFormatType type = CellFormatType.match(settingStr); + if (type != null && type.isNeed(cellElement, settingStr, extraStr)) { + cellInfos.add((CellInfo) info); + } + } + return cellInfos; + } + + @Override + public boolean hasExpand(String str, String parentStr) { + CellFormatType type = CellFormatType.match(parentStr); + if (type != null) { + return type.hasExpand(parentStr); + } + return false; + } + + @Override + public List getExtraItems(String str) { + CellFormatType type = CellFormatType.match(str); + if (type != null) { + return type.getItems(); + } + return new ArrayList<>(); + } + + @Override + public void replace(Info info, String firstStr, String secondStr) { + CellFormatType type = CellFormatType.match(firstStr); + if (type != null) { + type.replace(info, firstStr, secondStr); + } + } + }, + /** + * 单元格-数据设置 + */ + CELL_DATA_SETTING(SettingContent.CELL_DATA_SETTING_NAME) { + @Override + public List getItems() { + return ITReplaceNorthPanel.digitItems; + } + + @Override + public List showSearchValue(JTemplate jTemplate) { + SearchCellDSColumnAction.getInstance().search4Infos(jTemplate); + return SearchCellDSColumnAction.getInstance().getCellInfos(); + } + + @Override + public List addMatchResult(List list, String settingStr, String extraStr) { + List cellInfos = new ArrayList<>(); + for (Info info : list) { + CellElement cellElement = (CellElement) info.getContent().getReplaceObject(); + //能到这步说明单元格里是数据列 + CellGroupType cellGroupType = CellGroupType.match(settingStr); + if (cellGroupType != null && cellGroupType.isNeed(cellElement, settingStr, extraStr)) { + cellInfos.add((CellInfo) info); + } + } + return cellInfos; + } + + @Override + public List getExtraItems(String str) { + CellGroupType type = CellGroupType.match(str); + if (type != null) { + return type.getItems(); + } + return new ArrayList<>(); + } + + @Override + public boolean hasExpand(String str, String parentStr) { + CellGroupType type = CellGroupType.match(parentStr); + if (type != null) { + return type.hasExpand(parentStr); + } + return false; + } + + @Override + public void replace(Info info, String firstStr, String secondStr) { + CellGroupType type = CellGroupType.match(firstStr); + if (type != null) { + type.replace(info, firstStr, secondStr); + } + } + }, + /** + * 单元格-数据列 + */ + CELL_DS_COLUMN(SettingContent.CELL_DS_COLUMN_NAME) { + @Override + public List showSearchValue(JTemplate jTemplate) { + SearchCellDSColumnAction.getInstance().search4Infos(jTemplate); + return SearchCellDSColumnAction.getInstance().getCellInfos(); + } + + @Override + public List addMatchResult(List list, String settingStr, String extraStr) { + List cellInfos = new ArrayList<>(); + for (Info info : list) { + CellElement cellElement = (CellElement) info.getContent().getReplaceObject(); + //能到这步说明单元格里是数据列 + DSColumn dsColumn = (DSColumn) cellElement.getValue(); + if (isNeed(dsColumn, settingStr, extraStr)) { + cellInfos.add((CellInfo) info); + } + } + return cellInfos; + } + + public boolean isNeed(DSColumn dsColumn, String settingStr, String extraStr) { + return dsColumn != null && StringUtils.equals(settingStr, dsColumn.getDSName()) && dsColumn.getColumn() != null && StringUtils.equals(dsColumn.getColumnName(), extraStr); + } + + @Override + public List getItems() { + JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + List tableDataArray = new ArrayList<>(); + if (jTemplate != null && jTemplate.getTarget() instanceof TableDataSource) { + TableDataSource source = (TableDataSource) jTemplate.getTarget(); + Iterator dataIterator = source.getTableDataNameIterator(); + while (dataIterator.hasNext()) { + String dataName = (String) dataIterator.next(); + tableDataArray.add(dataName); + } + } + return tableDataArray; + } + + @Override + public List getExtraItems(String str) { + JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + List tableDataArray = new ArrayList<>(); + if (jTemplate != null) { + TableDataSource source = jTemplate.getTarget(); + tableDataArray = Arrays.asList(DesignTableDataManager.getSelectedColumnNames(source, str)); + } + return tableDataArray; + } + + @Override + public boolean hasExpand(String str, String parentStr) { + return true; + } + + @Override + public void replace(Info info, String firstStr, String secondStr) { + CellElement cellElement = (CellElement) info.getContent().getReplaceObject(); + DSColumn dsColumn = (DSColumn) cellElement.getValue(); + dsColumn.setDSName(firstStr); + dsColumn.setColumn(TableDataColumn.createColumn(secondStr)); + + } + }, + /** + * 数据源-数据连接 + */ + DATASOURCE_CONNECTION(SettingContent.DATASOURCE_CONNECTION_NAME) { + @Override + public List showSearchValue(JTemplate jTemplate) { + SearchConnectionAction.getInstance().search4Infos(jTemplate); + return SearchConnectionAction.getInstance().getConnectionInfos(); + } + + @Override + public List addMatchResult(List list, String settingStr, String extraStr) { + List connectionInfos = new ArrayList<>(); + for (Info info : list) { + if (StringUtils.equals(info.getContent().getShowStr(), settingStr)) { + connectionInfos.add((ConnectionInfo) info); + } + } + return connectionInfos; + + } + + @Override + public List getItems() { + List nameList = new ArrayList<>(); + for (String name : ConnectionConfig.getInstance().getConnections().keySet()) { + nameList.add(name); + } + return nameList; + } + + }, + /** + * 数据源-数据集 + */ + DATASOURCE_COLLECT(SettingContent.DATASOURCE_COLLECT_NAME) { + @Override + public List showSearchValue(JTemplate jTemplate) { + SearchDSColumnAction.getInstance().search4Infos(jTemplate); + return SearchDSColumnAction.getInstance().getDsColumnInfos(); + } + + + @Override + public List addMatchResult(List list, String settingStr, String extraStr) { + return list; + } + + @Override + public List getItems() { + return ITReplaceNorthPanel.dsColumnItems; + } + + + }; + + + private String name; + + SettingController(String name) { + this.name = name; + } + + + /** + * 匹配 + * + * @param name + * @return + */ + @Nullable + public static SettingController match(String name) { + SettingController[] values = SettingController.values(); + for (SettingController value : values) { + if (StringUtils.equals(value.name, name)) { + return value; + } + } + return null; + } + + /** + * 获取界面的数据,使之与选项匹配 + * + * @param name 选项 + */ + public static List getSettingRefreshItems(String name) { + SettingController[] values = SettingController.values(); + for (SettingController value : values) { + if (StringUtils.equals(value.name, name)) { + return value.getItems(); + } + } + return new ArrayList<>(); + } + + /** + * 获取界面的数据,使之与选项匹配 + * + * @param parentStr 选项 + */ + public static List getSettingExtraRefreshItems(String str, String parentStr) { + SettingController[] values = SettingController.values(); + for (SettingController value : values) { + if (StringUtils.equals(value.name, str)) { + return value.getExtraItems(parentStr); + } + } + return new ArrayList<>(); + } + + /** + * 获取界面数据 + */ + public List getItems() { + return new ArrayList<>(); + } + + /** + * 获取扩展数据 + * + * @param str 父类名称 + * @return 扩展的数据列表 + */ + public List getExtraItems(String str) { + return new ArrayList<>(); + } + + /** + * 是否能扩展选项 + * + * @return 能扩展则返回true + */ + public boolean hasExpand(String str, String parentStr) { + return false; + } + + /** + * 替换 + * + * @param info 存储信息的数据结构 + * @param firstStr 用户设定的第一级下拉框的内容 + * @param secondStr 用户设定的第二级下拉框的内容 + */ + public void replace(Info info, String firstStr, String secondStr) { + + } + + /** + * 是否修改过 + * + * @param info 存储信息的数据结构 + * @param inputStr 用户搜索的一级下拉框内容 + * @param extraStr 用户搜索的二级下拉框内容 + * @return 没修改过则返回false + */ + public boolean isEverChanged(Info info, String inputStr, String extraStr) { + return false; + } +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchCellDSColumnAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchCellDSColumnAction.java new file mode 100644 index 0000000000..3a79231867 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchCellDSColumnAction.java @@ -0,0 +1,82 @@ +package com.fr.design.actions.replace.action.setting.action; + +import com.fr.design.actions.replace.action.SearchAction; +import com.fr.design.actions.replace.action.content.cell.SearchCellAction; +import com.fr.design.actions.replace.info.CellInfo; +import com.fr.design.mainframe.JTemplate; +import com.fr.general.GeneralUtils; +import com.fr.report.cell.CellElement; +import com.fr.report.cell.cellattr.core.group.DSColumn; + +import java.util.ArrayList; +import java.util.List; + +/** + * 存储单元格-数据列 + * + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-10-26 + */ +public class SearchCellDSColumnAction implements SearchAction { + private List cellInfos = new ArrayList<>(); + + private SearchCellDSColumnAction() { + } + + @Override + public void search4Infos(JTemplate jTemplate) { + List cellInfos = new ArrayList<>(); + SearchCellAction.getInstance().search4Infos(jTemplate); + for (CellInfo info : SearchCellAction.getInstance().getCellInfos()) { + CellElement cellElement = (CellElement) info.getContent().getReplaceObject(); + if (cellElement.getValue() instanceof DSColumn) { + info.getContent().setShowStr(GeneralUtils.objectToString(cellElement.getValue())); + cellInfos.add(info); + } + } + setCellInfos(cellInfos); + } + + public List getCellInfos() { + return cellInfos; + } + + public void setCellInfos(List cellInfos) { + this.cellInfos = cellInfos; + } + + /** + * 对外开放的获取对象的方法 + * + * @return + */ + public static SearchCellDSColumnAction getInstance() { + return SearchCellDSColumnActionEnum.SINGLETON.getInstance(); + } + + /** + * 枚举实现单例 + */ + private enum SearchCellDSColumnActionEnum { + /** + * 单例 + */ + SINGLETON; + + private SearchCellDSColumnAction instance; + + SearchCellDSColumnActionEnum() { + instance = new SearchCellDSColumnAction(); + } + + /** + * 获取对象 + * + * @return + */ + public SearchCellDSColumnAction getInstance() { + return instance; + } + } +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchCellFormatAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchCellFormatAction.java new file mode 100644 index 0000000000..bd607c625b --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchCellFormatAction.java @@ -0,0 +1,92 @@ +package com.fr.design.actions.replace.action.setting.action; + +import com.fr.base.Formula; +import com.fr.design.actions.replace.action.SearchAction; +import com.fr.design.actions.replace.action.content.cell.SearchCellAction; +import com.fr.design.actions.replace.info.CellInfo; +import com.fr.design.mainframe.JTemplate; +import com.fr.general.GeneralUtils; +import com.fr.report.cell.CellElement; +import com.fr.report.cell.cellattr.core.group.DSColumn; + +import java.util.ArrayList; +import java.util.List; + +/** + * 存储有格式的单元格 + * + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-10-25 + */ +public class SearchCellFormatAction implements SearchAction { + private List cellInfos = new ArrayList<>(); + + private SearchCellFormatAction() { + } + + @Override + public void search4Infos(JTemplate jTemplate) { + List cellInfos = new ArrayList<>(); + SearchCellAction.getInstance().search4Infos(jTemplate); + for (CellInfo info : SearchCellAction.getInstance().getCellInfos()) { + CellElement cellElement = (CellElement) info.getContent().getReplaceObject(); + if (isFormatValid(cellElement)) { + info.getContent().setShowStr(GeneralUtils.objectToString(cellElement.getValue())); + cellInfos.add(info); + } + } + setCellInfos(cellInfos); + } + + public boolean isFormatValid(CellElement cellElement) { + return cellElement.getStyle() != null + && (cellElement.getValue() instanceof Formula + || cellElement.getValue() instanceof DSColumn + || cellElement.getValue() instanceof String + || cellElement.getValue() instanceof Integer); + } + + public List getCellInfos() { + return cellInfos; + } + + public void setCellInfos(List cellInfos) { + this.cellInfos = cellInfos; + } + + /** + * 对外开放的获取对象的方法 + * + * @return + */ + public static SearchCellFormatAction getInstance() { + return SearchCellFormatActionEnum.SINGLETON.getInstance(); + } + + /** + * 枚举实现单例 + */ + private enum SearchCellFormatActionEnum { + /** + * 单例 + */ + SINGLETON; + + private SearchCellFormatAction instance; + + SearchCellFormatActionEnum() { + instance = new SearchCellFormatAction(); + } + + /** + * 获取对象 + * + * @return + */ + public SearchCellFormatAction getInstance() { + return instance; + } + } + +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchConnectionAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchConnectionAction.java new file mode 100644 index 0000000000..199361fd7b --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchConnectionAction.java @@ -0,0 +1,108 @@ +package com.fr.design.actions.replace.action.setting.action; + +import com.fr.base.TableData; +import com.fr.base.TableDataConnection; +import com.fr.data.TableDataSource; +import com.fr.data.impl.Connection; +import com.fr.data.impl.NameDatabaseConnection; +import com.fr.design.actions.replace.action.SearchAction; +import com.fr.design.actions.replace.info.ConnectionInfo; +import com.fr.design.actions.replace.info.base.ITContent; +import com.fr.design.mainframe.JTemplate; +import com.fr.file.ConnectionConfig; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * 存储数据连接信息 + * + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-10-26 + */ +public class SearchConnectionAction implements SearchAction { + private List connectionInfos = new ArrayList<>(); + + + private SearchConnectionAction() { + + } + + @Override + public void search4Infos(JTemplate jTemplate) { + List connectionInfos = new ArrayList<>(); + Map map = ConnectionConfig.getInstance().getConnections(); + Map needMap = new HashMap<>(); + TableDataSource source = (TableDataSource) jTemplate.getTarget(); + Iterator dataIterator = source.getTableDataNameIterator(); + while (dataIterator.hasNext()) { + String dataName = (String) dataIterator.next(); + TableData data = source.getTableData(dataName); + if (isNameDataBaseConnectionValid(data)) { + NameDatabaseConnection connection = (NameDatabaseConnection) ((TableDataConnection) data).getDatabase(); + if (map.containsKey(connection.getName())) { + needMap.put(connection.getName(), connection); + } + } + } + for (String name : needMap.keySet()) { + ITContent content = new ITContent(); + content.setReplaceObject(needMap.get(name)); + content.setTemplateName(jTemplate.getTemplateName()); + content.setJumpAble(false); + content.setShowStr(name); + connectionInfos.add(new ConnectionInfo(content)); + } + setConnectionInfos(connectionInfos); + } + + public boolean isNameDataBaseConnectionValid(TableData data) { + return data instanceof TableDataConnection && ((TableDataConnection) data).getDatabase() instanceof NameDatabaseConnection; + } + + public List getConnectionInfos() { + return connectionInfos; + } + + public void setConnectionInfos(List connectionInfos) { + this.connectionInfos = connectionInfos; + } + + /** + * 对外开放的获取对象的方法 + * + * @return + */ + public static SearchConnectionAction getInstance() { + return SearchConnectionActionEnum.SINGLETON.getInstance(); + } + + /** + * 枚举实现单例 + */ + private enum SearchConnectionActionEnum { + /** + * 单例 + */ + SINGLETON; + + private SearchConnectionAction instance; + + SearchConnectionActionEnum() { + instance = new SearchConnectionAction(); + } + + /** + * 获取对象 + * + * @return + */ + public SearchConnectionAction getInstance() { + return instance; + } + } +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchDSColumnAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchDSColumnAction.java new file mode 100644 index 0000000000..1cba80902b --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchDSColumnAction.java @@ -0,0 +1,87 @@ +package com.fr.design.actions.replace.action.setting.action; + +import com.fr.base.TableData; +import com.fr.data.TableDataSource; +import com.fr.design.actions.replace.action.SearchAction; +import com.fr.design.actions.replace.info.DSColumnInfo; +import com.fr.design.actions.replace.info.base.ITContent; +import com.fr.design.mainframe.JTemplate; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +/** + * 搜索数据列 + * + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-10-26 + */ +public class SearchDSColumnAction implements SearchAction { + private List dsColumnInfos = new ArrayList<>(); + + + private SearchDSColumnAction() { + } + + @Override + public void search4Infos(JTemplate jTemplate) { + List dsColumnInfos = new ArrayList<>(); + TableDataSource source = (TableDataSource) jTemplate.getTarget(); + Iterator dataIterator = source.getTableDataNameIterator(); + while (dataIterator.hasNext()) { + String dataName = (String) dataIterator.next(); + TableData data = source.getTableData(dataName); + ITContent content = new ITContent(); + content.setJumpAble(false); + content.setReplaceObject(data); + content.setShowStr(dataName); + content.setTemplateName(jTemplate.getTemplateName()); + dsColumnInfos.add(new DSColumnInfo(content)); + setDsColumnInfos(dsColumnInfos); + } + } + + public List getDsColumnInfos() { + return dsColumnInfos; + } + + public void setDsColumnInfos(List dsColumnInfos) { + this.dsColumnInfos = dsColumnInfos; + } + + /** + * 对外开放的获取对象的方法 + * + * @return + */ + public static SearchDSColumnAction getInstance() { + return SearchDSColumnActionEnum.SINGLETON.getInstance(); + } + + /** + * 枚举实现单例 + */ + private enum SearchDSColumnActionEnum { + /** + * 单例 + */ + SINGLETON; + + private SearchDSColumnAction instance; + + SearchDSColumnActionEnum() { + instance = new SearchDSColumnAction(); + } + + /** + * 获取对象 + * + * @return + */ + public SearchDSColumnAction getInstance() { + return instance; + } + } +} From 33d82a0db404b475a4ed790ffc033445484944d3 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 27 Oct 2022 15:39:25 +0800 Subject: [PATCH 107/310] =?UTF-8?q?REPORT-80695=20=E3=80=90=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E5=85=A8=E5=B1=80=E7=BA=A7=E5=88=AB=E6=9F=A5=E6=89=BE?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E4=BA=8C=E6=9C=9F=E3=80=91=E9=80=82=E9=85=8D?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E5=A4=9A=E5=87=BA=E6=9D=A5=E7=9A=84=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E5=90=8E=E5=86=85=E5=AE=B9=E8=BF=99=E4=B8=80=E5=88=97?= =?UTF-8?q?=EF=BC=8C=E4=BB=A5=E5=8F=8A=E9=83=A8=E5=88=86=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../content/component/ComponentType.java | 10 +- .../content/formula/FormulaReplaceObject.java | 118 ++++++++++-------- .../action/content/formula/FormulaTag.java | 41 ++++-- .../template/SearchTemplateFormulaAction.java | 4 +- .../replace/action/content/js/JSCheckTag.java | 15 +++ .../action/content/js/JSCheckType.java | 65 ++++++++++ .../action/content/widget/FrmWidgetType.java | 1 + 7 files changed, 191 insertions(+), 63 deletions(-) create mode 100644 designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/JSCheckTag.java create mode 100644 designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/JSCheckType.java diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/component/ComponentType.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/component/ComponentType.java index bb6e190f69..13712a570a 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/component/ComponentType.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/component/ComponentType.java @@ -126,7 +126,9 @@ public enum ComponentType implements DealWithInfoValue { info.updateOldStr(titleLayout.getWidgetName(), findStr); titleLayout.setWidgetName(ShowValueUtils.replaceAll(titleLayout.getWidgetName(), findStr, replaceStr)); CRBoundsWidget crBoundsWidget = ((CRBoundsWidget) titleLayout.getWidget(0)); - crBoundsWidget.getWidget().setWidgetName(ShowValueUtils.replaceAll(crBoundsWidget.getWidget().getWidgetName(), findStr, replaceStr)); + String str = crBoundsWidget.getWidget().getWidgetName(); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + crBoundsWidget.getWidget().setWidgetName(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } } }, @@ -144,7 +146,9 @@ public enum ComponentType implements DealWithInfoValue { info.updateOldStr(scaleLayout.getWidgetName(), findStr); scaleLayout.setWidgetName(ShowValueUtils.replaceAll(scaleLayout.getWidgetName(), findStr, replaceStr)); CRBoundsWidget crBoundsWidget = ((CRBoundsWidget) scaleLayout.getWidget(0)); - crBoundsWidget.getWidget().setWidgetName(ShowValueUtils.replaceAll(crBoundsWidget.getWidget().getWidgetName(), findStr, replaceStr)); + String str = crBoundsWidget.getWidget().getWidgetName(); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + crBoundsWidget.getWidget().setWidgetName(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } } }, @@ -333,7 +337,9 @@ public enum ComponentType implements DealWithInfoValue { Object replaceObject = info.getContent().getReplaceObject(); if (replaceObject instanceof Widget) { Widget widget = ((Widget) replaceObject); + String str = widget.getWidgetName(); info.updateOldStr(widget.getWidgetName(), findStr); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); widget.setWidgetName(widget.getWidgetName().replaceAll(findStr, replaceStr)); } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java index 02cd18810e..a58ae83d11 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java @@ -58,12 +58,14 @@ public enum FormulaReplaceObject implements DealWithInfoValue { public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { Object replaceObject = info.getContent().getReplaceObject(); info.updateOldStr(((Formula) replaceObject).getContent(), findStr); - ((Formula) replaceObject).setContent(ShowValueUtils.replaceAll(((Formula) replaceObject).getContent(), findStr, replaceStr)); + String str = ((Formula) replaceObject).getContent(); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + ((Formula) replaceObject).setContent(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } @Override public boolean check(Info info) { - if (info.getContent().getReplaceObject() instanceof Formula){ + if (info.getContent().getReplaceObject() instanceof Formula) { Formula formula = (Formula) info.getContent().getReplaceObject(); return StringUtils.equals(formula.getContent(), info.getContent().getOldShowStr()); } @@ -88,13 +90,14 @@ public enum FormulaReplaceObject implements DealWithInfoValue { Object replaceObject = info.getContent().getReplaceObject(); //更新上一次操作的信息 info.updateOldStr(((FormulaCondition) replaceObject).getFormula(), findStr); - - ((FormulaCondition) replaceObject).setFormula(ShowValueUtils.replaceAll(((FormulaCondition) replaceObject).getFormula(), findStr, replaceStr)); + String str = ((FormulaCondition) replaceObject).getFormula(); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + ((FormulaCondition) replaceObject).setFormula(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } @Override public boolean check(Info info) { - if (info.getContent().getReplaceObject() instanceof FormulaCondition){ + if (info.getContent().getReplaceObject() instanceof FormulaCondition) { FormulaCondition condition = (FormulaCondition) info.getContent().getReplaceObject(); return StringUtils.equals(condition.getFormula(), info.getContent().getOldShowStr()); } @@ -120,14 +123,15 @@ public enum FormulaReplaceObject implements DealWithInfoValue { if (((Compare) replaceObject).getValue() instanceof Formula) { Formula formula = (Formula) ((Compare) replaceObject).getValue(); info.updateOldStr(formula.getContent(), findStr); - - formula.setContent(ShowValueUtils.replaceAll(formula.getContent(), findStr, replaceStr)); + String str = formula.getContent(); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + formula.setContent(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } } @Override public boolean check(Info info) { - if (info.getContent().getReplaceObject() instanceof Compare){ + if (info.getContent().getReplaceObject() instanceof Compare) { Compare compare = (Compare) info.getContent().getReplaceObject(); return StringUtils.equals(GeneralUtils.objectToString(compare.getValue()), info.getContent().getOldShowStr()); } @@ -151,13 +155,14 @@ public enum FormulaReplaceObject implements DealWithInfoValue { public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { Object replaceObject = info.getContent().getReplaceObject(); info.updateOldStr(((Formula) ((com.fr.base.core.KV) replaceObject).getValue()).getContent(), findStr); - - ((Formula) ((com.fr.base.core.KV) replaceObject).getValue()).setContent(ShowValueUtils.replaceAll(((Formula) ((com.fr.base.core.KV) replaceObject).getValue()).getContent(), findStr, replaceStr)); + String str = ((Formula) ((com.fr.base.core.KV) replaceObject).getValue()).getContent(); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + ((Formula) ((com.fr.base.core.KV) replaceObject).getValue()).setContent(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } @Override public boolean check(Info info) { - if (info.getContent().getReplaceObject() instanceof com.fr.base.core.KV){ + if (info.getContent().getReplaceObject() instanceof com.fr.base.core.KV) { com.fr.base.core.KV kv = (com.fr.base.core.KV) info.getContent().getReplaceObject(); return StringUtils.equals(GeneralUtils.objectToString(kv.getValue()), info.getContent().getOldShowStr()); } @@ -181,12 +186,14 @@ public enum FormulaReplaceObject implements DealWithInfoValue { public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { Object replaceObject = info.getContent().getReplaceObject(); info.updateOldStr(((Formula) (((CellInsertPolicyAttr) replaceObject).getDefaultInsertValue())).getContent(), findStr); - ((Formula) (((CellInsertPolicyAttr) replaceObject).getDefaultInsertValue())).setContent(ShowValueUtils.replaceAll(((Formula) (((CellInsertPolicyAttr) replaceObject).getDefaultInsertValue())).getContent(), findStr, replaceStr)); + String str = ((Formula) (((CellInsertPolicyAttr) replaceObject).getDefaultInsertValue())).getContent(); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + ((Formula) (((CellInsertPolicyAttr) replaceObject).getDefaultInsertValue())).setContent(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } @Override public boolean check(Info info) { - if (info.getContent().getReplaceObject() instanceof CellInsertPolicyAttr){ + if (info.getContent().getReplaceObject() instanceof CellInsertPolicyAttr) { CellInsertPolicyAttr policyAttr = (CellInsertPolicyAttr) info.getContent().getReplaceObject(); return StringUtils.equals(GeneralUtils.objectToString(policyAttr.getDefaultInsertValue()), info.getContent().getOldShowStr()); } @@ -210,13 +217,14 @@ public enum FormulaReplaceObject implements DealWithInfoValue { public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { Object replaceObject = info.getContent().getReplaceObject(); info.updateOldStr(((FormulaPresent) replaceObject).getFormulaContent(), findStr); - - ((FormulaPresent) replaceObject).setFormulaContent(ShowValueUtils.replaceAll(((FormulaPresent) replaceObject).getFormulaContent(), findStr, replaceStr)); + String str = ((FormulaPresent) replaceObject).getFormulaContent(); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + ((FormulaPresent) replaceObject).setFormulaContent(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } @Override public boolean check(Info info) { - if (info.getContent().getReplaceObject() instanceof FormulaPresent){ + if (info.getContent().getReplaceObject() instanceof FormulaPresent) { FormulaPresent present = (FormulaPresent) info.getContent().getReplaceObject(); return StringUtils.equals(present.getFormulaContent(), info.getContent().getOldShowStr()); } @@ -240,12 +248,14 @@ public enum FormulaReplaceObject implements DealWithInfoValue { public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { Object replaceObject = info.getContent().getReplaceObject(); info.updateOldStr(((SingleJavaScript) replaceObject).getFileName(), findStr); - ((SingleJavaScript) replaceObject).setFileName(ShowValueUtils.replaceAll(((SingleJavaScript) replaceObject).getFileName(), findStr, replaceStr)); + String str = ((SingleJavaScript) replaceObject).getFileName(); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + ((SingleJavaScript) replaceObject).setFileName(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } @Override public boolean check(Info info) { - if (info.getContent().getReplaceObject() instanceof SingleJavaScript){ + if (info.getContent().getReplaceObject() instanceof SingleJavaScript) { SingleJavaScript javaScript = (SingleJavaScript) info.getContent().getReplaceObject(); return StringUtils.equals(javaScript.getFileName(), info.getContent().getOldShowStr()); } @@ -269,15 +279,16 @@ public enum FormulaReplaceObject implements DealWithInfoValue { public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { Object replaceObject = info.getContent().getReplaceObject(); info.updateOldStr(((Formula) (((ParameterProvider) replaceObject).getValue())).getContent(), findStr); - - ((Formula) (((ParameterProvider) replaceObject).getValue())).setContent(ShowValueUtils.replaceAll(((Formula) (((ParameterProvider) replaceObject).getValue())).getContent(), findStr, replaceStr)); + String str = ((Formula) (((ParameterProvider) replaceObject).getValue())).getContent(); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + ((Formula) (((ParameterProvider) replaceObject).getValue())).setContent(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } @Override public boolean check(Info info) { - if (info.getContent().getReplaceObject() instanceof ParameterProvider){ + if (info.getContent().getReplaceObject() instanceof ParameterProvider) { ParameterProvider provider = (ParameterProvider) info.getContent().getReplaceObject(); - if (provider.getValue() instanceof Formula){ + if (provider.getValue() instanceof Formula) { return StringUtils.equals(GeneralUtils.objectToString(provider.getValue()), info.getContent().getOldShowStr()); } } @@ -301,13 +312,14 @@ public enum FormulaReplaceObject implements DealWithInfoValue { public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { Object replaceObject = info.getContent().getReplaceObject(); info.updateOldStr(((FormulaProvider) replaceObject).getContent(), findStr); - - ((FormulaProvider) replaceObject).setContent(ShowValueUtils.replaceAll(((FormulaProvider) replaceObject).getContent(), findStr, replaceStr)); + String str = ((FormulaProvider) replaceObject).getContent(); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + ((FormulaProvider) replaceObject).setContent(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } @Override public boolean check(Info info) { - if (info.getContent().getReplaceObject() instanceof FormulaProvider){ + if (info.getContent().getReplaceObject() instanceof FormulaProvider) { FormulaProvider provider = (FormulaProvider) info.getContent().getReplaceObject(); return StringUtils.equals(provider.getContent(), info.getContent().getOldShowStr()); } @@ -331,15 +343,16 @@ public enum FormulaReplaceObject implements DealWithInfoValue { public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { Object replaceObject = info.getContent().getReplaceObject(); info.updateOldStr(((Formula) (((Parameter) replaceObject).getValue())).getContent(), findStr); - - ((Formula) (((Parameter) replaceObject).getValue())).setContent(ShowValueUtils.replaceAll(((Formula) (((Parameter) replaceObject).getValue())).getContent(), findStr, replaceStr)); + String str = ((Formula) (((Parameter) replaceObject).getValue())).getContent(); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + ((Formula) (((Parameter) replaceObject).getValue())).setContent(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } @Override public boolean check(Info info) { - if (info.getContent().getReplaceObject() instanceof Parameter){ + if (info.getContent().getReplaceObject() instanceof Parameter) { Parameter parameter = (Parameter) info.getContent().getReplaceObject(); - if (parameter.getValue() instanceof Formula){ + if (parameter.getValue() instanceof Formula) { return StringUtils.equals(((Formula) parameter.getValue()).getContent(), info.getContent().getOldShowStr()); } } @@ -363,13 +376,14 @@ public enum FormulaReplaceObject implements DealWithInfoValue { public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { Object replaceObject = info.getContent().getReplaceObject(); info.updateOldStr(((DSColumn) replaceObject).getResult(), findStr); - - ((DSColumn) replaceObject).setResult(ShowValueUtils.replaceAll(((DSColumn) replaceObject).getResult(), findStr, replaceStr)); + String str = ((DSColumn) replaceObject).getResult(); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + ((DSColumn) replaceObject).setResult(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } @Override public boolean check(Info info) { - if (info.getContent().getReplaceObject() instanceof DSColumn){ + if (info.getContent().getReplaceObject() instanceof DSColumn) { DSColumn column = (DSColumn) info.getContent().getReplaceObject(); return StringUtils.equals(column.getResult(), info.getContent().getOldShowStr()); } @@ -393,13 +407,14 @@ public enum FormulaReplaceObject implements DealWithInfoValue { public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { Object replaceObject = info.getContent().getReplaceObject(); info.updateOldStr(((BaseFormula) replaceObject).getContent(), findStr); - - ((BaseFormula) replaceObject).setContent(ShowValueUtils.replaceAll(((BaseFormula) replaceObject).getContent(), findStr, replaceStr)); + String str = ((BaseFormula) replaceObject).getContent(); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + ((BaseFormula) replaceObject).setContent(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } @Override public boolean check(Info info) { - if (info.getContent().getReplaceObject() instanceof BaseFormula){ + if (info.getContent().getReplaceObject() instanceof BaseFormula) { BaseFormula formula = (BaseFormula) info.getContent().getReplaceObject(); return StringUtils.equals(formula.getContent(), info.getContent().getOldShowStr()); } @@ -423,16 +438,17 @@ public enum FormulaReplaceObject implements DealWithInfoValue { public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { Object replaceObject = info.getContent().getReplaceObject(); info.updateOldStr(((Formula) ((StoreProcedureParameter) replaceObject).getValue()).getContent(), findStr); - - ((Formula) ((StoreProcedureParameter) replaceObject).getValue()).setContent(ShowValueUtils.replaceAll(((Formula) ((StoreProcedureParameter) replaceObject).getValue()).getContent(), findStr, replaceStr)); + String str = ((Formula) ((StoreProcedureParameter) replaceObject).getValue()).getContent(); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + ((Formula) ((StoreProcedureParameter) replaceObject).getValue()).setContent(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } @Override public boolean check(Info info) { - if (info.getContent().getReplaceObject() instanceof StoreProcedureParameter){ + if (info.getContent().getReplaceObject() instanceof StoreProcedureParameter) { StoreProcedureParameter procedureParameter = (StoreProcedureParameter) info.getContent().getReplaceObject(); - if (procedureParameter.getValue() instanceof Formula){ + if (procedureParameter.getValue() instanceof Formula) { return StringUtils.equals(GeneralUtils.objectToString(procedureParameter.getValue()), info.getContent().getOldShowStr()); } } @@ -457,13 +473,15 @@ public enum FormulaReplaceObject implements DealWithInfoValue { WorkBook workBook = (WorkBook) HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTarget(); WatermarkAttr watermarkAttr = (WatermarkAttr) info.getContent().getReplaceObject(); info.updateOldStr(watermarkAttr.getText(), findStr); - watermarkAttr.setText(ShowValueUtils.replaceAll(watermarkAttr.getText(), findStr, replaceStr)); + String str = watermarkAttr.getText(); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + watermarkAttr.setText(ShowValueUtils.replaceAll(str, findStr, replaceStr)); workBook.addAttrMark(watermarkAttr); } @Override public boolean check(Info info) { - if (info.getContent().getReplaceObject() instanceof WatermarkAttr){ + if (info.getContent().getReplaceObject() instanceof WatermarkAttr) { WatermarkAttr watermarkAttr = ((WatermarkAttr) info.getContent().getReplaceObject()); return StringUtils.equals(watermarkAttr.getText(), info.getContent().getOldShowStr()); } @@ -473,11 +491,11 @@ public enum FormulaReplaceObject implements DealWithInfoValue { /** * 存储字符串类型需要特殊处理 */ - STRING("String"){ + STRING("String") { @Override public Map getValue(Object... o) { HashMap map = new HashMap<>(); - if (StringUtils.isNotEmpty(GeneralUtils.objectToString(o[0]))){ + if (StringUtils.isNotEmpty(GeneralUtils.objectToString(o[0]))) { map.put("content", GeneralUtils.objectToString(o[0])); } return map; @@ -486,7 +504,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { @Override public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { FormulaTag formulaTag = FormulaTag.match(info.getContent().getTag()); - if (formulaTag != null){ + if (formulaTag != null) { info.updateOldStr(GeneralUtils.objectToString(info.getContent().getReplaceObject()), findStr); formulaTag.setValue(info, findStr, replaceStr, operatorArray); } @@ -500,7 +518,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { /** * 排序 */ - FORMULA_SORT_EXPRESSION("FormulaSortExpression"){ + FORMULA_SORT_EXPRESSION("FormulaSortExpression") { @Override public Map getValue(Object... o) { HashMap map = new HashMap<>(); @@ -514,19 +532,20 @@ public enum FormulaReplaceObject implements DealWithInfoValue { public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { Object replaceObject = info.getContent().getReplaceObject(); info.updateOldStr((((FormulaSortExpression) replaceObject).getFormula()), findStr); - ((FormulaSortExpression) replaceObject).setFormula(ShowValueUtils.replaceAll((((FormulaSortExpression) replaceObject).getFormula()), findStr, replaceStr)); + String str = (((FormulaSortExpression) replaceObject).getFormula()); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + ((FormulaSortExpression) replaceObject).setFormula(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } @Override public boolean check(Info info) { - if (info.getContent().getReplaceObject() instanceof FormulaSortExpression){ + if (info.getContent().getReplaceObject() instanceof FormulaSortExpression) { FormulaSortExpression sortExpression = (FormulaSortExpression) info.getContent().getReplaceObject(); return StringUtils.equals(sortExpression.getFormula(), info.getContent().getOldShowStr()); } return false; } - } - ; + }; String name; @@ -554,6 +573,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { /** * 校验内容 + * * @param info * @return */ diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java index c3f3c83a1d..be35a76671 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java @@ -33,7 +33,9 @@ public enum FormulaTag implements DealWithInfoValue { public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { if (info.getContent().getHoldObject() instanceof VanMapReportDefinition) { VanMapReportDefinition definition = (VanMapReportDefinition) info.getContent().getHoldObject(); - definition.setLongitude(ShowValueUtils.replaceAll(GeneralUtils.objectToString(definition.getLongitude()), findStr, replaceStr)); + String str = GeneralUtils.objectToString(definition.getLongitude()); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + definition.setLongitude(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } } }, @@ -45,7 +47,9 @@ public enum FormulaTag implements DealWithInfoValue { public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { if (info.getContent().getHoldObject() instanceof VanMapReportDefinition) { VanMapReportDefinition definition = (VanMapReportDefinition) info.getContent().getHoldObject(); - definition.setLatitude(ShowValueUtils.replaceAll(GeneralUtils.objectToString(definition.getLatitude()), findStr, replaceStr)); + String str = GeneralUtils.objectToString(definition.getLatitude()); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + definition.setLatitude(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } } }, @@ -57,7 +61,9 @@ public enum FormulaTag implements DealWithInfoValue { public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { if (info.getContent().getHoldObject() instanceof VanMapReportDefinition) { VanMapReportDefinition definition = (VanMapReportDefinition) info.getContent().getHoldObject(); - definition.setCategoryName(ShowValueUtils.replaceAll(GeneralUtils.objectToString(definition.getCategoryName()), findStr, replaceStr)); + String str = GeneralUtils.objectToString(definition.getCategoryName()); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + definition.setCategoryName(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } } }, @@ -69,7 +75,9 @@ public enum FormulaTag implements DealWithInfoValue { public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { if (info.getContent().getHoldObject() instanceof VanMapReportDefinition) { VanMapReportDefinition definition = (VanMapReportDefinition) info.getContent().getHoldObject(); - definition.setEndLongitude(ShowValueUtils.replaceAll(GeneralUtils.objectToString(definition.getEndLongitude()), findStr, replaceStr)); + String str = GeneralUtils.objectToString(definition.getEndLongitude()); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + definition.setEndLongitude(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } } }, @@ -81,7 +89,9 @@ public enum FormulaTag implements DealWithInfoValue { public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { if (info.getContent().getHoldObject() instanceof VanMapReportDefinition) { VanMapReportDefinition definition = (VanMapReportDefinition) info.getContent().getHoldObject(); - definition.setEndLatitude(ShowValueUtils.replaceAll(GeneralUtils.objectToString(definition.getEndLatitude()), findStr, replaceStr)); + String str = GeneralUtils.objectToString(definition.getEndLatitude()); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + definition.setEndLatitude(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } } }, @@ -93,7 +103,9 @@ public enum FormulaTag implements DealWithInfoValue { public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { if (info.getContent().getHoldObject() instanceof VanMapReportDefinition) { VanMapReportDefinition definition = (VanMapReportDefinition) info.getContent().getHoldObject(); - definition.setEndAreaName(ShowValueUtils.replaceAll(GeneralUtils.objectToString(definition.getEndAreaName()), findStr, replaceStr)); + String str = GeneralUtils.objectToString(definition.getEndAreaName()); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + definition.setEndAreaName(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } } }, @@ -105,7 +117,9 @@ public enum FormulaTag implements DealWithInfoValue { public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { if (info.getContent().getHoldObject() instanceof VerifyItem) { VerifyItem item = (VerifyItem) info.getContent().getHoldObject(); - item.setMessage(ShowValueUtils.replaceAll(item.getMessage(), findStr, replaceStr)); + String str = item.getMessage(); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + item.setMessage(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } } }, @@ -119,6 +133,7 @@ public enum FormulaTag implements DealWithInfoValue { WorkBook workBook = (WorkBook) info.getContent().getHoldObject(); int sheetId = Integer.parseInt(info.getContent().getSheetID()); String name = workBook.getReportName(sheetId); + ShowValueUtils.updateAfterReplaceStr(info, name, findStr, replaceStr); workBook.setReportName(sheetId, ShowValueUtils.replaceAll(name, findStr, replaceStr)); } } @@ -131,7 +146,9 @@ public enum FormulaTag implements DealWithInfoValue { public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { if (info.getContent().getHoldObject() instanceof CellGUIAttr) { CellGUIAttr attr = (CellGUIAttr) info.getContent().getHoldObject(); - attr.setTooltipText(ShowValueUtils.replaceAll(attr.getTooltipText(), findStr, replaceStr)); + String str = attr.getTooltipText(); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + attr.setTooltipText(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } } }, @@ -140,7 +157,9 @@ public enum FormulaTag implements DealWithInfoValue { public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { if (info.getContent().getHoldObject() instanceof FormulaDictionary) { FormulaDictionary dictionary = (FormulaDictionary) info.getContent().getHoldObject(); - dictionary.setExcuteFormula(ShowValueUtils.replaceAll(dictionary.getExcuteFormula(), findStr, replaceStr)); + String str = dictionary.getExcuteFormula(); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + dictionary.setExcuteFormula(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } } }, @@ -149,7 +168,9 @@ public enum FormulaTag implements DealWithInfoValue { public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { if (info.getContent().getHoldObject() instanceof FormulaDictionary) { FormulaDictionary dictionary = (FormulaDictionary) info.getContent().getHoldObject(); - dictionary.setProduceFormula(ShowValueUtils.replaceAll(dictionary.getProduceFormula(), findStr, replaceStr)); + String str = dictionary.getProduceFormula(); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + dictionary.setProduceFormula(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } } }; diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java index 0dd6919558..0dab4a7e4b 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java @@ -149,8 +149,8 @@ public class SearchTemplateFormulaAction implements SearchTemplateFormula { @Override public void searchTemplateWaterMarkFormula(JTemplate jTemplate, List formulaInfos, ITContent content) { - WatermarkAttr watermarkAttr = ReportUtils.getWatermarkAttrFromTemplateAndGlobal((AttrMark) jTemplate.getTarget()); - if (watermarkAttr != null) { + WatermarkAttr watermarkAttr = ReportUtils.getWatermarkAttrFromTemplate((AttrMark) jTemplate.getTarget()); + if (watermarkAttr != null && watermarkAttr.isValid()) { ITContent waterMarkContent = ITContent.copy(content); waterMarkContent.addOtherPos(Toolkit.i18nText("Fine-Design_Form_WaterMark")); waterMarkContent.setReplaceObject(watermarkAttr); diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/JSCheckTag.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/JSCheckTag.java new file mode 100644 index 0000000000..71f5d82d6f --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/JSCheckTag.java @@ -0,0 +1,15 @@ +package com.fr.design.actions.replace.action.content.js; + +/** + * 检查JS的标签 + * + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-10-26 + */ +public class JSCheckTag { + /** + * 单元格-超级链接 + */ + public static final int CELL_HYPERLINK = 0; +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/JSCheckType.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/JSCheckType.java new file mode 100644 index 0000000000..5d4ff03c7d --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/JSCheckType.java @@ -0,0 +1,65 @@ +package com.fr.design.actions.replace.action.content.js; + +import com.fr.design.actions.replace.info.Info; +import com.fr.js.NameJavaScript; +import com.fr.js.NameJavaScriptGroup; +import com.fr.report.cell.Elem; +import org.jetbrains.annotations.Nullable; + +/** + * 检查JS是否修改过 + * + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-10-26 + */ +public enum JSCheckType { + /** + * 单元格-超级链接 + */ + CELL_HYPERLINK(JSCheckTag.CELL_HYPERLINK) { + @Override + public boolean check(Info info) { + Elem elem = (Elem) info.getContent().getHoldObject(); + NameJavaScriptGroup group = elem.getNameHyperlinkGroup(); + int len = group.size(); + if (len == 0) { + return false; + } + NameJavaScript javaScript = (NameJavaScript) info.getContent().getReplaceObject(); + for (int i = 0; i < len; i++) { + if (group.getNameHyperlink(i).equals(javaScript)) { + return true; + } + } + return false; + } + }; + + + int index; + + JSCheckType(int index) { + this.index = index; + } + + /** + * 匹配 + * + * @param index + * @return + */ + @Nullable + public static JSCheckType match(int index) { + JSCheckType[] values = JSCheckType.values(); + for (JSCheckType value : values) { + if (value.index == index) { + return value; + } + } + return null; + } + + public abstract boolean check(Info info); + +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/widget/FrmWidgetType.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/widget/FrmWidgetType.java index 98d2282f5d..5aa8e208c5 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/widget/FrmWidgetType.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/widget/FrmWidgetType.java @@ -167,6 +167,7 @@ public enum FrmWidgetType implements SearchFrmWidget, DealWithInfoValue { if (((WidgetInfo) info).isWaterMark()) { WaterMark waterMark = (WaterMark) widget; info.updateOldStr(waterMark.getWaterMark(), findStr); + ShowValueUtils.updateAfterReplaceStr(info, waterMark.getWaterMark(), findStr, replaceStr); waterMark.setWaterMark(ShowValueUtils.replaceAll(waterMark.getWaterMark(), findStr, replaceStr)); } else { info.updateOldStr(widget.getWidgetName(), findStr); From 65963e7d2dea12aefe3e8ce8230db54c5decd9b9 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 27 Oct 2022 15:42:06 +0800 Subject: [PATCH 108/310] =?UTF-8?q?REPORT-80695=20=E3=80=90=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E5=85=A8=E5=B1=80=E7=BA=A7=E5=88=AB=E6=9F=A5=E6=89=BE?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E4=BA=8C=E6=9C=9F=E3=80=91=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/replace/action/content/js/JSCheckType.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/JSCheckType.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/JSCheckType.java index 5d4ff03c7d..b3357721ed 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/JSCheckType.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/JSCheckType.java @@ -60,6 +60,11 @@ public enum JSCheckType { return null; } + /** + * 校验是否修改 + * @param info 存储信息的数据结构 + * @return + */ public abstract boolean check(Info info); } From 0cd4b400538d1710a8d00c95a6ad30e8f608368d Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 27 Oct 2022 15:44:26 +0800 Subject: [PATCH 109/310] =?UTF-8?q?REPORT-80695=20=E3=80=90=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E5=85=A8=E5=B1=80=E7=BA=A7=E5=88=AB=E6=9F=A5=E6=89=BE?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E4=BA=8C=E6=9C=9F=E3=80=91=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../action/setting/action/SearchCellFormatAction.java | 6 ++++++ .../action/setting/action/SearchConnectionAction.java | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchCellFormatAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchCellFormatAction.java index bd607c625b..016f6b259b 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchCellFormatAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchCellFormatAction.java @@ -39,6 +39,12 @@ public class SearchCellFormatAction implements SearchAction { setCellInfos(cellInfos); } + /** + * 单元格的内容是否是在查找范围内 + * + * @param cellElement 单元格 + * @return 在查找范围内返回true + */ public boolean isFormatValid(CellElement cellElement) { return cellElement.getStyle() != null && (cellElement.getValue() instanceof Formula diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchConnectionAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchConnectionAction.java index 199361fd7b..2f4a75ba48 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchConnectionAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchConnectionAction.java @@ -60,6 +60,12 @@ public class SearchConnectionAction implements SearchAction { setConnectionInfos(connectionInfos); } + /** + * 数据连接是否可用 + * + * @param data 数据库 + * @return 可用返回true + */ public boolean isNameDataBaseConnectionValid(TableData data) { return data instanceof TableDataConnection && ((TableDataConnection) data).getDatabase() instanceof NameDatabaseConnection; } From 4b2237b70ef10097bfa24e15c6cc3613a0357e12 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 27 Oct 2022 15:58:54 +0800 Subject: [PATCH 110/310] =?UTF-8?q?REPORT-80695=20=E3=80=90=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E5=85=A8=E5=B1=80=E7=BA=A7=E5=88=AB=E6=9F=A5=E6=89=BE?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E4=BA=8C=E6=9C=9F=E3=80=91=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../replace/action/setting/CellFormatType.java | 2 ++ .../replace/action/setting/CellGroupType.java | 3 +-- .../replace/action/setting/SettingContent.java | 2 ++ .../actions/replace/ui/ITReplaceMainDialog.java | 8 ++++++++ .../actions/replace/ui/ITReplaceNorthPanel.java | 15 ++++++++++++--- .../actions/replace/ui/ITReplaceSouthPanel.java | 5 +++++ 6 files changed, 30 insertions(+), 5 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellFormatType.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellFormatType.java index 9f77d7d2b4..ab2a71ba97 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellFormatType.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellFormatType.java @@ -16,6 +16,8 @@ import java.util.Arrays; import java.util.List; /** + * 单元格-格式 + * * @author Destiny.Lin * @version 11.0 * created by Destiny.Lin on 2022-10-25 diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellGroupType.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellGroupType.java index 8e769b4715..a9b20b6627 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellGroupType.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellGroupType.java @@ -207,10 +207,9 @@ public enum CellGroupType { return new MinFunction(); case COUNT_FUNCTION: return new CountFunction(); - case NONE_FUNCTION: + default: return new NoneFunction(); } - return new NoneFunction(); } /** diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingContent.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingContent.java index 67211b77e9..a72ddd3a74 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingContent.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingContent.java @@ -4,6 +4,8 @@ import com.fr.design.actions.replace.utils.ShowValueUtils; import com.fr.design.i18n.Toolkit; /** + * 设置项的一些常用常量 + * * @author Destiny.Lin * @version 11.0 * created by Destiny.Lin on 2022-10-24 diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index f80609e39d..8497dcff01 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -527,6 +527,10 @@ public class ITReplaceMainDialog extends UIDialog { public void checkValid() throws Exception { } + /** + * 获取模板内容数据 + * @return 存储数据的list + */ public static List getSearchContentResultList() { return searchContentResultList; } @@ -535,6 +539,10 @@ public class ITReplaceMainDialog extends UIDialog { this.searchContentResultList = searchContentResultList; } + /** + * 获取设置项数据 + * @return 存储数据的list + */ public static List getSearchSettingResultList() { return searchSettingResultList; } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java index 60300de2a9..cf358ad384 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java @@ -88,7 +88,7 @@ public class ITReplaceNorthPanel { private static final int FIRST_X = 20, SECOND_X = 80; private static final int LABEL_WIDTH = 60; private static final Icon CHANGE_ICON = IconUtils.readIcon("/com/fr/design/images/replace/change_normal.svg"); - private static final String[] rangeItems = new String[]{Toolkit.i18nText("Fine-Design_Basic_Export_JS_Template_Current")}; + private static final String[] RANGE_ITEMS = new String[]{Toolkit.i18nText("Fine-Design_Basic_Export_JS_Template_Current")}; public static final String CARD_CONTENT = "Content"; public static final String CARD_SETTING = "setting"; @@ -186,7 +186,7 @@ public class ITReplaceNorthPanel { resultLabel = new UILabel(); String[] replaceInputItems = new String[]{StringUtils.EMPTY}; findCombobox = new UIComboBox(findItems.toArray()); - rangeCombobox = new UIComboBox(rangeItems); + rangeCombobox = new UIComboBox(RANGE_ITEMS); findInputCombobox = new UIComboBox(findInputItems.toArray()) { @Override public void setEditor(ComboBoxEditor comboBoxEditor) { @@ -233,7 +233,7 @@ public class ITReplaceNorthPanel { rangeSettingLabel = new UILabel(Toolkit.i18nText("Fine-Design_Replace_Search_Range")); settingResultLabel = new UILabel(); findSettingComboBox = new UIComboBox(findSettingItems.toArray()); - rangeSettingComboBox = new UIComboBox(rangeItems); + rangeSettingComboBox = new UIComboBox(RANGE_ITEMS); findSettingInputComboBox = new UIComboBox(formatItems.toArray()) { @Override public void setEditor(ComboBoxEditor anEditor) { @@ -703,10 +703,19 @@ public class ITReplaceNorthPanel { this.searchButton = searchButton; } + /** + * 获取CardLayout + * @return CardLayout + */ public static CardLayout getCardLayout() { return cardLayout; } + /** + * 获取表格主界面 + * + * @return cardPanel + */ public static JPanel getCardPanel() { return cardPanel; } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java index 24c441b9a3..cd086d903c 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java @@ -47,6 +47,11 @@ public class ITReplaceSouthPanel { this.tableEditorPane = tableEditorPane; } + /** + * 获取表格的editor + * + * @return 表格的editor + */ public static ITTableEditor getItTableEditor() { return itTableEditor; } From 6b517c213ccc4f99e155cf65917aefd22c5d2fb5 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 27 Oct 2022 16:24:49 +0800 Subject: [PATCH 111/310] =?UTF-8?q?REPORT-80695=20=E3=80=90=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E5=85=A8=E5=B1=80=E7=BA=A7=E5=88=AB=E6=9F=A5=E6=89=BE?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E4=BA=8C=E6=9C=9F=E3=80=91=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=A1=B9=E7=9A=84=E6=BB=9A=E8=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java index cf358ad384..16d2926a60 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java @@ -163,7 +163,7 @@ public class ITReplaceNorthPanel { cardPanel.add(contentScrollPane, CARD_CONTENT); - cardPanel.add(upSettingPanel, CARD_SETTING); + cardPanel.add(settingScrollPane, CARD_SETTING); } /** @@ -267,7 +267,7 @@ public class ITReplaceNorthPanel { replaceSettingButton = new UIButton(Toolkit.i18nText("Fine-Design_Replace_Button")); replaceSettingButton.setEnabled(false); - + upSettingPanel.setPreferredSize(new Dimension(limit_width, HEIGHT)); upSettingPanel.add(findSettingLabel); upSettingPanel.add(rangeSettingLabel); upSettingPanel.add(findSettingComboBox); From 518e74dfaf5a6f1aae9a7593640b9b61a2355e0f Mon Sep 17 00:00:00 2001 From: "Link.Zhao" Date: Thu, 27 Oct 2022 18:29:30 +0800 Subject: [PATCH 112/310] =?UTF-8?q?REPORT-80750=20=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E4=B8=AD=E7=9A=84=E4=B8=B4=E6=97=B6=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=9B=AE=E5=BD=95=E6=A2=B3=E7=90=86=E5=92=8C=E6=95=B4?= =?UTF-8?q?=E6=94=B9=201=E3=80=81=E5=B0=86=E4=B8=8D=E5=BF=85=E8=A6=81?= =?UTF-8?q?=E5=85=B1=E4=BA=AB=E7=9A=84=E8=B5=84=E6=BA=90=E4=BB=8Eassets?= =?UTF-8?q?=E8=BF=81=E7=A7=BB=E5=88=B0=E5=85=B6=E4=BB=96=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=202=E3=80=81=E5=B0=86=E8=BF=87=E6=97=B6=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E4=BB=8Eassets=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/style/TranslucentBorderSpecialPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/style/TranslucentBorderSpecialPane.java b/designer-base/src/main/java/com/fr/design/gui/style/TranslucentBorderSpecialPane.java index 20e47f556c..e3ef66bfeb 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/TranslucentBorderSpecialPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/TranslucentBorderSpecialPane.java @@ -191,7 +191,7 @@ public class TranslucentBorderSpecialPane extends AbstractBorderPackerPane imple String lastUsedBorderImageDirPath = history.getLastSelectedBorderImageDir(); File lastUsedBorderImageDir = StringUtils.isNotEmpty(lastUsedBorderImageDirPath) ? new File(lastUsedBorderImageDirPath) : null; - File inbuiltBorderImagesDir = new File(StableUtils.pathJoin(ProjectLibrary.getInstance().getLibHome(), ProjectConstants.ASSETS_NAME, "border_images")); + File inbuiltBorderImagesDir = new File(StableUtils.pathJoin(ProjectLibrary.getInstance().getLibHome(), ProjectConstants.NOT_SHARE, ProjectConstants.BORDER_IMAGES)); if (lastUsedBorderImageDir!= null && lastUsedBorderImageDir.exists()) { imageFileChooser.setCurrentDirectory(lastUsedBorderImageDir); From ae78045a4b20a337c9b67cedf785c3292c9ea103 Mon Sep 17 00:00:00 2001 From: "Coral.Chen" Date: Thu, 27 Oct 2022 19:23:22 +0800 Subject: [PATCH 113/310] =?UTF-8?q?REPORT-82546&REPORT-82706=20=E6=8B=96?= =?UTF-8?q?=E5=8A=A8=E6=A8=A1=E6=9D=BF=E8=BF=9B=E5=85=A5=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=AD=98=E5=9C=A8=E5=A4=A7=E9=87=8F=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E3=80=90xxx=20is=20a=20different=20type=20path=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JTemplate.java | 3 ++- .../src/main/java/com/fr/nx/app/designer/JStreamBook.java | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) 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 844b8d0144..b59df2cf08 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 @@ -111,6 +111,7 @@ import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.FontMetrics; import java.io.ByteArrayOutputStream; +import java.nio.file.Paths; import java.util.Set; import java.util.concurrent.Callable; @@ -1620,7 +1621,7 @@ public abstract class JTemplate> return StringUtils.EMPTY; } String path = this.getEditingFILE().getPath(); - CptxMetadata metadata = CptxFileUtils.getMetadata(path); + CptxMetadata metadata = Paths.get(path).isAbsolute() ? null : CptxFileUtils.getMetadata(path); //是否是兼容模式,兼容模式下,设置了新引擎的cpt和cptx的后缀不同 if (metadata != null && metadata.isForceCpt()) { if (path.endsWith(".cptx")) { diff --git a/designer-realize/src/main/java/com/fr/nx/app/designer/JStreamBook.java b/designer-realize/src/main/java/com/fr/nx/app/designer/JStreamBook.java index 15f64a044e..94a057337d 100644 --- a/designer-realize/src/main/java/com/fr/nx/app/designer/JStreamBook.java +++ b/designer-realize/src/main/java/com/fr/nx/app/designer/JStreamBook.java @@ -14,11 +14,11 @@ 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.nx.app.designer.menu.CalculateAttrAction; import com.fr.nx.app.designer.toolbar.TemplateTransformer; import com.fr.nx.app.designer.toolbar.TransformResult; import com.fr.nx.app.designer.toolbar.TransformResultInfo; +import com.fr.nx.cptx.entry.metadata.CptxMetadata; import com.fr.nx.cptx.utils.CptxFileUtils; import com.fr.stable.StringUtils; import com.fr.stable.project.ProjectConstants; @@ -27,6 +27,7 @@ import com.fr.third.jodd.util.ArraysUtil; import java.io.File; import java.io.FileOutputStream; import java.io.OutputStream; +import java.nio.file.Paths; public class JStreamBook extends JWorkBook { @@ -103,7 +104,8 @@ public class JStreamBook extends JWorkBook { } private String getSuffix() { - CptxMetadata metadata = CptxFileUtils.getMetadata(this.getEditingFILE().getPath()); + String path = this.getEditingFILE().getPath(); + CptxMetadata metadata = Paths.get(path).isAbsolute() ? null : CptxFileUtils.getMetadata(path); if (metadata != null && metadata.isForceCpt()) { return InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Compatibility_Mode"); } From 5082c190bdff7d75bc1c63dc6689b6b46a5da9ec Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 27 Oct 2022 19:34:24 +0800 Subject: [PATCH 114/310] =?UTF-8?q?REPORT-80695=20=E3=80=90=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E5=85=A8=E5=B1=80=E7=BA=A7=E5=88=AB=E6=9F=A5=E6=89=BE?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E4=BA=8C=E6=9C=9F=E3=80=91=E5=8E=BB=E9=99=A4?= =?UTF-8?q?=E5=A4=9A=E4=BD=99=E5=BC=95=E5=85=A5=EF=BC=8C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/replace/action/ShowValue.java | 21 ++++++++++--------- .../design/actions/replace/info/JSInfo.java | 1 - 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/ShowValue.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/ShowValue.java index 34211f1f8a..b1b73122a6 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/ShowValue.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/ShowValue.java @@ -18,19 +18,19 @@ public interface ShowValue { /** * 获取搜索结果 * - * @param jTemplate - * @return + * @param jTemplate 要搜索的模板 + * @return 所有对应类型的集合 */ default List showSearchValue(JTemplate jTemplate) { return new ArrayList<>(); } /** - * 对搜索结果进行过滤 + * 对搜索结果进行过滤(主要针对模板内容,只需要用户输入要搜索的文本内容即可) * - * @param str - * @param list - * @return + * @param str 用户输入的内容 + * @param list 包含所有内容的列表 + * @return 过滤后的内容 */ default List addMatchResult(String str, List list) { return new ArrayList<>(); @@ -38,11 +38,12 @@ public interface ShowValue { /** * 对搜索结果进行过滤(多个过滤条件,主要针对设置项) + * 通过用户输入的级别去界定指定的搜索类型 * - * @param list - * @param settingStr - * @param extraStr - * @return + * @param list 包含所有内容的列表 + * @param settingStr 用户输入的第一级下拉框内容 + * @param extraStr 用户输入的第二级下拉框内容 + * @return 界定后符合条件的内容组合成的列表 */ default List addMatchResult(List list, String settingStr, String extraStr) { return new ArrayList<>(); diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/JSInfo.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/JSInfo.java index 3718381f12..3f0632fe84 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/JSInfo.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/JSInfo.java @@ -1,7 +1,6 @@ package com.fr.design.actions.replace.info; -import com.fr.design.actions.replace.action.content.js.JSCheckType; import com.fr.design.actions.replace.info.base.ITContent; import com.fr.stable.AssistUtils; From 4ce4e31ba721f0192077441fcc96931656123a7f Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Fri, 28 Oct 2022 09:30:42 +0800 Subject: [PATCH 115/310] =?UTF-8?q?REPORT-80690=20=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E5=8D=95=E5=85=83=E6=A0=BC=20=E3=80=90?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=20=E3=80=90?= =?UTF-8?q?=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E6=93=8D=E4=BD=9C=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=20=E3=80=90review=E5=BB=BA=E8=AE=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/EastRegionContainerPane.java | 7 +- .../cell/AbstractCellElementAction.java | 49 ++-- .../design/dscolumn/DSColumnAdvancedPane.java | 80 ------ .../dscolumn/ResultSetGroupDockingPane.java | 11 + .../design/dscolumn/ResultSetGroupPane.java | 25 +- .../com/fr/grid/selection/CellSelection.java | 70 +++++- .../com/fr/quickeditor/CellQuickEditor.java | 234 +++++++++++++++--- .../cellquick/CellDSColumnEditor.java | 198 ++++++++++++--- .../cellquick/CellFormulaQuickEditor.java | 50 ---- .../cellquick/CellStringQuickEditor.java | 52 ---- 10 files changed, 480 insertions(+), 296 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index d640f84f44..d32a54ca4f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -354,12 +354,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { public void updateCellElementState(boolean isSelectedOneCell) { PropertyItem cellElement = propertyItemMap.get(KEY_CELL_ELEMENT); - if (isSelectedOneCell) { - enableCellElementPane(cellElement); - } else { // 如果选中多个单元格,禁用单元格元素 tab - disableCellElementPane(cellElement); - refreshRightPane(); - } + enableCellElementPane(cellElement); } // 禁用单元格元素tab diff --git a/designer-realize/src/main/java/com/fr/design/actions/cell/AbstractCellElementAction.java b/designer-realize/src/main/java/com/fr/design/actions/cell/AbstractCellElementAction.java index e4108e6d2f..0b2e702de3 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/cell/AbstractCellElementAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/cell/AbstractCellElementAction.java @@ -14,6 +14,8 @@ import com.fr.report.core.SheetUtils; import com.fr.report.elementcase.TemplateElementCase; import com.fr.report.stable.ReportConstants; +import java.awt.Rectangle; + /** * TODO ALEX_SEP 这个类与AbstractCellAction有什么关系? * @@ -45,28 +47,31 @@ public abstract class AbstractCellElementAction extends CellSelectionAction { dialog.addDialogActionListener(new DialogActionAdapter() { @Override public void doOk() { - // 需要先行后列地增加新元素。 - for (int j = 0; j < finalCS.getRowSpan(); j++) { - for (int i = 0; i < finalCS.getColumnSpan(); i++) { - int column = i + finalCS.getColumn(); - int row = j + finalCS.getRow(); - TemplateCellElement editCellElement = tplEC.getTemplateCellElement(column, row); - if (editCellElement == null) { - editCellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row); - tplEC.addCellElement(editCellElement); - } - // alex:不加这一句话会导致跨行跨列的格子被多次update - if (editCellElement.getColumn() != column || editCellElement.getRow() != row) { - continue; - } - updateBasicPane(bp, editCellElement); - // update cell attributes - if (isNeedShinkToFit()) { - // shink to fit.(如果value是String) - Object editElementValue = editCellElement.getValue(); - if (editElementValue != null && (editElementValue instanceof String || editElementValue instanceof Number)) { - // TODO ALEX_SEP 暂时用FIT_DEFAULT替代,不取reportsetting里面的设置,因为也不知道是应该放在report里面还是elementcase里面 - GridUtils.shrinkToFit(ReportConstants.AUTO_SHRINK_TO_FIT_DEFAULT, tplEC, editCellElement); + for (int rect = 0; rect < finalCS.getCellRectangleCount(); rect++) { + Rectangle cellRectangle = finalCS.getCellRectangle(rect); + // 需要先行后列地增加新元素。 + for (int j = 0; j < cellRectangle.height; j++) { + for (int i = 0; i < cellRectangle.width; i++) { + int column = i + cellRectangle.x; + int row = j + cellRectangle.y; + TemplateCellElement editCellElement = tplEC.getTemplateCellElement(column, row); + if (editCellElement == null) { + editCellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row); + tplEC.addCellElement(editCellElement); + } + // alex:不加这一句话会导致跨行跨列的格子被多次update + if (editCellElement.getColumn() != column || editCellElement.getRow() != row) { + continue; + } + updateBasicPane(bp, editCellElement); + // update cell attributes + if (isNeedShinkToFit()) { + // shink to fit.(如果value是String) + Object editElementValue = editCellElement.getValue(); + if (editElementValue != null && (editElementValue instanceof String || editElementValue instanceof Number)) { + // TODO ALEX_SEP 暂时用FIT_DEFAULT替代,不取reportsetting里面的设置,因为也不知道是应该放在report里面还是elementcase里面 + GridUtils.shrinkToFit(ReportConstants.AUTO_SHRINK_TO_FIT_DEFAULT, tplEC, editCellElement); + } } } } diff --git a/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java b/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java index 91c8fa292c..e1b8a676ad 100644 --- a/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java +++ b/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java @@ -8,7 +8,6 @@ import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.formula.CustomVariableResolver; import com.fr.design.formula.FormulaFactory; import com.fr.design.formula.UIFormula; -import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icombobox.UIComboBox; @@ -16,7 +15,6 @@ import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.gui.style.TextFormatPane; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -52,7 +50,6 @@ public class DSColumnAdvancedPane extends BasicPane { private SortPane sortPane; private SelectCountPane selectCountPane; private ValuePane valuePane; - private FormatAttrPane formatAttrPane; private UICheckBox horizontalExtendableCheckBox; private UICheckBox verticalExtendableCheckBox; private UICheckBox useMultiplyNumCheckBox; @@ -89,10 +86,6 @@ public class DSColumnAdvancedPane extends BasicPane { valuePane = new ValuePane(); valuePane.setBorder(UITitledBorder.createBorderWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Custom_Data_Appearance"))); - formatAttrPane = new FormatAttrPane(); - JPanel titleBorderedFormatPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Format")); - titleBorderedFormatPane.add(formatAttrPane, BorderLayout.NORTH); - JPanel extendablePane = null; if (setting > DSColumnPane.SETTING_DSRELATED) { // extendableDirectionPane @@ -130,7 +123,6 @@ public class DSColumnAdvancedPane extends BasicPane { {sortPane}, {selectCountPane}, {valuePane}, - {titleBorderedFormatPane}, {extendablePane}, {multiNumPane} }; @@ -138,7 +130,6 @@ public class DSColumnAdvancedPane extends BasicPane { components = new Component[][]{ {sortPane}, {valuePane}, - {titleBorderedFormatPane} }; } @@ -161,7 +152,6 @@ public class DSColumnAdvancedPane extends BasicPane { sortPane.populateBean(cellElement); valuePane.populate(cellElement); - formatAttrPane.populate(cellElement); if (selectCountPane != null) { selectCountPane.populate(cellElement); @@ -211,7 +201,6 @@ public class DSColumnAdvancedPane extends BasicPane { sortPane.updateBean(cellElement); valuePane.update(cellElement); - formatAttrPane.update(cellElement); if (selectCountPane != null) { selectCountPane.update(cellElement); @@ -518,75 +507,6 @@ public class DSColumnAdvancedPane extends BasicPane { } } - - public static class ReLayoutTextFormatPane extends TextFormatPane { - - protected void initLayout() { - JComponent[][] components = new JComponent[][] { {typeComboBox, textField, roundingBox} }; - double[] rowSize = new double[] { TableLayout.FILL }; - double[] columnSize = {TableLayout.PREFERRED, 200, TableLayout.PREFERRED}; - - JPanel settingPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 4, 0); - - addComponents(4, new JComponent[]{settingPane, previewLabel}); - } - - @Override - protected void setRoundingBoxVisible(boolean visible) { - roundingBox.setVisible(visible); - } - - public void populate(CellElement cellElement) { - if (cellElement != null) { - populateBean(cellElement.getStyle()); - } - } - - public void update(CellElement cellElement) { - if (cellElement != null) { - cellElement.setStyle(update(cellElement.getStyle())); - } - } - } - - public static class FormatAttrPane extends AbstractAttrNoScrollPane { - private TextFormatPane formatPane; - - @Override - protected JPanel createContentPane() { - this.formatPane = new ReLayoutTextFormatPane(); - return this.formatPane; - } - - @Override - public Dimension getPreferredSize() { - if (formatPane == null) { - return super.getPreferredSize(); - } - return formatPane.getPreferredSize(); - } - - protected void initContentPane() { - leftContentPane = createContentPane(); - if (leftContentPane != null) { - leftContentPane.setBorder(BorderFactory.createEmptyBorder()); - this.add(leftContentPane, BorderLayout.CENTER); - } - } - - public void populate(CellElement cellElement) { - if (cellElement != null && formatPane != null) { - formatPane.populateBean(cellElement.getStyle()); - } - } - - public void update(CellElement cellElement) { - if (cellElement != null && formatPane != null) { - cellElement.setStyle(formatPane.update(cellElement.getStyle())); - } - } - } - private void checkButtonEnabled() { if (useMultiplyNumCheckBox.isSelected()) { multiNumSpinner.setEnabled(true); diff --git a/designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupDockingPane.java b/designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupDockingPane.java index b1784cb24b..a485fab05d 100644 --- a/designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupDockingPane.java +++ b/designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupDockingPane.java @@ -26,6 +26,7 @@ import java.awt.Component; import java.awt.Dimension; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; +import java.util.Set; /** * 这个pane是选中数据列后,在上方QuickRegion处显示的pane @@ -167,6 +168,11 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane { @Override public void update() { + updateCellElement(cellElement); + } + + + private void updateCellElement(TemplateCellElement cellElement) { if (isNPE(cellElement)) { return; } @@ -242,4 +248,9 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane { groupComboBox.removeItemListener(this.listener); functionComboBox.removeItemListener(this.listener); } + + @Override + public void update(Set cellElements) { + cellElements.forEach(this::updateCellElement); + } } \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupPane.java b/designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupPane.java index 2097dfcfc3..2fb7b98496 100644 --- a/designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupPane.java +++ b/designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupPane.java @@ -1,17 +1,10 @@ package com.fr.design.dscolumn; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import javax.swing.JPanel; -import javax.swing.SwingUtilities; - import com.fr.design.data.DesignTableDataManager; +import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; -import com.fr.design.dialog.DialogActionAdapter; - import com.fr.report.cell.CellElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.cellattr.core.group.CustomGrouper; @@ -19,6 +12,12 @@ import com.fr.report.cell.cellattr.core.group.DSColumn; import com.fr.report.cell.cellattr.core.group.FunctionGrouper; import com.fr.report.cell.cellattr.core.group.RecordGrouper; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.Set; + //august:1:31 我又改回以前的样子了 neil那个方法还是有bug 9922 public abstract class ResultSetGroupPane extends JPanel { @@ -38,7 +37,15 @@ public abstract class ResultSetGroupPane extends JPanel { abstract void update(); - abstract void setRecordGrouper(RecordGrouper recordGrouper); + /** + * 批量更新数据设置 + * + * @param cellElements 需要更新的单元格 + */ + public void update(Set cellElements) { + } + + abstract void setRecordGrouper(RecordGrouper recordGrouper); void fireTargetChanged() { }; diff --git a/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java b/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java index 7a23a1396a..4d3568cd86 100644 --- a/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java +++ b/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java @@ -34,6 +34,7 @@ import com.fr.design.report.RowColumnPane; import com.fr.design.selection.QuickEditor; import com.fr.grid.GridUtils; import com.fr.report.cell.CellElement; +import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.cellattr.CellGUIAttr; import com.fr.report.elementcase.TemplateElementCase; @@ -46,8 +47,10 @@ import javax.swing.JOptionPane; import javax.swing.SwingUtilities; import java.awt.Rectangle; import java.util.ArrayList; +import java.util.HashSet; import java.util.Iterator; import java.util.List; +import java.util.Set; /** * the cell selection (column,row)是所选单元格中左上角的位置 , 这个数据结构就是一个Rectangle @@ -739,16 +742,77 @@ public class CellSelection extends Selection { TemplateElementCase tplEC = ePane.getEditingElementCase(); TemplateCellElement cellElement = tplEC.getTemplateCellElement(column, row); Object value = null; - boolean b = ePane.isSelectedOneCell(); - if (cellElement != null && b) { + if (cellElement != null) { value = cellElement.getValue(); } - value = value == null ? StringUtils.EMPTY : value; + Set allCellElement = getAllCellElements(tplEC); + + boolean sameType = checkSameType(allCellElement); + + // 多选时,多元格元素类型 + value = sameType && value != null ? value : StringUtils.EMPTY; //之前是少了个bigInteger,刚kunsnat又发现少了个bigDecimal,数字类型的都用stringEditor,没必要那个样子 QuickEditor editor = ActionFactory.getCellEditor((value instanceof Number) ? (Number.class) : (value.getClass())); return editor; } + /** + * 选中的单元格插入元素类型是否相同 + * + * @param cellElements 单元格 + * @return true: 相同 + */ + public boolean checkSameType(Set cellElements) { + Class lastType = null; + for (TemplateCellElement cellElement : cellElements) { + + Object value = cellElement.getValue(); + if (value == null) { + value = StringUtils.EMPTY; + } + + Class type = value.getClass(); + if (lastType != null && lastType != type) { + return false; + } + lastType = type; + } + return true; + } + + /** + * 获取当前选中的所有单元格,若选中未编辑状态的单元格,暂时不添加为编辑状态 + * + * @param elementCase + * @return 获取当前选中的所有单元格 + */ + public Set getAllCellElements(TemplateElementCase elementCase) { + + Set cellElements = new HashSet<>(); + // 遍历选择的rect + for (int rect = 0; rect < getCellRectangleCount(); rect++) { + Rectangle cellRectangle = getCellRectangle(rect); + // 遍历rect中每个ce + for (int j = 0; j < cellRectangle.height; j++) { + for (int i = 0; i < cellRectangle.width; i++) { + int column = i + cellRectangle.x; + int row = j + cellRectangle.y; + + TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row); + + if (cellElement == null) { + cellElement = new DefaultTemplateCellElement(column, row); + } + + cellElements.add(cellElement); + + } + } + } + + return cellElements; + } + @Override public void populatePropertyPane(ElementCasePane ePane) { CellElementPropertyPane.getInstance().reInit(ePane); diff --git a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java index 6c177d1334..dde927a168 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java @@ -1,13 +1,17 @@ package com.fr.quickeditor; import com.fr.base.GraphHelper; +import com.fr.base.Style; import com.fr.design.actions.UpdateAction; import com.fr.design.actions.core.ActionFactory; import com.fr.design.file.HistoryTemplateListCache; +import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; +import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.iscrollbar.UIScrollBar; import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.gui.style.TextFormatPane; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -23,6 +27,7 @@ import com.fr.design.widget.FRWidgetFactory; import com.fr.grid.selection.CellSelection; import com.fr.quickeditor.cellquick.layout.CellElementBarLayout; import com.fr.report.cell.TemplateCellElement; +import com.fr.report.elementcase.TemplateElementCase; import com.fr.stable.ColumnRow; import javax.swing.BorderFactory; @@ -31,6 +36,7 @@ import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollBar; import java.awt.BorderLayout; +import java.awt.CardLayout; import java.awt.Component; import java.awt.Container; import java.awt.Dimension; @@ -41,6 +47,8 @@ import java.awt.event.AdjustmentListener; import java.awt.event.MouseWheelEvent; import java.awt.event.MouseWheelListener; import java.util.ArrayList; +import java.util.Objects; +import java.util.Set; /** * @author zhou, yaoh.wu @@ -59,6 +67,13 @@ public abstract class CellQuickEditor extends QuickEditor { private static final int CONTENT_PANE_WIDTH_GAP = 3; private static final int MOUSE_WHEEL_SPEED = 5; private static final int SCROLLBAR_WIDTH = 7; + + /** + * 区分单选多选单元格,生成相应设置面板 + */ + private final String SINGLE_SELECT = "singleSelect"; + private final String MULTIPLE_SELECT = "multipleSelect"; + private int maxHeight = 280; private static final int TITLE_HEIGHT = 50; @@ -67,11 +82,22 @@ public abstract class CellQuickEditor extends QuickEditor { */ protected UITextField columnRowTextField; protected TemplateCellElement cellElement; + protected TextFormatPane formatPane; + private final JPanel topContentContainer; + private final JComponent centerBodyContainer; + + private CardLayout topCardLayout; + /** + * 不同单元格元素产生的面板 + */ + private CardLayout centerCardLayout; // 占位label protected final UILabel EMPTY_LABEL = new UILabel(); - private UIComboBox comboBox; + private UIComboBox singleComboBox; + private UIComboBox multipleComboBox; + private UpdateAction[] cellInsertActions; private int selectedIndex; private int currentSelectedIndex; @@ -84,16 +110,19 @@ public abstract class CellQuickEditor extends QuickEditor { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {p, f}; - JComponent centerBody = createCenterBody(); - JPanel topContent = initTopContent(); + JPanel formatContainerPanel = createFormatPane(); + topContentContainer = initTopContent(); + centerBodyContainer = createAllCenterBody(); if (isScrollAll()) { - double[] scrollAllRowSize = {p, p}; + double[] scrollAllRowSize = {p, p, p}; prepareScrollBar(); - topContent.setBorder(BorderFactory.createMatteBorder(10, 10, 0, 0, this.getBackground())); - centerBody.setBorder(BorderFactory.createMatteBorder(0, 10, 0, 0, this.getBackground())); + topContentContainer.setBorder(BorderFactory.createMatteBorder(10, 10, 0, 0, this.getBackground())); + formatContainerPanel.setBorder(BorderFactory.createMatteBorder(0, 10, 0, 0, this.getBackground())); + centerBodyContainer.setBorder(BorderFactory.createMatteBorder(0, 10, 0, 0, this.getBackground())); Component[][] components = new Component[][]{ - new Component[]{topContent, null}, - new Component[]{centerBody, null} + new Component[]{topContentContainer, null}, + new Component[]{formatContainerPanel, null}, + new Component[]{centerBodyContainer, null} }; leftContentPane = TableLayoutHelper.createGapTableLayoutPane(components, scrollAllRowSize, columnSize, HGAP, VGAP); this.setLayout(new CellElementBarLayout(leftContentPane) { @@ -122,12 +151,14 @@ public abstract class CellQuickEditor extends QuickEditor { this.add(scrollBar); this.add(leftContentPane); } else { - double[] scrollContentRowSize = {p, f}; - topContent.setBorder(BorderFactory.createMatteBorder(10, 10, 0, 10, this.getBackground())); - centerBody.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 0, this.getBackground())); + double[] scrollContentRowSize = {p, p, f}; + topContentContainer.setBorder(BorderFactory.createMatteBorder(10, 10, 0, 10, this.getBackground())); + formatContainerPanel.setBorder(BorderFactory.createMatteBorder(0, 10, 0, 10, this.getBackground())); + centerBodyContainer.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 0, this.getBackground())); Component[][] components = new Component[][]{ - new Component[]{topContent, null}, - new Component[]{centerBody, null} + new Component[]{topContentContainer, null}, + new Component[]{formatContainerPanel, null}, + new Component[]{centerBodyContainer, null} }; this.setLayout(new BorderLayout()); this.add(TableLayoutHelper.createGapTableLayoutPane(components, scrollContentRowSize, columnSize, HGAP, VGAP), BorderLayout.CENTER); @@ -156,48 +187,99 @@ public abstract class CellQuickEditor extends QuickEditor { */ public abstract Object getComboBoxSelected(); + /** + * 初始化创建单选及多选面板 + * + * @return 创建的面板 + */ + private JComponent createAllCenterBody() { + centerCardLayout = new CardLayout(); + + JPanel centerPanel = new JPanel(centerCardLayout); + + centerPanel.add(SINGLE_SELECT, createCenterBody()); + centerPanel.add(MULTIPLE_SELECT, createCenterBody4Multiple()); + + return centerPanel; + } + + /** + * 为多选单元格创建详细面板,默认创建空面板 + * + * @return 空面板 + */ + public JComponent createCenterBody4Multiple() { + return new JPanel(); + } + + /** * 刷新 */ @Override protected void refresh() { + + refreshPanel(); + + refreshFormatPanel(); + + refreshDetails(); + } + + private void refreshFormatPanel() { + if (cellElement != null) { + formatPane.populateBean(cellElement.getStyle()); + } else { + formatPane.populateBean(Style.DEFAULT_STYLE); + } + } + + private void refreshPanel() { + CellSelection cs = (CellSelection) tc.getSelection(); ColumnRow columnRow = ColumnRow.valueOf(cs.getColumn(), cs.getRow()); + String selectType = tc.isSelectedOneCell() ? SINGLE_SELECT : MULTIPLE_SELECT; + + topCardLayout.show(topContentContainer, selectType); + centerCardLayout.show(centerBodyContainer, selectType); + columnRowTextField.setText(columnRow.toString()); cellElement = tc.getEditingElementCase().getTemplateCellElement(cs.getColumn(), cs.getRow()); JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); if (jTemplate != null) { - comboBox.removeActionListener(comboBoxActionListener); - comboBox.removeAllItems(); + singleComboBox.removeActionListener(comboBoxActionListener); + singleComboBox.removeAllItems(); String[] items = getDefaultComboBoxItems(); for (String item : items) { - comboBox.addItem(item); + singleComboBox.addItem(item); + multipleComboBox.addItem(item); } Object comboBoxSelected = getComboBoxSelected(); if (comboBoxSelected != null) { - comboBox.setSelectedItem(((ShortCut) comboBoxSelected).getMenuKeySet().getMenuKeySetName()); + singleComboBox.setSelectedItem(((ShortCut) comboBoxSelected).getMenuKeySet().getMenuKeySetName()); + multipleComboBox.setSelectedItem(((ShortCut) comboBoxSelected).getMenuKeySet().getMenuKeySetName()); } else { - comboBox.setSelectedIndex(1); + singleComboBox.setSelectedIndex(1); + multipleComboBox.setSelectedIndex(1); } - currentSelectedIndex = comboBox.getSelectedIndex(); + currentSelectedIndex = singleComboBox.getSelectedIndex(); comboBoxActionListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { cellInsertActions = ActionFactory.createCellInsertAction(ElementCasePane.class, tc); - selectedIndex = comboBox.getSelectedIndex(); - comboBox.setPopupVisible(false); - comboBox.repaint(); + selectedIndex = singleComboBox.getSelectedIndex(); + singleComboBox.setPopupVisible(false); + singleComboBox.repaint(); // comboBox.getSelectedIndex()可能返回-1 if (selectedIndex != -1 && selectedIndex < cellInsertActions.length) { cellInsertActions[selectedIndex].actionPerformed(e); } - comboBox.setSelectedIndex(currentSelectedIndex); + singleComboBox.setSelectedIndex(currentSelectedIndex); } }; - comboBox.addActionListener(comboBoxActionListener); + singleComboBox.addActionListener(comboBoxActionListener); } - refreshDetails(); } /** @@ -207,6 +289,10 @@ public abstract class CellQuickEditor extends QuickEditor { private JPanel initTopContent() { + topCardLayout = new CardLayout(); + JPanel topContentPane = new JPanel(topCardLayout); + + // 单选面板 double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {GraphHelper.getWidth(Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")), f}; @@ -216,9 +302,31 @@ public abstract class CellQuickEditor extends QuickEditor { initCellElementEditComboBox(); Component[][] components = new Component[][]{ new Component[]{cellLabel, columnRowTextField = initColumnRowTextField()}, - new Component[]{insertContentLabel, UIComponentUtils.wrapWithBorderLayoutPane(comboBox)}, + new Component[]{insertContentLabel, UIComponentUtils.wrapWithBorderLayoutPane(singleComboBox)}, + }; + JPanel singlePanel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP); + topContentPane.add(SINGLE_SELECT, singlePanel); + + + // 多选面板 + UILabel multipleTipLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Basic_Cell_Element_Multiple_Tip")); + multipleTipLabel.setEnabled(false); + multipleTipLabel.setBorder(BorderFactory.createMatteBorder(5, 0, 0, 0, this.getBackground())); + UILabel insertContentLabel1 = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")); + Component[][] components1 = new Component[][]{ + new Component[]{insertContentLabel1, UIComponentUtils.wrapWithBorderLayoutPane(multipleComboBox)}, }; - return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP); + multipleComboBox.setEnabled(false); + JPanel insertPanel = TableLayoutHelper.createGapTableLayoutPane(components1, new double[]{p}, columnSize, HGAP, + VGAP); + Component[][] components2 = new Component[][]{ + new Component[]{multipleTipLabel}, + new Component[]{insertPanel}, + }; + JPanel multiplePanel = TableLayoutHelper.createGapTableLayoutPane(components2, rowSize, new double[]{f}, HGAP, VGAP); + topContentPane.add(MULTIPLE_SELECT, multiplePanel); + + return topContentPane; } private void prepareScrollBar() { @@ -266,19 +374,23 @@ public abstract class CellQuickEditor extends QuickEditor { private void initCellElementEditComboBox() { JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); if (jTemplate == null) { - comboBox = new UIComboBox(); + singleComboBox = new UIComboBox(); + multipleComboBox = new UIComboBox(); return; } final String[] items = getDefaultComboBoxItems(); - comboBox = new UIComboBox(items); + singleComboBox = new UIComboBox(items); + multipleComboBox = new UIComboBox(items); final Object comboBoxSelected = getComboBoxSelected(); if (comboBoxSelected != null) { - comboBox.setSelectedItem(((ShortCut) comboBoxSelected).getMenuKeySet().getMenuKeySetName()); + singleComboBox.setSelectedItem(((ShortCut) comboBoxSelected).getMenuKeySet().getMenuKeySetName()); + multipleComboBox.setSelectedItem(((ShortCut) comboBoxSelected).getMenuKeySet().getMenuKeySetName()); } else { - comboBox.setSelectedIndex(1); + singleComboBox.setSelectedIndex(1); + multipleComboBox.setSelectedIndex(1); } - currentSelectedIndex = comboBox.getSelectedIndex(); - comboBox.addActionListener(comboBoxActionListener); + currentSelectedIndex = singleComboBox.getSelectedIndex(); + singleComboBox.addActionListener(comboBoxActionListener); } private String[] getDefaultComboBoxItems() { @@ -324,4 +436,60 @@ public abstract class CellQuickEditor extends QuickEditor { }); return columnRowTextField; } + + private JPanel createFormatPane() { + formatPane = new TextFormatPane(); + AbstractAttrNoScrollPane container = new AbstractAttrNoScrollPane() { + @Override + protected JPanel createContentPane() { + return formatPane; + } + + protected void initContentPane() { + leftContentPane = createContentPane(); + if (leftContentPane != null) { + leftContentPane.setBorder(BorderFactory.createEmptyBorder()); + this.add(leftContentPane, BorderLayout.CENTER); + } + } + + @Override + public Dimension getPreferredSize() { + if (formatPane == null) { + return super.getPreferredSize(); + } + return formatPane.getPreferredSize(); + } + }; + + container.addAttributeChangeListener(new AttributeChangeListener() { + @Override + public void attributeChange() { + + isEditing = true; + boolean updateStyle = false; + + CellSelection cs = (CellSelection) tc.getSelection(); + TemplateElementCase editingElementCase = tc.getEditingElementCase(); + Set allCellElements = cs.getAllCellElements(editingElementCase); + for (TemplateCellElement cellElement : allCellElements) { + Style elementStyle = cellElement.getStyle(); + Style style = formatPane.update(elementStyle); + if (!Objects.equals(style.getFormat(), elementStyle.getFormat())) { + // 点击单元格,但未设置格式时,不将单元格设置为编辑状态,防止将所选的每个单元格都设置为编辑状态 + editingElementCase.addCellElement(cellElement); + cellElement.setStyle(style); + updateStyle = true; + } + } + + if (updateStyle) { + // 防止频繁触发保存 + fireTargetModified(); + } + isEditing = false; + } + }); + return container; + } } diff --git a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java index 1c50499f77..0b7b011f04 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java @@ -15,10 +15,8 @@ import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.formula.CustomVariableResolver; import com.fr.design.formula.FormulaFactory; import com.fr.design.formula.UIFormula; -import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.ibutton.UIButton; -import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icombobox.UIComboBox; @@ -26,7 +24,6 @@ import com.fr.design.gui.ilable.MultilineLabel; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.gui.style.TextFormatPane; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; @@ -36,6 +33,7 @@ import com.fr.design.sort.celldscolumn.CellDSColumnSortPane; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.widget.FRWidgetFactory; import com.fr.general.IOUtils; +import com.fr.grid.selection.CellSelection; import com.fr.quickeditor.CellQuickEditor; import com.fr.report.cell.CellElement; import com.fr.report.cell.TemplateCellElement; @@ -46,12 +44,9 @@ import com.fr.report.cell.cellattr.core.group.SelectCount; import com.fr.stable.StringUtils; import javax.swing.BorderFactory; -import javax.swing.Icon; import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.SwingUtilities; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Color; @@ -63,6 +58,8 @@ import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.BOTTOM; import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.EVEN; @@ -110,6 +107,10 @@ public class CellDSColumnEditor extends CellQuickEditor { * 数据列高级设置 */ private DSColumnAdvancedEditorPane cellDSColumnAdvancedPane; + /** + * 多选面板设置 + */ + private DSColumnMultipleEditorPane cellDSColumnMultiplePane; public CellDSColumnEditor() { super(); @@ -144,6 +145,7 @@ public class CellDSColumnEditor extends CellQuickEditor { protected void refreshDetails() { cellDSColumnBasicPane.populate(); cellDSColumnAdvancedPane.populate(); + cellDSColumnMultiplePane.populate(); this.validate(); } @@ -188,6 +190,8 @@ public class CellDSColumnEditor extends CellQuickEditor { super.release(); cellDSColumnBasicPane.release(); cellDSColumnAdvancedPane.release(); + cellDSColumnMultiplePane.release(); + } /** @@ -352,10 +356,6 @@ public class CellDSColumnEditor extends CellQuickEditor { * 自定义值显示 */ private CustomValuePane valuePane; - /** - * 文本格式 - */ - private FormatAttrPane formatAttrPane; /** * 横向可扩展性 */ @@ -402,7 +402,6 @@ public class CellDSColumnEditor extends CellQuickEditor { public void update() { if (cellElement != null) { valuePane.update(cellElement); - formatAttrPane.update(cellElement); filterPane.update(cellElement); //更新单元格扩展属性 updateExtendConfig(); @@ -417,7 +416,6 @@ public class CellDSColumnEditor extends CellQuickEditor { if (cellElement != null) { this.removeAttributeChangeListener(); valuePane.populate(cellElement); - formatAttrPane.populate(cellElement); filterPane.populate(cellElement); CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr(); if (cellExpandAttr == null) { @@ -529,9 +527,6 @@ public class CellDSColumnEditor extends CellQuickEditor { //自定义值显示 valuePane = new CustomValuePane(); - // 文本格式 - formatAttrPane = new FormatAttrPane(); - //可扩展性 JPanel extendableDirectionPane = FRGUIPaneFactory.createYBoxEmptyBorderPane(); extendableDirectionPane.add(heCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_ExpandD_Horizontal_Extendable"))); @@ -559,7 +554,6 @@ public class CellDSColumnEditor extends CellQuickEditor { Component[][] components = new Component[][]{ {filterPane}, {valuePane}, - {formatAttrPane}, {extendableDirectionPane}, {multiNumPane} }; @@ -1030,45 +1024,167 @@ public class CellDSColumnEditor extends CellQuickEditor { } } - public class FormatAttrPane extends AbstractAttrNoScrollPane { - private TextFormatPane formatPane; + } + - @Override - protected JPanel createContentPane() { - this.formatPane = new TextFormatPane(); - return this.formatPane; + class DSColumnMultipleEditorPane extends AbstractDSCellEditorPane { + + /** + * 数据分组设置 + */ + private ResultSetGroupDockingPane groupPane; + /** + * 条件过滤按钮面板 + */ + private JPanel conditionPane; + + /** + * 条件过滤按钮触发动作 + */ + private DSColumnConditionAction condition; + + /** + * 条件过滤按钮 + */ + private UIButton conditionUIButton; + + + @Override + public String getIconPath() { + return Toolkit.i18nText("Fine-Design_Report_Basic"); + } + + @Override + public String title4PopupWindow() { + return Toolkit.i18nText("FR-Designer_Basic"); + } + + + @Override + public void update() { + groupPane.update(); + } + + @Override + public void populate() { + this.removeAttributeChangeListener(); + if (tc != null) { + CellSelection selection = (CellSelection) tc.getSelection(); + Set cellElements = selection.getAllCellElements(tc.getEditingElementCase()); + conditionPane.setVisible(checkSameDSName(cellElements)); + condition.setEditingComponent(tc); + cellElements.forEach(cellElement -> groupPane.populate(cellElement)); } + this.addAttributeChangeListener(); + } - @Override - public Dimension getPreferredSize() { - if (formatPane == null) { - return super.getPreferredSize(); + /** + * 判断是否属于同一个数据集 + * + * @param cellElements + * @return + */ + private boolean checkSameDSName(Set cellElements) { + String lastDSName = StringUtils.EMPTY; + for (TemplateCellElement cellElement : cellElements) { + DSColumn dsColumn = (DSColumn) cellElement.getValue(); + String dsName = dsColumn.getDSName(); + if (StringUtils.isNotEmpty(lastDSName) && !StringUtils.equals(dsName, lastDSName)) { + return false; } - return formatPane.getPreferredSize(); + lastDSName = dsName; } + return true; + } - protected void initContentPane() { - leftContentPane = createContentPane(); - if (leftContentPane != null) { - leftContentPane.setBorder(BorderFactory.createEmptyBorder()); - this.add(leftContentPane, BorderLayout.CENTER); - } + @Override + protected void release() { + condition.setEditingComponent(null); + } + + + /** + * 创建有内容的面板显示信息 + * + * @return content JPanel + */ + @Override + protected JPanel createContentPane() { + initComponents(); + double[] columnSize = {F}; + double[] rowSize = {P, P}; + Component[][] components = new Component[][]{ + //数据分组设置 + new Component[]{this.groupPane}, + //条件过滤 + new Component[]{this.conditionPane} + }; + return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP); + } + + private void initComponents() { + groupPane = new ResultSetGroupDockingPane(); + initListener(); + double[] rowSize = {P}, columnSize = {60, F}; + UILabel uiLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Report_Filter_Conditions")); + condition = new DSColumnConditionAction(); + if (tc != null) { + condition.setEditingComponent(tc); } + //丢掉icon,修改按钮名称为编辑 + condition.setSmallIcon(UIConstants.EMPTY_ICON); + condition.setName(Toolkit.i18nText("Fine-Design_Basic_Edit")); + conditionUIButton = new UIButton(condition); + Component[][] components = new Component[][]{ + new Component[]{uiLabel, UIComponentUtils.wrapWithBorderLayoutPane(conditionUIButton)} + }; + conditionPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP); + this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); + } - public void populate(CellElement cellElement) { - if (cellElement != null && formatPane != null) { - formatPane.populateBean(cellElement.getStyle()); + + private void initListener() { + groupPane.setListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + Set cellElements = new HashSet<>(); + if (tc != null) { + CellSelection selection = (CellSelection) tc.getSelection(); + cellElements = selection.getAllCellElements(tc.getEditingElementCase()); + } + + if (e == null) { + //分组-高级-自定义点确定的时候传进来null的e,但是这时候应该触发保存 + groupPane.update(cellElements); + fireTargetModified(); + return; + } + if (e.getStateChange() == ItemEvent.DESELECTED) { + groupPane.update(cellElements); + fireTargetModified(); + } } - } + }); + } - public void update(CellElement cellElement) { - if (cellElement != null && formatPane != null) { - cellElement.setStyle(formatPane.update(cellElement.getStyle())); + @Override + protected AttributeChangeListener getAttributeChangeListener() { + return new AttributeChangeListener() { + @Override + public void attributeChange() { + update(); + fireTargetModified(); } - } + }; } } + @Override + public JComponent createCenterBody4Multiple() { + cellDSColumnMultiplePane = new DSColumnMultipleEditorPane(); + return cellDSColumnMultiplePane; + } + @Override public Object getComboBoxSelected() { return ActionFactory.createAction(DSColumnCellAction.class); diff --git a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java index 30a5f0f558..297b0feb9e 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java @@ -8,17 +8,13 @@ import com.fr.design.actions.insert.cell.FormulaCellAction; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.formula.FormulaFactory; import com.fr.design.formula.UIFormula; -import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; -import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.gui.style.TextFormatPane; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase; import com.fr.general.IOUtils; - import com.fr.grid.selection.CellSelection; import com.fr.quickeditor.CellQuickEditor; import com.fr.report.ReportHelper; @@ -50,7 +46,6 @@ import java.util.Arrays; public class CellFormulaQuickEditor extends CellQuickEditor { //文本域 private UITextField formulaTextField; - private TextFormatPane formatPane; //编辑状态 private boolean isEditing = false; @@ -144,57 +139,16 @@ public class CellFormulaQuickEditor extends CellQuickEditor { Component[][] componentLines = new Component[][] { new Component[]{EMPTY_LABEL, content}, - new Component[]{createFormatPane(), null}, }; double[] rowSize = new double[componentLines.length]; Arrays.fill(rowSize, TableLayout.PREFERRED); double[] columnSize = new double[] {TableLayout.PREFERRED, TableLayout.FILL }; return TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ new Component[]{EMPTY_LABEL, content}, - new Component[]{createFormatPane(), null}, }, rowSize, columnSize, HGAP, VGAP); } - private JPanel createFormatPane() { - formatPane = new TextFormatPane(); - AbstractAttrNoScrollPane container = new AbstractAttrNoScrollPane() { - @Override - protected JPanel createContentPane() { - return formatPane; - } - - protected void initContentPane() { - leftContentPane = createContentPane(); - if (leftContentPane != null) { - leftContentPane.setBorder(BorderFactory.createEmptyBorder()); - this.add(leftContentPane, BorderLayout.CENTER); - } - } - }; - - container.addAttributeChangeListener(new AttributeChangeListener() { - @Override - public void attributeChange() { - isEditing = true; - - CellSelection cs1 = (CellSelection) tc.getSelection(); - cellElement = tc.getEditingElementCase().getTemplateCellElement(cs1.getColumn(), cs1.getRow()); - - if (cellElement == null) { - CellSelection cs = (CellSelection) tc.getSelection(); - cellElement = DefaultThemedTemplateCellElementCase.createInstance(cs.getColumn(), cs.getRow()); - tc.getEditingElementCase().addCellElement(cellElement, false); - } - - cellElement.setStyle(formatPane.update(cellElement.getStyle())); - - fireTargetModified(); - isEditing = false; - } - }); - return container; - } @Override public Object getComboBoxSelected() { @@ -257,10 +211,6 @@ public class CellFormulaQuickEditor extends CellQuickEditor { showText(str); formulaTextField.setEditable(tc.isSelectedOneCell()); - if (cellElement != null) { - Style style = cellElement.getStyle(); - formatPane.populateBean(style); - } } /** diff --git a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellStringQuickEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellStringQuickEditor.java index 1b2c9ae4db..126486d13e 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellStringQuickEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellStringQuickEditor.java @@ -4,10 +4,7 @@ import com.fr.base.BaseFormula; import com.fr.base.Style; import com.fr.base.TextFormat; import com.fr.design.designer.IntervalConstants; -import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; -import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.itextarea.UITextArea; -import com.fr.design.gui.style.TextFormatPane; import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase; import com.fr.grid.GridKeyListener; import com.fr.grid.selection.CellSelection; @@ -16,7 +13,6 @@ import com.fr.report.ReportHelper; import com.fr.stable.ColumnRow; import com.fr.stable.StringUtils; -import javax.swing.BorderFactory; import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.event.DocumentEvent; @@ -31,7 +27,6 @@ import java.awt.event.KeyEvent; public class CellStringQuickEditor extends CellQuickEditor { //文本域 直接可以自适应大小 private UITextArea stringTextArea; - private TextFormatPane formatPane; //编辑状态 private boolean isEditing = false; @@ -95,51 +90,9 @@ public class CellStringQuickEditor extends CellQuickEditor { }); content.add(stringTextArea, BorderLayout.NORTH); - content.add(createFormatPane(), BorderLayout.CENTER); - return content; } - private JPanel createFormatPane() { - formatPane = new TextFormatPane(); - AbstractAttrNoScrollPane container = new AbstractAttrNoScrollPane() { - @Override - protected JPanel createContentPane() { - return formatPane; - } - - protected void initContentPane() { - leftContentPane = createContentPane(); - if (leftContentPane != null) { - leftContentPane.setBorder(BorderFactory.createEmptyBorder()); - this.add(leftContentPane, BorderLayout.CENTER); - } - } - }; - - container.addAttributeChangeListener(new AttributeChangeListener() { - @Override - public void attributeChange() { - isEditing = true; - - CellSelection cs1 = (CellSelection) tc.getSelection(); - cellElement = tc.getEditingElementCase().getTemplateCellElement(cs1.getColumn(), cs1.getRow()); - - if (cellElement == null) { - CellSelection cs = (CellSelection) tc.getSelection(); - cellElement = DefaultThemedTemplateCellElementCase.createInstance(cs.getColumn(), cs.getRow()); - tc.getEditingElementCase().addCellElement(cellElement, false); - } - - cellElement.setStyle(formatPane.update(cellElement.getStyle())); - - fireTargetModified(); - isEditing = false; - } - }); - return container; - } - @Override public boolean isScrollAll() { return true; @@ -200,11 +153,6 @@ public class CellStringQuickEditor extends CellQuickEditor { } showText(str); stringTextArea.setEditable(tc.isSelectedOneCell()); - - if (cellElement != null) { - Style style = cellElement.getStyle(); - formatPane.populateBean(style); - } } /** From c0151166701f3d4c711350f60b75776c6b6bbc9f Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Fri, 28 Oct 2022 10:12:31 +0800 Subject: [PATCH 116/310] =?UTF-8?q?REPORT-80695=20=E3=80=90=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E5=85=A8=E5=B1=80=E7=BA=A7=E5=88=AB=E6=9F=A5=E6=89=BE?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E4=BA=8C=E6=9C=9F=E3=80=91=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=E9=83=A8=E5=88=86=E9=9D=99=E6=80=81=EF=BC=8C=E5=88=A0=E5=87=8F?= =?UTF-8?q?=E5=A4=9A=E4=BD=99=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../action/setting/SettingController.java | 6 ++-- .../action/SearchConnectionAction.java | 12 ++++---- .../setting/action/SearchDSColumnAction.java | 12 ++++---- .../actions/replace/info/DSColumnInfo.java | 28 ------------------- ...onnectionInfo.java => DataSourceInfo.java} | 8 +++--- .../replace/ui/ITReplaceMainDialog.java | 20 +++++++++---- .../replace/ui/ITReplaceSouthPanel.java | 11 ++++++-- 7 files changed, 41 insertions(+), 56 deletions(-) delete mode 100644 designer-realize/src/main/java/com/fr/design/actions/replace/info/DSColumnInfo.java rename designer-realize/src/main/java/com/fr/design/actions/replace/info/{ConnectionInfo.java => DataSourceInfo.java} (60%) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingController.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingController.java index fa7fcc0b09..8dd29b2364 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingController.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingController.java @@ -8,7 +8,7 @@ import com.fr.design.actions.replace.action.setting.action.SearchCellFormatActio import com.fr.design.actions.replace.action.setting.action.SearchConnectionAction; import com.fr.design.actions.replace.action.setting.action.SearchDSColumnAction; import com.fr.design.actions.replace.info.CellInfo; -import com.fr.design.actions.replace.info.ConnectionInfo; +import com.fr.design.actions.replace.info.DataSourceInfo; import com.fr.design.actions.replace.info.Info; import com.fr.design.actions.replace.ui.ITReplaceNorthPanel; import com.fr.design.data.DesignTableDataManager; @@ -224,10 +224,10 @@ public enum SettingController implements ShowValue { @Override public List addMatchResult(List list, String settingStr, String extraStr) { - List connectionInfos = new ArrayList<>(); + List connectionInfos = new ArrayList<>(); for (Info info : list) { if (StringUtils.equals(info.getContent().getShowStr(), settingStr)) { - connectionInfos.add((ConnectionInfo) info); + connectionInfos.add((DataSourceInfo) info); } } return connectionInfos; diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchConnectionAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchConnectionAction.java index 2f4a75ba48..bd69a52365 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchConnectionAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchConnectionAction.java @@ -6,7 +6,7 @@ import com.fr.data.TableDataSource; import com.fr.data.impl.Connection; import com.fr.data.impl.NameDatabaseConnection; import com.fr.design.actions.replace.action.SearchAction; -import com.fr.design.actions.replace.info.ConnectionInfo; +import com.fr.design.actions.replace.info.DataSourceInfo; import com.fr.design.actions.replace.info.base.ITContent; import com.fr.design.mainframe.JTemplate; import com.fr.file.ConnectionConfig; @@ -25,7 +25,7 @@ import java.util.Map; * created by Destiny.Lin on 2022-10-26 */ public class SearchConnectionAction implements SearchAction { - private List connectionInfos = new ArrayList<>(); + private List connectionInfos = new ArrayList<>(); private SearchConnectionAction() { @@ -34,7 +34,7 @@ public class SearchConnectionAction implements SearchAction { @Override public void search4Infos(JTemplate jTemplate) { - List connectionInfos = new ArrayList<>(); + List connectionInfos = new ArrayList<>(); Map map = ConnectionConfig.getInstance().getConnections(); Map needMap = new HashMap<>(); TableDataSource source = (TableDataSource) jTemplate.getTarget(); @@ -55,7 +55,7 @@ public class SearchConnectionAction implements SearchAction { content.setTemplateName(jTemplate.getTemplateName()); content.setJumpAble(false); content.setShowStr(name); - connectionInfos.add(new ConnectionInfo(content)); + connectionInfos.add(new DataSourceInfo(content)); } setConnectionInfos(connectionInfos); } @@ -70,11 +70,11 @@ public class SearchConnectionAction implements SearchAction { return data instanceof TableDataConnection && ((TableDataConnection) data).getDatabase() instanceof NameDatabaseConnection; } - public List getConnectionInfos() { + public List getConnectionInfos() { return connectionInfos; } - public void setConnectionInfos(List connectionInfos) { + public void setConnectionInfos(List connectionInfos) { this.connectionInfos = connectionInfos; } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchDSColumnAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchDSColumnAction.java index 1cba80902b..9493cbfa7d 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchDSColumnAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchDSColumnAction.java @@ -3,7 +3,7 @@ package com.fr.design.actions.replace.action.setting.action; import com.fr.base.TableData; import com.fr.data.TableDataSource; import com.fr.design.actions.replace.action.SearchAction; -import com.fr.design.actions.replace.info.DSColumnInfo; +import com.fr.design.actions.replace.info.DataSourceInfo; import com.fr.design.actions.replace.info.base.ITContent; import com.fr.design.mainframe.JTemplate; @@ -19,7 +19,7 @@ import java.util.List; * created by Destiny.Lin on 2022-10-26 */ public class SearchDSColumnAction implements SearchAction { - private List dsColumnInfos = new ArrayList<>(); + private List dsColumnInfos = new ArrayList<>(); private SearchDSColumnAction() { @@ -27,7 +27,7 @@ public class SearchDSColumnAction implements SearchAction { @Override public void search4Infos(JTemplate jTemplate) { - List dsColumnInfos = new ArrayList<>(); + List dsColumnInfos = new ArrayList<>(); TableDataSource source = (TableDataSource) jTemplate.getTarget(); Iterator dataIterator = source.getTableDataNameIterator(); while (dataIterator.hasNext()) { @@ -38,16 +38,16 @@ public class SearchDSColumnAction implements SearchAction { content.setReplaceObject(data); content.setShowStr(dataName); content.setTemplateName(jTemplate.getTemplateName()); - dsColumnInfos.add(new DSColumnInfo(content)); + dsColumnInfos.add(new DataSourceInfo(content)); setDsColumnInfos(dsColumnInfos); } } - public List getDsColumnInfos() { + public List getDsColumnInfos() { return dsColumnInfos; } - public void setDsColumnInfos(List dsColumnInfos) { + public void setDsColumnInfos(List dsColumnInfos) { this.dsColumnInfos = dsColumnInfos; } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/DSColumnInfo.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/DSColumnInfo.java deleted file mode 100644 index f51a75fe5c..0000000000 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/DSColumnInfo.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.fr.design.actions.replace.info; - -import com.fr.design.actions.replace.info.base.ITContent; - -/** - * 存储数据列 - * - * @author Destiny.Lin - * @version 11.0 - * created by Destiny.Lin on 2022-10-26 - */ -public class DSColumnInfo implements Info { - private ITContent content; - - - public DSColumnInfo(ITContent content) { - this.content = content; - } - - @Override - public ITContent getContent() { - return content; - } - - public void setContent(ITContent content) { - this.content = content; - } -} diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ConnectionInfo.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/DataSourceInfo.java similarity index 60% rename from designer-realize/src/main/java/com/fr/design/actions/replace/info/ConnectionInfo.java rename to designer-realize/src/main/java/com/fr/design/actions/replace/info/DataSourceInfo.java index b88c8c6e07..f1c4cbd12c 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ConnectionInfo.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/DataSourceInfo.java @@ -3,17 +3,17 @@ package com.fr.design.actions.replace.info; import com.fr.design.actions.replace.info.base.ITContent; /** - * 存储数据连接 + * 存储数据源相关的信息,后续数据源部分如果有自己额外的信息把这个当成父类进行拓展即可 * * @author Destiny.Lin * @version 11.0 - * created by Destiny.Lin on 2022-10-26 + * created by Destiny.Lin on 2022-10-28 */ -public class ConnectionInfo implements Info { +public class DataSourceInfo implements Info{ private ITContent content; - public ConnectionInfo(ITContent content) { + public DataSourceInfo(ITContent content) { this.content = content; } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index 8497dcff01..e207ca5004 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -214,7 +214,7 @@ public class ITReplaceMainDialog extends UIDialog { Toolkit.i18nText("Fine-Design_Replace_Message"), Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), JOptionPane.YES_NO_CANCEL_OPTION, - JOptionPane.ERROR_MESSAGE, + JOptionPane.WARNING_MESSAGE, null, // 如果传null, 则按钮为 optionType 类型所表示的按钮(也就是确认对话框) options, @@ -437,7 +437,7 @@ public class ITReplaceMainDialog extends UIDialog { Toolkit.i18nText("Fine-Design_Replace_Message"), Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), JOptionPane.YES_NO_CANCEL_OPTION, - JOptionPane.ERROR_MESSAGE, + JOptionPane.WARNING_MESSAGE, null, // 如果传null, 则按钮为 optionType 类型所表示的按钮(也就是确认对话框) options, @@ -535,8 +535,12 @@ public class ITReplaceMainDialog extends UIDialog { return searchContentResultList; } - public void setSearchContentResultList(List searchContentResultList) { - this.searchContentResultList = searchContentResultList; + /** + * 设置模板内容数据 + * @param searchContentResultList 模板内容表格的数据 + */ + public static void setSearchContentResultList(List searchContentResultList) { + ITReplaceMainDialog.searchContentResultList = searchContentResultList; } /** @@ -547,8 +551,12 @@ public class ITReplaceMainDialog extends UIDialog { return searchSettingResultList; } - public void setSearchSettingResultList(List searchSettingResultList) { - this.searchSettingResultList = searchSettingResultList; + /** + * 设置设置项的数据 + * @param searchSettingResultList 设置项表格的数据 + */ + public static void setSearchSettingResultList(List searchSettingResultList) { + ITReplaceMainDialog.searchSettingResultList = searchSettingResultList; } /** diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java index cd086d903c..2a555a4387 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java @@ -14,7 +14,7 @@ import java.awt.Color; */ public class ITReplaceSouthPanel { ITTableEditorPane tableEditorPane; - public static ITTableEditor itTableEditor; + private static ITTableEditor itTableEditor; //勾选框索引 public static final int CHECKBOX_INDEX = 0; //ITContent在表格的列索引 @@ -56,7 +56,12 @@ public class ITReplaceSouthPanel { return itTableEditor; } - public void setItTableEditor(ITTableEditor itTableEditor) { - this.itTableEditor = itTableEditor; + /** + * 设置表格的editor,可用于刷新表格的数据 + * + * @param itTableEditor 表格的editor + */ + public static void setItTableEditor(ITTableEditor itTableEditor) { + ITReplaceSouthPanel.itTableEditor = itTableEditor; } } From aca1701772f2df3c87acd5d5bdee85cd4801cf34 Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Fri, 28 Oct 2022 11:13:45 +0800 Subject: [PATCH 117/310] =?UTF-8?q?REPORT-80690=20=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E5=8D=95=E5=85=83=E6=A0=BC=20=E3=80=90?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=20=E3=80=90?= =?UTF-8?q?=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E6=93=8D=E4=BD=9C=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=20=E3=80=90review=E5=BB=BA=E8=AE=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/actions/cell/AbstractCellElementAction.java | 6 +++++- .../src/main/java/com/fr/quickeditor/CellQuickEditor.java | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/cell/AbstractCellElementAction.java b/designer-realize/src/main/java/com/fr/design/actions/cell/AbstractCellElementAction.java index 0b2e702de3..450c326915 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/cell/AbstractCellElementAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/cell/AbstractCellElementAction.java @@ -68,7 +68,7 @@ public abstract class AbstractCellElementAction extends CellSelectionAction { if (isNeedShinkToFit()) { // shink to fit.(如果value是String) Object editElementValue = editCellElement.getValue(); - if (editElementValue != null && (editElementValue instanceof String || editElementValue instanceof Number)) { + if (checkValueType(editElementValue)) { // TODO ALEX_SEP 暂时用FIT_DEFAULT替代,不取reportsetting里面的设置,因为也不知道是应该放在report里面还是elementcase里面 GridUtils.shrinkToFit(ReportConstants.AUTO_SHRINK_TO_FIT_DEFAULT, tplEC, editCellElement); } @@ -78,6 +78,10 @@ public abstract class AbstractCellElementAction extends CellSelectionAction { } ePane.fireTargetModified(); } + + private boolean checkValueType(Object editElementValue) { + return editElementValue instanceof String || editElementValue instanceof Number; + } }); //控件设置记住dlg,提交入库智能添加单元格后可以show出来 DesignerContext.setReportWritePane(dialog); diff --git a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java index dde927a168..107b06e5e9 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java @@ -82,7 +82,7 @@ public abstract class CellQuickEditor extends QuickEditor { */ protected UITextField columnRowTextField; protected TemplateCellElement cellElement; - protected TextFormatPane formatPane; + private TextFormatPane formatPane; private final JPanel topContentContainer; private final JComponent centerBodyContainer; @@ -437,6 +437,10 @@ public abstract class CellQuickEditor extends QuickEditor { return columnRowTextField; } + /** + * 创建格式化面板 + * @return + */ private JPanel createFormatPane() { formatPane = new TextFormatPane(); AbstractAttrNoScrollPane container = new AbstractAttrNoScrollPane() { From b08e6be68d743ab4520c06a9518d15a94301fd8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvan-=E6=AC=A7=E9=98=B3=E5=B8=86?= Date: Fri, 28 Oct 2022 11:18:12 +0800 Subject: [PATCH 118/310] =?UTF-8?q?REPORT-80693=20-=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=84=B1=E6=95=8F=E4=BA=8C=E6=9C=9F=EF=BC=88=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=EF=BC=89=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0?= =?UTF-8?q?=E3=80=91rt=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF?= =?UTF-8?q?=E3=80=91=E8=AF=A6=E8=A7=81https://kms.fineres.com/pages/viewpa?= =?UTF-8?q?ge.action=3FpageId=3D550539157=20=E3=80=90review=E5=BB=BA?= =?UTF-8?q?=E8=AE=AE=E3=80=91=E6=96=87=E6=A1=A3=E5=BF=98=E8=AE=B0=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E8=AF=84=E5=AE=A1=E4=BA=86=EF=BC=8Creview=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=E5=B8=AE=E5=BF=99=E6=89=93=E4=B8=AA=E5=88=86?= =?UTF-8?q?=EF=BC=8C=E6=84=9F=E8=B0=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datapane/preview/PreviewTableModel.java | 13 +++ .../datapane/preview/PreviewTablePane.java | 2 +- .../TableDataPreviewDesensitizeManager.java | 51 +++++------ .../model/DesensitizedPreviewTableModel.java | 26 +++--- .../rule/DesensitizationRuleChoosePane.java | 3 + .../rule/DesensitizationRuleDebugPane.java | 2 +- .../rule/DesensitizationRuleEditPane.java | 10 +-- .../TableDataDesensitizationSettingPane.java | 12 +-- .../TableDataDesensitizationTableModel.java | 89 +++++++------------ .../TableDataDesensitizationTablePane.java | 8 +- 10 files changed, 99 insertions(+), 117 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTableModel.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTableModel.java index 49ce4ba420..9074a18d66 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTableModel.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTableModel.java @@ -116,6 +116,19 @@ public class PreviewTableModel extends AbstractTableModel { } } + /** + * 根据列名获取列序号,当返回-1时代表异常,异常会被忽略,不打印日志或给出前台提示 + * @param columnName + * @return + */ + public int getColumnIndexWithExceptionIngore(String columnName) { + try { + return dataModel.getColumnIndex(columnName); + } catch (TableDataException ingore) { + return -1; + } + } + public int getRowCount() { try { return this.dataModel.getRowCount(); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java index dc3bc6ed8d..b701112f57 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java @@ -776,6 +776,6 @@ public class PreviewTablePane extends BasicPane { */ private boolean isDesensitizeOpened() { return tableData instanceof DesensitizationTableData && - ((DesensitizationTableData) tableData).isDesensitizeOpen(); + ((DesensitizationTableData) tableData).getDesensitizationConfig().isDesensitizeOpened(); } } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java index 0632de3e65..ed5104fbce 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java @@ -3,7 +3,7 @@ package com.fr.design.data.datapane.preview.desensitization; import com.fr.base.TableData; import com.fr.data.desensitize.base.DesensitizationTableData; -import com.fr.data.desensitize.base.TableDataDesensitizationBean; +import com.fr.data.desensitize.base.TableDataDesensitizationItem; import com.fr.data.desensitize.manage.DesensitizationManager; import com.fr.data.desensitize.util.DesentizationUtils; import com.fr.decision.webservice.bean.user.DepartmentPostBean; @@ -14,12 +14,10 @@ import com.fr.decision.webservice.v10.user.PositionService; import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.datapane.preview.PreviewTableModel; import com.fr.design.data.datapane.preview.desensitization.model.DesensitizedPreviewTableModel; -import com.fr.design.data.tabledata.wrapper.TableDataWrapper; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; -import java.util.ArrayList; import java.util.Collection; import java.util.Comparator; import java.util.LinkedHashMap; @@ -57,14 +55,14 @@ public class TableDataPreviewDesensitizeManager implements DesensitizationManage /** * 判断数据集预览时是否需要脱敏,这里不需要判断roleIds,因为默认有权限编辑的人一定有权限看脱敏前后字段值 + * 只需要保证此数据集存在脱敏配置就行 * * @param tableData * @return */ public boolean needDesensitize(TableData tableData) { return tableData instanceof DesensitizationTableData && - DesentizationUtils.isCollectionNotEmpty(((DesensitizationTableData) tableData).getDesensitizationBeans()) && - ((DesensitizationTableData) tableData).getDesensitizationBeans().stream().noneMatch(TableDataDesensitizationBean::invalid); + DesentizationUtils.isCollectionNotEmpty(((DesensitizationTableData) tableData).getDesensitizationConfig().getDesensitizationItems()); } /** @@ -75,25 +73,23 @@ public class TableDataPreviewDesensitizeManager implements DesensitizationManage */ public PreviewTableModel desensitizeTableModel(TableData tableData, PreviewTableModel model) { - Map desensitizationBeanMap = new LinkedHashMap<>(); + Map desensitizationItemMap = new LinkedHashMap<>(); // 获取此数据集的所有脱敏信息 - Collection desensitizationBeans = ((DesensitizationTableData) tableData).getDesensitizationBeans(); - // 去除被禁用的规则 + 排序 - List sortedBeans = desensitizationBeans - .stream() - .filter(bean -> bean.getDesensitizationRule().isEnable()) - .sorted(Comparator.comparingInt(TableDataDesensitizationBean::getColumnIndex)) - .collect(Collectors.toList()); - int columnIndex = 0; - for (TableDataDesensitizationBean sortedBean : sortedBeans) { - // 当map中已包含列序号时,代表对这一列设置了不同的脱敏规则,将key + 1 - if (desensitizationBeanMap.containsKey(columnIndex)) { - columnIndex++; + Collection desensitizationItems = ((DesensitizationTableData) tableData).getDesensitizationConfig().getDesensitizationItems(); + if (DesentizationUtils.isCollectionNotEmpty(desensitizationItems)) { + // 先对脱敏配置项集合做过滤和排序处理 + List items = desensitizationItems.stream() + .filter(item -> item.getRule().isEnable() && + matchColumnIndex(item, model) >= 0) + .sorted(Comparator.comparingInt(item -> matchColumnIndex(item, model))) + .collect(Collectors.toList()); + // 然后转换成Map + for (int i = 0; i < items.size(); i++) { + desensitizationItemMap.put(i, items.get(i)); } - desensitizationBeanMap.put(columnIndex, sortedBean); } // 包装TableModel - return new DesensitizedPreviewTableModel(model, desensitizationBeanMap); + return new DesensitizedPreviewTableModel(model, desensitizationItemMap); } /** @@ -104,16 +100,7 @@ public class TableDataPreviewDesensitizeManager implements DesensitizationManage * @return */ public List getColumnNamesByTableData(TableData tableData) { - List> editingDataSet = DesignTableDataManager.getEditingDataSet(DesignTableDataManager.getEditingTableDataSource()); - // 当前所有模板数据集Wrapper,不包括存储过程 - Map templeteDataMap = editingDataSet.get(0); - // 当前所有模板数据集Wrapper,包括存储过程 - Map dataWrapperMap = DesignTableDataManager.getAllDataSetIncludingProcedure(templeteDataMap); - // 找到匹配当前数据集名称的Wrapper - TableDataWrapper tableDataWrapper = dataWrapperMap.get(tableData.getName()); - return tableDataWrapper == null ? - new ArrayList<>() : - tableDataWrapper.calculateColumnNameList(); + return DesignTableDataManager.getColumnNamesByTableData(tableData); } /** @@ -189,4 +176,8 @@ public class TableDataPreviewDesensitizeManager implements DesensitizationManage public String mergeRoleId(String departmentId, String positionId) { return departmentId + CONNECTOR + positionId; } + + public int matchColumnIndex(TableDataDesensitizationItem desensitizationItem, PreviewTableModel previewModel) { + return previewModel.getColumnIndexWithExceptionIngore(desensitizationItem.getColumnName()); + } } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/model/DesensitizedPreviewTableModel.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/model/DesensitizedPreviewTableModel.java index e3598e39c0..d8908fd14d 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/model/DesensitizedPreviewTableModel.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/model/DesensitizedPreviewTableModel.java @@ -1,10 +1,11 @@ package com.fr.design.data.datapane.preview.desensitization.model; -import com.fr.data.desensitize.base.TableDataDesensitizationBean; +import com.fr.data.desensitize.base.TableDataDesensitizationItem; import com.fr.data.desensitize.calculate.DesensitizationCalculator; import com.fr.data.desensitize.rule.base.DesensitizationRule; import com.fr.design.data.datapane.preview.PreviewTableModel; +import com.fr.design.data.datapane.preview.desensitization.TableDataPreviewDesensitizeManager; import java.util.Map; import java.util.Objects; @@ -26,20 +27,20 @@ public class DesensitizedPreviewTableModel extends PreviewTableModel { /** * 脱敏后新组装的TableModel中,列序号 - 脱敏信息 对应的Map */ - private Map desensitizationBeanMap; + private Map desensitizationItemMap; private boolean needDesensitize = false; - public DesensitizedPreviewTableModel(PreviewTableModel previewTableModel, Map desensitizationBeanMap) { + public DesensitizedPreviewTableModel(PreviewTableModel previewTableModel, Map desensitizationItemMap) { this.previewTableModel = previewTableModel; - this.desensitizationBeanMap = desensitizationBeanMap; + this.desensitizationItemMap = desensitizationItemMap; } @Override public String getColumnName(int column) { - int originIndex = needDesensitize && Objects.nonNull(desensitizationBeanMap.get(column)) ? - desensitizationBeanMap.get(column).getColumnIndex() : column; - return previewTableModel.getColumnName(originIndex); + return needDesensitize ? + desensitizationItemMap.get(column).getColumnName() : + previewTableModel.getColumnName(column); } @Override @@ -56,7 +57,7 @@ public class DesensitizedPreviewTableModel extends PreviewTableModel { @Override public Object getValueAt(int rowIndex, int columnIndex) { - return needDesensitize && Objects.nonNull(desensitizationBeanMap.get(columnIndex)) ? + return needDesensitize && Objects.nonNull(desensitizationItemMap.get(columnIndex)) ? getDesensitizedValue(rowIndex, columnIndex) : previewTableModel.getValueAt(rowIndex, columnIndex); } @@ -70,7 +71,7 @@ public class DesensitizedPreviewTableModel extends PreviewTableModel { */ private Object getDesensitizedValue(int rowIndex, int columnIndex) { // 先通过columnIndex找到对应原TableModel的列序号 - int originColumnIndex = desensitizationBeanMap.get(columnIndex).getColumnIndex(); + int originColumnIndex = TableDataPreviewDesensitizeManager.getInstance().matchColumnIndex(desensitizationItemMap.get(columnIndex), previewTableModel); // 获取原值 Object value = previewTableModel.getValueAt(rowIndex, originColumnIndex); // 判空 @@ -91,9 +92,8 @@ public class DesensitizedPreviewTableModel extends PreviewTableModel { * @return */ private String desensitizeValue(String strValue, int columnIndex) { - TableDataDesensitizationBean desensitizationBean = desensitizationBeanMap.get(columnIndex); - DesensitizationRule desensitizationRule = desensitizationBean.getDesensitizationRule(); - return DesensitizationCalculator.getInstance().desensitize(strValue, desensitizationRule); + DesensitizationRule rule = desensitizationItemMap.get(columnIndex).getRule(); + return DesensitizationCalculator.getInstance().desensitize(strValue, rule); } /** @@ -102,7 +102,7 @@ public class DesensitizedPreviewTableModel extends PreviewTableModel { * @return */ public int getDesensitizeColumnsCount() { - return desensitizationBeanMap.size(); + return desensitizationItemMap.size(); } /** diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java index 16900defa4..fd627e8cc4 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java @@ -305,6 +305,9 @@ public class DesensitizationRuleChoosePane extends JPanel { public void actionPerformed(ActionEvent e) { // 获取当前选中规则 DesensitizationRule selectedRule = getSelectedValue(); + if (selectedRule == null) { + return; + } DesensitizationRuleDebugPane ruleDebugPane = new DesensitizationRuleDebugPane(selectedRule); BasicDialog ruleDebugDialog = ruleDebugPane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(parent), null, BasicDialog.DEFAULT); ruleDebugDialog.setVisible(true); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleDebugPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleDebugPane.java index 5f74dee9c0..eba6d10899 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleDebugPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleDebugPane.java @@ -52,7 +52,7 @@ public class DesensitizationRuleDebugPane extends BasicPane { JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); panel.setBorder(BorderFactory.createEmptyBorder(20, 10, 0, 0)); UILabel desensitizationRule = new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Algorithm")); - UILabel characterReplace = new UILabel(rule.getRuleType().getTypeName()); + UILabel characterReplace = new UILabel(rule.getRuleType().getRuleTypeName()); UILabel description = new UILabel(DesensitizationRule.getDescription(rule)); JComponent[][] components = new JComponent[][]{ {desensitizationRule, characterReplace}, diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleEditPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleEditPane.java index 2f526f4b8f..7354dc0b11 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleEditPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleEditPane.java @@ -185,8 +185,8 @@ public class DesensitizationRuleEditPane extends BasicBeanPane tableDataDesensitizationBeans) { - tableData.setDesensitizationBeans(tableDataDesensitizationBeans); + public void saveDesensitizationBeans(List desensitizationItems) { + tableData.getDesensitizationConfig().setDesensitizationItems(desensitizationItems); } } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java index c43795ac98..bbc91efa2a 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java @@ -1,7 +1,7 @@ package com.fr.design.data.datapane.preview.desensitization.view.setting; import com.fr.data.desensitize.base.DesensitizationTableData; -import com.fr.data.desensitize.base.TableDataDesensitizationBean; +import com.fr.data.desensitize.base.TableDataDesensitizationItem; import com.fr.data.desensitize.rule.base.DesensitizationRule; import com.fr.design.data.datapane.preview.desensitization.TableDataPreviewDesensitizeManager; import com.fr.design.data.datapane.preview.desensitization.view.rule.DesensitizationRulePane; @@ -18,7 +18,6 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.stable.StringUtils; -import com.fr.stable.collections.CollectionUtils; import org.jetbrains.annotations.Nullable; import javax.swing.AbstractCellEditor; @@ -33,6 +32,7 @@ import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; +import java.util.Collection; import java.util.HashMap; import java.util.LinkedHashSet; import java.util.List; @@ -48,7 +48,7 @@ import java.util.Set; * @version 11.0 * Created by Yvan on 2022/9/23 */ -public class TableDataDesensitizationTableModel extends UITableModelAdapter { +public class TableDataDesensitizationTableModel extends UITableModelAdapter { private static final String APOSTROPHE = "..."; @@ -106,59 +106,32 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter= 0 && columnIndex < columnNames.size(); - } - /** * 通过id匹配此用户组对应的部门职位名称(或者说自定义角色名称) * * @param roleIds * @return */ - private List matchRoleNamesByIds(Set roleIds) { + private List matchRoleNamesByIds(Collection roleIds) { List result = new ArrayList<>(); for (String roleId : roleIds) { if (roleMap != null && roleMap.containsKey(roleId)) { @@ -184,7 +157,7 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter generateRolesCheckBoxSelectedValues(TableDataDesensitizationBean desensitizationBean) { + private Map generateRolesCheckBoxSelectedValues(TableDataDesensitizationItem desensitizationItem) { Map result = new HashMap<>(roleMap.size()); for (Map.Entry roleEntry : roleMap.entrySet()) { String roleId = roleEntry.getKey(); String roleName = roleEntry.getValue(); - if (desensitizationBean.getRoleIds().contains(roleId)) { + if (desensitizationItem.getRoleIds().contains(roleId)) { result.put(roleName, true); } else { result.put(roleName, false); @@ -444,7 +419,7 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter editorPane; + private UITableEditorPane editorPane; public TableDataDesensitizationTablePane(DesensitizationTableData tableData, Component parent) { this.tableData = tableData; @@ -54,13 +54,13 @@ public class TableDataDesensitizationTablePane extends JPanel { */ public void populateDesensitizationSetting(DesensitizationTableData tableData) { this.tableData = tableData; - editorPane.populate(tableData.getDesensitizationBeans().toArray(new TableDataDesensitizationBean[0])); + editorPane.populate(tableData.getDesensitizationConfig().getDesensitizationItems().toArray(new TableDataDesensitizationItem[0])); } /** * 获取当前对TableData的配置脱敏规则信息 */ - public List updateDesensitizationSetting() { + public List updateDesensitizationSetting() { return editorPane.update(); } } From 7f1f72ec74725c4889cf240fd1994c1b082ef5f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvan-=E6=AC=A7=E9=98=B3=E5=B8=86?= Date: Fri, 28 Oct 2022 11:30:12 +0800 Subject: [PATCH 119/310] =?UTF-8?q?REPORT-80693=20-=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=84=B1=E6=95=8F=E4=BA=8C=E6=9C=9F=EF=BC=88=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=EF=BC=89=20=E4=BB=A3=E7=A0=81=E8=B4=A8=E9=87=8F=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E9=97=AE=E9=A2=98=EF=BC=8C=E5=8A=A0=E4=B8=AA=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../desensitization/TableDataPreviewDesensitizeManager.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java index ed5104fbce..3d3c59331f 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java @@ -177,6 +177,12 @@ public class TableDataPreviewDesensitizeManager implements DesensitizationManage return departmentId + CONNECTOR + positionId; } + /** + * 根据列名,从PreviewTableModel中匹配列序号,如果返回-1代表未匹配到 + * @param desensitizationItem + * @param previewModel + * @return + */ public int matchColumnIndex(TableDataDesensitizationItem desensitizationItem, PreviewTableModel previewModel) { return previewModel.getColumnIndexWithExceptionIngore(desensitizationItem.getColumnName()); } From 37fe3cad371b68e4b702ad88d185637a85119cc6 Mon Sep 17 00:00:00 2001 From: "Link.Zhao" Date: Fri, 28 Oct 2022 13:52:33 +0800 Subject: [PATCH 120/310] =?UTF-8?q?REPORT-80750=20=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E4=B8=AD=E7=9A=84=E4=B8=B4=E6=97=B6=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=9B=AE=E5=BD=95=E6=A2=B3=E7=90=86=E5=92=8C=E6=95=B4?= =?UTF-8?q?=E6=94=B9=201=E3=80=81=E4=BF=AE=E6=94=B9notshare=E4=B8=BAlocal?= =?UTF-8?q?=202=E3=80=81engine=E7=9B=B4=E6=8E=A5=E5=88=A0=E9=99=A4=203?= =?UTF-8?q?=E3=80=81FineReport.Reuse=E9=9C=80=E8=A6=81=E8=BF=81=E7=A7=BB?= =?UTF-8?q?=E5=A4=87=E4=BB=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/style/TranslucentBorderSpecialPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/style/TranslucentBorderSpecialPane.java b/designer-base/src/main/java/com/fr/design/gui/style/TranslucentBorderSpecialPane.java index e3ef66bfeb..cc49820de5 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/TranslucentBorderSpecialPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/TranslucentBorderSpecialPane.java @@ -191,7 +191,7 @@ public class TranslucentBorderSpecialPane extends AbstractBorderPackerPane imple String lastUsedBorderImageDirPath = history.getLastSelectedBorderImageDir(); File lastUsedBorderImageDir = StringUtils.isNotEmpty(lastUsedBorderImageDirPath) ? new File(lastUsedBorderImageDirPath) : null; - File inbuiltBorderImagesDir = new File(StableUtils.pathJoin(ProjectLibrary.getInstance().getLibHome(), ProjectConstants.NOT_SHARE, ProjectConstants.BORDER_IMAGES)); + File inbuiltBorderImagesDir = new File(StableUtils.pathJoin(ProjectLibrary.getInstance().getLibHome(), ProjectConstants.LOCAL, ProjectConstants.BORDER_IMAGES)); if (lastUsedBorderImageDir!= null && lastUsedBorderImageDir.exists()) { imageFileChooser.setCurrentDirectory(lastUsedBorderImageDir); From 41838d27860715101e0a5979c9cd279fda5bfdaf Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Fri, 28 Oct 2022 15:23:28 +0800 Subject: [PATCH 121/310] =?UTF-8?q?REPORT-80695=20=E3=80=90=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E5=85=A8=E5=B1=80=E7=BA=A7=E5=88=AB=E6=9F=A5=E6=89=BE?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E4=BA=8C=E6=9C=9F=E3=80=91=E5=90=88=E6=B3=95?= =?UTF-8?q?=E6=80=A7=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/replace/info/ComponentInfo.java | 23 +++ .../fr/design/actions/replace/info/Info.java | 16 +++ .../actions/replace/info/WidgetInfo.java | 23 +++ .../actions/replace/info/base/ITContent.java | 24 ++++ .../actions/replace/ui/ITCheckDialog.java | 98 +++++++++++++ .../actions/replace/ui/ITCheckEditor.java | 64 +++++++++ .../replace/ui/ITReplaceMainDialog.java | 132 ++++++++++++++++-- .../actions/replace/utils/ShowValueUtils.java | 2 +- 8 files changed, 367 insertions(+), 15 deletions(-) create mode 100644 designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITCheckDialog.java create mode 100644 designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITCheckEditor.java diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ComponentInfo.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ComponentInfo.java index b302376fb6..77993c53db 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ComponentInfo.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ComponentInfo.java @@ -1,10 +1,14 @@ package com.fr.design.actions.replace.info; import com.fr.design.actions.replace.action.content.component.ComponentType; +import com.fr.design.actions.replace.action.content.component.SearchComponentAction; import com.fr.design.actions.replace.info.base.ITContent; +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.JTemplate; import com.fr.form.ui.Widget; import com.fr.stable.StringUtils; import com.fr.stable.collections.combination.Pair; +import com.fr.stable.js.WidgetName; import java.util.HashMap; @@ -79,4 +83,23 @@ public class ComponentInfo implements Info { public String getInfoShowStr(Info info) { return this.getContent().getOldShowStr(); } + + @Override + public Boolean isLegalValid(JTemplate jTemplate, String searchStr, String replaceStr) { + if (StringUtils.isEmpty(replaceStr)) { + this.getContent().setCheckStr(Toolkit.i18nText("Fine-Design_Replace_Not_Empty")); + return false; + } + SearchComponentAction.getInstance().search4Infos(jTemplate); + List list = SearchComponentAction.getInstance().getComponentInfos(); + String replacedName = ((Widget)this.getContent().getReplaceObject()).getWidgetName().replace(searchStr, replaceStr); + for (ComponentInfo info : list) { + String widgetName = ((Widget)info.getContent().getReplaceObject()).getWidgetName(); + if (StringUtils.equals(replacedName, widgetName)) { + this.getContent().setCheckStr(Toolkit.i18nText("Fine-Design_Replace_Exist_Same_Name")); + return false; + } + } + return true; + } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/Info.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/Info.java index 6f26be2595..9fc5aedad6 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/Info.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/Info.java @@ -1,6 +1,7 @@ package com.fr.design.actions.replace.info; import com.fr.design.actions.replace.info.base.ITContent; +import com.fr.design.mainframe.JTemplate; /** @@ -40,4 +41,19 @@ public interface Info extends DealWithInfoValue { //todo 完善所有类型的校验 return true; } + + /** + * 校验合法性(内容是否合法 + * 当前需要检测的目标: + * 控件名:值是否为空、重名 + * 组件名:值是否为空、重名 + * + * @param jTemplate 要检测的模板 + * @param searchStr 搜索的内容 + * @param replaceStr 替换的内容 + * @return 检测合法则返回true + */ + default Boolean isLegalValid(JTemplate jTemplate,String searchStr, String replaceStr) { + return true; + } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/WidgetInfo.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/WidgetInfo.java index afdf098028..7adfc01536 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/WidgetInfo.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/WidgetInfo.java @@ -4,12 +4,16 @@ import com.fr.design.actions.replace.action.content.widget.FrmWidgetType; import com.fr.design.actions.replace.info.base.ITContent; import com.fr.design.actions.replace.utils.ShowValueUtils; +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.JTemplate; import com.fr.form.ui.WaterMark; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WScaleLayout; import com.fr.form.ui.widget.CRBoundsWidget; import com.fr.stable.AssistUtils; +import com.fr.stable.StringUtils; import com.fr.stable.collections.combination.Pair; +import com.fr.stable.js.WidgetName; import java.util.HashMap; @@ -128,4 +132,23 @@ public class WidgetInfo implements Info, DealWithInfoValue { } + @Override + public Boolean isLegalValid(JTemplate jTemplate,String searchStr, String replaceStr) { + if (StringUtils.isEmpty(replaceStr)) { + this.getContent().setCheckStr(Toolkit.i18nText("Fine-Design_Replace_Not_Empty")); + return false; + } + if (!this.isWaterMark()) { + String replacedName = ((Widget)this.getContent().getReplaceObject()).getWidgetName().replace(searchStr, replaceStr); + for (WidgetName name : jTemplate.getModel().getWidgetsName()) { + String widgetName = name.getName(); + if (StringUtils.equals(replacedName, widgetName)) { + this.getContent().setCheckStr(Toolkit.i18nText("Fine-Design_Replace_Exist_Same_Name")); + return false; + } + } + } + return true; + } + } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/ITContent.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/ITContent.java index aecbe2ed10..e75b224649 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/ITContent.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/ITContent.java @@ -87,6 +87,13 @@ public class ITContent implements Cloneable { */ private boolean replaced = false; + /** + * + */ + private String checkStr = StringUtils.EMPTY; + + private boolean wrongful = false; + public ITContent() { this.sheetID = StringUtils.EMPTY; this.sheetName = StringUtils.EMPTY; @@ -133,6 +140,7 @@ public class ITContent implements Cloneable { result.setTemplatePath(content.getTemplatePath()); result.setAfterReplaceStr(content.getAfterReplaceStr()); result.setReplaced(content.isReplaced()); + result.setWrongful(content.isWrongful()); } return result; } @@ -245,6 +253,22 @@ public class ITContent implements Cloneable { this.replaced = replaced; } + public String getCheckStr() { + return checkStr; + } + + public void setCheckStr(String checkStr) { + this.checkStr = checkStr; + } + + public boolean isWrongful() { + return wrongful; + } + + public void setWrongful(boolean wrongful) { + this.wrongful = wrongful; + } + /** * 添加位置信息 * diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITCheckDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITCheckDialog.java new file mode 100644 index 0000000000..e597e3172e --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITCheckDialog.java @@ -0,0 +1,98 @@ +package com.fr.design.actions.replace.ui; + + +import com.fr.design.dialog.UIDialog; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ilable.UILabel; + +import com.fr.design.gui.itableeditorpane.UITableEditorPane; + +import com.fr.design.i18n.Toolkit; + +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import static com.fr.design.actions.replace.ui.ITTableEditorPane.getEditTable; + +/** + * 合法性校验的面板 + * + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-10-28 + */ +public class ITCheckDialog extends UIDialog { + private UITableEditorPane editorPane; + private ITCheckEditor editor; + private static final int DIALOG_WIDTH = 660, DIALOG_HEIGHT = 400; + private static final int TABLE_WIDTH = 640, TABLE_HEIGHT = 320; + private static final int LABEL_HEIGHT = 20; + + public static final Object[] columnTitle = {Toolkit.i18nText("Fine-Design_Replace_Check_Content"), Toolkit.i18nText("Fine-Design_Replace_Check_Reason")}; + + public ITCheckDialog() { + super(ITReplaceMainDialog.getInstance()); + setTitle(Toolkit.i18nText("Fine-Design_Replace_Check_Title")); + JPanel centerPanel = new JPanel(); + JPanel southPanel = new JPanel(); + southPanel.setLayout(new FlowLayout(FlowLayout.RIGHT)); + + editor = new ITCheckEditor(); + editorPane = new UITableEditorPane(editor); + editor.add(ITReplaceMainDialog.getCheckValidList()); + + UILabel label = new UILabel("" + Toolkit.i18nText("Fine-Design_Replace_Check") + "" + ITReplaceMainDialog.contentReplaceFailedCount + "" + Toolkit.i18nText("Fine-Design_Replace_Check_Tip")); + JPanel center = new JPanel(new BorderLayout()); + UIButton location = new UIButton(Toolkit.i18nText("Fine-Design_Chart_Location")); + UIButton cancel = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel")); + + location.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + for (int i : ITReplaceMainDialog.getSerialNumber()) { + getEditTable().addRowSelectionInterval(i, i); + } + ITCheckDialog.this.dispose(); + } + }); + + cancel.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + ITCheckDialog.this.dispose(); + } + }); + + + editorPane.setPreferredSize(new Dimension(TABLE_WIDTH, TABLE_HEIGHT)); + label.setPreferredSize(new Dimension(TABLE_WIDTH, LABEL_HEIGHT)); + + centerPanel.add(editorPane); + southPanel.add(location); + southPanel.add(cancel); + center.add(southPanel, BorderLayout.SOUTH); + center.add(label, BorderLayout.NORTH); + center.add(centerPanel, BorderLayout.CENTER); + center.setVisible(true); + //主体部分 + add(center); + + + setSize(DIALOG_WIDTH, DIALOG_HEIGHT); + setMaximumSize(new Dimension(DIALOG_WIDTH, DIALOG_HEIGHT)); + setMinimumSize(new Dimension(DIALOG_WIDTH, DIALOG_HEIGHT)); + + setLocation(ITReplaceMainDialog.getInstance().getX() + ITReplaceMainDialog.getInstance().getWidth() / 2 - DIALOG_WIDTH / 2, ITReplaceMainDialog.getInstance().getY()); + setVisible(true); + } + + + @Override + public void checkValid() throws Exception { + + } +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITCheckEditor.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITCheckEditor.java new file mode 100644 index 0000000000..1efb8beffc --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITCheckEditor.java @@ -0,0 +1,64 @@ +package com.fr.design.actions.replace.ui; + +import com.fr.design.actions.replace.info.Info; +import com.fr.design.actions.replace.info.base.ITContent; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itableeditorpane.UITableEditAction; +import com.fr.design.gui.itableeditorpane.UITableModelAdapter; +import com.fr.design.i18n.Toolkit; + +import java.util.List; + +/** + * 合法性校验表格的Model + * + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-10-28 + */ +public class ITCheckEditor extends UITableModelAdapter { + + public ITCheckEditor() { + super(new String[]{ + Toolkit.i18nText("Fine-Design_Replace_Check_Content"), + Toolkit.i18nText("Fine-Design_Replace_Check_Reason") + }); + + this.setColumnClass(new Class[]{ + UILabel.class, + UILabel.class, + }); + } + + @Override + public Object getValueAt(int rowIndex, int columnIndex) { + ITContent content = (ITContent) this.getList().get(rowIndex); + if (columnIndex == 0) { + return content.getShowStr(); + } else { + return content.getCheckStr(); + } + } + + @Override + public boolean isCellEditable(int row, int col) { + return false; + } + + @Override + public UITableEditAction[] createAction() { + return new UITableEditAction[0]; + } + + /** + * 添加数据 + * + * @param list + */ + public void add(List list) { + for (Info info : list) { + addRow(info.getContent()); + } + fireTableDataChanged(); + } +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index e207ca5004..868ad8ad2a 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -16,6 +16,8 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; +import com.fr.design.mainframe.toast.DesignerToastMsgUtil; +import com.fr.design.mainframe.toast.ToastMsgDialog; import com.fr.general.GeneralUtils; import com.fr.stable.StringUtils; @@ -45,6 +47,8 @@ import static com.fr.design.actions.replace.ui.ITTableEditorPane.getEditTable; public class ITReplaceMainDialog extends UIDialog { private static List searchContentResultList = new ArrayList<>(); private static List searchSettingResultList = new ArrayList<>(); + private static List checkValidList = new ArrayList<>(); + private static List serialNumber = new ArrayList<>(); private static boolean ITReplaceFlag = false; private static boolean matched = false; private static volatile ITReplaceMainDialog instance = null; @@ -184,26 +188,15 @@ public class ITReplaceMainDialog extends UIDialog { } /** - * 替换 + * 模板内容替换相关 */ private void replace4Content() { String searchStr = ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).getText(); String replaceStr = ((UITextField) (northPane.getReplaceInputCombobox().getEditor().getEditorComponent())).getText(); clearContentCount(); if (isITReplaceValid() && checkTemplateChanged(searchContentResultList)) { - if (StringUtils.equals(getSearchStr(), searchStr) && StringUtils.isNotEmpty(replaceStr)) { - HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(true); - for (Info info : searchContentResultList) { - if (isAllow2Replace(info)) { - info.setValue(info, searchStr, replaceStr, info.getContent().getOperatorArray()); - info.getContent().setReplaced(true); - contentReplaceCount++; - } - } - northPane.getResultLabel().setText(ShowValueUtils.getResultTip(searchContentResultList.size(), contentReplaceCount, contentReplaceFailedCount)); - southPanel.getTableEditorPane().update(); - northPane.refreshReplaceInputComboBoxItems(); - ITTableEditorPane.getEditTable().repaint(); + if (StringUtils.equals(getSearchStr(), searchStr)) { + checkLegalValiditySelector(searchStr, replaceStr); } else { search4Content(); } @@ -227,6 +220,86 @@ public class ITReplaceMainDialog extends UIDialog { } } + /** + * 替换 + * + * @param searchStr + * @param replaceStr + */ + public void replace(String searchStr, String replaceStr) { + HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(true); + for (Info info : searchContentResultList) { + if (!info.getContent().isWrongful()) { + info.setValue(info, searchStr, replaceStr, info.getContent().getOperatorArray()); + } + info.getContent().setReplaced(true); + } + northPane.getResultLabel().setText(ShowValueUtils.getResultTip(searchContentResultList.size(), contentReplaceCount, contentReplaceFailedCount)); + southPanel.getTableEditorPane().update(); + northPane.refreshReplaceInputComboBoxItems(); + ITTableEditorPane.getEditTable().repaint(); + } + + /** + * 合法性校验选择器(选择是否进行校验) + */ + public void checkLegalValiditySelector(String searchStr, String replaceStr) { + Object[] options = new Object[]{Toolkit.i18nText("Fine-Design_Replace_Go_To_Check"), Toolkit.i18nText("Fine-Design_Replace_Direct")}; + int optionSelected = FineJOptionPane.showOptionDialog( + ITReplaceMainDialog.this, + Toolkit.i18nText("Fine-Design_Replace_Legal"), + Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), + JOptionPane.YES_NO_CANCEL_OPTION, + JOptionPane.WARNING_MESSAGE, + null, + // 如果传null, 则按钮为 optionType 类型所表示的按钮(也就是确认对话框) + options, + options[0] + ); + //如果选择了直接替换,则直接执行替换 + if (optionSelected == 1) { + updateCheckValidList(); + replace(searchStr, replaceStr); + } else { + checkLegalValidity(); + } + } + + /** + * 检测 + */ + public void checkLegalValidity() { + updateCheckValidList(); + if (contentReplaceFailedCount == 0) { + ToastMsgDialog dialog = DesignerToastMsgUtil.createPromptDialog(Toolkit.i18nText("Fine-Design_Replace_Check_None")); + dialog.setVisible(true); + } else { + new ITCheckDialog(); + } + } + + private void updateCheckValidList() { + checkValidList.clear(); + serialNumber.clear(); + int count = 0; + String searchStr = ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).getText(); + String replaceStr = ((UITextField) (northPane.getReplaceInputCombobox().getEditor().getEditorComponent())).getText(); + for (Info info : searchContentResultList) { + if (isAllow2Replace(info)) { + if (!info.isLegalValid(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(), searchStr, replaceStr)) { + contentReplaceFailedCount++; + checkValidList.add(info); + serialNumber.add(count); + info.getContent().setWrongful(true); + } else { + contentReplaceCount++; + } + count++; + } + } + + } + /** * 是否能够替换 * @@ -520,6 +593,15 @@ public class ITReplaceMainDialog extends UIDialog { this.settingExtraStr = settingExtraStr; } + /** + * 获取不合法的序号 + * + * @return 不合法的元素的序号列表 + */ + public static List getSerialNumber() { + return serialNumber; + } + /** * 检测结果是否合法 */ @@ -529,6 +611,7 @@ public class ITReplaceMainDialog extends UIDialog { /** * 获取模板内容数据 + * * @return 存储数据的list */ public static List getSearchContentResultList() { @@ -537,6 +620,7 @@ public class ITReplaceMainDialog extends UIDialog { /** * 设置模板内容数据 + * * @param searchContentResultList 模板内容表格的数据 */ public static void setSearchContentResultList(List searchContentResultList) { @@ -545,6 +629,7 @@ public class ITReplaceMainDialog extends UIDialog { /** * 获取设置项数据 + * * @return 存储数据的list */ public static List getSearchSettingResultList() { @@ -553,12 +638,31 @@ public class ITReplaceMainDialog extends UIDialog { /** * 设置设置项的数据 + * * @param searchSettingResultList 设置项表格的数据 */ public static void setSearchSettingResultList(List searchSettingResultList) { ITReplaceMainDialog.searchSettingResultList = searchSettingResultList; } + /** + * 获取检测的列表 + * + * @return + */ + public static List getCheckValidList() { + return checkValidList; + } + + /** + * 设置检测列表 + * + * @param checkValidList + */ + public static void setCheckValidList(List checkValidList) { + ITReplaceMainDialog.checkValidList = checkValidList; + } + /** * 重置计数 */ diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java index 8f1174e8fc..01205bf886 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java @@ -395,7 +395,7 @@ public class ShowValueUtils { if (replaceCount != 0) { str.append(Toolkit.i18nText("Fine-Design_Replace_Also_Finish")).append("").append(replaceCount).append("").append(Toolkit.i18nText("Fine-Design_Replace_Result_Count")); if (failedCount != 0) { - str.append(Toolkit.i18nText("Fine-Design_Replace_Have")).append("").append(replaceCount).append("").append(Toolkit.i18nText("Fine-Design_Replace_Can_Not_Replace")); + str.append(Toolkit.i18nText("Fine-Design_Replace_Have")).append("").append(failedCount).append("").append(Toolkit.i18nText("Fine-Design_Replace_Can_Not_Replace")); } } From b688e55822c67bd3e24b47e3016a80c7caecc80e Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Fri, 28 Oct 2022 15:29:59 +0800 Subject: [PATCH 122/310] =?UTF-8?q?REPORT-80695=20=E3=80=90=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E5=85=A8=E5=B1=80=E7=BA=A7=E5=88=AB=E6=9F=A5=E6=89=BE?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E4=BA=8C=E6=9C=9F=E3=80=91=E5=88=AA=E9=99=A4?= =?UTF-8?q?=E5=A4=9A=E4=BD=99=E5=B8=B8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/actions/replace/ui/ITCheckDialog.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITCheckDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITCheckDialog.java index e597e3172e..3c586fac4e 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITCheckDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITCheckDialog.java @@ -32,8 +32,6 @@ public class ITCheckDialog extends UIDialog { private static final int TABLE_WIDTH = 640, TABLE_HEIGHT = 320; private static final int LABEL_HEIGHT = 20; - public static final Object[] columnTitle = {Toolkit.i18nText("Fine-Design_Replace_Check_Content"), Toolkit.i18nText("Fine-Design_Replace_Check_Reason")}; - public ITCheckDialog() { super(ITReplaceMainDialog.getInstance()); setTitle(Toolkit.i18nText("Fine-Design_Replace_Check_Title")); From faa21e95f9c5e446748a70a36da657a59b6d9f1b Mon Sep 17 00:00:00 2001 From: "John.Ying" Date: Mon, 31 Oct 2022 00:09:03 +0800 Subject: [PATCH 123/310] =?UTF-8?q?REPORT-80513=20=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=A4=A7=E6=95=B0=E6=8D=AE=E6=94=AF=E6=8C=81csv?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/fit/menupane/FitRadioGroup.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/fit/menupane/FitRadioGroup.java b/designer-form/src/main/java/com/fr/design/fit/menupane/FitRadioGroup.java index 46fb327686..70bf18fd69 100644 --- a/designer-form/src/main/java/com/fr/design/fit/menupane/FitRadioGroup.java +++ b/designer-form/src/main/java/com/fr/design/fit/menupane/FitRadioGroup.java @@ -77,4 +77,12 @@ public class FitRadioGroup extends ButtonGroup { } } + /** + * + * @return 被选中的按钮 + */ + public UIRadioButton getSelectedButton() { + return radioButtons.get(this.getSelectRadioIndex()); + } + } From 193473d4e3e782e11ac34d1e386f3d9b5dbd1773 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 31 Oct 2022 14:43:22 +0800 Subject: [PATCH 124/310] =?UTF-8?q?REPORT-80695=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=85=A8=E5=B1=80=E7=BA=A7=E5=88=AB=E6=9F=A5=E6=89=BE=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E4=BA=8C=E6=9C=9F=20=E4=BF=AE=E5=A4=8D=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E6=A1=86=E5=86=85=E5=AE=B9=E4=B8=8E=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E4=B8=8D=E5=8C=B9=E9=85=8D=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E5=AE=8C=E5=96=84=E5=8D=95=E5=85=83=E6=A0=BC=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=EF=BC=8C=E5=A2=9E=E5=8A=A0=E8=AE=BE=E7=BD=AE=E9=A1=B9?= =?UTF-8?q?=E3=80=81SQL=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../action/setting/CellFormatType.java | 69 +++++++++++++++++-- .../action/setting/SettingController.java | 13 ++++ .../action/SearchCellFormatAction.java | 17 +++-- .../design/actions/replace/info/SQLInfo.java | 9 +++ .../replace/ui/ITReplaceNorthPanel.java | 15 ++-- 5 files changed, 106 insertions(+), 17 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellFormatType.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellFormatType.java index ab2a71ba97..a468dc995c 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellFormatType.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellFormatType.java @@ -35,7 +35,7 @@ public enum CellFormatType { @Override public List getItems() { - return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_NUMBER))); + return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_NUMBER), false)); } @Override @@ -57,6 +57,12 @@ public enum CellFormatType { public boolean isNeed(CellElement cellElement, String firstStr, String secondStr) { return cellElement.getStyle().getFormat() == null; } + + @Override + public boolean isEverChanged(Info info, String inputStr, String extraStr) { + CellElement cellElement = (CellElement) info.getContent().getReplaceObject(); + return (cellElement.getStyle() != null && cellElement.getStyle().getFormat() == null); + } }, /** * 单元格-格式-货币 @@ -69,7 +75,7 @@ public enum CellFormatType { @Override public List getItems() { - return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_MONEY))); + return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_MONEY), false)); } @Override @@ -89,7 +95,7 @@ public enum CellFormatType { @Override public List getItems() { - return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_DATE))); + return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_DATE), false)); } @Override @@ -97,6 +103,11 @@ public enum CellFormatType { Format format = cellElement.getStyle().getFormat(); return format instanceof FineDateFormat && StringUtils.equals(((FineDateFormat) format).toPattern(), secondStr); } + + @Override + public boolean isEverChanged(Info info, String inputStr, String extraStr) { + return isEverChanged4FineDataFormat(info, extraStr); + } }, /** * 单元格-格式-时间 @@ -109,7 +120,7 @@ public enum CellFormatType { @Override public List getItems() { - return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_TIME))); + return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_TIME), false)); } @Override @@ -117,6 +128,11 @@ public enum CellFormatType { Format format = cellElement.getStyle().getFormat(); return format instanceof FineDateFormat && StringUtils.equals(((FineDateFormat) format).toPattern(), secondStr); } + + @Override + public boolean isEverChanged(Info info, String inputStr, String extraStr) { + return isEverChanged4FineDataFormat(info, extraStr); + } }, /** * 单元格-格式-科学计数 @@ -129,7 +145,7 @@ public enum CellFormatType { @Override public List getItems() { - return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_SCIENCE))); + return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_SCIENCE), false)); } @Override @@ -149,7 +165,7 @@ public enum CellFormatType { @Override public List getItems() { - return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_PERCENT))); + return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_PERCENT), false)); } @Override @@ -169,7 +185,7 @@ public enum CellFormatType { @Override public List getItems() { - return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_PERMILLAGE))); + return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_PERMILLAGE), false)); } @Override @@ -187,6 +203,14 @@ public enum CellFormatType { Format format = cellElement.getStyle().getFormat(); return format instanceof TextFormat; } + + @Override + public boolean isEverChanged(Info info, String inputStr, String extraStr) { + CellElement cellElement = (CellElement) info.getContent().getReplaceObject(); + return !(cellElement.getStyle() != null + && cellElement.getStyle().getFormat() != null + && cellElement.getStyle().getFormat() instanceof TextFormat); + } }; @@ -256,4 +280,35 @@ public enum CellFormatType { ((NameStyle) cellElement.getStyle()).refreshStyle(); } } + + /** + * 是否修改过 + * + * @param info 存储单元格信息的数据结构 + * @param inputStr 用户输入的第一级下拉框内容 + * @param extraStr 用户输入的第二级下拉框内容 + * @return 修改过返回true + */ + public boolean isEverChanged(Info info, String inputStr, String extraStr) { + CellElement cellElement = (CellElement) info.getContent().getReplaceObject(); + return !(cellElement.getStyle() != null + && cellElement.getStyle().getFormat() != null + && cellElement.getStyle().getFormat() instanceof CoreDecimalFormat + && StringUtils.equals(((CoreDecimalFormat) cellElement.getStyle().getFormat()).toPattern(), extraStr)); + } + + /** + * 针对日期和时间类型的修改判定 + * + * @param info 存储单元格信息的数据结构 + * @param extraStr 用户输入的第二级下拉框内容 + * @return 修改过返回true + */ + public boolean isEverChanged4FineDataFormat(Info info, String extraStr) { + CellElement cellElement = (CellElement) info.getContent().getReplaceObject(); + return !(cellElement.getStyle() != null + && cellElement.getStyle().getFormat() != null + && cellElement.getStyle().getFormat() instanceof FineDateFormat + && StringUtils.equals(((FineDateFormat) cellElement.getStyle().getFormat()).toPattern(), extraStr)); + } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingController.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingController.java index 8dd29b2364..0b481a1272 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingController.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingController.java @@ -10,6 +10,7 @@ import com.fr.design.actions.replace.action.setting.action.SearchDSColumnAction; import com.fr.design.actions.replace.info.CellInfo; import com.fr.design.actions.replace.info.DataSourceInfo; import com.fr.design.actions.replace.info.Info; +import com.fr.design.actions.replace.info.ReplaceObject; import com.fr.design.actions.replace.ui.ITReplaceNorthPanel; import com.fr.design.data.DesignTableDataManager; import com.fr.design.file.HistoryTemplateListCache; @@ -88,6 +89,18 @@ public enum SettingController implements ShowValue { type.replace(info, firstStr, secondStr); } } + + @Override + public boolean isEverChanged(Info info, String inputStr, String extraStr) { + CellElement cellElement = (CellElement) info.getContent().getReplaceObject(); + if (cellElement.getStyle() != null) { + CellFormatType type = CellFormatType.match(inputStr); + if (type != null) { + return type.isEverChanged(info, inputStr, extraStr); + } + } + return false; + } }, /** * 单元格-数据设置 diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchCellFormatAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchCellFormatAction.java index 016f6b259b..e7c8e45dd4 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchCellFormatAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchCellFormatAction.java @@ -1,13 +1,16 @@ package com.fr.design.actions.replace.action.setting.action; -import com.fr.base.Formula; +import com.fr.chart.chartattr.ChartCollection; import com.fr.design.actions.replace.action.SearchAction; import com.fr.design.actions.replace.action.content.cell.SearchCellAction; import com.fr.design.actions.replace.info.CellInfo; import com.fr.design.mainframe.JTemplate; import com.fr.general.GeneralUtils; +import com.fr.general.ImageWithSuffix; import com.fr.report.cell.CellElement; -import com.fr.report.cell.cellattr.core.group.DSColumn; +import com.fr.report.cell.cellattr.core.RichText; +import com.fr.report.cell.cellattr.core.SubReport; +import com.fr.report.cell.painter.BiasTextPainter; import java.util.ArrayList; import java.util.List; @@ -47,10 +50,12 @@ public class SearchCellFormatAction implements SearchAction { */ public boolean isFormatValid(CellElement cellElement) { return cellElement.getStyle() != null - && (cellElement.getValue() instanceof Formula - || cellElement.getValue() instanceof DSColumn - || cellElement.getValue() instanceof String - || cellElement.getValue() instanceof Integer); + && !(cellElement.getValue() instanceof SubReport + || cellElement.getValue() instanceof BiasTextPainter + || cellElement.getValue() instanceof ChartCollection + || cellElement.getValue() instanceof RichText + || cellElement.getValue() instanceof ImageWithSuffix + ); } public List getCellInfos() { diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/SQLInfo.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/SQLInfo.java index 6006c83754..0fdbbb86de 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/SQLInfo.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/SQLInfo.java @@ -68,4 +68,13 @@ public class SQLInfo implements Info { public String getInfoShowStr(Info info) { return this.getContent().getOldShowStr(); } + + @Override + public Boolean checkValid() { + ReplaceObject o = ReplaceObject.match(this.content.getReplaceObject().getClass().getSimpleName()); + if (o != null) { + return o.check(this); + } + return false; + } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java index 16d2926a60..913150dcd3 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java @@ -249,11 +249,9 @@ public class ITReplaceNorthPanel { }; replaceSettingInputComboBox.setSelectedIndex(-1); - - ((UITextField) (findSettingInputComboBox.getEditor().getEditorComponent())).setPlaceholder(Toolkit.i18nText("Fine-Design_Replace_Choose_Search") + SettingContent.CELL_FORMAT_NAME); + updateSettingPlaceholder(SettingContent.CELL_FORMAT_NAME); findSettingInputComboBox.setEditable(true); ((UITextField) (findSettingInputComboBox.getEditor().getEditorComponent())).setEditable(false); - ((UITextField) (replaceSettingInputComboBox.getEditor().getEditorComponent())).setPlaceholder(Toolkit.i18nText("Fine-Design_Replace_Choose_Replace") + SettingContent.CELL_FORMAT_NAME); replaceSettingInputComboBox.setEditable(true); ((UITextField) (replaceSettingInputComboBox.getEditor().getEditorComponent())).setEditable(false); @@ -301,7 +299,7 @@ public class ITReplaceNorthPanel { refreshSettingComboBox(SettingController.getSettingRefreshItems(str)); setDataSourceComboBoxStatus(isAllow2Replace()); replaceSettingButton.setEnabled(false); - + updateSettingPlaceholder(str); } }); @@ -784,4 +782,13 @@ public class ITReplaceNorthPanel { public void setSettingResultLabel(UILabel settingResultLabel) { this.settingResultLabel = settingResultLabel; } + + /** + * 更新展示的默认值 + * @param str 默认值 + */ + public void updateSettingPlaceholder(String str) { + ((UITextField) (findSettingInputComboBox.getEditor().getEditorComponent())).setPlaceholder(Toolkit.i18nText("Fine-Design_Replace_Choose_Search") + str); + ((UITextField) (replaceSettingInputComboBox.getEditor().getEditorComponent())).setPlaceholder(Toolkit.i18nText("Fine-Design_Replace_Choose_Replace") + str); + } } From a9314ea89a7fa66dbf2793b3d1574e017e44b6a6 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 31 Oct 2022 15:09:39 +0800 Subject: [PATCH 125/310] =?UTF-8?q?REPORT-80695=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=85=A8=E5=B1=80=E7=BA=A7=E5=88=AB=E6=9F=A5=E6=89=BE=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E4=BA=8C=E6=9C=9F=20=E5=A2=9E=E5=8A=A0=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E9=9D=A2=E6=9D=BF=E5=90=8E=E7=9A=84=E6=B8=85=E9=99=A4?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=8A=A8=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../replace/ui/ITReplaceMainDialog.java | 19 +++++++++++++++++++ .../replace/ui/ITReplaceNorthPanel.java | 8 ++++++++ 2 files changed, 27 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index 868ad8ad2a..27162e863d 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -25,11 +25,15 @@ import com.fr.stable.StringUtils; import javax.swing.JOptionPane; import javax.swing.JPanel; +import javax.swing.WindowConstants; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.Point; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.awt.event.WindowListener; import java.util.ArrayList; import java.util.List; @@ -132,6 +136,7 @@ public class ITReplaceMainDialog extends UIDialog { southPanel = new ITReplaceSouthPanel(); westPanel = new ITReplaceWestPanel(); + initCloseListener(); northPane.fitScreen(0, 0, jTemplate.getWidth()); JPanel center = new JPanel(new BorderLayout()); @@ -187,6 +192,20 @@ public class ITReplaceMainDialog extends UIDialog { center.setVisible(true); } + private void initCloseListener() { + this.addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent e) { + searchContentResultList.clear(); + searchSettingResultList.clear(); + ITReplaceSouthPanel.getItTableEditor().clear(); + northPane.clear(); + dialogExit(); + } + + }); + } + /** * 模板内容替换相关 */ diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java index 913150dcd3..977d819807 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java @@ -791,4 +791,12 @@ public class ITReplaceNorthPanel { ((UITextField) (findSettingInputComboBox.getEditor().getEditorComponent())).setPlaceholder(Toolkit.i18nText("Fine-Design_Replace_Choose_Search") + str); ((UITextField) (replaceSettingInputComboBox.getEditor().getEditorComponent())).setPlaceholder(Toolkit.i18nText("Fine-Design_Replace_Choose_Replace") + str); } + + /** + * 清除搜索结果 + */ + public void clear() { + settingResultLabel.setText(StringUtils.EMPTY); + resultLabel.setText(StringUtils.EMPTY); + } } From cdf23d5e87686b4916583d09831516378931b61f Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 31 Oct 2022 15:10:35 +0800 Subject: [PATCH 126/310] =?UTF-8?q?REPORT-80695=20=E5=8E=BB=E9=99=A4?= =?UTF-8?q?=E5=A4=9A=E4=BD=99=E5=BC=95=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/actions/replace/ui/ITReplaceMainDialog.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index 27162e863d..7f2530d2c6 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -25,7 +25,6 @@ import com.fr.stable.StringUtils; import javax.swing.JOptionPane; import javax.swing.JPanel; -import javax.swing.WindowConstants; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.Point; @@ -33,7 +32,6 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; -import java.awt.event.WindowListener; import java.util.ArrayList; import java.util.List; From a138f031ef82fb382c8ad689fda4baa4682541d1 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 31 Oct 2022 16:40:49 +0800 Subject: [PATCH 127/310] =?UTF-8?q?REPORT-80695=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=85=A8=E5=B1=80=E6=9F=A5=E6=89=BE=E6=9B=BF=E6=8D=A2=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=A1=E9=AA=8C=E9=80=BB=E8=BE=91=EF=BC=8C?= =?UTF-8?q?=E5=8F=AA=E5=85=81=E8=AE=B8=E7=BB=84=E4=BB=B6=E5=92=8C=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E9=9D=A2=E6=9D=BF=E6=8E=A7=E4=BB=B6=E5=8F=82=E4=B8=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../action/content/widget/FrmWidgetType.java | 2 +- .../content/widget/SearchWidgetAction.java | 2 +- .../actions/replace/info/WidgetInfo.java | 23 +++++- .../actions/replace/ui/ITCheckDialog.java | 1 + .../replace/ui/ITReplaceMainDialog.java | 14 +++- .../actions/replace/utils/CheckUtils.java | 77 +++++++++++++++++++ 6 files changed, 111 insertions(+), 8 deletions(-) create mode 100644 designer-realize/src/main/java/com/fr/design/actions/replace/utils/CheckUtils.java diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/widget/FrmWidgetType.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/widget/FrmWidgetType.java index 5aa8e208c5..8c6333e11a 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/widget/FrmWidgetType.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/widget/FrmWidgetType.java @@ -130,7 +130,7 @@ public enum FrmWidgetType implements SearchFrmWidget, DealWithInfoValue { public List dealAbsoluteWidget(ITContent content, Widget widget) { ArrayList widgetInfos = new ArrayList<>(); ITContent newContent = ITContent.copy(content); - widgetInfos.add(new WidgetInfo(newContent)); + widgetInfos.add(new WidgetInfo(newContent, true)); return widgetInfos; } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/widget/SearchWidgetAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/widget/SearchWidgetAction.java index 32a21bee54..63b5df9d8f 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/widget/SearchWidgetAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/widget/SearchWidgetAction.java @@ -148,7 +148,7 @@ public class SearchWidgetAction implements SearchAction { newContent.setReplaceObject(widget); newContent.setJumpAble(false); newContent.setShowObject(Toolkit.i18nText("Fine-Design_Parameter_Panel")); - widgetInfos.add(new WidgetInfo(newContent)); + widgetInfos.add(new WidgetInfo(newContent, true)); } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/WidgetInfo.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/WidgetInfo.java index 7adfc01536..4ebae73da9 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/WidgetInfo.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/WidgetInfo.java @@ -3,6 +3,7 @@ package com.fr.design.actions.replace.info; import com.fr.design.actions.replace.action.content.widget.FrmWidgetType; import com.fr.design.actions.replace.info.base.ITContent; +import com.fr.design.actions.replace.utils.CheckUtils; import com.fr.design.actions.replace.utils.ShowValueUtils; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.JTemplate; @@ -30,11 +31,17 @@ import java.util.Map; public class WidgetInfo implements Info, DealWithInfoValue { private ITContent content; private boolean waterMarkFlag = true; + private boolean need2Check = false; public WidgetInfo(ITContent content) { this.content = content; } + public WidgetInfo(ITContent content, boolean need2Check) { + this.content = content; + this.need2Check = need2Check; + } + @Override public ITContent getContent() { return content; @@ -96,7 +103,9 @@ public class WidgetInfo implements Info, DealWithInfoValue { */ public WidgetInfo copy(WidgetInfo widgetInfo) { ITContent content = ITContent.copy(widgetInfo.getContent()); - return new WidgetInfo(content); + WidgetInfo info = new WidgetInfo(content); + info.setNeed2Check(widgetInfo.isNeed2Check()); + return info; } /** @@ -112,6 +121,14 @@ public class WidgetInfo implements Info, DealWithInfoValue { this.waterMarkFlag = waterMarkFlag; } + public boolean isNeed2Check() { + return need2Check; + } + + public void setNeed2Check(boolean need2Check) { + this.need2Check = need2Check; + } + /** * ReplaceObject是否存在 * @@ -138,9 +155,9 @@ public class WidgetInfo implements Info, DealWithInfoValue { this.getContent().setCheckStr(Toolkit.i18nText("Fine-Design_Replace_Not_Empty")); return false; } - if (!this.isWaterMark()) { + if (!this.isWaterMark() && this.isNeed2Check()) { String replacedName = ((Widget)this.getContent().getReplaceObject()).getWidgetName().replace(searchStr, replaceStr); - for (WidgetName name : jTemplate.getModel().getWidgetsName()) { + for (WidgetName name : CheckUtils.getNeed2CheckWidgetsName(jTemplate)) { String widgetName = name.getName(); if (StringUtils.equals(replacedName, widgetName)) { this.getContent().setCheckStr(Toolkit.i18nText("Fine-Design_Replace_Exist_Same_Name")); diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITCheckDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITCheckDialog.java index 3c586fac4e..9b82dea3ce 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITCheckDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITCheckDialog.java @@ -34,6 +34,7 @@ public class ITCheckDialog extends UIDialog { public ITCheckDialog() { super(ITReplaceMainDialog.getInstance()); + setModal(true); setTitle(Toolkit.i18nText("Fine-Design_Replace_Check_Title")); JPanel centerPanel = new JPanel(); JPanel southPanel = new JPanel(); diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index 7f2530d2c6..7fa5ad2804 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -213,7 +213,13 @@ public class ITReplaceMainDialog extends UIDialog { clearContentCount(); if (isITReplaceValid() && checkTemplateChanged(searchContentResultList)) { if (StringUtils.equals(getSearchStr(), searchStr)) { - checkLegalValiditySelector(searchStr, replaceStr); + String str = GeneralUtils.objectToString(northPane.getFindCombobox().getSelectedItem()); + //如果是控件或组件才要进行合法性校验 + if (StringUtils.equals(str, Toolkit.i18nText("Fine-Design_Replace_Component")) || StringUtils.equals(str, Toolkit.i18nText("Fine-Design_Basic_Widget"))) { + checkLegalValiditySelector(searchStr, replaceStr); + } else { + replace(searchStr, replaceStr); + } } else { search4Content(); } @@ -273,9 +279,9 @@ public class ITReplaceMainDialog extends UIDialog { options, options[0] ); + updateCheckValidList(); //如果选择了直接替换,则直接执行替换 if (optionSelected == 1) { - updateCheckValidList(); replace(searchStr, replaceStr); } else { checkLegalValidity(); @@ -286,7 +292,6 @@ public class ITReplaceMainDialog extends UIDialog { * 检测 */ public void checkLegalValidity() { - updateCheckValidList(); if (contentReplaceFailedCount == 0) { ToastMsgDialog dialog = DesignerToastMsgUtil.createPromptDialog(Toolkit.i18nText("Fine-Design_Replace_Check_None")); dialog.setVisible(true); @@ -308,12 +313,15 @@ public class ITReplaceMainDialog extends UIDialog { checkValidList.add(info); serialNumber.add(count); info.getContent().setWrongful(true); + info.getContent().setReplaced(true); } else { contentReplaceCount++; } count++; } } + southPanel.getTableEditorPane().update(); + ITTableEditorPane.getEditTable().repaint(); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/CheckUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/CheckUtils.java new file mode 100644 index 0000000000..18020aaf74 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/CheckUtils.java @@ -0,0 +1,77 @@ +package com.fr.design.actions.replace.utils; + +import com.fr.design.mainframe.JTemplate; +import com.fr.form.main.Form; +import com.fr.form.main.WidgetGatherAdapter; +import com.fr.form.ui.Widget; +import com.fr.main.impl.WorkBook; +import com.fr.main.impl.WorkBookHelper; +import com.fr.stable.Filter; +import com.fr.stable.StringUtils; +import com.fr.stable.js.WidgetName; + +import java.util.ArrayList; +import java.util.List; + +/** + * 用于合法性检验相关的工具类 + * + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-10-31 + */ +public class CheckUtils { + + /** + * 获取需要检测的控件名称 + * + * @param jTemplate 模板 + * @return 控件名称列表 + */ + public static List getNeed2CheckWidgetsName(JTemplate jTemplate) { + if (jTemplate.getTarget() instanceof WorkBook) { + return getWorkBookNeedWidgetsName((WorkBook) jTemplate.getTarget()); + } else if (jTemplate.getTarget() instanceof Form) { + return getFormNeedWidgetsName((Form) jTemplate.getTarget()); + } + return new ArrayList<>(); + } + + private static List getFormNeedWidgetsName(Form target) { + final List list = new ArrayList(); + Form.traversalFormWidget(target.getContainer(), new WidgetGatherAdapter() { + + @Override + public void dealWith(Widget widget) { + if (widgetAccepted(widget)) { + list.add(new WidgetName(widget.getWidgetName())); + } + } + + @Override + public boolean dealWithAllCards() { + return true; + } + }); + return list; + } + + private static List getWorkBookNeedWidgetsName(WorkBook wb) { + return WorkBookHelper.listWidgetNamesInWorkBook(wb, new Filter() { + @Override + public boolean accept(Widget widget) { + return widgetAccepted(widget); + } + }, new Filter() { + @Override + public boolean accept(Widget widget) { + return false; + } + }); + } + + + private static boolean widgetAccepted(Widget widget) { + return widget != null && StringUtils.isNotEmpty(widget.getWidgetName()); + } +} From db42b4e512b111963b2dae894b4d906b866206ce Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 31 Oct 2022 16:47:26 +0800 Subject: [PATCH 128/310] =?UTF-8?q?REPORT-80695=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E9=AD=94=E6=B3=95=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/actions/replace/ui/ITReplaceMainDialog.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index 7fa5ad2804..b2ae3cae09 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -73,6 +73,8 @@ public class ITReplaceMainDialog extends UIDialog { public static int contentReplaceFailedCount = 0; public static int settingReplaceCount = 0; public static int settingReplaceFailedCount = 0; + public static final String COMPONENT = Toolkit.i18nText("Fine-Design_Replace_Component"); + public static final String WIDGET = Toolkit.i18nText("Fine-Design_Basic_Widget"); public ITReplaceMainDialog() { @@ -215,7 +217,7 @@ public class ITReplaceMainDialog extends UIDialog { if (StringUtils.equals(getSearchStr(), searchStr)) { String str = GeneralUtils.objectToString(northPane.getFindCombobox().getSelectedItem()); //如果是控件或组件才要进行合法性校验 - if (StringUtils.equals(str, Toolkit.i18nText("Fine-Design_Replace_Component")) || StringUtils.equals(str, Toolkit.i18nText("Fine-Design_Basic_Widget"))) { + if (StringUtils.equals(str, COMPONENT) || StringUtils.equals(str, WIDGET)) { checkLegalValiditySelector(searchStr, replaceStr); } else { replace(searchStr, replaceStr); From 62affbceb37acda679ed4603c84ad8772f1ed26d Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Tue, 1 Nov 2022 11:21:02 +0800 Subject: [PATCH 129/310] =?UTF-8?q?REPORT-83305=20=E3=80=90=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E6=93=8D=E4=BD=9C=E5=8D=95=E5=85=83=E6=A0=BC=E3=80=91?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=BC=E5=BC=8F->=E6=92=A4=E9=94=80?= =?UTF-8?q?=EF=BC=8C=E6=A0=BC=E5=BC=8F=E6=81=A2=E5=A4=8D=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E4=B8=8D=E5=90=8C=E6=A0=BC=E5=BC=8F=EF=BC=8C?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E9=9D=A2=E6=9D=BF=E5=8F=91=E7=94=9F=E5=A4=9A?= =?UTF-8?q?=E6=AC=A1=E5=8F=98=E5=8C=96=EF=BC=8C=E5=AF=BC=E8=87=B4=E5=A4=9A?= =?UTF-8?q?=E6=AC=A1=E8=A7=A6=E5=8F=91=E4=BF=9D=E5=AD=98=20=E3=80=90?= =?UTF-8?q?=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E4=BF=AE=E6=94=B9=E6=96=B9=E5=BC=8F=20?= =?UTF-8?q?=E3=80=90review=E5=BB=BA=E8=AE=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/style/TextFormatPaneContainer.java | 72 +++++ .../dscolumn/ResultSetGroupDockingPane.java | 12 +- .../design/dscolumn/ResultSetGroupPane.java | 4 - .../dscolumn/SelectedDataColumnPane.java | 10 + .../com/fr/grid/selection/CellSelection.java | 10 +- .../com/fr/quickeditor/CellQuickEditor.java | 301 ++++++++---------- .../cellquick/CellDSColumnEditor.java | 241 +++----------- 7 files changed, 282 insertions(+), 368 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/gui/style/TextFormatPaneContainer.java diff --git a/designer-base/src/main/java/com/fr/design/gui/style/TextFormatPaneContainer.java b/designer-base/src/main/java/com/fr/design/gui/style/TextFormatPaneContainer.java new file mode 100644 index 0000000000..3d2b658670 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/style/TextFormatPaneContainer.java @@ -0,0 +1,72 @@ +package com.fr.design.gui.style; + +import com.fr.base.Style; +import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; +import com.fr.design.gui.frpane.AttributeChangeListener; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.text.Format; + +/** + * 封装格式panel,管理 AttributeChangeListener + * + * @author Leo.Qin + * @version 11.0 + * Created by Leo.Qin on 2022/10/31 + */ +public class TextFormatPaneContainer extends AbstractAttrNoScrollPane { + private TextFormatPane formatPane; + private AttributeChangeListener oldListner; + + @Override + protected JPanel createContentPane() { + formatPane = new TextFormatPane(); + return formatPane; + } + + protected void initContentPane() { + leftContentPane = createContentPane(); + if (leftContentPane != null) { + leftContentPane.setBorder(BorderFactory.createEmptyBorder()); + this.add(leftContentPane, BorderLayout.CENTER); + } + } + + @Override + public Dimension getPreferredSize() { + if (formatPane == null) { + return super.getPreferredSize(); + } + return formatPane.getPreferredSize(); + } + + public void populateBean(Style style) { + formatPane.populateBean(style); + } + + public Format update() { + return formatPane.update(); + } + + public Style update(Style style) { + return formatPane.update(style); + } + + @Override + public void removeAttributeChangeListener() { + super.removeAttributeChangeListener(); + } + + @Override + public void addAttributeChangeListener(AttributeChangeListener listener) { + oldListner = listener; + super.addAttributeChangeListener(listener); + } + + public void restoreAttributeChangeListener() { + super.addAttributeChangeListener(oldListner); + } +} diff --git a/designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupDockingPane.java b/designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupDockingPane.java index a485fab05d..2c994cc7be 100644 --- a/designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupDockingPane.java +++ b/designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupDockingPane.java @@ -229,7 +229,7 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane { } void fireTargetChanged() { - listener.itemStateChanged(null); + } @Override @@ -249,8 +249,16 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane { functionComboBox.removeItemListener(this.listener); } - @Override public void update(Set cellElements) { cellElements.forEach(this::updateCellElement); } + + @Override + public Dimension getPreferredSize() { + if (this.isVisible()) { + return super.getPreferredSize(); + } else { + return new Dimension(); + } + } } \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupPane.java b/designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupPane.java index 2fb7b98496..3741ba8296 100644 --- a/designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupPane.java +++ b/designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupPane.java @@ -47,9 +47,6 @@ public abstract class ResultSetGroupPane extends JPanel { abstract void setRecordGrouper(RecordGrouper recordGrouper); - void fireTargetChanged() { - }; - ActionListener groupAdvancedListener = new ActionListener() { public void actionPerformed(ActionEvent evt) { if (cellElement == null) { @@ -75,7 +72,6 @@ public abstract class ResultSetGroupPane extends JPanel { dSColumn.setGrouper(rg); } setRecordGrouper(rg); - fireTargetChanged(); JTemplate targetComponent = DesignerContext.getDesignerFrame().getSelectedJTemplate(); if (targetComponent != null) { targetComponent.fireTargetModified(); diff --git a/designer-realize/src/main/java/com/fr/design/dscolumn/SelectedDataColumnPane.java b/designer-realize/src/main/java/com/fr/design/dscolumn/SelectedDataColumnPane.java index ad670abf33..052fba9046 100644 --- a/designer-realize/src/main/java/com/fr/design/dscolumn/SelectedDataColumnPane.java +++ b/designer-realize/src/main/java/com/fr/design/dscolumn/SelectedDataColumnPane.java @@ -392,4 +392,14 @@ public class SelectedDataColumnPane extends BasicPane { } return new ArrayList<>(); } + + @Override + public Dimension getPreferredSize() { + if (this.isVisible()) { + return super.getPreferredSize(); + } + else { + return new Dimension(); + } + } } diff --git a/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java b/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java index 4d3568cd86..b5419cf391 100644 --- a/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java +++ b/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java @@ -70,6 +70,7 @@ public class CellSelection extends Selection { private Rectangle editRectangle = new Rectangle(0, 0, 1, 1); private List cellRectangleList = new ArrayList(); + private Set cellElements = new HashSet<>(); public CellSelection() { this(0, 0, 1, 1); @@ -745,9 +746,10 @@ public class CellSelection extends Selection { if (cellElement != null) { value = cellElement.getValue(); } - Set allCellElement = getAllCellElements(tplEC); - boolean sameType = checkSameType(allCellElement); + cellElements = getAllCellElements(tplEC); + + boolean sameType = checkSameType(cellElements); // 多选时,多元格元素类型 value = sameType && value != null ? value : StringUtils.EMPTY; @@ -813,6 +815,10 @@ public class CellSelection extends Selection { return cellElements; } + public Set getCellElements() { + return cellElements; + } + @Override public void populatePropertyPane(ElementCasePane ePane) { CellElementPropertyPane.getInstance().reInit(ePane); diff --git a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java index 107b06e5e9..6f060b4f06 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java @@ -5,13 +5,12 @@ import com.fr.base.Style; import com.fr.design.actions.UpdateAction; import com.fr.design.actions.core.ActionFactory; import com.fr.design.file.HistoryTemplateListCache; -import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.iscrollbar.UIScrollBar; import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.gui.style.TextFormatPane; +import com.fr.design.gui.style.TextFormatPaneContainer; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -35,8 +34,8 @@ import javax.swing.JComponent; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollBar; +import javax.swing.SwingUtilities; import java.awt.BorderLayout; -import java.awt.CardLayout; import java.awt.Component; import java.awt.Container; import java.awt.Dimension; @@ -46,6 +45,7 @@ import java.awt.event.AdjustmentEvent; import java.awt.event.AdjustmentListener; import java.awt.event.MouseWheelEvent; import java.awt.event.MouseWheelListener; +import java.text.Format; import java.util.ArrayList; import java.util.Objects; import java.util.Set; @@ -67,12 +67,7 @@ public abstract class CellQuickEditor extends QuickEditor { private static final int CONTENT_PANE_WIDTH_GAP = 3; private static final int MOUSE_WHEEL_SPEED = 5; private static final int SCROLLBAR_WIDTH = 7; - - /** - * 区分单选多选单元格,生成相应设置面板 - */ - private final String SINGLE_SELECT = "singleSelect"; - private final String MULTIPLE_SELECT = "multipleSelect"; + private UILabel cellLabel; private int maxHeight = 280; private static final int TITLE_HEIGHT = 50; @@ -82,21 +77,16 @@ public abstract class CellQuickEditor extends QuickEditor { */ protected UITextField columnRowTextField; protected TemplateCellElement cellElement; - private TextFormatPane formatPane; - private final JPanel topContentContainer; - private final JComponent centerBodyContainer; + private TextFormatPaneContainer formatPane; + private JPanel topContentContainer; + private JComponent centerBodyContainer; + private UILabel multipleLabelTip; - private CardLayout topCardLayout; - /** - * 不同单元格元素产生的面板 - */ - private CardLayout centerCardLayout; // 占位label protected final UILabel EMPTY_LABEL = new UILabel(); - private UIComboBox singleComboBox; - private UIComboBox multipleComboBox; + private UIComboBox comboBox; private UpdateAction[] cellInsertActions; private int selectedIndex; @@ -106,23 +96,38 @@ public abstract class CellQuickEditor extends QuickEditor { private ActionListener comboBoxActionListener; public CellQuickEditor() { + + initComponents(); + + createPanelBody(); + } + + private void initComponents() { EMPTY_LABEL.setPreferredSize(LABEL_DIMENSION); + topContentContainer = initTopContent(); + formatPane = createFormatPane(); + centerBodyContainer = createCenterBody(); + + multipleLabelTip = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Basic_Cell_Element_Multiple_Tip")); + multipleLabelTip.setEnabled(false); + } + + private void createPanelBody() { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double[] columnSize = {p, f}; - JPanel formatContainerPanel = createFormatPane(); - topContentContainer = initTopContent(); - centerBodyContainer = createAllCenterBody(); + double[] columnSize = {f}; if (isScrollAll()) { - double[] scrollAllRowSize = {p, p, p}; + double[] scrollAllRowSize = {p, p, p, p}; prepareScrollBar(); - topContentContainer.setBorder(BorderFactory.createMatteBorder(10, 10, 0, 0, this.getBackground())); - formatContainerPanel.setBorder(BorderFactory.createMatteBorder(0, 10, 0, 0, this.getBackground())); + multipleLabelTip.setBorder(BorderFactory.createMatteBorder(5, 10, 0, 0, this.getBackground())); + topContentContainer.setBorder(BorderFactory.createMatteBorder(0, 10, 0, 0, this.getBackground())); + formatPane.setBorder(BorderFactory.createMatteBorder(0, 10, 0, 0, this.getBackground())); centerBodyContainer.setBorder(BorderFactory.createMatteBorder(0, 10, 0, 0, this.getBackground())); Component[][] components = new Component[][]{ - new Component[]{topContentContainer, null}, - new Component[]{formatContainerPanel, null}, - new Component[]{centerBodyContainer, null} + new Component[]{multipleLabelTip}, + new Component[]{topContentContainer}, + new Component[]{formatPane}, + new Component[]{centerBodyContainer} }; leftContentPane = TableLayoutHelper.createGapTableLayoutPane(components, scrollAllRowSize, columnSize, HGAP, VGAP); this.setLayout(new CellElementBarLayout(leftContentPane) { @@ -151,14 +156,16 @@ public abstract class CellQuickEditor extends QuickEditor { this.add(scrollBar); this.add(leftContentPane); } else { - double[] scrollContentRowSize = {p, p, f}; - topContentContainer.setBorder(BorderFactory.createMatteBorder(10, 10, 0, 10, this.getBackground())); - formatContainerPanel.setBorder(BorderFactory.createMatteBorder(0, 10, 0, 10, this.getBackground())); + double[] scrollContentRowSize = {p, p, p, f}; + multipleLabelTip.setBorder(BorderFactory.createMatteBorder(5, 10, 0, 0, this.getBackground())); + topContentContainer.setBorder(BorderFactory.createMatteBorder(0, 10, 0, 10, this.getBackground())); + formatPane.setBorder(BorderFactory.createMatteBorder(0, 10, 0, 10, this.getBackground())); centerBodyContainer.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 0, this.getBackground())); Component[][] components = new Component[][]{ - new Component[]{topContentContainer, null}, - new Component[]{formatContainerPanel, null}, - new Component[]{centerBodyContainer, null} + new Component[]{multipleLabelTip}, + new Component[]{topContentContainer}, + new Component[]{formatPane}, + new Component[]{centerBodyContainer} }; this.setLayout(new BorderLayout()); this.add(TableLayoutHelper.createGapTableLayoutPane(components, scrollContentRowSize, columnSize, HGAP, VGAP), BorderLayout.CENTER); @@ -187,31 +194,6 @@ public abstract class CellQuickEditor extends QuickEditor { */ public abstract Object getComboBoxSelected(); - /** - * 初始化创建单选及多选面板 - * - * @return 创建的面板 - */ - private JComponent createAllCenterBody() { - centerCardLayout = new CardLayout(); - - JPanel centerPanel = new JPanel(centerCardLayout); - - centerPanel.add(SINGLE_SELECT, createCenterBody()); - centerPanel.add(MULTIPLE_SELECT, createCenterBody4Multiple()); - - return centerPanel; - } - - /** - * 为多选单元格创建详细面板,默认创建空面板 - * - * @return 空面板 - */ - public JComponent createCenterBody4Multiple() { - return new JPanel(); - } - /** * 刷新 @@ -224,61 +206,90 @@ public abstract class CellQuickEditor extends QuickEditor { refreshFormatPanel(); refreshDetails(); + + refreshMultipleDetails(); + } + + /** + * 多选时默认隐藏与插入元素类型相关的所有面板 + * 若其他面板需要扩展多选时可修改的内容, + * 通过重写改方法,实现显示/隐藏部分组件 + */ + public void refreshMultipleDetails() { + centerBodyContainer.setVisible(tc.isSelectedOneCell()); } private void refreshFormatPanel() { + // 在populate的时候会多次触发AttributeChangeListener事件, + // 导致不断更新单元格格式,因此populate的时候暂时删除listener + formatPane.removeAttributeChangeListener(); + if (cellElement != null) { formatPane.populateBean(cellElement.getStyle()); } else { formatPane.populateBean(Style.DEFAULT_STYLE); } + + formatPane.restoreAttributeChangeListener(); } private void refreshPanel() { + changeVisiableState(); CellSelection cs = (CellSelection) tc.getSelection(); ColumnRow columnRow = ColumnRow.valueOf(cs.getColumn(), cs.getRow()); - String selectType = tc.isSelectedOneCell() ? SINGLE_SELECT : MULTIPLE_SELECT; - - topCardLayout.show(topContentContainer, selectType); - centerCardLayout.show(centerBodyContainer, selectType); columnRowTextField.setText(columnRow.toString()); cellElement = tc.getEditingElementCase().getTemplateCellElement(cs.getColumn(), cs.getRow()); JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); if (jTemplate != null) { - singleComboBox.removeActionListener(comboBoxActionListener); - singleComboBox.removeAllItems(); + comboBox.removeActionListener(comboBoxActionListener); + comboBox.removeAllItems(); String[] items = getDefaultComboBoxItems(); for (String item : items) { - singleComboBox.addItem(item); - multipleComboBox.addItem(item); + comboBox.addItem(item); } Object comboBoxSelected = getComboBoxSelected(); if (comboBoxSelected != null) { - singleComboBox.setSelectedItem(((ShortCut) comboBoxSelected).getMenuKeySet().getMenuKeySetName()); - multipleComboBox.setSelectedItem(((ShortCut) comboBoxSelected).getMenuKeySet().getMenuKeySetName()); + comboBox.setSelectedItem(((ShortCut) comboBoxSelected).getMenuKeySet().getMenuKeySetName()); } else { - singleComboBox.setSelectedIndex(1); - multipleComboBox.setSelectedIndex(1); + comboBox.setSelectedIndex(1); } - currentSelectedIndex = singleComboBox.getSelectedIndex(); + currentSelectedIndex = comboBox.getSelectedIndex(); comboBoxActionListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { cellInsertActions = ActionFactory.createCellInsertAction(ElementCasePane.class, tc); - selectedIndex = singleComboBox.getSelectedIndex(); - singleComboBox.setPopupVisible(false); - singleComboBox.repaint(); + selectedIndex = comboBox.getSelectedIndex(); + comboBox.setPopupVisible(false); + comboBox.repaint(); // comboBox.getSelectedIndex()可能返回-1 if (selectedIndex != -1 && selectedIndex < cellInsertActions.length) { cellInsertActions[selectedIndex].actionPerformed(e); } - singleComboBox.setSelectedIndex(currentSelectedIndex); + comboBox.setSelectedIndex(currentSelectedIndex); } }; - singleComboBox.addActionListener(comboBoxActionListener); + comboBox.addActionListener(comboBoxActionListener); + } + } + + /** + * 单选多选时切换部分组件的 隐藏/显示 状态 + */ + private void changeVisiableState() { + boolean selectedOneCell = tc.isSelectedOneCell(); + + comboBox.setEnabled(selectedOneCell); + if (selectedOneCell) { + columnRowTextField.setPreferredSize(null); + cellLabel.setPreferredSize(null); + multipleLabelTip.setPreferredSize(new Dimension()); + } else { + columnRowTextField.setPreferredSize(new Dimension()); + cellLabel.setPreferredSize(new Dimension()); + multipleLabelTip.setPreferredSize(null); } } @@ -289,44 +300,19 @@ public abstract class CellQuickEditor extends QuickEditor { private JPanel initTopContent() { - topCardLayout = new CardLayout(); - JPanel topContentPane = new JPanel(topCardLayout); - // 单选面板 double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {GraphHelper.getWidth(Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")), f}; double[] rowSize = {p, p}; - UILabel cellLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Cell")); + cellLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Basic_Cell")); UILabel insertContentLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")); initCellElementEditComboBox(); Component[][] components = new Component[][]{ new Component[]{cellLabel, columnRowTextField = initColumnRowTextField()}, - new Component[]{insertContentLabel, UIComponentUtils.wrapWithBorderLayoutPane(singleComboBox)}, - }; - JPanel singlePanel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP); - topContentPane.add(SINGLE_SELECT, singlePanel); - - - // 多选面板 - UILabel multipleTipLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Basic_Cell_Element_Multiple_Tip")); - multipleTipLabel.setEnabled(false); - multipleTipLabel.setBorder(BorderFactory.createMatteBorder(5, 0, 0, 0, this.getBackground())); - UILabel insertContentLabel1 = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")); - Component[][] components1 = new Component[][]{ - new Component[]{insertContentLabel1, UIComponentUtils.wrapWithBorderLayoutPane(multipleComboBox)}, - }; - multipleComboBox.setEnabled(false); - JPanel insertPanel = TableLayoutHelper.createGapTableLayoutPane(components1, new double[]{p}, columnSize, HGAP, - VGAP); - Component[][] components2 = new Component[][]{ - new Component[]{multipleTipLabel}, - new Component[]{insertPanel}, + new Component[]{insertContentLabel, UIComponentUtils.wrapWithBorderLayoutPane(comboBox)}, }; - JPanel multiplePanel = TableLayoutHelper.createGapTableLayoutPane(components2, rowSize, new double[]{f}, HGAP, VGAP); - topContentPane.add(MULTIPLE_SELECT, multiplePanel); - - return topContentPane; + return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP); } private void prepareScrollBar() { @@ -374,23 +360,19 @@ public abstract class CellQuickEditor extends QuickEditor { private void initCellElementEditComboBox() { JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); if (jTemplate == null) { - singleComboBox = new UIComboBox(); - multipleComboBox = new UIComboBox(); + comboBox = new UIComboBox(); return; } final String[] items = getDefaultComboBoxItems(); - singleComboBox = new UIComboBox(items); - multipleComboBox = new UIComboBox(items); + comboBox = new UIComboBox(items); final Object comboBoxSelected = getComboBoxSelected(); if (comboBoxSelected != null) { - singleComboBox.setSelectedItem(((ShortCut) comboBoxSelected).getMenuKeySet().getMenuKeySetName()); - multipleComboBox.setSelectedItem(((ShortCut) comboBoxSelected).getMenuKeySet().getMenuKeySetName()); + comboBox.setSelectedItem(((ShortCut) comboBoxSelected).getMenuKeySet().getMenuKeySetName()); } else { - singleComboBox.setSelectedIndex(1); - multipleComboBox.setSelectedIndex(1); + comboBox.setSelectedIndex(1); } - currentSelectedIndex = singleComboBox.getSelectedIndex(); - singleComboBox.addActionListener(comboBoxActionListener); + currentSelectedIndex = comboBox.getSelectedIndex(); + comboBox.addActionListener(comboBoxActionListener); } private String[] getDefaultComboBoxItems() { @@ -439,61 +421,52 @@ public abstract class CellQuickEditor extends QuickEditor { /** * 创建格式化面板 - * @return */ - private JPanel createFormatPane() { - formatPane = new TextFormatPane(); - AbstractAttrNoScrollPane container = new AbstractAttrNoScrollPane() { - @Override - protected JPanel createContentPane() { - return formatPane; - } - - protected void initContentPane() { - leftContentPane = createContentPane(); - if (leftContentPane != null) { - leftContentPane.setBorder(BorderFactory.createEmptyBorder()); - this.add(leftContentPane, BorderLayout.CENTER); - } - } + private TextFormatPaneContainer createFormatPane() { + TextFormatPaneContainer formatPane = new TextFormatPaneContainer(); - @Override - public Dimension getPreferredSize() { - if (formatPane == null) { - return super.getPreferredSize(); - } - return formatPane.getPreferredSize(); - } - }; - - container.addAttributeChangeListener(new AttributeChangeListener() { + AttributeChangeListener attributeChangeListener = new AttributeChangeListener() { @Override public void attributeChange() { - isEditing = true; - boolean updateStyle = false; - - CellSelection cs = (CellSelection) tc.getSelection(); - TemplateElementCase editingElementCase = tc.getEditingElementCase(); - Set allCellElements = cs.getAllCellElements(editingElementCase); - for (TemplateCellElement cellElement : allCellElements) { - Style elementStyle = cellElement.getStyle(); - Style style = formatPane.update(elementStyle); - if (!Objects.equals(style.getFormat(), elementStyle.getFormat())) { - // 点击单元格,但未设置格式时,不将单元格设置为编辑状态,防止将所选的每个单元格都设置为编辑状态 - editingElementCase.addCellElement(cellElement); - cellElement.setStyle(style); - updateStyle = true; + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + // 耗时任务放线程中,让其他UI组件更新界面, + // 防止多次调用此处每次获取的界面值不同,导致不断更新单元格格式 + isEditing = true; + boolean updateStyle = false; + + CellSelection cs = (CellSelection) tc.getSelection(); + TemplateElementCase editingElementCase = tc.getEditingElementCase(); + Set allCellElements = cs.getCellElements(); + Style oldStyle = cellElement == null ? Style.DEFAULT_STYLE : cellElement.getStyle(); + Style style = formatPane.update(oldStyle); + for (TemplateCellElement cellElement : allCellElements) { + Format elementFormat = cellElement.getStyle().getFormat(); + Format paneFormat = style.getFormat(); + if (!Objects.equals(paneFormat, elementFormat)) { + // 点击单元格,但未设置格式时,不将单元格设置为编辑状态,防止将所选的每个单元格都设置为编辑状态 + editingElementCase.addCellElement(cellElement); + cellElement.setStyle(style); + updateStyle = true; + } + } + + if (updateStyle) { + // 防止频繁触发保存 + fireTargetModified(); + } + + isEditing = false; } - } + }); - if (updateStyle) { - // 防止频繁触发保存 - fireTargetModified(); - } - isEditing = false; } - }); - return container; + }; + + formatPane.addAttributeChangeListener(attributeChangeListener); + + return formatPane; } } diff --git a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java index 0b7b011f04..c53439fcba 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java @@ -54,11 +54,8 @@ import java.awt.Component; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; import java.util.ArrayList; import java.util.Arrays; -import java.util.HashSet; import java.util.Set; import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.BOTTOM; @@ -107,10 +104,6 @@ public class CellDSColumnEditor extends CellQuickEditor { * 数据列高级设置 */ private DSColumnAdvancedEditorPane cellDSColumnAdvancedPane; - /** - * 多选面板设置 - */ - private DSColumnMultipleEditorPane cellDSColumnMultiplePane; public CellDSColumnEditor() { super(); @@ -145,7 +138,6 @@ public class CellDSColumnEditor extends CellQuickEditor { protected void refreshDetails() { cellDSColumnBasicPane.populate(); cellDSColumnAdvancedPane.populate(); - cellDSColumnMultiplePane.populate(); this.validate(); } @@ -190,7 +182,6 @@ public class CellDSColumnEditor extends CellQuickEditor { super.release(); cellDSColumnBasicPane.release(); cellDSColumnAdvancedPane.release(); - cellDSColumnMultiplePane.release(); } @@ -241,7 +232,10 @@ public class CellDSColumnEditor extends CellQuickEditor { @Override public void update() { dataPane.update(cellElement); - groupPane.update(); + + CellSelection selection = (CellSelection) tc.getSelection(); + Set allCellElements = selection.getCellElements(); + groupPane.update(allCellElements); } @Override @@ -286,7 +280,6 @@ public class CellDSColumnEditor extends CellQuickEditor { private void initComponents(){ dataPane = new SelectedDataColumnPane(true, true); groupPane = new ResultSetGroupDockingPane(); - initListener(); double[] rowSize = {P}, columnSize = {60, F}; UILabel uiLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Report_Filter_Conditions")); condition = new DSColumnConditionAction(); @@ -303,35 +296,8 @@ public class CellDSColumnEditor extends CellQuickEditor { conditionPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP); this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); } - - - private void initListener() { - dataPane.setListener(new ItemListener() { - @Override - public void itemStateChanged(ItemEvent e) { - if (e.getStateChange() == ItemEvent.SELECTED) { - dataPane.update(cellElement); - fireTargetModified(); - } - } - }); - groupPane.setListener(new ItemListener() { - @Override - public void itemStateChanged(ItemEvent e) { - if (e == null) { - //分组-高级-自定义点确定的时候传进来null的e,但是这时候应该触发保存 - groupPane.update(); - fireTargetModified(); - return; - } - if (e.getStateChange() == ItemEvent.DESELECTED) { - groupPane.update(); - fireTargetModified(); - } - } - }); - } - + + @Override protected AttributeChangeListener getAttributeChangeListener() { return new AttributeChangeListener() { @@ -342,6 +308,40 @@ public class CellDSColumnEditor extends CellQuickEditor { } }; } + + + public void setMultipleVisible(boolean selectedOneCell) { + // 数据源面板 需要在单选与多选间切换显示状态 + dataPane.setVisible(selectedOneCell); + + if (!selectedOneCell) { + // 只有在批量操作的时候才需要判断是否隐藏条件面板 + CellSelection selection = (CellSelection) tc.getSelection(); + boolean sameDSName = checkSameDSName(selection.getCellElements()); + conditionPane.setVisible(sameDSName); + } + } + + /** + * 判断是否属于同一个数据集 + * + * @param cellElements + * @return + */ + private boolean checkSameDSName(Set cellElements) { + String lastDSName = StringUtils.EMPTY; + for (TemplateCellElement cellElement : cellElements) { + DSColumn dsColumn = (DSColumn) cellElement.getValue(); + String dsName = dsColumn.getDSName(); + if (StringUtils.isNotEmpty(lastDSName) && !StringUtils.equals(dsName, lastDSName)) { + return false; + } + lastDSName = dsName; + } + return true; + } + + } @@ -1026,163 +1026,12 @@ public class CellDSColumnEditor extends CellQuickEditor { } - - class DSColumnMultipleEditorPane extends AbstractDSCellEditorPane { - - /** - * 数据分组设置 - */ - private ResultSetGroupDockingPane groupPane; - /** - * 条件过滤按钮面板 - */ - private JPanel conditionPane; - - /** - * 条件过滤按钮触发动作 - */ - private DSColumnConditionAction condition; - - /** - * 条件过滤按钮 - */ - private UIButton conditionUIButton; - - - @Override - public String getIconPath() { - return Toolkit.i18nText("Fine-Design_Report_Basic"); - } - - @Override - public String title4PopupWindow() { - return Toolkit.i18nText("FR-Designer_Basic"); - } - - - @Override - public void update() { - groupPane.update(); - } - - @Override - public void populate() { - this.removeAttributeChangeListener(); - if (tc != null) { - CellSelection selection = (CellSelection) tc.getSelection(); - Set cellElements = selection.getAllCellElements(tc.getEditingElementCase()); - conditionPane.setVisible(checkSameDSName(cellElements)); - condition.setEditingComponent(tc); - cellElements.forEach(cellElement -> groupPane.populate(cellElement)); - } - this.addAttributeChangeListener(); - } - - /** - * 判断是否属于同一个数据集 - * - * @param cellElements - * @return - */ - private boolean checkSameDSName(Set cellElements) { - String lastDSName = StringUtils.EMPTY; - for (TemplateCellElement cellElement : cellElements) { - DSColumn dsColumn = (DSColumn) cellElement.getValue(); - String dsName = dsColumn.getDSName(); - if (StringUtils.isNotEmpty(lastDSName) && !StringUtils.equals(dsName, lastDSName)) { - return false; - } - lastDSName = dsName; - } - return true; - } - - @Override - protected void release() { - condition.setEditingComponent(null); - } - - - /** - * 创建有内容的面板显示信息 - * - * @return content JPanel - */ - @Override - protected JPanel createContentPane() { - initComponents(); - double[] columnSize = {F}; - double[] rowSize = {P, P}; - Component[][] components = new Component[][]{ - //数据分组设置 - new Component[]{this.groupPane}, - //条件过滤 - new Component[]{this.conditionPane} - }; - return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP); - } - - private void initComponents() { - groupPane = new ResultSetGroupDockingPane(); - initListener(); - double[] rowSize = {P}, columnSize = {60, F}; - UILabel uiLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Report_Filter_Conditions")); - condition = new DSColumnConditionAction(); - if (tc != null) { - condition.setEditingComponent(tc); - } - //丢掉icon,修改按钮名称为编辑 - condition.setSmallIcon(UIConstants.EMPTY_ICON); - condition.setName(Toolkit.i18nText("Fine-Design_Basic_Edit")); - conditionUIButton = new UIButton(condition); - Component[][] components = new Component[][]{ - new Component[]{uiLabel, UIComponentUtils.wrapWithBorderLayoutPane(conditionUIButton)} - }; - conditionPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP); - this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); - } - - - private void initListener() { - groupPane.setListener(new ItemListener() { - @Override - public void itemStateChanged(ItemEvent e) { - Set cellElements = new HashSet<>(); - if (tc != null) { - CellSelection selection = (CellSelection) tc.getSelection(); - cellElements = selection.getAllCellElements(tc.getEditingElementCase()); - } - - if (e == null) { - //分组-高级-自定义点确定的时候传进来null的e,但是这时候应该触发保存 - groupPane.update(cellElements); - fireTargetModified(); - return; - } - if (e.getStateChange() == ItemEvent.DESELECTED) { - groupPane.update(cellElements); - fireTargetModified(); - } - } - }); - } - - @Override - protected AttributeChangeListener getAttributeChangeListener() { - return new AttributeChangeListener() { - @Override - public void attributeChange() { - update(); - fireTargetModified(); - } - }; - } - } - @Override - public JComponent createCenterBody4Multiple() { - cellDSColumnMultiplePane = new DSColumnMultipleEditorPane(); - return cellDSColumnMultiplePane; + public void refreshMultipleDetails() { + tabsHeaderIconPane.setVisible(tc.isSelectedOneCell()); + cellDSColumnAdvancedPane.setVisible(tc.isSelectedOneCell()); + + cellDSColumnBasicPane.setMultipleVisible(tc.isSelectedOneCell()); } @Override From 47cc6f0f27cb38f663de40d1ddb564f01cbf5d73 Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Tue, 1 Nov 2022 11:26:56 +0800 Subject: [PATCH 130/310] =?UTF-8?q?REPORT-83305=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/style/TextFormatPaneContainer.java | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/style/TextFormatPaneContainer.java b/designer-base/src/main/java/com/fr/design/gui/style/TextFormatPaneContainer.java index 3d2b658670..bf58ab6558 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/TextFormatPaneContainer.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/TextFormatPaneContainer.java @@ -8,7 +8,6 @@ import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Dimension; -import java.text.Format; /** * 封装格式panel,管理 AttributeChangeListener @@ -43,14 +42,21 @@ public class TextFormatPaneContainer extends AbstractAttrNoScrollPane { return formatPane.getPreferredSize(); } + /** + * 根据单元格样式填充面板设置 + * + * @param style 单元格样式 + */ public void populateBean(Style style) { formatPane.populateBean(style); } - public Format update() { - return formatPane.update(); - } - + /** + * 根据面板设置获取修改后的单元格样式 + * + * @param style 单元格当前样式 + * @return 更新后的单元格样式 + */ public Style update(Style style) { return formatPane.update(style); } @@ -66,6 +72,9 @@ public class TextFormatPaneContainer extends AbstractAttrNoScrollPane { super.addAttributeChangeListener(listener); } + /** + * 恢复使用AttributeChangeListener + */ public void restoreAttributeChangeListener() { super.addAttributeChangeListener(oldListner); } From 7a272a97d78aa18941f1aa2fc8f5a5b93dd3aa6c Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Tue, 1 Nov 2022 11:37:13 +0800 Subject: [PATCH 131/310] =?UTF-8?q?REPORT-80690=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=9C=AA=E4=BD=BF=E7=94=A8=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/dscolumn/ResultSetGroupDockingPane.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupDockingPane.java b/designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupDockingPane.java index 2c994cc7be..3a51af2844 100644 --- a/designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupDockingPane.java +++ b/designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupDockingPane.java @@ -228,9 +228,6 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane { this.listener = listener; } - void fireTargetChanged() { - - } @Override public void setRecordGrouper(RecordGrouper recordGrouper) { From 16e871420934e59c796dc6a26678f179fca066e4 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 1 Nov 2022 16:52:01 +0800 Subject: [PATCH 132/310] =?UTF-8?q?REPORT-83339=20=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=A1=B9-=E5=88=87=E6=8D=A2=E6=A8=A1=E6=9D=BF=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E6=95=B0=E6=8D=AE=E9=9B=86=E7=9A=84=E6=9F=A5=E6=89=BE?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E8=BF=98=E6=98=AF=E4=B8=8A=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../replace/action/setting/action/SearchDSColumnAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchDSColumnAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchDSColumnAction.java index 9493cbfa7d..5e17f2e9a0 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchDSColumnAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchDSColumnAction.java @@ -39,8 +39,8 @@ public class SearchDSColumnAction implements SearchAction { content.setShowStr(dataName); content.setTemplateName(jTemplate.getTemplateName()); dsColumnInfos.add(new DataSourceInfo(content)); - setDsColumnInfos(dsColumnInfos); } + setDsColumnInfos(dsColumnInfos); } public List getDsColumnInfos() { From c558887d0380d26c976929943940e45e8acf28ea Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 1 Nov 2022 16:54:44 +0800 Subject: [PATCH 133/310] =?UTF-8?q?REPORT-83501=20=E5=A4=9A=E6=AC=A1?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E6=97=B6=EF=BC=8C=E4=B8=8B=E4=B8=80=E6=AC=A1?= =?UTF-8?q?=E4=BC=9A=E8=A6=86=E7=9B=96=E4=B8=8A=E4=B8=80=E6=AC=A1=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E7=9A=84=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/actions/replace/ui/ITReplaceMainDialog.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index b2ae3cae09..9d28ff31be 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -514,7 +514,7 @@ public class ITReplaceMainDialog extends UIDialog { String thirdStr = GeneralUtils.objectToString(northPane.getReplaceExtraSettingComboBox().getSelectedItem()); HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(true); for (Info info : searchSettingResultList) { - if (info.getContent().isSelected()) { + if (isSupportReplace(info)) { SettingController controller = SettingController.match(firstStr); if (controller != null) { controller.replace(info, secondStr, thirdStr); @@ -549,6 +549,10 @@ public class ITReplaceMainDialog extends UIDialog { } } } + + private boolean isSupportReplace(Info info) { + return info.getContent().isSelected() && !info.getContent().isReplaced(); + } private boolean isSelectSearch(int optionSelected) { return optionSelected == NONE; From d217d2a03597da020b6b5802bdcffc67a22cc2a6 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 1 Nov 2022 16:55:38 +0800 Subject: [PATCH 134/310] =?UTF-8?q?REPORT-83498=20=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC-=E6=A0=BC=E5=BC=8F-=E5=B8=B8=E8=A7=84=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E6=9B=BF=E6=8D=A2=E4=BC=9A=E6=8F=90=E7=A4=BA=E6=9F=A5?= =?UTF-8?q?=E6=89=BE=E5=86=85=E5=AE=B9=E4=B8=8D=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/replace/action/setting/CellFormatType.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellFormatType.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellFormatType.java index a468dc995c..b22434a457 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellFormatType.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellFormatType.java @@ -61,7 +61,7 @@ public enum CellFormatType { @Override public boolean isEverChanged(Info info, String inputStr, String extraStr) { CellElement cellElement = (CellElement) info.getContent().getReplaceObject(); - return (cellElement.getStyle() != null && cellElement.getStyle().getFormat() == null); + return !(cellElement.getStyle() != null && cellElement.getStyle().getFormat() == null); } }, /** From 59c4ea72018e566d027af9b594f6dd8c3a279ffe Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Tue, 1 Nov 2022 20:01:28 +0800 Subject: [PATCH 135/310] =?UTF-8?q?REPORT-83305=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=8E=E7=95=8C=E9=9D=A2=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cellquick/CellDSColumnEditor.java | 37 ++++++++++++++++++- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java index c53439fcba..bd449de01d 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java @@ -54,6 +54,8 @@ import java.awt.Component; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; import java.util.ArrayList; import java.util.Arrays; import java.util.Set; @@ -157,6 +159,10 @@ public class CellDSColumnEditor extends CellQuickEditor { tabsHeaderIconPane = new UIHeadGroup(iconArray) { @Override public void tabChanged(int index) { + + // 由于多选的时候修改了 cellDSColumnBasicPane 中组件的visiable属性,切换时需要将其设置为false + cellDSColumnBasicPane.setVisible(false); + card.show(cardContainer, paneList.get(index).title4PopupWindow()); paneList.get(index).populate(); } @@ -280,6 +286,7 @@ public class CellDSColumnEditor extends CellQuickEditor { private void initComponents(){ dataPane = new SelectedDataColumnPane(true, true); groupPane = new ResultSetGroupDockingPane(); + initListener(); double[] rowSize = {P}, columnSize = {60, F}; UILabel uiLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Report_Filter_Conditions")); condition = new DSColumnConditionAction(); @@ -297,14 +304,38 @@ public class CellDSColumnEditor extends CellQuickEditor { this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); } + private void initListener() { + dataPane.setListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + if (e.getStateChange() == ItemEvent.SELECTED) { + dataPane.update(cellElement); + fireTargetModified(); + } + } + }); + groupPane.setListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + CellSelection selection = (CellSelection) tc.getSelection(); + Set allCellElements = selection.getCellElements(); + groupPane.update(allCellElements); + if (e == null || e.getStateChange() == ItemEvent.DESELECTED) { + //分组-高级-自定义点确定的时候传进来null的e,但是这时候应该触发保存 + groupPane.update(allCellElements); + fireTargetModified(); + } + } + }); + } + @Override protected AttributeChangeListener getAttributeChangeListener() { return new AttributeChangeListener() { @Override public void attributeChange() { - update(); - fireTargetModified(); + } }; } @@ -319,6 +350,8 @@ public class CellDSColumnEditor extends CellQuickEditor { CellSelection selection = (CellSelection) tc.getSelection(); boolean sameDSName = checkSameDSName(selection.getCellElements()); conditionPane.setVisible(sameDSName); + } else { + conditionPane.setVisible(true); } } From 468e268723335edaa79e03dfd4775de17205a0a6 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 2 Nov 2022 17:11:05 +0800 Subject: [PATCH 136/310] =?UTF-8?q?REPORT-83571=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=88=97=E8=AE=BE=E7=BD=AE=E4=BB=8E=E5=88=86=E7=BB=84-?= =?UTF-8?q?=E6=99=AE=E9=80=9A=E6=9B=BF=E6=8D=A2=E4=B8=BA=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E4=B8=8D=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/replace/action/setting/CellGroupType.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellGroupType.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellGroupType.java index a9b20b6627..27aebee07d 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellGroupType.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellGroupType.java @@ -237,7 +237,11 @@ public enum CellGroupType { */ public void replace(Info info, String firstStr, String secondStr) { FunctionGrouper grouper = new FunctionGrouper(); - grouper.setDivideMode(getGroupType(secondStr)); + if (StringUtils.equals(firstStr, SettingContent.DIGIT_SETTING_LIST)) { + grouper.setDivideMode(getGroupType(firstStr)); + } else { + grouper.setDivideMode(getGroupType(secondStr)); + } CellElement cellElement = (CellElement) info.getContent().getReplaceObject(); DSColumn column = (DSColumn) cellElement.getValue(); column.setGrouper(grouper); From 35a6960a47af9d173be90422a59710c36f3f8659 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 2 Nov 2022 17:19:12 +0800 Subject: [PATCH 137/310] =?UTF-8?q?REPORT-83302=20=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=A1=B9=E5=BC=B9=E7=AA=97=E6=89=93=E5=BC=80=E5=90=8E=E5=86=8D?= =?UTF-8?q?=E6=AC=A1=E7=BC=96=E8=BE=91=E7=9A=84=E5=86=85=E5=AE=B9=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E5=AE=9E=E6=97=B6=E6=98=BE=E7=A4=BA=E5=9C=A8=E5=8F=AF?= =?UTF-8?q?=E9=80=89=E9=A1=B9=E9=87=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../replace/ui/ITReplaceNorthPanel.java | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java index 977d819807..a11886c2c8 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java @@ -20,6 +20,8 @@ import javax.swing.Icon; import javax.swing.JCheckBox; import javax.swing.JPanel; import javax.swing.ScrollPaneConstants; +import javax.swing.event.PopupMenuEvent; +import javax.swing.event.PopupMenuListener; import java.awt.CardLayout; import java.awt.Dimension; import java.awt.event.ActionEvent; @@ -317,6 +319,45 @@ public class ITReplaceNorthPanel { refreshExtraComboBox(replaceSettingInputComboBox, replaceExtraSettingComboBox); } }); + + initInputComboBoxPopupListener(findSettingInputComboBox); + initInputComboBoxPopupListener(replaceSettingInputComboBox); + + } + + private void initInputComboBoxPopupListener(UIComboBox box) { + box.addPopupMenuListener(new PopupMenuListener() { + @Override + public void popupMenuWillBecomeVisible(PopupMenuEvent e) { + String str = GeneralUtils.objectToString(findSettingComboBox.getSelectedItem()); + int findExtraIndex = findExtraSettingComboBox.getSelectedIndex(); + int replaceExtraIndex = replaceExtraSettingComboBox.getSelectedIndex(); + box.refreshBoxItems(SettingController.getSettingRefreshItems(str)); + dealExtraItemSelect(findExtraSettingComboBox, findExtraIndex); + dealExtraItemSelect(replaceExtraSettingComboBox, replaceExtraIndex); + } + + @Override + public void popupMenuWillBecomeInvisible(PopupMenuEvent e) { + + } + + @Override + public void popupMenuCanceled(PopupMenuEvent e) { + + } + }); + } + + /** + * 重新设置额外下拉框的选中索引 + * @param comboBox 额外下拉框 + * @param index 索引 + */ + private void dealExtraItemSelect(UIComboBox comboBox, int index) { + if (comboBox.getItemCount() > index) { + comboBox.setSelectedIndex(index); + } } /** From 0178d770ad2a26a0c0519801e015ae661b0115e1 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 2 Nov 2022 17:22:40 +0800 Subject: [PATCH 138/310] =?UTF-8?q?REPORT-83604=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=89=80=E6=9C=89=E7=B1=BB=E5=9E=8B=E7=9A=84?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=EF=BC=9A=E5=8D=95=E6=9D=A1=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=E4=BC=9A=E6=9B=BF=E6=8D=A2=E6=89=80=E6=9C=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/actions/replace/ui/ITReplaceMainDialog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index 9d28ff31be..78daf0a09f 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -254,7 +254,7 @@ public class ITReplaceMainDialog extends UIDialog { public void replace(String searchStr, String replaceStr) { HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(true); for (Info info : searchContentResultList) { - if (!info.getContent().isWrongful()) { + if (!info.getContent().isWrongful() && info.getContent().isSelected()) { info.setValue(info, searchStr, replaceStr, info.getContent().getOperatorArray()); } info.getContent().setReplaced(true); From ffe4406165b1e5115fcf5500b98262e539c17b90 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 2 Nov 2022 17:25:27 +0800 Subject: [PATCH 139/310] =?UTF-8?q?REPORT-83083=20FR=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E5=85=A8=E9=87=8F=E8=A6=86=E7=9B=96-=E9=83=A8=E5=88=86?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E5=86=85=E5=AE=B9=E6=9F=A5=E4=B8=8D=E5=88=B0?= =?UTF-8?q?=E7=9B=B8=E5=BA=94=E4=BD=8D=E7=BD=AE=E4=BF=A1=E6=81=AF=EF=BC=8C?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E8=A1=A5=E5=85=85=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SearchChartCollectionFormulaAction.java | 153 +++++++++++------- .../SearchChartMapDataFormulaAction.java | 41 +++-- .../SearchChartHyperPopLinkAction.java | 3 +- .../content/js/SearchChartJSAction.java | 56 ++++--- .../actions/replace/utils/SearchJSUtils.java | 142 +++++++++++++--- .../actions/replace/utils/ShowValueUtils.java | 40 ++++- 6 files changed, 312 insertions(+), 123 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java index aadf2aee41..40e5283ce9 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java @@ -13,15 +13,14 @@ import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.SwitchTitle; import com.fr.chart.chartattr.Title; -import com.fr.chart.chartdata.NormalReportDataDefinition; -import com.fr.chart.chartdata.SeriesDefinition; + import com.fr.design.actions.replace.action.content.formula.highlight.javascript.SearchJSHighlightAction; import com.fr.design.actions.replace.action.content.formula.widget.DictionaryType; -import com.fr.design.actions.replace.info.CellInfo; import com.fr.design.actions.replace.info.FormulaInfo; -import com.fr.design.actions.replace.info.JSInfo; import com.fr.design.actions.replace.info.base.ITContent; +import com.fr.design.actions.replace.utils.SearchJSUtils; +import com.fr.design.actions.replace.utils.ShowValueUtils; import com.fr.design.i18n.Toolkit; import com.fr.js.NameJavaScript; @@ -29,10 +28,13 @@ import com.fr.js.NameJavaScriptGroup; import com.fr.plugin.chart.attr.axis.VanChartAlertValue; import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.axis.VanChartValueAxis; +import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; +import com.fr.plugin.chart.custom.CustomDefinition; import com.fr.plugin.chart.custom.CustomPlotFactory; import com.fr.plugin.chart.custom.VanChartCustomPlot; + import com.fr.plugin.chart.custom.type.CustomPlotType; -import com.fr.report.cell.TemplateCellElement; +import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.stable.StringUtils; import java.util.List; @@ -111,21 +113,41 @@ public class SearchChartCollectionFormulaAction { } private void dealPlot(List formulaInfos, ITContent content, Plot plot) { - NameJavaScriptGroup javaScriptGroup = plot.getHotHyperLink(); + if (SearchJSUtils.isCustomMapPlot(plot)) { + dealNameJavaScriptGroup(formulaInfos, ShowValueUtils.getCustomMapContent(content, Toolkit.i18nText("Fine-Design_Chart_Region_Map")), ((VanChartMapPlot) plot).getAreaHotHyperLink()); + dealNameJavaScriptGroup(formulaInfos, ShowValueUtils.getCustomMapContent(content, Toolkit.i18nText("Fine-Design_Chart_LineMap")), ((VanChartMapPlot) plot).getLineHotHyperLink()); + dealNameJavaScriptGroup(formulaInfos, ShowValueUtils.getCustomMapContent(content, Toolkit.i18nText("Fine-Design_Chart_PointMap")), ((VanChartMapPlot) plot).getPointHotHyperLink()); + } else { + NameJavaScriptGroup javaScriptGroup = plot.getHotHyperLink(); + dealNameJavaScriptGroup(formulaInfos, content, javaScriptGroup); + } + } + + private void dealNameJavaScriptGroup(List formulaInfos, ITContent content, NameJavaScriptGroup javaScriptGroup) { if (javaScriptGroup != null) { for (int i = 0; i < javaScriptGroup.size(); i++) { + ITContent formulaContent = ITContent.copy(content); NameJavaScript javaScript = javaScriptGroup.getNameHyperlink(i); - content.addOtherPos(javaScript.getName()); + formulaContent.addOtherPos(javaScript.getName()); SearchJSHighlightAction action = SearchJSHighlightAction.getInstance(); - action.searchJSFormulaFromOther(formulaInfos, content, javaScript.getJavaScript()); + action.searchJSFormulaFromOther(formulaInfos, formulaContent, javaScript.getJavaScript()); } } } private void searchFormulaFromChartPresent(List formulaInfos, ITContent content, TopDefinitionProvider provider) { - searchPresent4Formula(provider.getCategoryPresent(), content, formulaInfos); - searchPresent4Formula(provider.getSeriesPresent(), content, formulaInfos); - + if (provider instanceof CustomDefinition) { + CustomDefinition definition = (CustomDefinition) provider; + Map map = definition.getDefinitionProviderMap(); + for (CustomPlotType type : map.keySet()) { + ITContent customContent = ITContent.copy(content); + customContent.addOtherPos(CustomPlotFactory.getTitle(type)); + searchFormulaFromChartPresent(formulaInfos, customContent, map.get(type)); + } + } else { + searchPresent4Formula(provider.getCategoryPresent(), ShowValueUtils.getCustomMapContent(content, Toolkit.i18nText("Fine-Design_Chart_Category")), formulaInfos); + searchPresent4Formula(provider.getSeriesPresent(), ShowValueUtils.getCustomMapContent(content, Toolkit.i18nText("Fine-Design_Chart_Series")), formulaInfos); + } } private void searchPresent4Formula(Present present, ITContent content, List formulaInfos) { @@ -195,36 +217,40 @@ public class SearchChartCollectionFormulaAction { private void searchChartPatternFormulaFromAlertLine(List formulaInfos, ITContent chartContent, Chart chart) { if (chart.getPlot() != null) { - Axis xAxis = chart.getPlot().getxAxis(); - Axis yAxis = chart.getPlot().getyAxis(); + if (chart.getPlot() instanceof VanChartRectanglePlot) { + VanChartRectanglePlot plot = chart.getPlot(); + for (VanChartAxis axis : plot.getXAxisList()) { + dealAlertLineFormula(formulaInfos, chartContent, axis); + } + for (VanChartAxis axis : plot.getYAxisList()) { + dealAlertLineFormula(formulaInfos, chartContent, axis); + } + } else { + dealAlertLineFormula(formulaInfos, chartContent, chart.getPlot().getxAxis()); + dealAlertLineFormula(formulaInfos, chartContent, chart.getPlot().getyAxis()); + } + } + } + + private void dealAlertLineFormula(List formulaInfos, ITContent chartContent, Axis axis) { + if (axis instanceof VanChartAxis) { ITContent content = ITContent.copy(chartContent); content.addOtherPos( Toolkit.i18nText("Fine-Design_Chart_Pattern"), Toolkit.i18nText("Fine-Design_Chart_Background"), Toolkit.i18nText("Fine-Design_Chart_Plot_Region"), - Toolkit.i18nText("Fine-Design_Chart_Alert_Line") + Toolkit.i18nText("Fine-Design_Chart_Alert_Line"), + ((VanChartAxis) axis).getAxisName() ); - if (xAxis instanceof VanChartAxis) { - List list = ((VanChartAxis) xAxis).getAlertValues(); - for (VanChartAlertValue alertValue : list) { - //警戒线设置 - dealAlertValue(formulaInfos, content, alertValue); - //提示文字 - dealAlertContent(formulaInfos, content, alertValue); - } - } - if (yAxis instanceof VanChartAxis) { - List list = ((VanChartAxis) yAxis).getAlertValues(); - for (VanChartAlertValue alertValue : list) { - //警戒线设置 - dealAlertValue(formulaInfos, content, alertValue); - //提示文字 - dealAlertContent(formulaInfos, content, alertValue); - } + + List list = ((VanChartAxis) axis).getAlertValues(); + for (VanChartAlertValue alertValue : list) { + //警戒线设置 + dealAlertValue(formulaInfos, content, alertValue); + //提示文字 + dealAlertContent(formulaInfos, content, alertValue); } } - - } private void dealAlertContent(List formulaInfos, ITContent content, VanChartAlertValue alertValue) { @@ -247,39 +273,42 @@ public class SearchChartCollectionFormulaAction { private void searchChartPatternFormulaFromAxisValue(List formulaInfos, ITContent chartContent, Chart chart) { if (chart.getPlot() != null) { - Axis xAxis = chart.getPlot().getxAxis(); - Axis yAxis = chart.getPlot().getyAxis(); - //样式-坐标轴-x轴 - if (xAxis != null) { - //轴标题 - ITContent xAxisContent = ITContent.copy(chartContent); - if (!chartContent.isFrm()) { - xAxisContent.addOtherPos(chart.getChartName()); - } - xAxisContent.addOtherPos( - Toolkit.i18nText("Fine-Design_Chart_Pattern"), - Toolkit.i18nText("Fine-Design_Chart_Axis"), - Toolkit.i18nText("Fine-Design_Chart_X_Axis") - ); - dealTitle(formulaInfos, xAxisContent, xAxis.getTitle()); - dealChartValueDefine(formulaInfos, xAxisContent, xAxis); + if (chart.getPlot() instanceof VanChartRectanglePlot) { + searchVanChartRectanglePlotAxisFormula(formulaInfos, chartContent, chart.getPlot(), chart); + } else { + Axis xAxis = chart.getPlot().getxAxis(); + Axis yAxis = chart.getPlot().getyAxis(); + //样式-坐标轴 + dealAxisFormula(formulaInfos, chartContent, xAxis, chart); + dealAxisFormula(formulaInfos, chartContent, yAxis, chart); } + } + } - //样式-坐标轴-y轴-轴标题 - if (yAxis != null) { - ITContent yAxisContent = ITContent.copy(chartContent); - yAxisContent.addOtherPos( - chart.getChartName(), - Toolkit.i18nText("Fine-Design_Chart_Pattern"), - Toolkit.i18nText("Fine-Design_Chart_Axis"), - Toolkit.i18nText("Fine-Design_Chart_Y_Axis") - - ); - dealTitle(formulaInfos, yAxisContent, yAxis.getTitle()); - dealChartValueDefine(formulaInfos, yAxisContent, yAxis); - } + private void searchVanChartRectanglePlotAxisFormula(List formulaInfos, ITContent chartContent, VanChartRectanglePlot plot, Chart chart) { + for (VanChartAxis axis : plot.getXAxisList()) { + dealAxisFormula(formulaInfos, chartContent, axis, chart); } + for (VanChartAxis axis : plot.getYAxisList()) { + dealAxisFormula(formulaInfos, chartContent, axis, chart); + } + } + private void dealAxisFormula(List formulaInfos, ITContent chartContent, Axis axis, Chart chart) { + if (axis instanceof VanChartAxis) { + //轴标题 + ITContent content = ITContent.copy(chartContent); + if (!chartContent.isFrm()) { + content.addOtherPos(chart.getChartName()); + } + content.addOtherPos( + Toolkit.i18nText("Fine-Design_Chart_Pattern"), + Toolkit.i18nText("Fine-Design_Chart_Axis"), + ((VanChartAxis) axis).getAxisName() + ); + dealTitle(formulaInfos, content, axis.getTitle()); + dealChartValueDefine(formulaInfos, content, axis); + } } private void dealChartValueDefine(List formulaInfos, ITContent axisContent, Axis axis) { diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartMapDataFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartMapDataFormulaAction.java index b892e35c82..862ab0e6dc 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartMapDataFormulaAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartMapDataFormulaAction.java @@ -34,11 +34,11 @@ public class SearchChartMapDataFormulaAction implements SearchChartDataFormula { //流向地图 ITContent lineContent = ITContent.copy(content); lineContent.addOtherPos(Toolkit.i18nText("Fine-Design_Chart_LineMap")); - dealLineDefinition(formulaInfos, content, mapDefinition.getLineDefinition()); + dealLineDefinition(formulaInfos, lineContent, mapDefinition.getLineDefinition()); //点地图 ITContent pointContent = ITContent.copy(content); pointContent.addOtherPos(Toolkit.i18nText("Fine-Design_Chart_PointMap")); - dealPointDefinition(formulaInfos, content, mapDefinition.getPointDefinition()); + dealPointDefinition(formulaInfos, pointContent, mapDefinition.getPointDefinition()); } } @@ -101,7 +101,7 @@ public class SearchChartMapDataFormulaAction implements SearchChartDataFormula { formulaInfos.add(new FormulaInfo(endAreaNameContent)); } //区域名 - dealAreaName(formulaInfos, lineContent, definition.getCategoryName(), definition); + dealAreaName(formulaInfos, lineContent, definition.getCategoryName(), definition, true); } } @@ -160,18 +160,34 @@ public class SearchChartMapDataFormulaAction implements SearchChartDataFormula { } /** - * 处理区域名 - * @param formulaInfos - * @param content - * @param object - * @param definition + * 处理区域名(不用考虑特殊起名) + * @param formulaInfos 存储信息的数据结构 + * @param content ITContent + * @param object 分类 + * @param definition 数据 */ public void dealAreaName(List formulaInfos, ITContent content, Object object, VanMapReportDefinition definition) { + dealAreaName(formulaInfos, content, object, definition, false); + } + + /** + * 处理区域名(特殊起名) + * @param formulaInfos 存储信息的数据结构 + * @param content ITContent + * @param object 分类 + * @param definition 数据 + * @param lineFlag 线地图的标志 + */ + public void dealAreaName(List formulaInfos, ITContent content, Object object, VanMapReportDefinition definition, boolean lineFlag) { + String str; + if (lineFlag) { + str = Toolkit.i18nText("Fine-Design_Chart_Start_Area_Name"); + } else { + str = Toolkit.i18nText("Fine-Design_Chart_Area_Name"); + } if (object instanceof Formula) { ITContent cateContent = ITContent.copy(content); - cateContent.addOtherPos( - Toolkit.i18nText("Fine-Design_Chart_Area_Name") - ); + cateContent.addOtherPos(str); cateContent.setReplaceObject(object); formulaInfos.add(new FormulaInfo(cateContent)); } else if (isFormulaString(object)) { @@ -179,12 +195,11 @@ public class SearchChartMapDataFormulaAction implements SearchChartDataFormula { strContent.setHoldObject(definition); strContent.setTag(SearchTag.CHART_AREA_NAME); strContent.setReplaceObject(object); - strContent.addOtherPos(Toolkit.i18nText("Fine-Design_Chart_Area_Name")); + strContent.addOtherPos(str); formulaInfos.add(new FormulaInfo(strContent)); } } - /** * 处理系列名&值 */ diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchChartHyperPopLinkAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchChartHyperPopLinkAction.java index 4edd5b4f17..4fa710878c 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchChartHyperPopLinkAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchChartHyperPopLinkAction.java @@ -27,7 +27,8 @@ public class SearchChartHyperPopLinkAction implements SearchJSFormula { if (javaScript instanceof ChartHyperPoplink) { ChartHyperPoplink chartHyperPoplink = (ChartHyperPoplink) javaScript; if (chartHyperPoplink.getChartCollection() instanceof ChartCollection) { - SearchChartCollectionFormulaAction.getInstance().searchChartCollectionFormula(formulaInfos, content, (ChartCollection) chartHyperPoplink.getChartCollection()); + ITContent chartContent = ITContent.copy(content); + SearchChartCollectionFormulaAction.getInstance().searchChartCollectionFormula(formulaInfos, chartContent, (ChartCollection) chartHyperPoplink.getChartCollection()); } } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchChartJSAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchChartJSAction.java index ad97655263..dc3092c01a 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchChartJSAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchChartJSAction.java @@ -13,6 +13,7 @@ import com.fr.js.NameJavaScript; import com.fr.js.NameJavaScriptGroup; import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.plot.VanChartPlot; +import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; import com.fr.plugin.chart.base.RefreshMoreLabel; import com.fr.plugin.chart.base.VanChartHtmlLabel; import com.fr.plugin.chart.custom.CustomPlotFactory; @@ -45,7 +46,7 @@ public class SearchChartJSAction { */ public void searchChartJS(ChartCollection chartCollection, ITContent content, List jsInfos) { List> htmlLabels = SearchJSUtils.getHtmlLabel(chartCollection); - List nameJavaScripts = SearchJSUtils.getNameJavaScript(chartCollection); + List nameJavaScripts = SearchJSUtils.getNameJavaScript(chartCollection, content, jsInfos); //图表-样式-标签以及图表-特效-条件显示 ITContent htmlITContent = ITContent.copy(content); htmlITContent.addOtherPos(Toolkit.i18nText("Fine-Design_Chart_Chart")); @@ -117,29 +118,44 @@ public class SearchChartJSAction { private void searchAxisJS(List jsInfos, ITContent chartContent, Chart chart) { if (chart.getPlot() != null) { - Axis xAxis = chart.getPlot().getxAxis(); - Axis yAxis = chart.getPlot().getyAxis(); - if (xAxis instanceof VanChartAxis) { - ITContent xAxisContent = ITContent.copy(chartContent); - xAxisContent.addOtherPos( - Toolkit.i18nText("Fine-Design_Chart_Axis"), - Toolkit.i18nText("Fine-Design_Chart_X_Axis"), - Toolkit.i18nText("Fine-Design_Chart_Axis_Label_Format") - ); - dealAxisHtmlLabelJS(jsInfos, ((VanChartAxis) xAxis).getHtmlLabel(), xAxisContent); + if (chart.getPlot() instanceof VanChartRectanglePlot) { + searchVanChartRectanglePlotAxisJS(jsInfos, chartContent, chart.getPlot()); + } else { + Axis xAxis = chart.getPlot().getxAxis(); + Axis yAxis = chart.getPlot().getyAxis(); + dealAxis(jsInfos, chartContent, xAxis); + dealAxis(jsInfos, chartContent, yAxis); } + } - if (yAxis instanceof VanChartAxis) { - ITContent yAxisContent = ITContent.copy(chartContent); - yAxisContent.addOtherPos( - Toolkit.i18nText("Fine-Design_Chart_Axis"), - Toolkit.i18nText("Fine-Design_Chart_Y_Axis"), - Toolkit.i18nText("Fine-Design_Chart_Axis_Label_Format") - ); - dealAxisHtmlLabelJS(jsInfos, ((VanChartAxis) yAxis).getHtmlLabel(), yAxisContent); - } + } + + private void dealAxis(List jsInfos, ITContent chartContent, Axis axis) { + if (axis instanceof VanChartAxis) { + ITContent yAxisContent = ITContent.copy(chartContent); + yAxisContent.addOtherPos( + Toolkit.i18nText("Fine-Design_Chart_Axis"), + ((VanChartAxis) axis).getAxisName(), + Toolkit.i18nText("Fine-Design_Chart_Axis_Label_Format") + ); + dealAxisHtmlLabelJS(jsInfos, ((VanChartAxis) axis).getHtmlLabel(), yAxisContent); } + } + + /** + * 自定义的图表可以存放多个轴 + * @param jsInfos 存储信息的数据结构 + * @param chartContent ITContent + * @param plot 图表的VanChartRectanglePlot + */ + private void searchVanChartRectanglePlotAxisJS(List jsInfos, ITContent chartContent, VanChartRectanglePlot plot) { + for (VanChartAxis axis : plot.getXAxisList()) { + dealAxis(jsInfos, chartContent, axis); + } + for (VanChartAxis axis : plot.getYAxisList()) { + dealAxis(jsInfos, chartContent, axis); + } } private void dealAxisHtmlLabelJS(List jsInfos, VanChartHtmlLabel label, ITContent content) { diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java index ef2909db6b..8901f76edb 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java @@ -2,6 +2,7 @@ package com.fr.design.actions.replace.utils; import com.fr.chart.base.DataSeriesCondition; import com.fr.chart.chartattr.ChartCollection; +import com.fr.chart.chartattr.Plot; import com.fr.chart.chartglyph.ConditionAttr; import com.fr.chart.chartglyph.ConditionCollection; import com.fr.chart.web.ChartHyperPoplink; @@ -22,9 +23,13 @@ import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.base.AttrLabel; import com.fr.plugin.chart.base.AttrTooltip; import com.fr.plugin.chart.base.VanChartHtmlLabel; +import com.fr.plugin.chart.custom.CustomPlotFactory; +import com.fr.plugin.chart.custom.VanChartCustomPlot; +import com.fr.plugin.chart.custom.type.CustomPlotType; import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.map.attr.AttrMapLabel; import com.fr.plugin.chart.map.attr.AttrMapTooltip; +import com.fr.plugin.chart.type.MapType; import com.fr.plugin.chart.vanchart.VanChart; import com.fr.report.cell.Elem; import com.fr.stable.StringUtils; @@ -119,16 +124,60 @@ public class SearchJSUtils { for (int i = 0; i < collection.getChartCount(); i++) { if (collection.getChart(i) instanceof VanChart) { VanChart chart = ((VanChart) collection.getChart(i)); - int size = chart.getPlot().getConditionCollection().getConditionAttrSize(); - ConditionCollection conditionCollection = chart.getPlot().getConditionCollection(); + //如果是组合图 + if (chart.getPlot() instanceof VanChartCustomPlot) { + VanChartCustomPlot plot = chart.getPlot(); + for (VanChartPlot vanChartPlot : plot.getCustomPlotList()) { + dealPlotHtmlLabel(arrayList, vanChartPlot); + } + } else if (chart.getPlot() instanceof VanChartPlot){ + dealPlotHtmlLabel(arrayList, chart.getPlot()); + } addAttrLabelHtmlLabel(chart, arrayList); - for (int j = 0; j < size; j++) { - searchConditionCollection(arrayList, conditionCollection.getConditionAttr(j)); - } } } } + private static void dealPlotHtmlLabel(List> arrayList, VanChartPlot plot) { + //如果是组合地图 + if (plot instanceof VanChartMapPlot) { + dealMapPlotHtmlLabel(arrayList, (VanChartMapPlot) plot); + } else { + dealCommonPlotHtmlLabel(arrayList, plot); + } + + } + + private static void dealMapPlotHtmlLabel(List> arrayList, VanChartMapPlot plot) { + ConditionCollection area = plot.getConditionCollection(); + ConditionCollection line = plot.getLineConditionCollection(); + ConditionCollection point = plot.getPointConditionCollection(); + dealMapCollectionHtmlLabel(arrayList, area, Toolkit.i18nText("Fine-Design_Chart_Region_Map")); + dealMapCollectionHtmlLabel(arrayList, line, Toolkit.i18nText("Fine-Design_Chart_LineMap")); + dealMapCollectionHtmlLabel(arrayList, point, Toolkit.i18nText("Fine-Design_Chart_PointMap")); + + } + + private static void dealMapCollectionHtmlLabel(List> arrayList, ConditionCollection collection, String i18nText) { + for (int i = 0, size = collection.getConditionAttrSize(); i < size; i++) { + searchConditionCollection(arrayList, collection.getConditionAttr(i), i18nText); + } + } + + private static void dealCommonPlotHtmlLabel(List> arrayList, VanChartPlot plot) { + int size = plot.getConditionCollection().getConditionAttrSize(); + CustomPlotType plotType = CustomPlotFactory.getCustomType(plot); + ConditionCollection conditionCollection = plot.getConditionCollection(); + for (int j = 0; j < size; j++) { + if (plotType != null) { + searchConditionCollection(arrayList, conditionCollection.getConditionAttr(j), CustomPlotFactory.getTitle(plotType)); + } else { + searchConditionCollection(arrayList, conditionCollection.getConditionAttr(j), StringUtils.EMPTY); + } + + } + } + /** * 将图表-样式-标签以及图表-样式-提示中的HtmlLabel加入数组 * @@ -140,15 +189,26 @@ public class SearchJSUtils { //如果是地图类型要特殊处理 if (plot instanceof VanChartMapPlot) { addMapJS2Array((VanChartMapPlot) plot, arrayList); - } else { - addAttrToolTipCondition2Array(plot, arrayList); - if (isAttrLabelExist(plot)) { - addAttrLabelDetail2Array(plot, arrayList); - addAttrSecondLabelDetail2Array(plot, arrayList); + } else if(plot instanceof VanChartCustomPlot){ + for (VanChartPlot vanChartPlot : ((VanChartCustomPlot) plot).getCustomPlotList()) { + CustomPlotType plotType = CustomPlotFactory.getCustomType(vanChartPlot); + dealAttrLabelHtml4VanChartPlot(vanChartPlot, arrayList, CustomPlotFactory.getTitle(plotType)); } + } else { + dealAttrLabelHtml4VanChartPlot(plot, arrayList, StringUtils.EMPTY); + } + } + + private static void dealAttrLabelHtml4VanChartPlot(VanChartPlot plot, List> arrayList, String str) { + addAttrToolTipCondition2Array(plot, arrayList, str); + if (isAttrLabelExist(plot)) { + addAttrLabelDetail2Array(plot, arrayList, str); + addAttrSecondLabelDetail2Array(plot, arrayList, str); } } + + /** * 用于处理地图类型图表中的样式中的JS(AttrMapTooltip 与 AttrMapLabel) * @@ -195,9 +255,9 @@ public class SearchJSUtils { } } - private static void addAttrToolTipCondition2Array(VanChartPlot plot, List> arrayList) { + private static void addAttrToolTipCondition2Array(VanChartPlot plot, List> arrayList, String str) { if (isToolTipValid(plot.getAttrTooltipFromConditionCollection())) { - arrayList.add(new Pair<>(((AttrTooltip) plot.getAttrTooltipFromConditionCollection()).getContent().getHtmlLabel(), STYLE_TOOLTIP_CUSTOM)); + arrayList.add(new Pair<>(((AttrTooltip) plot.getAttrTooltipFromConditionCollection()).getContent().getHtmlLabel(), ShowValueUtils.getChartOtherPos(STYLE_TOOLTIP_CUSTOM, str))); } } @@ -205,9 +265,9 @@ public class SearchJSUtils { return tooltip instanceof AttrTooltip && ((AttrTooltip) tooltip).isEnable() && ((AttrTooltip) tooltip).getContent() != null && ((AttrTooltip) tooltip).getContent().getHtmlLabel() != null; } - private static void addAttrLabelDetail2Array(VanChartPlot plot, List> arrayList) { + private static void addAttrLabelDetail2Array(VanChartPlot plot, List> arrayList, String str) { if (isLabelDetailValid(plot)) { - arrayList.add(new Pair<>(plot.getAttrLabelFromConditionCollection().getAttrLabelDetail().getContent().getHtmlLabel(), STYLE_LABEL)); + arrayList.add(new Pair<>(plot.getAttrLabelFromConditionCollection().getAttrLabelDetail().getContent().getHtmlLabel(), ShowValueUtils.getChartOtherPos(STYLE_LABEL, str))); } } @@ -217,9 +277,9 @@ public class SearchJSUtils { && plot.getAttrLabelFromConditionCollection().getAttrLabelDetail().getContent().getHtmlLabel() != null; } - private static void addAttrSecondLabelDetail2Array(VanChartPlot plot, List> arrayList) { + private static void addAttrSecondLabelDetail2Array(VanChartPlot plot, List> arrayList, String str) { if (isSecondLabelDetailValid(plot)) { - arrayList.add(new Pair<>(plot.getAttrLabelFromConditionCollection().getSecondLabelDetail().getContent().getHtmlLabel(), CATEGORY_LABEL)); + arrayList.add(new Pair<>(plot.getAttrLabelFromConditionCollection().getSecondLabelDetail().getContent().getHtmlLabel(), ShowValueUtils.getChartOtherPos(CATEGORY_LABEL, str))); } } @@ -239,21 +299,22 @@ public class SearchJSUtils { * @param arrayList * @param conditionAttr */ - private static void searchConditionCollection(List> arrayList, ConditionAttr conditionAttr) { + private static void searchConditionCollection(List> arrayList, ConditionAttr conditionAttr, String name) { int conditionSize = conditionAttr.getDataSeriesConditionCount(); for (int t = 0; t < conditionSize; t++) { DataSeriesCondition condition = conditionAttr.getDataSeriesCondition(t); - String str = Toolkit.i18nText("Fine-Design_Chart_Animation_Special") + "-" + Toolkit.i18nText("Fine-Design_Chart_Condition_Display"); + String str = ShowValueUtils.joinStr4Position(Toolkit.i18nText("Fine-Design_Chart_Animation_Special"), Toolkit.i18nText("Fine-Design_Chart_Condition_Display")); if (StringUtils.isNotEmpty(conditionAttr.getName())) { - str += "-" + conditionAttr.getName(); + str = ShowValueUtils.joinStr4Position(str, conditionAttr.getName()); } + str = ShowValueUtils.joinStr4Position(str, name); if (condition instanceof AttrTooltip) { - arrayList.add(new Pair<>(((AttrTooltip) condition).getContent().getHtmlLabel(), str + "-" + Toolkit.i18nText("Fine-Design_Chart_Data_Point_Tooltip"))); + arrayList.add(new Pair<>(((AttrTooltip) condition).getContent().getHtmlLabel(), ShowValueUtils.joinStr4Position(str, Toolkit.i18nText("Fine-Design_Chart_Data_Point_Tooltip")))); } if (condition instanceof AttrLabel) { AttrLabel label = (AttrLabel) condition; if (isAttrLabelValid(label)) { - arrayList.add(new Pair<>(label.getContent().getHtmlLabel(), str + "-" + Toolkit.i18nText("Fine-Design_Chart_Label"))); + arrayList.add(new Pair<>(label.getContent().getHtmlLabel(), ShowValueUtils.joinStr4Position(str, Toolkit.i18nText("Fine-Design_Chart_Label")))); } } @@ -270,18 +331,51 @@ public class SearchJSUtils { * @param chartCollection * @return */ - public static List getNameJavaScript(ChartCollection chartCollection) { + public static List getNameJavaScript(ChartCollection chartCollection, ITContent content, List jsInfos) { ArrayList nameJavaScriptArrayList = new ArrayList<>(); for (int i = 0; i < chartCollection.getChartCount(); i++) { if (chartCollection.getChart(i) instanceof VanChart) { VanChart chart = ((VanChart) chartCollection.getChart(i)); - NameJavaScriptGroup nameJavaScriptGroup = chart.getPlot().getHotHyperLink(); - addNameJavaScript2Array(nameJavaScriptArrayList, nameJavaScriptGroup); + if (isCustomMapPlot(chart.getPlot())) { + dealMapNameJavaScript(content, chart.getPlot(), jsInfos); + } else { + NameJavaScriptGroup nameJavaScriptGroup = chart.getPlot().getHotHyperLink(); + addNameJavaScript2Array(nameJavaScriptArrayList, nameJavaScriptGroup); + } } } return nameJavaScriptArrayList; } + /** + * 是否是组合地图 + * @param plot 图表的plot + * @return 是则返回true + */ + public static boolean isCustomMapPlot(Plot plot) { + return plot instanceof VanChartMapPlot && ((VanChartMapPlot) plot).getMapType() == MapType.CUSTOM; + } + + + /** + * 处理图表的交互属性(可能存在多种地图) + * @param content 存储信息的数据结构 + * @param plot 图表的VanChartMapPlot + */ + private static void dealMapNameJavaScript(ITContent content, VanChartMapPlot plot, List jsInfos) { + List areaJavaScriptList = new ArrayList<>(); + List lineJavaScriptList = new ArrayList<>(); + List pointJavaScriptList = new ArrayList<>(); + + addNameJavaScript2Array(areaJavaScriptList, plot.getAreaHotHyperLink()); + addNameJavaScript2Array(lineJavaScriptList, plot.getLineHotHyperLink()); + addNameJavaScript2Array(pointJavaScriptList, plot.getPointHotHyperLink()); + + addJSInfosFromNameJS(ShowValueUtils.getCustomMapContent(content, Toolkit.i18nText("Fine-Design_Chart_Region_Map")), areaJavaScriptList, jsInfos); + addJSInfosFromNameJS(ShowValueUtils.getCustomMapContent(content, Toolkit.i18nText("Fine-Design_Chart_LineMap")), lineJavaScriptList, jsInfos); + addJSInfosFromNameJS(ShowValueUtils.getCustomMapContent(content, Toolkit.i18nText("Fine-Design_Chart_PointMap")), pointJavaScriptList, jsInfos); + } + private static void addNameJavaScript2Array(List nameJavaScriptArrayList, NameJavaScriptGroup nameJavaScriptGroup) { if (isNameJavaScriptGroupExist(nameJavaScriptGroup)) { for (int j = 0; j < nameJavaScriptGroup.size(); j++) { diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java index 01205bf886..cbd49d822d 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java @@ -2,6 +2,7 @@ package com.fr.design.actions.replace.utils; import com.fr.design.actions.replace.info.Info; +import com.fr.design.actions.replace.info.base.ITContent; import com.fr.design.actions.replace.ui.ITReplaceMainDialog; import com.fr.design.i18n.Toolkit; import com.fr.stable.StableUtils; @@ -391,14 +392,47 @@ public class ShowValueUtils { */ public static String getResultTip(int findCount, int replaceCount, int failedCount) { StringBuilder str = new StringBuilder(); - str.append("").append(Toolkit.i18nText("Fine-Design_Replace_Search_Finish")).append("").append(findCount).append("").append(Toolkit.i18nText("Fine-Design_Replace_Result")); + str.append("").append(Toolkit.i18nText("Fine-Design_Replace_Search_Finish", "" + findCount+ "")); if (replaceCount != 0) { - str.append(Toolkit.i18nText("Fine-Design_Replace_Also_Finish")).append("").append(replaceCount).append("").append(Toolkit.i18nText("Fine-Design_Replace_Result_Count")); + str.append(Toolkit.i18nText("Fine-Design_Replace_Also_Finish", "" + replaceCount + "")); if (failedCount != 0) { - str.append(Toolkit.i18nText("Fine-Design_Replace_Have")).append("").append(failedCount).append("").append(Toolkit.i18nText("Fine-Design_Replace_Can_Not_Replace")); + str.append(Toolkit.i18nText("Fine-Design_Replace_Have", "" + failedCount + "")); + } + } else { + if (failedCount != 0) { + str.append(Toolkit.i18nText("Fine-Design_Replace_Also_Finish", "" + replaceCount + "")); + str.append(Toolkit.i18nText("Fine-Design_Replace_Have", "" + failedCount + "")); } } return str.toString(); } + + + /** + * 返回图表类型的位置信息(组合图就需要加上对应的类型名称) + * @param str 基础信息 + * @param customStyle 组合图的类型信息 + * @return 组合后的位置信息 + */ + public static String getChartOtherPos(String str, String customStyle) { + if (StringUtils.isNotEmpty(customStyle)) { + return joinStr4Position(str, customStyle); + } else { + return str; + } + + } + + /** + * 用于获取增加指定地图后缀的ITContent + * @param content 原ITContent + * @param str 后缀 + * @return 处理后的新的ITContent + */ + public static ITContent getCustomMapContent(ITContent content, String str) { + ITContent resultContent = ITContent.copy(content); + resultContent.addOtherPos(str); + return resultContent; + } } From 7065e55ef02f036fa99c99f1d22fa234688f62a8 Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Thu, 3 Nov 2022 09:26:04 +0800 Subject: [PATCH 140/310] =?UTF-8?q?REPORT-80690=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=80=82=E9=85=8D=E9=80=82=E9=85=8D=E5=9F=8B=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cell/AbstractCellElementAction.java | 4 ++ .../actions/columnrow/ColumnWidthAction.java | 5 +- .../actions/columnrow/RowHeightAction.java | 4 ++ .../com/fr/quickeditor/CellQuickEditor.java | 50 +++++++++++++++++++ .../cellquick/CellDSColumnEditor.java | 4 +- 5 files changed, 65 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/cell/AbstractCellElementAction.java b/designer-realize/src/main/java/com/fr/design/actions/cell/AbstractCellElementAction.java index 450c326915..52f3539788 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/cell/AbstractCellElementAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/cell/AbstractCellElementAction.java @@ -9,6 +9,7 @@ import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase; import com.fr.grid.GridUtils; import com.fr.grid.selection.CellSelection; +import com.fr.quickeditor.CellQuickEditor; import com.fr.report.cell.TemplateCellElement; import com.fr.report.core.SheetUtils; import com.fr.report.elementcase.TemplateElementCase; @@ -76,6 +77,9 @@ public abstract class AbstractCellElementAction extends CellSelectionAction { } } } + if (!ePane.isSelectedOneCell()) { + CellQuickEditor.record(CellQuickEditor.multipleOperationType.FILTER); + } ePane.fireTargetModified(); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/columnrow/ColumnWidthAction.java b/designer-realize/src/main/java/com/fr/design/actions/columnrow/ColumnWidthAction.java index e363ee29e9..8ec7c90331 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/columnrow/ColumnWidthAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/columnrow/ColumnWidthAction.java @@ -4,8 +4,8 @@ package com.fr.design.actions.columnrow; import com.fr.design.mainframe.ElementCasePane; - import com.fr.grid.selection.CellSelection; +import com.fr.quickeditor.CellQuickEditor; import com.fr.report.elementcase.ElementCase; import com.fr.stable.unit.UNIT; @@ -32,6 +32,9 @@ public class ColumnWidthAction extends ColumnRowSizingAction { for (int i = 0; i < columns.length; i++) { report.setColumnWidth(columns[i], len); } + if (columns.length > 1) { + CellQuickEditor.record(CellQuickEditor.multipleOperationType.HEIHT_AND_COLUMN); + } } protected UNIT getIndexLen(int index, ElementCase report){ diff --git a/designer-realize/src/main/java/com/fr/design/actions/columnrow/RowHeightAction.java b/designer-realize/src/main/java/com/fr/design/actions/columnrow/RowHeightAction.java index 9485dc270a..ff4d63a1e9 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/columnrow/RowHeightAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/columnrow/RowHeightAction.java @@ -6,6 +6,7 @@ package com.fr.design.actions.columnrow; import com.fr.design.mainframe.ElementCasePane; import com.fr.grid.selection.CellSelection; +import com.fr.quickeditor.CellQuickEditor; import com.fr.report.elementcase.ElementCase; import com.fr.stable.unit.UNIT; @@ -32,6 +33,9 @@ public class RowHeightAction extends ColumnRowSizingAction { for (int i = 0; i < rows.length; i++) { report.setRowHeight(rows[i], len); } + if (rows.length > 1) { + CellQuickEditor.record(CellQuickEditor.multipleOperationType.HEIHT_AND_COLUMN); + } } @Override diff --git a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java index 6f060b4f06..c84396b483 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java @@ -455,6 +455,9 @@ public abstract class CellQuickEditor extends QuickEditor { if (updateStyle) { // 防止频繁触发保存 + if (!tc.isSelectedOneCell()) { + record(multipleOperationType.FORMAT); + } fireTargetModified(); } @@ -469,4 +472,51 @@ public abstract class CellQuickEditor extends QuickEditor { return formatPane; } + + + /** + * 用于适配记录批量操作的埋点数据 + * + * @param type 批量操作修改类型 + * @return 批量修改类型名称 + */ + public static String record(multipleOperationType type) { + return type.getType(); + } + + /** + * 批量操作的类型 + */ + public enum multipleOperationType { + /** + * 批量修改格式 + */ + FORMAT("FORMAT"), + + /** + * 批量修改数据列的数据设置 + */ + TYPE_OF_DATA("type-of-data"), + + /** + * 批量修改过滤条件 + */ + FILTER("filter"), + + /** + * 批量修改行高列宽 + */ + HEIHT_AND_COLUMN("row-height-and-column-width"); + + + private final String type; + + multipleOperationType(String type) { + this.type = type; + } + + public String getType() { + return type; + } + } } diff --git a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java index bd449de01d..575f89fb07 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java @@ -319,10 +319,12 @@ public class CellDSColumnEditor extends CellQuickEditor { public void itemStateChanged(ItemEvent e) { CellSelection selection = (CellSelection) tc.getSelection(); Set allCellElements = selection.getCellElements(); - groupPane.update(allCellElements); if (e == null || e.getStateChange() == ItemEvent.DESELECTED) { //分组-高级-自定义点确定的时候传进来null的e,但是这时候应该触发保存 groupPane.update(allCellElements); + if (!tc.isSelectedOneCell()) { + CellQuickEditor.record(multipleOperationType.TYPE_OF_DATA); + } fireTargetModified(); } } From 66ff36803c2bd10bcae73939bcda361b8f7b400b Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Thu, 3 Nov 2022 11:54:38 +0800 Subject: [PATCH 141/310] =?UTF-8?q?REPORT-80690=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BC=A0=E5=85=A5=E6=A0=BC=E5=BC=8F=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/quickeditor/CellQuickEditor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java index c84396b483..55a3712626 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java @@ -491,7 +491,7 @@ public abstract class CellQuickEditor extends QuickEditor { /** * 批量修改格式 */ - FORMAT("FORMAT"), + FORMAT("Format"), /** * 批量修改数据列的数据设置 From cdde517142da265966ac84eb1a5a87501502fe36 Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Thu, 3 Nov 2022 14:08:14 +0800 Subject: [PATCH 142/310] =?UTF-8?q?REPORT-80690=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BC=A0=E5=85=A5=E6=A0=BC=E5=BC=8F=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/quickeditor/CellQuickEditor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java index 55a3712626..354eb438fc 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java @@ -491,7 +491,7 @@ public abstract class CellQuickEditor extends QuickEditor { /** * 批量修改格式 */ - FORMAT("Format"), + FORMAT("format"), /** * 批量修改数据列的数据设置 From 9eeede7f68cf61766f2b36766ed96271b993853a Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 3 Nov 2022 14:38:42 +0800 Subject: [PATCH 143/310] =?UTF-8?q?REPORT-83624=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E6=9F=A5=E6=89=BE=E6=9B=BF=E6=8D=A2=E6=8F=90=E7=A4=BA=E8=AF=AD?= =?UTF-8?q?=E5=8F=A5key=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/actions/replace/ui/ITCheckDialog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITCheckDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITCheckDialog.java index 9b82dea3ce..ac392692f0 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITCheckDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITCheckDialog.java @@ -44,7 +44,7 @@ public class ITCheckDialog extends UIDialog { editorPane = new UITableEditorPane(editor); editor.add(ITReplaceMainDialog.getCheckValidList()); - UILabel label = new UILabel("" + Toolkit.i18nText("Fine-Design_Replace_Check") + "" + ITReplaceMainDialog.contentReplaceFailedCount + "" + Toolkit.i18nText("Fine-Design_Replace_Check_Tip")); + UILabel label = new UILabel("" + Toolkit.i18nText("Fine-Design_Replace_Check", "" + ITReplaceMainDialog.contentReplaceFailedCount + "")); JPanel center = new JPanel(new BorderLayout()); UIButton location = new UIButton(Toolkit.i18nText("Fine-Design_Chart_Location")); UIButton cancel = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel")); From b427149792417182ce863348b97ea620a9187c9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvan-=E6=AC=A7=E9=98=B3=E5=B8=86?= Date: Thu, 3 Nov 2022 15:42:18 +0800 Subject: [PATCH 144/310] =?UTF-8?q?REPORT-83313=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=84=B1=E6=95=8F-=E7=82=B9=E5=87=BB=E2=80=9C=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=84=B1=E6=95=8F=E8=AE=BE=E7=BD=AE=E2=80=9D=E5=90=8E?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E9=A1=B5=E9=9D=A2=E6=B2=A1=E6=9C=89=E6=B6=88?= =?UTF-8?q?=E5=A4=B1=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0?= =?UTF-8?q?=E3=80=91=E5=8E=9F=E6=9C=AC=E5=81=9A=E7=9A=84=E6=98=AF"?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=84=B1=E6=95=8F=E8=AE=BE=E7=BD=AE"?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E6=98=AF=E9=A2=84=E8=A7=88=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E4=B8=BAparent=E7=9A=84=E5=8F=A6=E4=B8=80=E4=B8=AAdialog?= =?UTF-8?q?=EF=BC=8C=E6=B2=A1=E6=8C=89=E7=85=A7=E4=BA=A7=E5=93=81=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E9=87=8C=E5=81=9A=20=E3=80=90=E6=94=B9=E5=8A=A8?= =?UTF-8?q?=E6=96=B9=E6=A1=88=E3=80=91=E4=BF=AE=E6=94=B9=E4=B8=8B=EF=BC=8C?= =?UTF-8?q?=E6=89=93=E5=BC=80=E8=84=B1=E6=95=8F=E8=AE=BE=E7=BD=AE=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E7=9A=84=E5=90=8C=E6=97=B6=EF=BC=8C=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=B6=88=E5=A4=B1=20=E3=80=90review=E5=BB=BA?= =?UTF-8?q?=E8=AE=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/data/datapane/preview/PreviewTablePane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java index b701112f57..b09af3659b 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java @@ -248,8 +248,6 @@ public class PreviewTablePane extends BasicPane { if (Objects.nonNull(editingTemplate)) { editingTemplate.fireTargetModified(true); } - // 刷新预览页面 - refreshTable(); } @Override @@ -258,6 +256,8 @@ public class PreviewTablePane extends BasicPane { } }, BasicDialog.DEFAULT); dialog.setVisible(true); + // 关闭预览页面 + PreviewTablePane.this.dialog.setVisible(false); } }); From b86ab2dbaf2f08b9393bb65f9a4b2a7159799e18 Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Thu, 3 Nov 2022 16:18:51 +0800 Subject: [PATCH 145/310] =?UTF-8?q?REPORT-80690=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/quickeditor/CellQuickEditor.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java index 354eb438fc..67a65672f1 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java @@ -476,9 +476,10 @@ public abstract class CellQuickEditor extends QuickEditor { /** * 用于适配记录批量操作的埋点数据 + * 真正的埋点提交方案在云端运维插件中 * * @param type 批量操作修改类型 - * @return 批量修改类型名称 + * @return 批量修改类型名称,用于云端运维埋点记录 */ public static String record(multipleOperationType type) { return type.getType(); From 4a753e5782e25ee8aca17fdd203783aa9d89a91a Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Fri, 4 Nov 2022 09:46:26 +0800 Subject: [PATCH 146/310] =?UTF-8?q?REPORT-80695=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=85=A8=E5=B1=80=E7=BA=A7=E5=88=AB=E6=9F=A5=E6=89=BE=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E4=BA=8C=E6=9C=9F=20=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/replace/action/ITChecker.java | 123 ++++++++++++++++++ .../content/component/ComponentType.java | 2 +- .../actions/replace/info/ComponentInfo.java | 4 +- .../actions/replace/info/WidgetInfo.java | 2 +- .../replace/ui/ITReplaceMainDialog.java | 31 ++++- .../replace/ui/ITReplaceNorthPanel.java | 9 +- 6 files changed, 157 insertions(+), 14 deletions(-) create mode 100644 designer-realize/src/main/java/com/fr/design/actions/replace/action/ITChecker.java diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/ITChecker.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/ITChecker.java new file mode 100644 index 0000000000..fddee0f038 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/ITChecker.java @@ -0,0 +1,123 @@ +package com.fr.design.actions.replace.action; + +import com.fr.design.actions.replace.info.Info; +import com.fr.design.i18n.Toolkit; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 校验JS、公式、控件、组件 + * 比较用户的所有对应类别的改动,不论是否选中要替换,只要整体类别改动过就算模板内容改动过 + * + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-11-03 + */ +public enum ITChecker { + WIDGET_CHECK_TAG(Toolkit.i18nText("Fine-Design_Basic_Widget")), + FORMULA_CHECK_TAG(Toolkit.i18nText("Fine-Design_Basic_Formula")), + JS_CHECK_TAG(Toolkit.i18nText("Fine-Design_Replace_JS")), + COMPONENT_CHECK_TAG(Toolkit.i18nText("Fine-Design_Replace_Component")) + ; + + + String name; + + ITChecker(String name) { + this.name = name; + } + + + /** + * 匹配 + * + * @param name 对应的检查类型 + * @return 对应的检查checker + */ + @Nullable + public static ITChecker match(String name) { + ITChecker[] values = ITChecker.values(); + for (ITChecker value : values) { + if (value.name.equals(name)) { + return value; + } + } + return null; + } + + public static List checkList = new ArrayList<>(); + public static Map appearTimesMap = new HashMap<>(); + + + /** + * 更新对应的check列表 + * + * @param list 查找后的searchList + */ + public static void updateCheckInfo(List list) { + checkList = list; + updateCheckMapFromList(list); + } + + /** + * 根据列表来更新对应元素的匹配Map + * + * @param list 更新后的checkList + */ + private static void updateCheckMapFromList(List list) { + appearTimesMap.clear(); + for (Info info : list) { + String showStr = info.getContent().getOldShowStr(); + if (appearTimesMap.containsKey(showStr)) { + //如果已经存过了就个数+1 + appearTimesMap.put(showStr, appearTimesMap.get(showStr) + 1); + } else { + //没有的话就把个数初始化为1个 + appearTimesMap.put(showStr, 1); + } + } + } + + + /** + * 判断是否修改过 + * + * @param list 重新获取的当前模板最新的list + * @return 修改过返回true + */ + public boolean isChanged(List list) { + if (list.size() != checkList.size()) { + //如果总的数据的数量变了,就说明肯定修改过,没必要再进行下一步 + return true; + } + return isChangedCheckByMap(list); + } + + /** + * 通过检查Map来比较是否修改过 + * + * @param list 传入的用于比较的list + * @return 修改过则返回true + */ + private boolean isChangedCheckByMap(List list) { + for (Info info : list) { + String showStr = info.getContent().getOldShowStr(); + if (appearTimesMap.containsKey(showStr)) { + //如果map中存在对应的值,就抵消,个数-1 + appearTimesMap.put(showStr, appearTimesMap.get(showStr) - 1); + if (appearTimesMap.get(showStr) < 0) { + //如果map中的值小于0了,就说明数量对不上,修改过 + return true; + } + } else { + //如果存在map中没存的值就没必要继续下去了,肯定改过 + return true; + } + } + return false; + } +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/component/ComponentType.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/component/ComponentType.java index 13712a570a..de747cbeaa 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/component/ComponentType.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/component/ComponentType.java @@ -340,7 +340,7 @@ public enum ComponentType implements DealWithInfoValue { String str = widget.getWidgetName(); info.updateOldStr(widget.getWidgetName(), findStr); ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); - widget.setWidgetName(widget.getWidgetName().replaceAll(findStr, replaceStr)); + widget.setWidgetName(ShowValueUtils.replaceAll(widget.getWidgetName(), findStr, replaceStr)); } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ComponentInfo.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ComponentInfo.java index 77993c53db..c5667c7c41 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ComponentInfo.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ComponentInfo.java @@ -3,6 +3,7 @@ package com.fr.design.actions.replace.info; import com.fr.design.actions.replace.action.content.component.ComponentType; import com.fr.design.actions.replace.action.content.component.SearchComponentAction; import com.fr.design.actions.replace.info.base.ITContent; +import com.fr.design.actions.replace.utils.ShowValueUtils; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.JTemplate; import com.fr.form.ui.Widget; @@ -92,7 +93,8 @@ public class ComponentInfo implements Info { } SearchComponentAction.getInstance().search4Infos(jTemplate); List list = SearchComponentAction.getInstance().getComponentInfos(); - String replacedName = ((Widget)this.getContent().getReplaceObject()).getWidgetName().replace(searchStr, replaceStr); + + String replacedName = ShowValueUtils.replaceAll(((Widget)this.getContent().getReplaceObject()).getWidgetName(), searchStr, replaceStr); for (ComponentInfo info : list) { String widgetName = ((Widget)info.getContent().getReplaceObject()).getWidgetName(); if (StringUtils.equals(replacedName, widgetName)) { diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/WidgetInfo.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/WidgetInfo.java index 4ebae73da9..051105bfad 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/WidgetInfo.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/WidgetInfo.java @@ -156,7 +156,7 @@ public class WidgetInfo implements Info, DealWithInfoValue { return false; } if (!this.isWaterMark() && this.isNeed2Check()) { - String replacedName = ((Widget)this.getContent().getReplaceObject()).getWidgetName().replace(searchStr, replaceStr); + String replacedName = ShowValueUtils.replaceAll(((Widget)this.getContent().getReplaceObject()).getWidgetName(), searchStr, replaceStr); for (WidgetName name : CheckUtils.getNeed2CheckWidgetsName(jTemplate)) { String widgetName = name.getName(); if (StringUtils.equals(replacedName, widgetName)) { diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index 78daf0a09f..1990062967 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -1,6 +1,7 @@ package com.fr.design.actions.replace.ui; +import com.fr.design.actions.replace.action.ITChecker; import com.fr.design.actions.replace.action.ShowSearchResultAction; import com.fr.design.actions.replace.action.setting.SettingController; @@ -37,6 +38,7 @@ import java.util.ArrayList; import java.util.List; import java.util.regex.Pattern; +import static com.fr.design.actions.replace.ui.ITTableEditorPane.editTable; import static com.fr.design.actions.replace.ui.ITTableEditorPane.getEditTable; /** @@ -210,10 +212,13 @@ public class ITReplaceMainDialog extends UIDialog { * 模板内容替换相关 */ private void replace4Content() { + String type = ((UITextField) (northPane.getFindCombobox().getEditor().getEditorComponent())).getText(); String searchStr = ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).getText(); String replaceStr = ((UITextField) (northPane.getReplaceInputCombobox().getEditor().getEditorComponent())).getText(); clearContentCount(); - if (isITReplaceValid() && checkTemplateChanged(searchContentResultList)) { + if (isITReplaceValid() && checkTemplateChanged(searchContentResultList, type)) { + ShowSearchResultAction searchAction = ShowSearchResultAction.match(GeneralUtils.objectToString(northPane.getFindCombobox().getSelectedItem())); + ITChecker.updateCheckInfo(searchAction.addMatchResult(searchStr, searchAction.showSearchValue(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate()))); if (StringUtils.equals(getSearchStr(), searchStr)) { String str = GeneralUtils.objectToString(northPane.getFindCombobox().getSelectedItem()); //如果是控件或组件才要进行合法性校验 @@ -257,7 +262,9 @@ public class ITReplaceMainDialog extends UIDialog { if (!info.getContent().isWrongful() && info.getContent().isSelected()) { info.setValue(info, searchStr, replaceStr, info.getContent().getOperatorArray()); } - info.getContent().setReplaced(true); + if (info.getContent().isSelected()) { + info.getContent().setReplaced(true); + } } northPane.getResultLabel().setText(ShowValueUtils.getResultTip(searchContentResultList.size(), contentReplaceCount, contentReplaceFailedCount)); southPanel.getTableEditorPane().update(); @@ -338,10 +345,18 @@ public class ITReplaceMainDialog extends UIDialog { } - private Boolean checkTemplateChanged(List searchResultList) { - for (Info info : searchResultList) { - if (!info.getContent().isReplaced() && !info.checkValid()) { - return false; + private Boolean checkTemplateChanged(List searchResultList, String type) { + ITChecker checker = ITChecker.match(type); + //对于JS、控件、组件、公式进行全量校验,不只针对当前选中的地方,这边先这样处理 + if (checker != null) { + ShowSearchResultAction searchAction = ShowSearchResultAction.match(GeneralUtils.objectToString(northPane.getFindCombobox().getSelectedItem())); + return !checker.isChanged(searchAction.addMatchResult(searchStr, searchAction.showSearchValue(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate()))); + } else { + //其他地方走各自的校验逻辑 + for (Info info : searchResultList) { + if (!info.getContent().isReplaced() && !info.checkValid()) { + return false; + } } } return true; @@ -436,7 +451,9 @@ public class ITReplaceMainDialog extends UIDialog { ShowSearchResultAction searchAction = ShowSearchResultAction.match(GeneralUtils.objectToString(northPane.getFindCombobox().getSelectedItem())); //搜索 if (searchAction != null) { - searchContentResultList = searchAction.addMatchResult(searchStr, searchAction.showSearchValue(jTemplate)); + List showValueList = searchAction.showSearchValue(jTemplate); + searchContentResultList = searchAction.addMatchResult(searchStr, showValueList); + ITChecker.updateCheckInfo(searchContentResultList); itTableEditor.add(searchContentResultList); northPane.getResultLabel().setText(ShowValueUtils.getResultTip(searchContentResultList.size(), contentReplaceCount, contentReplaceFailedCount)); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java index a11886c2c8..6739d3a42f 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java @@ -5,6 +5,7 @@ import com.fr.design.actions.replace.action.setting.SettingContent; import com.fr.design.actions.replace.action.setting.SettingController; import com.fr.design.data.datapane.TableDataComboBox; import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; @@ -51,7 +52,7 @@ public class ITReplaceNorthPanel { private UILabel resultLabel; private UIComboBox findCombobox; private UIComboBox rangeCombobox; - private JCheckBox matchRadioButton; + private UICheckBox matchRadioButton; private UILabel iconLabel; private UIComboBox findInputCombobox; private UIComboBox replaceInputCombobox; @@ -201,7 +202,7 @@ public class ITReplaceNorthPanel { super.setEditor(new ITComboBoxEditor()); } }; - matchRadioButton = new JCheckBox(Toolkit.i18nText("Fine-Design_Replace_WildCard")); + matchRadioButton = new UICheckBox(Toolkit.i18nText("Fine-Design_Replace_WildCard")); matchRadioButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -702,11 +703,11 @@ public class ITReplaceNorthPanel { this.rangeCombobox = rangeCombobox; } - public JCheckBox getMatchRadioButton() { + public UICheckBox getMatchRadioButton() { return matchRadioButton; } - public void setMatchRadioButton(JCheckBox checkBox) { + public void setMatchRadioButton(UICheckBox checkBox) { this.matchRadioButton = checkBox; } From 31c30d8c4fb900e368ee2ef4b6037fe8705f82ad Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Fri, 4 Nov 2022 09:51:26 +0800 Subject: [PATCH 147/310] =?UTF-8?q?REPORT-80695=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=85=A8=E5=B1=80=E7=BA=A7=E5=88=AB=E6=9F=A5=E6=89=BE=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E4=BA=8C=E6=9C=9F=20=E4=B8=BA=E4=BA=86=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E6=8F=92=E4=BB=B6=E6=A0=A1=E9=AA=8C=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E4=B8=80=E4=B8=8B=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/actions/replace/action/ITChecker.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/ITChecker.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/ITChecker.java index fddee0f038..ca15cd1a5b 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/ITChecker.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/ITChecker.java @@ -18,9 +18,21 @@ import java.util.Map; * created by Destiny.Lin on 2022-11-03 */ public enum ITChecker { + /** + * 控件 + */ WIDGET_CHECK_TAG(Toolkit.i18nText("Fine-Design_Basic_Widget")), + /** + * 公式 + */ FORMULA_CHECK_TAG(Toolkit.i18nText("Fine-Design_Basic_Formula")), + /** + * JS + */ JS_CHECK_TAG(Toolkit.i18nText("Fine-Design_Replace_JS")), + /** + * 组件 + */ COMPONENT_CHECK_TAG(Toolkit.i18nText("Fine-Design_Replace_Component")) ; From 3b166bf8ad135de39be90818e72f41fce63390fd Mon Sep 17 00:00:00 2001 From: Carlson Date: Fri, 4 Nov 2022 11:41:58 +0800 Subject: [PATCH 148/310] =?UTF-8?q?REPORT-83462=20fix:fvs-=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8-=E8=B6=85=E9=93=BE-=E7=BD=91=E7=BB=9C=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E7=BC=BA=E5=B0=91=E4=B8=80=E4=BA=9B=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=20&&=20KERNEL-12559=20feat:fvs=E5=85=88?= =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=89=88=E6=9C=AC=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/hyperlink/ReportletHyperlinkPane.java | 8 ++++++++ .../com/fr/design/mainframe/vcs/common/VcsHelper.java | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperlinkPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperlinkPane.java index 7147ef90e2..48affb7dc3 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperlinkPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperlinkPane.java @@ -158,6 +158,14 @@ public class ReportletHyperlinkPane extends AbstractHyperLinkPane Date: Fri, 4 Nov 2022 14:34:01 +0800 Subject: [PATCH 149/310] =?UTF-8?q?REPORT-80695=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=85=A8=E5=B1=80=E7=BA=A7=E5=88=AB=E6=9F=A5=E6=89=BE=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E4=BA=8C=E6=9C=9F=20=E4=BF=AE=E6=94=B9=E9=92=BB?= =?UTF-8?q?=E5=8F=96=E5=9C=B0=E5=9B=BE=E7=9A=84=E8=8E=B7=E5=8F=96=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SearchChartCollectionFormulaAction.java | 5 ++++ .../actions/replace/utils/SearchJSUtils.java | 29 ++++++++++++++++--- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java index 40e5283ce9..69b763248c 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java @@ -34,6 +34,7 @@ import com.fr.plugin.chart.custom.CustomPlotFactory; import com.fr.plugin.chart.custom.VanChartCustomPlot; import com.fr.plugin.chart.custom.type.CustomPlotType; +import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.stable.StringUtils; @@ -106,6 +107,10 @@ public class SearchChartCollectionFormulaAction { customContent.addOtherPos(CustomPlotFactory.getTitle(CustomPlotFactory.getCustomType(plot.getCustomPlotList().get(i)))); dealPlot(formulaInfos, customContent, plot.getCustomPlotList().get(i)); } + } else if (chart.getPlot() instanceof VanChartDrillMapPlot) { + ITContent drillContent = ITContent.copy(conditionContent); + drillContent.addOtherPos(Toolkit.i18nText("Fine-Design_Chart_Drill_Dir")); + dealNameJavaScriptGroup(formulaInfos, drillContent, ((VanChartDrillMapPlot) chart.getPlot()).getDrillUpHyperLink()); } else if (chart.getPlot() != null) { dealPlot(formulaInfos, conditionContent, chart.getPlot()); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java index 8901f76edb..dbec52eefc 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java @@ -26,6 +26,7 @@ import com.fr.plugin.chart.base.VanChartHtmlLabel; import com.fr.plugin.chart.custom.CustomPlotFactory; import com.fr.plugin.chart.custom.VanChartCustomPlot; import com.fr.plugin.chart.custom.type.CustomPlotType; +import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.map.attr.AttrMapLabel; import com.fr.plugin.chart.map.attr.AttrMapTooltip; @@ -338,6 +339,8 @@ public class SearchJSUtils { VanChart chart = ((VanChart) chartCollection.getChart(i)); if (isCustomMapPlot(chart.getPlot())) { dealMapNameJavaScript(content, chart.getPlot(), jsInfos); + } else if (chart.getPlot() instanceof VanChartDrillMapPlot) { + dealDrillNameJavaScript(content, chart.getPlot(), jsInfos); } else { NameJavaScriptGroup nameJavaScriptGroup = chart.getPlot().getHotHyperLink(); addNameJavaScript2Array(nameJavaScriptArrayList, nameJavaScriptGroup); @@ -347,6 +350,19 @@ public class SearchJSUtils { return nameJavaScriptArrayList; } + private static void dealDrillNameJavaScript(ITContent content, VanChartDrillMapPlot plot, List jsInfos) { + ITContent chartContent = ITContent.copy(content); + chartContent.addOtherPos( + Toolkit.i18nText("Fine-Design_Chart_Chart"), + Toolkit.i18nText("Fine-Design_Chart_Animation_Special"), + Toolkit.i18nText("Fine-Design_Chart_Interactive"), + Toolkit.i18nText("Fine-Design_Chart_Drill_Dir") + ); + List list = new ArrayList<>(); + addNameJavaScript2Array(list, plot.getDrillUpHyperLink()); + addJSInfosFromNameJS(chartContent, list, jsInfos); + } + /** * 是否是组合地图 * @param plot 图表的plot @@ -366,14 +382,19 @@ public class SearchJSUtils { List areaJavaScriptList = new ArrayList<>(); List lineJavaScriptList = new ArrayList<>(); List pointJavaScriptList = new ArrayList<>(); - + ITContent chartContent = ITContent.copy(content); + chartContent.addOtherPos( + Toolkit.i18nText("Fine-Design_Chart_Chart"), + Toolkit.i18nText("Fine-Design_Chart_Animation_Special"), + Toolkit.i18nText("Fine-Design_Chart_Interactive") + ); addNameJavaScript2Array(areaJavaScriptList, plot.getAreaHotHyperLink()); addNameJavaScript2Array(lineJavaScriptList, plot.getLineHotHyperLink()); addNameJavaScript2Array(pointJavaScriptList, plot.getPointHotHyperLink()); - addJSInfosFromNameJS(ShowValueUtils.getCustomMapContent(content, Toolkit.i18nText("Fine-Design_Chart_Region_Map")), areaJavaScriptList, jsInfos); - addJSInfosFromNameJS(ShowValueUtils.getCustomMapContent(content, Toolkit.i18nText("Fine-Design_Chart_LineMap")), lineJavaScriptList, jsInfos); - addJSInfosFromNameJS(ShowValueUtils.getCustomMapContent(content, Toolkit.i18nText("Fine-Design_Chart_PointMap")), pointJavaScriptList, jsInfos); + addJSInfosFromNameJS(ShowValueUtils.getCustomMapContent(chartContent, Toolkit.i18nText("Fine-Design_Chart_Region_Map")), areaJavaScriptList, jsInfos); + addJSInfosFromNameJS(ShowValueUtils.getCustomMapContent(chartContent, Toolkit.i18nText("Fine-Design_Chart_LineMap")), lineJavaScriptList, jsInfos); + addJSInfosFromNameJS(ShowValueUtils.getCustomMapContent(chartContent, Toolkit.i18nText("Fine-Design_Chart_PointMap")), pointJavaScriptList, jsInfos); } private static void addNameJavaScript2Array(List nameJavaScriptArrayList, NameJavaScriptGroup nameJavaScriptGroup) { From 588ee54b08b5f7c8b99155f1c24a55364402e3b9 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Fri, 4 Nov 2022 14:42:10 +0800 Subject: [PATCH 150/310] =?UTF-8?q?REPORT-80695=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=85=A8=E5=B1=80=E7=BA=A7=E5=88=AB=E6=9F=A5=E6=89=BE=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E4=BA=8C=E6=9C=9F=20=E4=BF=AE=E6=94=B9=E9=92=BB?= =?UTF-8?q?=E5=8F=96=E5=9C=B0=E5=9B=BE=E7=9A=84=E8=8E=B7=E5=8F=96=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/replace/utils/SearchJSUtils.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java index dbec52eefc..2a1a4ef188 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java @@ -64,6 +64,14 @@ public class SearchJSUtils { */ public static final String CATEGORY_LABEL = ShowValueUtils.joinStr4Position(Toolkit.i18nText("Fine-Design_Basic_Style"), Toolkit.i18nText("Fine-Design_Chart_Data_Label"), Toolkit.i18nText("Fine-Design_Chart_Category_Label")); + /** + * 条件属性 + */ + public static final String CONDITION = ShowValueUtils.joinStr4Position( + Toolkit.i18nText("Fine-Design_Chart_Chart"), + Toolkit.i18nText("Fine-Design_Chart_Animation_Special"), + Toolkit.i18nText("Fine-Design_Chart_Interactive")); + /** * 从Listener中获取JS */ @@ -353,9 +361,7 @@ public class SearchJSUtils { private static void dealDrillNameJavaScript(ITContent content, VanChartDrillMapPlot plot, List jsInfos) { ITContent chartContent = ITContent.copy(content); chartContent.addOtherPos( - Toolkit.i18nText("Fine-Design_Chart_Chart"), - Toolkit.i18nText("Fine-Design_Chart_Animation_Special"), - Toolkit.i18nText("Fine-Design_Chart_Interactive"), + CONDITION, Toolkit.i18nText("Fine-Design_Chart_Drill_Dir") ); List list = new ArrayList<>(); @@ -383,11 +389,7 @@ public class SearchJSUtils { List lineJavaScriptList = new ArrayList<>(); List pointJavaScriptList = new ArrayList<>(); ITContent chartContent = ITContent.copy(content); - chartContent.addOtherPos( - Toolkit.i18nText("Fine-Design_Chart_Chart"), - Toolkit.i18nText("Fine-Design_Chart_Animation_Special"), - Toolkit.i18nText("Fine-Design_Chart_Interactive") - ); + chartContent.addOtherPos(CONDITION); addNameJavaScript2Array(areaJavaScriptList, plot.getAreaHotHyperLink()); addNameJavaScript2Array(lineJavaScriptList, plot.getLineHotHyperLink()); addNameJavaScript2Array(pointJavaScriptList, plot.getPointHotHyperLink()); From aa1322dcf050087ac3cc29cc6acc9785e74a8354 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Fri, 4 Nov 2022 15:12:11 +0800 Subject: [PATCH 151/310] =?UTF-8?q?REPORT-83876=20=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E6=9B=BF=E6=8D=A2=E4=BA=863=E6=AC=A1=E4=BD=86?= =?UTF-8?q?=E6=92=A4=E5=9B=9E=E5=8F=98=E6=88=90=E4=BA=862=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/actions/replace/ui/ITReplaceMainDialog.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index 1990062967..ba7b4bf445 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -257,7 +257,6 @@ public class ITReplaceMainDialog extends UIDialog { * @param replaceStr */ public void replace(String searchStr, String replaceStr) { - HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(true); for (Info info : searchContentResultList) { if (!info.getContent().isWrongful() && info.getContent().isSelected()) { info.setValue(info, searchStr, replaceStr, info.getContent().getOperatorArray()); @@ -266,6 +265,7 @@ public class ITReplaceMainDialog extends UIDialog { info.getContent().setReplaced(true); } } + HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(true); northPane.getResultLabel().setText(ShowValueUtils.getResultTip(searchContentResultList.size(), contentReplaceCount, contentReplaceFailedCount)); southPanel.getTableEditorPane().update(); northPane.refreshReplaceInputComboBoxItems(); @@ -529,7 +529,6 @@ public class ITReplaceMainDialog extends UIDialog { if (isInputStrValid(inputStr, extraStr)) { String secondStr = GeneralUtils.objectToString(northPane.getReplaceSettingInputComboBox().getSelectedItem()); String thirdStr = GeneralUtils.objectToString(northPane.getReplaceExtraSettingComboBox().getSelectedItem()); - HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(true); for (Info info : searchSettingResultList) { if (isSupportReplace(info)) { SettingController controller = SettingController.match(firstStr); @@ -540,10 +539,10 @@ public class ITReplaceMainDialog extends UIDialog { } } } + HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(true); northPane.getSettingResultLabel().setText(ShowValueUtils.getResultTip(searchSettingResultList.size(), settingReplaceCount, settingReplaceFailedCount)); southPanel.getTableEditorPane().update(); ITTableEditorPane.getEditTable().repaint(); - HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(); } else { search4Setting(); } From 03a0807fef75e5c221751cffe827b8bcac84231e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvan-=E6=AC=A7=E9=98=B3=E5=B8=86?= Date: Fri, 4 Nov 2022 16:06:07 +0800 Subject: [PATCH 152/310] =?UTF-8?q?REPORT-80693=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=84=B1=E6=95=8F=E4=BA=8C=E6=9C=9F=20=E3=80=90=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E4=B8=80=E6=9C=9F=E5=92=8C?= =?UTF-8?q?=E4=BA=8C=E6=9C=9F=E4=B8=80=E8=B5=B7=E5=89=A9=E4=BD=99=E4=BA=86?= =?UTF-8?q?=E6=AF=94=E8=BE=83=E5=A4=9A=E7=9A=84bug=EF=BC=8C=E5=A4=84?= =?UTF-8?q?=E7=90=86=E6=9C=89=E9=A3=8E=E9=99=A9=EF=BC=8C=E8=B7=9FLipei?= =?UTF-8?q?=E3=80=81Harrison=E3=80=81Alicia=E9=80=8F=E6=98=8E=E8=AE=A8?= =?UTF-8?q?=E8=AE=BA=E5=90=8E=EF=BC=8C=E7=A1=AE=E5=AE=9A=E5=85=88=E5=BB=B6?= =?UTF-8?q?=E6=9C=9F=E8=BF=AD=E4=BB=A3=EF=BC=8C=E5=B7=B2=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=9A=84=E4=BB=A3=E7=A0=81=E5=B1=8F=E8=94=BD=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=85=A5=E5=8F=A3=E4=B8=8E=E5=85=B3=E9=94=AE=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=96=B9=E6=A1=88=E3=80=91?= =?UTF-8?q?=E5=85=B7=E4=BD=93=E5=B1=8F=E8=94=BD=E7=9A=84=E5=86=85=E5=AE=B9?= =?UTF-8?q?=EF=BC=8C=E8=AF=A6=E8=A7=81https://kms.fineres.com/pages/viewpa?= =?UTF-8?q?ge.action=3FpageId=3D568269880=20=E3=80=90review=E5=BB=BA?= =?UTF-8?q?=E8=AE=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datapane/preview/PreviewTablePane.java | 421 ++++-------------- 1 file changed, 88 insertions(+), 333 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java index b09af3659b..5926dcb2df 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java @@ -3,39 +3,28 @@ */ package com.fr.design.data.datapane.preview; +import com.fr.base.BaseUtils; import com.fr.base.TableData; -import com.fr.base.svg.IconUtils; import com.fr.data.TableDataSource; -import com.fr.data.desensitize.base.DesensitizationTableData; import com.fr.data.impl.DBTableData; import com.fr.data.impl.EmbeddedTableData; import com.fr.data.impl.NameDataModel; import com.fr.data.operator.DataOperator; import com.fr.design.DesignerEnvManager; -import com.fr.design.constants.UIConstants; import com.fr.design.data.DesignTableDataManager; -import com.fr.design.data.datapane.preview.desensitization.TableDataPreviewDesensitizeManager; -import com.fr.design.data.datapane.preview.desensitization.model.DesensitizedPreviewTableModel; -import com.fr.design.data.datapane.preview.desensitization.view.setting.TableDataDesensitizationSettingPane; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicPane; -import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.frpane.UITabbedPane; -import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.iprogressbar.AutoProgressBar; import com.fr.design.gui.itable.SortableJTable; import com.fr.design.gui.itable.TableSorter; import com.fr.design.gui.itextfield.UINumberField; -import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; -import com.fr.design.mainframe.JTemplate; -import com.fr.design.menu.SeparatorDef; -import com.fr.design.menu.ToolBarDef; import com.fr.design.ui.util.UIUtil; import com.fr.function.TIME; import com.fr.general.FRFont; @@ -50,7 +39,6 @@ import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; -import javax.swing.SwingUtilities; import javax.swing.SwingWorker; import javax.swing.UIManager; import javax.swing.table.DefaultTableCellRenderer; @@ -69,19 +57,12 @@ import java.sql.Timestamp; import java.util.ArrayList; import java.util.Date; import java.util.List; -import java.util.Objects; import java.util.concurrent.CancellationException; /** * august: PreviewTablePane一共提供5个共有的静态方法,用来预览。 */ public class PreviewTablePane extends BasicPane { - - private static final String DATA_DESENSITIZATION_CONFIG = Toolkit.i18nText("Fine-Design_Report_Desensitization_Config"); - private static final String LEFT_BRACKET = "("; - private static final String RIGHT_BRACKET = ")"; - private static final String COUNT = Toolkit.i18nText("Fine-Design_Report_Desensitization_Count"); - private TableData tableData; private DataModel dataModel; private UINumberField maxPreviewNumberField; @@ -97,54 +78,6 @@ public class PreviewTablePane extends BasicPane { private static PreviewTablePane THIS; private EmbeddedTableData previewTableData; - private UILabel desensitizationLabel; - - /** - * 用于refreshLabel的鼠标监听 - */ - private final MouseAdapter refreshLabelMouseAdapter = new MouseAdapter() { - boolean mouseEntered = false; - boolean buttonPressed = false; - - @Override - public void mouseEntered(MouseEvent e) { // 当鼠标进入时候调用. - mouseEntered = true; - if (!buttonPressed) { - refreshLabel.setBackground(java.awt.Color.WHITE); - refreshLabel.setOpaque(true); - refreshLabel.setBorder(BorderFactory.createLineBorder(java.awt.Color.GRAY)); - } - } - - @Override - public void mouseExited(MouseEvent e) { - mouseEntered = false; - refreshLabel.setOpaque(false); - refreshLabel.setBorder(BorderFactory.createEmptyBorder()); - } - - @Override - public void mousePressed(MouseEvent e) { - buttonPressed = true; - refreshLabel.setBackground(java.awt.Color.lightGray); - } - - @Override - public void mouseReleased(MouseEvent e) { - buttonPressed = false; - if (mouseEntered) { - refreshLabel.setBackground(java.awt.Color.WHITE); - try { - populate(tableData); - if (dataModel != null) { - setRowsLimitTableModel(); - } - } catch (Exception ignore) { - } - } - } - }; - public static final PreviewTablePane getInstance() { if (THIS == null) { THIS = new PreviewTablePane(); @@ -154,175 +87,91 @@ public class PreviewTablePane extends BasicPane { private PreviewTablePane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - // northPane - this.add(initNorthPane(), BorderLayout.NORTH); - // centerPane - this.add(initCenterPane(), BorderLayout.CENTER); - // dialog - initDialog(); - // progressBar - initProgressBar(); - } - /** - * 初始化northPane - * - * @return - */ - private JComponent initNorthPane() { - JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - // 预览行数面板 - northPane.add(initPreviewNumberPane(), BorderLayout.CENTER); - // 脱敏预览设置面板 - northPane.add(initDesensitizationPane(), BorderLayout.EAST); - return northPane; - } - - /** - * 初始化预览行数面板 - * - * @return - */ - private JComponent initPreviewNumberPane() { + // elalke:预览行数 JPanel previewNumberPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - // 当前行数 + this.add(previewNumberPanel, BorderLayout.NORTH); + JPanel currentPreviewPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + previewNumberPanel.add(currentPreviewPanel); currentPreviewPanel.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Current_Preview_Rows") + ":")); + currentRowsField = new UINumberField(); currentPreviewPanel.add(currentRowsField); currentRowsField.setEditable(false); currentRowsField.setColumns(4); currentRowsField.setInteger(true); - // 最大行数 + JPanel maxPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + previewNumberPanel.add(maxPanel); maxPanel.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Datasource_Maximum_Number_of_Preview_Rows") + ":")); + maxPreviewNumberField = new UINumberField(); maxPanel.add(maxPreviewNumberField); maxPreviewNumberField.setColumns(4); maxPreviewNumberField.setInteger(true); - maxPreviewNumberField.setValue(DesignerEnvManager.getEnvManager().getMaxNumberOrPreviewRow()); + + DesignerEnvManager designerEnvManager = DesignerEnvManager.getEnvManager(); + maxPreviewNumberField.setValue(designerEnvManager.getMaxNumberOrPreviewRow()); + maxPreviewNumberField.addActionListener(new ActionListener() { - @Override public void actionPerformed(ActionEvent evt) { DesignerEnvManager designerEnvManager = DesignerEnvManager.getEnvManager(); designerEnvManager.setMaxNumberOrPreviewRow((int) ((UINumberField) evt.getSource()).getValue()); } }); - // 刷新按钮 - initRefreshLabel(); - previewNumberPanel.add(currentPreviewPanel); - previewNumberPanel.add(maxPanel); - previewNumberPanel.add(refreshLabel); - return previewNumberPanel; - } - - private void initRefreshLabel() { - Icon refreshImage = IconUtils.readIcon("/com/fr/design/images/control/refresh"); + Icon refreshImage = BaseUtils.readIcon("/com/fr/design/images/control/refresh.png"); refreshLabel = new UILabel(refreshImage); - refreshLabel.addMouseListener(refreshLabelMouseAdapter); - } - - /** - * 初始化脱敏设置面板 - * - * @return - */ - private JComponent initDesensitizationPane() { - JPanel desensitizationPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - // 初始化Label - desensitizationLabel = new UILabel(DATA_DESENSITIZATION_CONFIG); - desensitizationLabel.setForeground(UIConstants.NORMAL_BLUE); - desensitizationLabel.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent e) { - TableDataDesensitizationSettingPane settingPane = new TableDataDesensitizationSettingPane((DesensitizationTableData) tableData); - settingPane.populateBean((DesensitizationTableData) tableData); - BasicDialog dialog = settingPane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(PreviewTablePane.this), new DialogActionAdapter() { - @Override - public void doOk() { - // 保存脱敏规则配置 - settingPane.updateBean(); - // 改变模板保存状态 - JTemplate editingTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - if (Objects.nonNull(editingTemplate)) { - editingTemplate.fireTargetModified(true); - } - } + previewNumberPanel.add(refreshLabel); + refreshLabel.addMouseListener(new MouseAdapter() { + boolean mouseEntered = false; + boolean buttonPressed = false; + + public void mouseEntered(MouseEvent e) { // 当鼠标进入时候调用. + mouseEntered = true; + if (!buttonPressed) { + refreshLabel.setBackground(java.awt.Color.WHITE); + refreshLabel.setOpaque(true); + refreshLabel.setBorder(BorderFactory.createLineBorder(java.awt.Color.GRAY)); + } + } - @Override - public void doCancel() { + public void mouseExited(MouseEvent e) { + mouseEntered = false; + refreshLabel.setOpaque(false); + refreshLabel.setBorder(BorderFactory.createEmptyBorder()); + } - } - }, BasicDialog.DEFAULT); - dialog.setVisible(true); - // 关闭预览页面 - PreviewTablePane.this.dialog.setVisible(false); + public void mousePressed(MouseEvent e) { + buttonPressed = true; + refreshLabel.setBackground(java.awt.Color.lightGray); } - }); - // 初始化分隔符 - ToolBarDef toolbarDef = new ToolBarDef(); - toolbarDef.addShortCut(SeparatorDef.DEFAULT); - UIToolbar toolBar = ToolBarDef.createJToolBar(); - toolBar.setBorderPainted(false); - toolbarDef.updateToolBar(toolBar); - - // 初始化预览按钮 - UIToggleButton previewToggle = new UIToggleButton(new Icon[]{IconUtils.readIcon("/com/fr/design/images/m_file/preview"), IconUtils.readIcon("/com/fr/design/images/m_file/preview")}, true); - previewToggle.setToolTipText(Toolkit.i18nText("Fine-Design_Report_Desensitization_Preview")); - previewToggle.setSelected(false); - previewToggle.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - // 切换TableModel的脱敏状态 - togglePreviewTableModelDesensitizeStatus(); - // 刷新页面,展示 - refreshTable(); + public void mouseReleased(MouseEvent e) { + buttonPressed = false; + if (mouseEntered) { + refreshLabel.setBackground(java.awt.Color.WHITE); + try { + populate(tableData); + if (dataModel != null) { + setRowsLimitTableModel(); + } + } catch (Exception e1) { + } + } } }); - desensitizationPane.add(desensitizationLabel); - desensitizationPane.add(toolBar); - desensitizationPane.add(previewToggle); - return desensitizationPane; - } - - /** - * 设置脱敏设置的个数 - * - * @param model - */ - private void setDesensitizationCount(TableModel model) { - if (isDesensitizeOpened()) { - int count = model instanceof DesensitizedPreviewTableModel ? ((DesensitizedPreviewTableModel) model).getDesensitizeColumnsCount() : 0; - desensitizationLabel.setText(DATA_DESENSITIZATION_CONFIG + LEFT_BRACKET + count + RIGHT_BRACKET + COUNT); - } else { - desensitizationLabel.setText(DATA_DESENSITIZATION_CONFIG); - } - } - - /** - * 初始化centerPane - * - * @return - */ - private JComponent initCenterPane() { preveiwTable = new CopyableJTable(new TableSorter()); preveiwTable.setRowSelectionAllowed(false); preveiwTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); - return new JScrollPane(preveiwTable); - } - private void initDialog() { + this.add(new JScrollPane(preveiwTable), BorderLayout.CENTER); if (this.dialog == null) { this.dialog = this.showWindow(new JFrame()); } - } - - private void initProgressBar() { progressBar = new AutoProgressBar(this, Toolkit.i18nText("Fine-Design_Basic_Loading_Data"), "", 0, 100) { - @Override public void doMonitorCanceled() { if (getWorker() != null) { getWorker().cancel(true); @@ -333,7 +182,7 @@ public class PreviewTablePane extends BasicPane { } public AutoProgressBar getProgressBar() { - return PreviewTablePane.progressBar; + return this.progressBar; } @Override @@ -373,19 +222,13 @@ public class PreviewTablePane extends BasicPane { return this.worker; } - /** - * 为预览表的columnIndex列着色. - * - * @param columnIndex 列索引值 - * @param c 颜色 - */ + // elake:为预览表的columnIndex列着c色. private void setPreviewTableColumnColor(final int columnIndex, final Color c) { addLoadedListener(new LoadedEventListener() { @Override public void fireLoaded() { TableColumn column = preveiwTable.getColumnModel().getColumn(columnIndex); DefaultTableCellRenderer cellRenderer = new DefaultTableCellRenderer() { - @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { JComponent comp = (JComponent) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); comp.setBackground(c); @@ -406,7 +249,7 @@ public class PreviewTablePane extends BasicPane { getInstance().preveiwTable = new SortableJTable(new TableSorter()); getInstance().preveiwTable.setRowSelectionAllowed(false); getInstance().preveiwTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); - PreviewTablePane.progressBar.close(); + getInstance().progressBar.close(); getInstance().repaint(); } @@ -488,7 +331,6 @@ public class PreviewTablePane extends BasicPane { private void previewTableDataSQL() throws Exception { connectionBar = new AutoProgressBar(this, Toolkit.i18nText("Fine-Design_Basic_Utils_Now_Create_Connection"), "", 0, 100) { - @Override public void doMonitorCanceled() { getWorker().cancel(true); getDialog().setVisible(false); @@ -503,49 +345,42 @@ public class PreviewTablePane extends BasicPane { private void setPreviewTableColumnValue(final Graphics g) { for (int i = 0; i < preveiwTable.getColumnModel().getColumnCount(); i++) { TableColumn column = preveiwTable.getColumnModel().getColumn(i); - DefaultTableCellRenderer cellRenderer = getDefaultTableCellRenderer(); - column.setCellRenderer(cellRenderer); - } - } - - /** - * 默认表格格子渲染器 - * - * @return - */ - private DefaultTableCellRenderer getDefaultTableCellRenderer() { - return new DefaultTableCellRenderer() { - @Override - public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { - JComponent comp = (JComponent) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); - Font f = table.getFont(); - - //默认在系统不支持 无法显示时 如自造的字 ,字体设置为空. - Font defaultShowFont = FRFont.getInstance("", f.getStyle(), f.getSize()); - if (value instanceof String) { - String str = (String) value; - for (int j = 0; j < str.length(); j++) { - char c = str.charAt(j); - if (!f.canDisplay(c)) { - table.setFont(defaultShowFont); + DefaultTableCellRenderer cellRenderer = new DefaultTableCellRenderer() { + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { + JComponent comp = (JComponent) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); + Font f = table.getFont(); + + //默认在系统不支持 无法显示时 如自造的字 ,字体设置为空. + Font defaultShowFont = FRFont.getInstance("", f.getStyle(), f.getSize()); + if (value instanceof String) { + String str = (String) value; + for (int j = 0; j < str.length(); j++) { + char c = str.charAt(j); + if (!f.canDisplay(c)) { + table.setFont(defaultShowFont); + } } } + return comp; } - return comp; - } - }; + }; + column.setCellRenderer(cellRenderer); + } } private void setWorker() { - worker = new SwingWorker() { - - @Override - protected TableModel doInBackground() throws Exception { + worker = new SwingWorker() { + protected PreviewTableModel doInBackground() throws Exception { connectionBar.start(); try { - testDBTableDataConnection(tableData); + if (tableData instanceof DBTableData) { + boolean status = DataOperator.getInstance().testConnection(((DBTableData) tableData).getDatabase()); + if (!status) { + throw new Exception(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed")); + } + } } finally { // 将close操作放到EDT线程中 UIUtil.invokeLaterIfNeeded(() -> connectionBar.close()); @@ -555,20 +390,22 @@ public class PreviewTablePane extends BasicPane { // parameterInputDialog // update之后的parameters,转成一个parameterMap,用于预览TableData PreviewTableModel previewModel = new PreviewTableModel(previewTableData.createDataModel(null), (int) maxPreviewNumberField.getValue()); - if (TableDataPreviewDesensitizeManager.getInstance().needDesensitize(tableData)) { - // 数据集预览脱敏 - previewModel = TableDataPreviewDesensitizeManager.getInstance().desensitizeTableModel(tableData, previewModel); + for (int i = 0; i < previewTableData.getColumnCount(); i++) { + Class cls = previewTableData.getColumnClass(i); + if (cls == Date.class || cls == TIME.class || cls == Timestamp.class) { + previewModel.dateIndexs.add(i); + } } - dealWithPreviewTableModelColumnClass(previewModel, previewTableData); return previewModel; } - @Override public void done() { try { - TableModel model = get(); - setPreviewTableModel(model); + PreviewTableModel model = get(); + setModel(model); + setCurrentRows(model.getRowCount()); setPreviewTableColumnValue(getParent().getGraphics()); + fireLoadedListener(); } catch (Exception e) { if (!(e instanceof CancellationException)) { FineLoggerFactory.getLogger().error(e.getMessage(), e); @@ -583,36 +420,6 @@ public class PreviewTablePane extends BasicPane { }; } - /** - * 检查DBTableData连接 - * - * @param tableData - * @throws Exception - */ - private void testDBTableDataConnection(TableData tableData) throws Exception { - if (tableData instanceof DBTableData) { - boolean status = DataOperator.getInstance().testConnection(((DBTableData) tableData).getDatabase()); - if (!status) { - throw new Exception(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed")); - } - } - } - - /** - * 处理预览Model的列类型 - * - * @param previewModel - * @param previewTableData - */ - private void dealWithPreviewTableModelColumnClass(PreviewTableModel previewModel, EmbeddedTableData previewTableData) { - for (int i = 0; i < previewTableData.getColumnCount(); i++) { - Class cls = previewTableData.getColumnClass(i); - if (cls == Date.class || cls == TIME.class || cls == Timestamp.class) { - previewModel.dateIndexs.add(i); - } - } - } - /** * 直接预览存储过程的一个返回数据集,没有实际值和显示值 * @@ -721,61 +528,9 @@ public class PreviewTablePane extends BasicPane { } catch (Exception e) { previewModel = new PreviewTableModel((int) maxPreviewNumberField.getValue()); } - setPreviewTableModel(previewModel); - - } - - /** - * 切换TableModel的展示状态 - */ - private void togglePreviewTableModelDesensitizeStatus() { - if (!isDesensitizeOpened()) { - // 未启用数据脱敏时,不需要切换 - return; - } - TableSorter tableSorter = (TableSorter) preveiwTable.getModel(); - TableModel originTableModel = tableSorter.getTableModel(); - if (originTableModel instanceof DesensitizedPreviewTableModel) { - ((DesensitizedPreviewTableModel) originTableModel).toggleNeedDesensite(); - } - } - - /** - * 刷新一下预览页面,用于切换脱敏和非脱敏时的显示 - */ - private void refreshTable() { - TableModel originTableModel = getCurrentTableModel(); - setPreviewTableModel(originTableModel); - } - - /** - * 获取当前的TableModel,已经除掉了TableSorter的包装 - * - * @return - */ - private TableModel getCurrentTableModel() { - TableSorter tableSorter = (TableSorter) preveiwTable.getModel(); - return tableSorter.getTableModel(); - } - - /** - * 设置预览TableModel - * - * @param previewTableModel - */ - private void setPreviewTableModel(TableModel previewTableModel) { - setDesensitizationCount(previewTableModel); - setModel(previewTableModel); - setCurrentRows(previewTableModel.getRowCount()); + setModel(previewModel); + setCurrentRows(previewModel.getRowCount()); fireLoadedListener(); - } - /** - * 数据脱敏是否启用 - * @return - */ - private boolean isDesensitizeOpened() { - return tableData instanceof DesensitizationTableData && - ((DesensitizationTableData) tableData).getDesensitizationConfig().isDesensitizeOpened(); } } From 7c2c59c2be07fe6d36eb4f31062bf32c7802cb5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvan-=E6=AC=A7=E9=98=B3=E5=B8=86?= Date: Fri, 4 Nov 2022 16:15:42 +0800 Subject: [PATCH 153/310] =?UTF-8?q?REPORT-80693=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=84=B1=E6=95=8F=E4=BA=8C=E6=9C=9F=20=E5=9C=88=E5=A4=8D?= =?UTF-8?q?=E6=9D=82=E5=BA=A6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/data/datapane/preview/PreviewTablePane.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java index 5926dcb2df..c9708087bf 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java @@ -222,7 +222,11 @@ public class PreviewTablePane extends BasicPane { return this.worker; } - // elake:为预览表的columnIndex列着c色. + /** + * elake:为预览表的columnIndex列着色. + * @param columnIndex + * @param c + */ private void setPreviewTableColumnColor(final int columnIndex, final Color c) { addLoadedListener(new LoadedEventListener() { @Override From dca702f558ac454ed087dc9b695fa4dcd1f3eda9 Mon Sep 17 00:00:00 2001 From: Harrison Date: Mon, 7 Nov 2022 09:28:46 +0800 Subject: [PATCH 154/310] =?UTF-8?q?fix:=20REPORT-82928=E3=80=90=E8=A7=86?= =?UTF-8?q?=E8=A7=89=E9=AA=8C=E6=94=B6=E3=80=91=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E8=B5=B7=E5=A7=8B=E9=A1=B5=20debug=20=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E7=9A=84=E6=BA=90=E7=A0=81=E3=80=82=E5=A4=84=E7=90=86=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20=E8=AF=A6=E8=A7=81=EF=BC=9Ahttps://kms.fineres.com/?= =?UTF-8?q?pages/viewpage.action=3FpageId=3D572293771?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../startup/ui/StartupPageWorkspacePanel.java | 44 ++++++++++++++++++- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/startup/ui/StartupPageWorkspacePanel.java b/designer-base/src/main/java/com/fr/startup/ui/StartupPageWorkspacePanel.java index ced2aa3767..923a12292c 100644 --- a/designer-base/src/main/java/com/fr/startup/ui/StartupPageWorkspacePanel.java +++ b/designer-base/src/main/java/com/fr/startup/ui/StartupPageWorkspacePanel.java @@ -4,6 +4,7 @@ import com.fr.base.svg.IconUtils; import com.fr.design.components.tooltip.ModernToolTip; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itextfield.FRGraphics2D; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.ColorUtils; @@ -17,6 +18,8 @@ import javax.swing.Icon; import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.JToolTip; +import javax.swing.JViewport; +import javax.swing.RepaintManager; import javax.swing.ScrollPaneConstants; import javax.swing.border.EmptyBorder; import java.awt.BasicStroke; @@ -28,9 +31,11 @@ import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.GridLayout; +import java.awt.Image; import java.awt.RenderingHints; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import java.awt.image.ImageObserver; import java.util.List; import java.util.concurrent.atomic.AtomicReference; @@ -127,9 +132,15 @@ public class StartupPageWorkspacePanel extends JPanel { this.contentPanel = generateUnLimitContentPanel(this.partitions); this.add(contentPanel, BorderLayout.NORTH); } - private JComponent generateUnLimitContentPanel(List> partitions) { + JComponent panel = generateUnLimitContentPanel0(partitions); + ColorUtils.transparentBackground(panel); + return panel; + } + + private JComponent generateUnLimitContentPanel0(List> partitions) { + JPanel workspaceDescWrapper = new JPanel(); workspaceDescWrapper.setLayout(new BorderLayout(0, 0)); workspaceDescWrapper.setBorder(new EmptyBorder(0, 0, 0, 0)); @@ -144,14 +155,20 @@ public class StartupPageWorkspacePanel extends JPanel { if (needScroll) { // 滚动条 UIScrollPane scrollPane = new UIScrollPane(workspaceDescPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); + JViewport viewport = scrollPane.getViewport(); + JViewport scrollViewport = new TransparentScrollViewPort(); + // 动态画图 + scrollViewport.addChangeListener(e -> repaintAll()); + scrollViewport.setView(viewport.getView()); + scrollPane.setViewport(scrollViewport); scrollPane.setBorder(new EmptyBorder(10, 0, 0, 0)); scrollPane.setPreferredSize(new Dimension(CONTENT_WIDTH, SCROLL_HEIGHT)); workspaceDescWrapper.add(scrollPane, BorderLayout.CENTER); + return workspaceDescWrapper; } workspaceDescWrapper.add(workspaceDescPanel, BorderLayout.CENTER); - ColorUtils.transparentBackground(workspaceDescWrapper); return workspaceDescWrapper; } @@ -580,4 +597,27 @@ public class StartupPageWorkspacePanel extends JPanel { this.getRootPane().repaint(); } + + /** + * 支持透明的滚动视图 + */ + private class TransparentScrollViewPort extends JViewport { + + /** + * 从而屏蔽掉 {@link RepaintManager.PaintManager#paintDoubleBuffered(JComponent, Image, Graphics, int, int, int, int)} + * + * @return 创建一个不会实际画图的 Graphics + */ + @Override + public Graphics getGraphics() { + + Graphics graphics = super.getGraphics(); + return new FRGraphics2D((Graphics2D) graphics) { + @Override + public boolean drawImage(Image img, int x, int y, ImageObserver observer) { + return true; + } + }; + } + } } From 465c5b6388b31d6182235532f63d9e3a55b9c06c Mon Sep 17 00:00:00 2001 From: Yann Date: Mon, 7 Nov 2022 10:26:51 +0800 Subject: [PATCH 155/310] =?UTF-8?q?REPORT-81039=20FR11=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E9=93=B6=E8=A1=8C=E5=B7=A5=E4=BD=9C=E5=B9=B3=E5=8F=B0=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=EF=BC=8Cfrm=E8=AE=BE=E8=AE=A1=E7=94=BB=E5=B8=83?= =?UTF-8?q?=E6=8B=96=E5=85=A5=E6=8F=92=E4=BB=B6=E6=8E=A7=E4=BB=B6=20?= =?UTF-8?q?=E5=8F=8C=E5=87=BB=EF=BC=8C=E5=81=B6=E7=8E=B0=E5=8F=B3=E4=BE=A7?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=A1=B9=E5=8F=98=E4=B8=BA=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E7=9A=84=E8=AE=BE=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/style/series/ColorPickerPaneNumFiled.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/ColorPickerPaneNumFiled.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/ColorPickerPaneNumFiled.java index fcaed6d990..12ab30b558 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/ColorPickerPaneNumFiled.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/ColorPickerPaneNumFiled.java @@ -6,6 +6,7 @@ import com.fr.module.ModuleContext; import com.fr.value.ClearableLazyValue; import org.jetbrains.annotations.NotNull; +import javax.swing.*; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -32,12 +33,9 @@ public class ColorPickerPaneNumFiled extends UINumberField { @Override protected void attributeChange() { - ses.getValue().schedule(new Runnable() { - @Override - public void run() { - // kuns: 默认修改500, 在地图修改系列颜色text时, 快速响应. - runChange(); - } + ses.getValue().schedule(() -> { + // kuns: 默认修改500, 在地图修改系列颜色text时, 快速响应. + SwingUtilities.invokeLater(this::runChange); }, 500, TimeUnit.MILLISECONDS); } From 4f54af4c9a8abba370b5eaa1871a020471591432 Mon Sep 17 00:00:00 2001 From: Yann Date: Mon, 7 Nov 2022 10:31:10 +0800 Subject: [PATCH 156/310] =?UTF-8?q?REPORT-81039=20FR11=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E9=93=B6=E8=A1=8C=E5=B7=A5=E4=BD=9C=E5=B9=B3=E5=8F=B0=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=EF=BC=8Cfrm=E8=AE=BE=E8=AE=A1=E7=94=BB=E5=B8=83?= =?UTF-8?q?=E6=8B=96=E5=85=A5=E6=8F=92=E4=BB=B6=E6=8E=A7=E4=BB=B6=20?= =?UTF-8?q?=E5=8F=8C=E5=87=BB=EF=BC=8C=E5=81=B6=E7=8E=B0=E5=8F=B3=E4=BE=A7?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=A1=B9=E5=8F=98=E4=B8=BA=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E7=9A=84=E8=AE=BE=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/style/series/ColorPickerPaneNumFiled.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/ColorPickerPaneNumFiled.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/ColorPickerPaneNumFiled.java index 12ab30b558..7ab5058f7e 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/ColorPickerPaneNumFiled.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/ColorPickerPaneNumFiled.java @@ -6,7 +6,7 @@ import com.fr.module.ModuleContext; import com.fr.value.ClearableLazyValue; import org.jetbrains.annotations.NotNull; -import javax.swing.*; +import javax.swing.SwingUtilities; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; From 4e3c7e01ed9f2f809d4d6dece1f351facb0356f3 Mon Sep 17 00:00:00 2001 From: Harrison Date: Mon, 7 Nov 2022 10:33:18 +0800 Subject: [PATCH 157/310] =?UTF-8?q?REPORT-80211=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E8=AF=AD=E8=A8=80=E4=BF=AE=E6=94=B9=E4=B8=BA=E8=8B=B1?= =?UTF-8?q?=E6=96=87=EF=BC=8C=E5=90=AF=E5=8A=A8=E9=A1=B5=E8=BF=9B=E5=85=A5?= =?UTF-8?q?=E5=90=8E=E9=99=90=E5=88=B6=E6=9C=89=E8=AF=AF=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=B8=80=E4=B8=8B=E9=95=BF=E5=BA=A6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/com/fr/design/i18n/dimension_en.properties | 1 + .../main/resources/com/fr/design/i18n/dimension_ja_JP.properties | 1 + .../main/resources/com/fr/design/i18n/dimension_ko_KR.properties | 1 + .../main/resources/com/fr/design/i18n/dimension_zh_TW.properties | 1 + 4 files changed, 4 insertions(+) diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties index 0205e6ea2b..d1f8ee17b2 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties @@ -15,6 +15,7 @@ com.fr.design.report.fit.firstColumn=120*20 com.fr.design.report.fit.column=160*20 com.fr.design.lock.LockInfoDialog=500*180 com.fr.design.mainframe.ForbiddenPane.refreshButton=75*24 +com.fr.start.common.DesignerOpenEmptyPanel.createButton=120*24 com.fr.design.cell.expand.sort.pane=257*185 com.fr.design.sort.rule.item=125*20 com.fr.design.ds.column.sort.pane=250*180 diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties index 9b143294f3..48164621c7 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties @@ -14,6 +14,7 @@ com.fr.design.report.fit.firstColumn=170*20 com.fr.design.report.fit.column=100*20 com.fr.design.lock.LockInfoDialog=500*180 com.fr.design.mainframe.ForbiddenPane.refreshButton=68*24 +com.fr.start.common.DesignerOpenEmptyPanel.createButton=120*24 com.fr.design.cell.expand.sort.pane=257*170 com.fr.design.sort.rule.item=125*20 com.fr.design.ds.column.sort.pane=250*165 diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties index e0f0130224..4e8b3f9cdb 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties @@ -14,6 +14,7 @@ com.fr.design.report.fit.firstColumn=130*20 com.fr.design.report.fit.column=100*20 com.fr.design.lock.LockInfoDialog=500*180 com.fr.design.mainframe.ForbiddenPane.refreshButton=80*24 +com.fr.start.common.DesignerOpenEmptyPanel.createButton=70*24 com.fr.design.cell.expand.sort.pane=267*165 com.fr.design.sort.rule.item=125*20 com.fr.design.ds.column.sort.pane=250*180 diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties index c00c2b8a9a..82f86a3a43 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties @@ -14,6 +14,7 @@ com.fr.design.report.fit.firstColumn=80*20 com.fr.design.report.fit.column=100*20 com.fr.design.lock.LockInfoDialog=400*180 com.fr.design.mainframe.ForbiddenPane.refreshButton=68*24 +com.fr.start.common.DesignerOpenEmptyPanel.createButton=70*24 com.fr.design.cell.expand.sort.pane=227*155 com.fr.design.sort.rule.item=80*20 com.fr.design.ds.column.sort.pane=220*150 From b877e9d9344b902912627f3ab64b3d0beeb4664e Mon Sep 17 00:00:00 2001 From: Harrison Date: Mon, 7 Nov 2022 10:35:49 +0800 Subject: [PATCH 158/310] =?UTF-8?q?refactor:=20=E5=8F=98=E6=9B=B4=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E7=9A=84=E9=95=BF=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../startup/ui/StartupPageWorkspacePanel.java | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/designer-base/src/main/java/com/fr/startup/ui/StartupPageWorkspacePanel.java b/designer-base/src/main/java/com/fr/startup/ui/StartupPageWorkspacePanel.java index 923a12292c..3cd6b78773 100644 --- a/designer-base/src/main/java/com/fr/startup/ui/StartupPageWorkspacePanel.java +++ b/designer-base/src/main/java/com/fr/startup/ui/StartupPageWorkspacePanel.java @@ -153,25 +153,31 @@ public class StartupPageWorkspacePanel extends JPanel { } boolean needScroll = partitions.size() > 4; if (needScroll) { - // 滚动条 - UIScrollPane scrollPane = new UIScrollPane(workspaceDescPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); - JViewport viewport = scrollPane.getViewport(); - JViewport scrollViewport = new TransparentScrollViewPort(); - // 动态画图 - scrollViewport.addChangeListener(e -> repaintAll()); - scrollViewport.setView(viewport.getView()); - scrollPane.setViewport(scrollViewport); - scrollPane.setBorder(new EmptyBorder(10, 0, 0, 0)); - scrollPane.setPreferredSize(new Dimension(CONTENT_WIDTH, SCROLL_HEIGHT)); - workspaceDescWrapper.add(scrollPane, BorderLayout.CENTER); - - return workspaceDescWrapper; + return generateScrollUnLimitContentPanel(workspaceDescWrapper, workspaceDescPanel); } workspaceDescWrapper.add(workspaceDescPanel, BorderLayout.CENTER); return workspaceDescWrapper; } + @NotNull + private JPanel generateScrollUnLimitContentPanel(JPanel workspaceDescWrapper, JPanel workspaceDescPanel) { + + // 滚动条 + UIScrollPane scrollPane = new UIScrollPane(workspaceDescPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); + JViewport viewport = scrollPane.getViewport(); + JViewport scrollViewport = new TransparentScrollViewPort(); + // 动态画图 + scrollViewport.addChangeListener(e -> repaintAll()); + scrollViewport.setView(viewport.getView()); + scrollPane.setViewport(scrollViewport); + scrollPane.setBorder(new EmptyBorder(10, 0, 0, 0)); + scrollPane.setPreferredSize(new Dimension(CONTENT_WIDTH, SCROLL_HEIGHT)); + workspaceDescWrapper.add(scrollPane, BorderLayout.CENTER); + + return workspaceDescWrapper; + } + private JPanel generateLimitContentPanel(List> partitions) { JPanel workspaceDescPanel = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEFT, 0, 0); From 2531859fbf638862c12f15b27c835ae7fc973387 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 7 Nov 2022 11:51:59 +0800 Subject: [PATCH 159/310] =?UTF-8?q?REPORT-80695=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=85=A8=E5=B1=80=E7=BA=A7=E5=88=AB=E6=9F=A5=E6=89=BE=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E4=BA=8C=E6=9C=9F=20=E9=87=8D=E5=A4=8D=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/actions/replace/ui/ITReplaceMainDialog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index ba7b4bf445..dd01157a75 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -258,7 +258,7 @@ public class ITReplaceMainDialog extends UIDialog { */ public void replace(String searchStr, String replaceStr) { for (Info info : searchContentResultList) { - if (!info.getContent().isWrongful() && info.getContent().isSelected()) { + if (!info.getContent().isWrongful() && isSupportReplace(info)) { info.setValue(info, searchStr, replaceStr, info.getContent().getOperatorArray()); } if (info.getContent().isSelected()) { From 33bc64393c75547b979f5d2889e4d84217b2c86f Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 7 Nov 2022 14:48:59 +0800 Subject: [PATCH 160/310] =?UTF-8?q?REPORT-80695=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=85=A8=E5=B1=80=E7=BA=A7=E5=88=AB=E6=9F=A5=E6=89=BE=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E4=BA=8C=E6=9C=9F=20=E5=85=88=E5=81=9C=E7=94=A8?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/actions/replace/ui/ITReplaceMainDialog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index dd01157a75..e5ba60f703 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -138,7 +138,7 @@ public class ITReplaceMainDialog extends UIDialog { southPanel = new ITReplaceSouthPanel(); westPanel = new ITReplaceWestPanel(); - initCloseListener(); + //initCloseListener(); northPane.fitScreen(0, 0, jTemplate.getWidth()); JPanel center = new JPanel(new BorderLayout()); From 93b763f09bffb4cfac25d44c937bcc34a3831227 Mon Sep 17 00:00:00 2001 From: Harrison Date: Mon, 7 Nov 2022 20:05:48 +0800 Subject: [PATCH 161/310] =?UTF-8?q?REPORT-80211=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E8=AF=AD=E8=A8=80=E4=BF=AE=E6=94=B9=E4=B8=BA=E8=8B=B1?= =?UTF-8?q?=E6=96=87=EF=BC=8C=E5=90=AF=E5=8A=A8=E9=A1=B5=E8=BF=9B=E5=85=A5?= =?UTF-8?q?=E5=90=8E=E9=99=90=E5=88=B6=E6=9C=89=E8=AF=AF=20=E6=97=A5?= =?UTF-8?q?=E6=96=87=E5=A4=84=E7=90=86=E4=B8=80=E4=B8=8B=EF=BC=8C=E7=BC=A9?= =?UTF-8?q?=E7=9F=AD=E9=95=BF=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/com/fr/design/i18n/dimension_ja_JP.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties index 48164621c7..a5b3a03fe6 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties @@ -14,7 +14,7 @@ com.fr.design.report.fit.firstColumn=170*20 com.fr.design.report.fit.column=100*20 com.fr.design.lock.LockInfoDialog=500*180 com.fr.design.mainframe.ForbiddenPane.refreshButton=68*24 -com.fr.start.common.DesignerOpenEmptyPanel.createButton=120*24 +com.fr.start.common.DesignerOpenEmptyPanel.createButton=70*24 com.fr.design.cell.expand.sort.pane=257*170 com.fr.design.sort.rule.item=125*20 com.fr.design.ds.column.sort.pane=250*165 From eab0e8e48cc7e5c7dcfde7160daea6d714910301 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 8 Nov 2022 10:07:17 +0800 Subject: [PATCH 162/310] =?UTF-8?q?REPORT-82745=20=E4=BA=8C=E6=AC=A1?= =?UTF-8?q?=E6=96=B0=E5=BB=BA=E6=A8=A1=E6=9D=BF=E8=AE=A1=E6=95=B0=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/JTemplateNameHelper.java | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplateNameHelper.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplateNameHelper.java index 96ca5b4843..0f245d8bb4 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplateNameHelper.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplateNameHelper.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe; +import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.TemplateTreePane; import com.fr.design.gui.itree.filetree.TemplateFileTree; import com.fr.stable.StringUtils; @@ -19,8 +20,6 @@ public class JTemplateNameHelper { private static final int PREFIX_NUM = 3000; - private static short currentIndex = 0;// 此变量用于多次新建模板时,让名字不重复 - public static String newTemplateNameByIndex(String prefix) { // 用于获取左侧模板的文件名,如左侧已包含"WorkBook1.cpt, WorkBook12.cpt, WorkBook177.cpt" // 那么新建的文件名将被命名为"WorkBook178.cpt",即取最大数+1 @@ -37,13 +36,33 @@ public class JTemplateNameHelper { reportNum.add(index); } } + //把当前编辑面板的模板名也加进来判断 + addHistoryTemplateName2List(reportNum, prefix); Collections.sort(reportNum); BigInteger idx = reportNum.size() > 0 ? reportNum.get(reportNum.size() - 1).add(BigInteger.valueOf(1)) : BigInteger.valueOf(1); - idx = idx.add(BigInteger.valueOf(currentIndex)); - currentIndex++; return prefix + idx; } + /** + * 将当前打开的模板列表的模板名处理一下加进来,以便于获取左侧模板文件名与当前模板列表的最大值 + * + * @param reportNum 存储后缀的列表 + * @param prefix 前缀 + */ + private static void addHistoryTemplateName2List(List reportNum, String prefix) { + int len = HistoryTemplateListCache.getInstance().getHistoryCount(); + for (int i = 0; i < len; i++) { + JTemplate jTemplate = HistoryTemplateListCache.getInstance().get(i); + if (jTemplate != null) { + String templateName = jTemplate.getTemplateName(); + BigInteger index = getFileNameIndex(prefix, templateName); + if (index != null) { + reportNum.add(index); + } + } + } + } + /** * @return java.lang.Integer WorkBook11.cpt则返回11,如果没有找到index返回null * @Description 返回文件名中的index From f531098ff1c733a1f63825c4fedfa84857ffc680 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 8 Nov 2022 15:48:25 +0800 Subject: [PATCH 163/310] =?UTF-8?q?REPORT-80695=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=85=A8=E5=B1=80=E6=9F=A5=E6=89=BE=E6=9B=BF=E6=8D=A22?= =?UTF-8?q?=E6=9C=9F=20=E5=A2=9E=E5=8A=A0=E6=9B=BF=E6=8D=A2tip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/actions/replace/ui/ITReplaceMainDialog.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index e5ba60f703..67fae2e141 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -260,6 +260,10 @@ public class ITReplaceMainDialog extends UIDialog { for (Info info : searchContentResultList) { if (!info.getContent().isWrongful() && isSupportReplace(info)) { info.setValue(info, searchStr, replaceStr, info.getContent().getOperatorArray()); + contentReplaceCount++; + } + if (info.getContent().isWrongful()) { + contentReplaceFailedCount++; } if (info.getContent().isSelected()) { info.getContent().setReplaced(true); @@ -318,13 +322,10 @@ public class ITReplaceMainDialog extends UIDialog { for (Info info : searchContentResultList) { if (isAllow2Replace(info)) { if (!info.isLegalValid(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(), searchStr, replaceStr)) { - contentReplaceFailedCount++; checkValidList.add(info); serialNumber.add(count); info.getContent().setWrongful(true); info.getContent().setReplaced(true); - } else { - contentReplaceCount++; } count++; } From a0cbf5d6a34d635348d44d15e24a7b149e07d54d Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 9 Nov 2022 09:32:35 +0800 Subject: [PATCH 164/310] =?UTF-8?q?REPORT-80695=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=85=A8=E5=B1=80=E6=9F=A5=E6=89=BE=E6=9B=BF=E6=8D=A22?= =?UTF-8?q?=E6=9C=9F=20=E6=A0=A1=E9=AA=8C=E5=85=A5=E5=8F=A3=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E4=B8=B2=E8=8E=B7=E5=8F=96=E9=80=BB=E8=BE=91=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/actions/replace/ui/ITReplaceMainDialog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index 67fae2e141..da5604bd70 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -212,7 +212,7 @@ public class ITReplaceMainDialog extends UIDialog { * 模板内容替换相关 */ private void replace4Content() { - String type = ((UITextField) (northPane.getFindCombobox().getEditor().getEditorComponent())).getText(); + String type = GeneralUtils.objectToString(northPane.getFindCombobox().getSelectedItem()); String searchStr = ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).getText(); String replaceStr = ((UITextField) (northPane.getReplaceInputCombobox().getEditor().getEditorComponent())).getText(); clearContentCount(); From 734668c3b15137744cbe0756f6a29218da69426d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvan-=E6=AC=A7=E9=98=B3=E5=B8=86?= Date: Wed, 9 Nov 2022 16:30:10 +0800 Subject: [PATCH 165/310] =?UTF-8?q?REPORT-84331=20=E3=80=90=E5=86=92?= =?UTF-8?q?=E7=83=9F=E3=80=91=E6=9C=AC=E5=9C=B0=E7=9B=AE=E5=BD=95=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=EF=BC=8C=E8=BF=98=E6=8F=90=E7=A4=BA=E6=88=91=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E7=89=88=E6=9C=AC=E4=B8=8D=E4=B8=80=E8=87=B4=20?= =?UTF-8?q?=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91jar?= =?UTF-8?q?=E5=8C=85=E5=92=8C=E6=8F=92=E4=BB=B6=E7=9A=84=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=EF=BC=8C=E5=9D=87=E4=BC=9A=E5=9C=A8=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E5=90=AF=E5=8A=A8=E5=90=8E=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E4=B8=80=E6=AC=A1=EF=BC=8C=E4=BD=86=E6=98=AFjar=E5=8C=85?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E5=88=A4=E6=96=AD=E4=BA=86=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E4=B8=BA=E6=9C=AC=E5=9C=B0=E7=9B=AE=E5=BD=95=EF=BC=8C=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E6=A3=80=E6=9F=A5=E6=9C=AA=E5=88=A4=E6=96=AD=EF=BC=8C?= =?UTF-8?q?=E5=9B=A0=E6=AD=A4=E8=BF=9B=E8=A1=8C=E4=BA=86=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=EF=BC=8C=E5=90=8C=E6=97=B6=E5=8F=88=E5=9B=A0?= =?UTF-8?q?=E4=B8=BA=E6=B5=8B=E8=AF=95=E5=90=8C=E5=AD=A6=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E5=90=8CID=E7=9A=84=E5=A4=9A=E4=B8=AA?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=8F=92=E4=BB=B6=EF=BC=8C=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E4=BA=86=E6=A3=80=E6=9F=A5=E7=BB=93=E6=9E=9C=E4=B8=BA"XXX?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E7=89=88=E6=9C=AC=E4=B8=8D=E4=B8=80=E8=87=B4?= =?UTF-8?q?"=EF=BC=8C=E5=B9=B6=E7=BB=99=E5=87=BA=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E6=8F=90=E9=86=92=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D?= =?UTF-8?q?=E8=B7=AF=E3=80=91=E5=B0=86"=E5=88=A4=E6=96=AD=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E4=B8=BA=E6=9C=AC=E5=9C=B0=E7=9B=AE=E5=BD=95"?= =?UTF-8?q?=E7=9A=84=E9=80=BB=E8=BE=91=E6=8F=90=E5=89=8D=EF=BC=8C=E5=85=88?= =?UTF-8?q?=E5=88=A4=E6=96=AD=EF=BC=8C=E5=86=8D=E5=8E=BB=E5=81=9Ajar?= =?UTF-8?q?=E5=92=8C=E6=8F=92=E4=BB=B6=E6=A3=80=E6=9F=A5=EF=BC=8C=20?= =?UTF-8?q?=E3=80=90review=E5=BB=BA=E8=AE=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../versioncheck/VersionCheckUtils.java | 46 +++++++++++-------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java b/designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java index 55dfe60cf1..bd208749e8 100644 --- a/designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java +++ b/designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java @@ -88,7 +88,23 @@ public class VersionCheckUtils { public static boolean versionCheck(String envName) { - return checkLocalAndRemoteJartime(envName) && checkLocalAndRemotePlugin().size() == 0; + if (needCheckConsistency(envName)) { + return checkLocalAndRemoteJartime(envName) && checkLocalAndRemotePlugin().size() == 0; + } + return true; + } + + /** + * 判断是否需要检查Jartime和插件的一致性 + * + * @param selectedEnvName 当前工作目录名称 + * @return + */ + private static boolean needCheckConsistency(String selectedEnvName) { + DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); + DesignerWorkspaceInfo selectedEnv = envManager.getWorkspaceInfo(selectedEnvName); + // 当前工作目录为远程工作目录时,需要检查 + return selectedEnv.getType() == DesignerWorkspaceType.Remote; } public static boolean versionCheck(DesignerWorkspaceInfo selectedEnv) { @@ -139,21 +155,17 @@ public class VersionCheckUtils { } public static boolean checkLocalAndRemoteJartime(DesignerWorkspaceInfo selectedEnv) { - //是否需要做服务校验 - if (needCheckBranch(selectedEnv)) { - String localBranch; - String remoteBranch = getRemoteBranch(selectedEnv); - localBranch = GeneralUtils.readFullBuildNO(); - //通过是否包含#来避免当前版本为非安装版本(主要是内部开发版本) - if (localBranch.contains("#") && ComparatorUtils.equals(localBranch, remoteBranch)) { - //说明版本一致,仅做日志记录 - FineLoggerFactory.getLogger().info("Remote Designer version consistency"); - return true; - } else { - return false; - } + String localBranch; + String remoteBranch = getRemoteBranch(selectedEnv); + localBranch = GeneralUtils.readFullBuildNO(); + //通过是否包含#来避免当前版本为非安装版本(主要是内部开发版本) + if (localBranch.contains("#") && ComparatorUtils.equals(localBranch, remoteBranch)) { + //说明版本一致,仅做日志记录 + FineLoggerFactory.getLogger().info("Remote Designer version consistency"); + return true; + } else { + return false; } - return true; } public static List getNoExistServiceDescription(String envName) { @@ -267,10 +279,6 @@ public class VersionCheckUtils { return df.format(jarDate); } - private static boolean needCheckBranch(DesignerWorkspaceInfo selectedEnv) { - return selectedEnv.getType() == DesignerWorkspaceType.Remote; - } - public static JSONArray checkLocalAndRemotePlugin() { JSONArray differentPlugins = new JSONArray(); JSONArray remotePlugins = FRContext.getCommonOperator().getPluginStatus(); From 94b58223b43d3c5c41808a83f7e60f4b39c62f9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvan-=E6=AC=A7=E9=98=B3=E5=B8=86?= Date: Wed, 9 Nov 2022 16:34:30 +0800 Subject: [PATCH 166/310] =?UTF-8?q?REPORT-84331=20=E3=80=90=E5=86=92?= =?UTF-8?q?=E7=83=9F=E3=80=91=E6=9C=AC=E5=9C=B0=E7=9B=AE=E5=BD=95=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=EF=BC=8C=E8=BF=98=E6=8F=90=E7=A4=BA=E6=88=91=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E7=89=88=E6=9C=AC=E4=B8=8D=E4=B8=80=E8=87=B4=20?= =?UTF-8?q?=E5=A4=84=E7=90=86=E4=BB=A3=E7=A0=81=E8=B4=A8=E9=87=8F=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/versioncheck/VersionCheckUtils.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java b/designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java index bd208749e8..a6a2d7896a 100644 --- a/designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java +++ b/designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java @@ -70,6 +70,7 @@ public class VersionCheckUtils { private static final String GROUP = "group"; private static final String BI = "bi"; private static final String BIPREFIX = "com.finebi"; + private static final String DEVELOP_BRANCH_MARK = "#"; private static final Set pluginsNeedIgnore = new HashSet<>(); static { pluginsNeedIgnore.addAll(Arrays.asList( @@ -158,8 +159,8 @@ public class VersionCheckUtils { String localBranch; String remoteBranch = getRemoteBranch(selectedEnv); localBranch = GeneralUtils.readFullBuildNO(); - //通过是否包含#来避免当前版本为非安装版本(主要是内部开发版本) - if (localBranch.contains("#") && ComparatorUtils.equals(localBranch, remoteBranch)) { + // 通过是否包含"#"来避免当前版本为非安装版本(主要是内部开发版本) + if (localBranch.contains(DEVELOP_BRANCH_MARK) && ComparatorUtils.equals(localBranch, remoteBranch)) { //说明版本一致,仅做日志记录 FineLoggerFactory.getLogger().info("Remote Designer version consistency"); return true; From 2f3a9296bc8ec834c3102f1d20d9c2185433c5e2 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 9 Nov 2022 17:01:11 +0800 Subject: [PATCH 167/310] =?UTF-8?q?REPORT-80695=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E6=9F=A5=E6=89=BE=E6=9B=BF=E6=8D=A2=E4=BA=8C=E6=9C=9F=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=95=B0=E6=8D=AE=E5=88=97=E4=B8=8E=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=AE=BE=E7=BD=AE=E6=9B=BF=E6=8D=A2=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../replace/action/setting/CellGroupType.java | 24 +++++++++++++++++++ .../action/setting/SettingController.java | 16 +++++++++++++ 2 files changed, 40 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellGroupType.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellGroupType.java index 27aebee07d..161aca91f4 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellGroupType.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellGroupType.java @@ -246,4 +246,28 @@ public enum CellGroupType { DSColumn column = (DSColumn) cellElement.getValue(); column.setGrouper(grouper); } + + /** + * 是否修改过 + * + * @param info 存储信息的数据结构 + * @param inputStr 用户输入的第一级下拉框内容 + * @param extraStr 用户输入的第二级下拉框内容 + * @return 修改过返回true + */ + public boolean isEverChanged(Info info, String inputStr, String extraStr) { + return !isNeed(getCellElementFromInfo(info), inputStr, extraStr); + } + + /** + * 从Info中获取CellElement + * 能到这一步肯定是单元格数据列类型 + * + * @param info 存储查找替换信息的数据结构 + * @return CellElement + */ + public CellElement getCellElementFromInfo(Info info) { + CellElement cellElement = (CellElement) info.getContent().getReplaceObject(); + return cellElement; + } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingController.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingController.java index 0b481a1272..676bfba9cb 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingController.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingController.java @@ -156,6 +156,15 @@ public enum SettingController implements ShowValue { type.replace(info, firstStr, secondStr); } } + + @Override + public boolean isEverChanged(Info info, String inputStr, String extraStr) { + CellGroupType type = CellGroupType.match(inputStr); + if (type != null) { + return type.isEverChanged(info, inputStr, extraStr); + } + return false; + } }, /** * 单元格-数据列 @@ -224,6 +233,13 @@ public enum SettingController implements ShowValue { dsColumn.setColumn(TableDataColumn.createColumn(secondStr)); } + + @Override + public boolean isEverChanged(Info info, String inputStr, String extraStr) { + CellElement cellElement = (CellElement) info.getContent().getReplaceObject(); + DSColumn dsColumn = (DSColumn) cellElement.getValue(); + return !isNeed(dsColumn, inputStr, extraStr); + } }, /** * 数据源-数据连接 From d719ce70149ea14388bba0dd1165835768587a5b Mon Sep 17 00:00:00 2001 From: Carlson Date: Mon, 14 Nov 2022 09:45:08 +0800 Subject: [PATCH 168/310] =?UTF-8?q?REPORT-82933=20fix:=E5=A4=9A=E5=B1=82?= =?UTF-8?q?=E9=A5=BC=E5=9B=BE=E3=80=81=E7=9F=A9=E5=BD=A2=E6=A0=91=E5=9B=BE?= =?UTF-8?q?=E3=80=81=E6=89=A9=E5=B1=95=E5=9B=BE=E8=A1=A8=E7=AD=89=E6=9B=B4?= =?UTF-8?q?=E6=8D=A2=E6=95=B0=E6=8D=AE=E9=9B=86=E5=90=8E=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=80=BC=E6=9C=AA=E6=B8=85=E7=A9=BA=20&&=20REPORT-82921=20fix:?= =?UTF-8?q?=E6=89=80=E6=9C=89=E5=9B=BE=E8=A1=A8=E6=9B=B4=E6=8D=A2=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E5=90=8E=E5=AD=97=E6=AE=B5=E5=90=8D=E6=9C=AA?= =?UTF-8?q?=E6=B8=85=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/AbstractCustomFieldComboBoxPane.java | 7 ++++--- .../correlation/AbstractCorrelationPane.java | 5 +++++ .../java/com/fr/design/chartx/single/DataSetPane.java | 5 +++++ .../gui/data/table/SeriesNameUseFieldNamePane.java | 8 +++++--- .../data/MultiPiePlotTableDataContentPane.java | 11 +++++++++-- 5 files changed, 28 insertions(+), 8 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java index 562393699d..41deba8d5f 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java @@ -23,13 +23,13 @@ import javax.swing.JPanel; import javax.swing.SwingConstants; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import java.util.ArrayList; -import java.util.List; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Component; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; +import java.util.ArrayList; +import java.util.List; /** * Created by shine on 2018/9/12. @@ -93,12 +93,13 @@ public abstract class AbstractCustomFieldComboBoxPane extends BasicBeanPane(columnNameList); } private void checkCardPane() { diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/correlation/AbstractCorrelationPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/correlation/AbstractCorrelationPane.java index 5c468c424a..3371854a9d 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/correlation/AbstractCorrelationPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/correlation/AbstractCorrelationPane.java @@ -127,4 +127,9 @@ public abstract class AbstractCorrelationPane extends BasicBeanPane { return StringUtils.EMPTY; } + public void clearAllBoxList() { + this.correlationPane.getTable().clear(); + this.correlationPane.getTable().updateUI(); + } + } diff --git a/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java b/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java index 3df0d3d6d5..dab74e15a4 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java @@ -8,6 +8,7 @@ import com.fr.design.chartx.fields.AbstractDataSetFieldsPane; import com.fr.design.data.tabledata.wrapper.TableDataWrapper; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.chart.gui.data.DatabaseTableDataPane; +import com.fr.stable.StringUtils; import javax.swing.JPanel; import java.awt.BorderLayout; @@ -75,6 +76,10 @@ public class DataSetPane extends FurtherBasicBeanPane { List columnNameList = dataWrap.calculateColumnNameList(); if (dataSetFieldsPane != null) { + // 如果属性编辑画板中选中的数据集发生改变,则清空之前的匹配项 + if (!StringUtils.equals(dataSetFieldsPane.getTableName(), dataWrap.getTableDataName())) { + dataSetFieldsPane.clearAllBoxList(); + } dataSetFieldsPane.refreshBoxListWithSelectTableData(columnNameList); dataSetFieldsPane.setTableName(dataWrap.getTableDataName()); } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java index 9783c0577a..65031b1408 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java @@ -24,8 +24,6 @@ import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.JTable; import javax.swing.event.ChangeEvent; -import java.util.ArrayList; -import java.util.List; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Container; @@ -33,6 +31,8 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; +import java.util.ArrayList; +import java.util.List; /** * 属性表 数据集界面: 系列名 使用字段名. @@ -145,7 +145,7 @@ public class SeriesNameUseFieldNamePane extends FurtherBasicBeanPane Date: Mon, 14 Nov 2022 10:16:34 +0800 Subject: [PATCH 169/310] =?UTF-8?q?REPORT-84031=E5=A1=AB=E6=8A=A5-?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=A0=E9=99=A4=E8=A1=8C-&A1+=5F=E3=80=81?= =?UTF-8?q?=5F=E5=85=AC=E5=BC=8F=E5=9C=A8=E6=8F=92=E5=85=A5=E8=A1=8C?= =?UTF-8?q?=E5=90=8E=E6=97=A0=E6=B3=95=E9=87=8D=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-realize/src/main/java/com/fr/grid/GridUI.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/grid/GridUI.java b/designer-realize/src/main/java/com/fr/grid/GridUI.java index 7ae22a51fa..60fb2c30ad 100644 --- a/designer-realize/src/main/java/com/fr/grid/GridUI.java +++ b/designer-realize/src/main/java/com/fr/grid/GridUI.java @@ -51,7 +51,7 @@ import com.fr.stable.AssistUtils; import com.fr.stable.ColumnRow; import com.fr.stable.Constants; import com.fr.stable.GraphDrawHelper; -import com.fr.stable.script.CalculatorUtils; +import com.fr.script.CalculatorUtils; import com.fr.stable.unit.FU; import com.fr.stable.unit.UNIT; import com.fr.third.antlr.ANTLRException; From 8f63daeb3c98f3828a79145d4e742af470eae1ed Mon Sep 17 00:00:00 2001 From: "Coral.Chen" Date: Mon, 14 Nov 2022 14:20:47 +0800 Subject: [PATCH 170/310] =?UTF-8?q?REPORT-84313=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=8A=A9=E6=89=8B-=E6=8B=96=E5=8A=A8=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E8=BF=9B=E8=AE=BE=E8=AE=A1=E5=99=A8=EF=BC=8C=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E4=B8=AD=E6=9C=89esd=E6=A3=80=E6=9F=A5=E9=94=99=E8=AF=AF=20?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=AC=A1=E6=8B=96=E5=8A=A8=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E8=BF=9B=E8=AE=BE=E8=AE=A1=E5=99=A8=EF=BC=8C=E4=BC=9A=E6=9C=89?= =?UTF-8?q?=E7=A9=BA=E6=8C=87=E9=92=88=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/data/StrategyConfigAttrUtils.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/StrategyConfigAttrUtils.java b/designer-base/src/main/java/com/fr/design/data/StrategyConfigAttrUtils.java index e2a75fc11b..a03ccc99dc 100644 --- a/designer-base/src/main/java/com/fr/design/data/StrategyConfigAttrUtils.java +++ b/designer-base/src/main/java/com/fr/design/data/StrategyConfigAttrUtils.java @@ -11,11 +11,11 @@ import com.fr.esd.event.DSMapping; import com.fr.esd.event.DsNameTarget; import com.fr.esd.event.StrategyEventsNotifier; import com.fr.esd.event.xml.XMLSavedHook; -import com.fr.file.FILE; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import com.fr.workspace.WorkContext; +import java.nio.file.Paths; import java.util.HashMap; import java.util.HashSet; import java.util.Map; @@ -46,7 +46,9 @@ public class StrategyConfigAttrUtils { } //新建模版此时不存在,不需要注册钩子 - if (attr.getXmlSavedHook() == null && WorkContext.getWorkResource().exist(jTemplate.getPath())) { + //不处理外部路径,保存到设计器才处理 + String path = jTemplate.getPath(); + if (attr.getXmlSavedHook() == null && !Paths.get(path).isAbsolute() && WorkContext.getWorkResource().exist(path)) { attr.setXmlSavedHook(new StrategyConfigsAttrSavedHook(jTemplate.getPath(), attr)); } return attr; From 850e2c968e35804ebac4c46bc900638b7715be8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvan-=E6=AC=A7=E9=98=B3=E5=B8=86?= Date: Mon, 14 Nov 2022 14:35:11 +0800 Subject: [PATCH 171/310] =?UTF-8?q?REPORT-75091=20-=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=84=B1=E6=95=8F=EF=BC=88=E6=8A=A5=E8=A1=A8=EF=BC=89=20?= =?UTF-8?q?=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E4=B8=8A?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=9B=A0=E4=B8=BA=E8=BF=AD=E4=BB=A3=E5=BB=B6?= =?UTF-8?q?=E6=9C=9F=E5=B1=8F=E8=94=BD=E4=BA=86=E4=BB=A3=E7=A0=81=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=85=A5=E5=8F=A3=20=E3=80=90=E6=94=B9=E5=8A=A8?= =?UTF-8?q?=E6=80=9D=E8=B7=AF=E3=80=91=E5=B0=86=E5=B1=8F=E8=94=BD=E5=8F=96?= =?UTF-8?q?=E6=B6=88=20=E3=80=90review=E5=BB=BA=E8=AE=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datapane/preview/PreviewTablePane.java | 424 ++++++++++++++---- 1 file changed, 333 insertions(+), 91 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java index c9708087bf..6859c77874 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java @@ -3,28 +3,39 @@ */ package com.fr.design.data.datapane.preview; -import com.fr.base.BaseUtils; import com.fr.base.TableData; +import com.fr.base.svg.IconUtils; import com.fr.data.TableDataSource; +import com.fr.data.desensitize.base.DesensitizationTableData; import com.fr.data.impl.DBTableData; import com.fr.data.impl.EmbeddedTableData; import com.fr.data.impl.NameDataModel; import com.fr.data.operator.DataOperator; import com.fr.design.DesignerEnvManager; +import com.fr.design.constants.UIConstants; import com.fr.design.data.DesignTableDataManager; +import com.fr.design.data.datapane.preview.desensitization.TableDataPreviewDesensitizeManager; +import com.fr.design.data.datapane.preview.desensitization.model.DesensitizedPreviewTableModel; +import com.fr.design.data.datapane.preview.desensitization.view.setting.TableDataDesensitizationSettingPane; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicPane; +import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.frpane.UITabbedPane; +import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.iprogressbar.AutoProgressBar; import com.fr.design.gui.itable.SortableJTable; import com.fr.design.gui.itable.TableSorter; import com.fr.design.gui.itextfield.UINumberField; +import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.JTemplate; +import com.fr.design.menu.SeparatorDef; +import com.fr.design.menu.ToolBarDef; import com.fr.design.ui.util.UIUtil; import com.fr.function.TIME; import com.fr.general.FRFont; @@ -39,6 +50,7 @@ import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; +import javax.swing.SwingUtilities; import javax.swing.SwingWorker; import javax.swing.UIManager; import javax.swing.table.DefaultTableCellRenderer; @@ -57,12 +69,19 @@ import java.sql.Timestamp; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.Objects; import java.util.concurrent.CancellationException; /** * august: PreviewTablePane一共提供5个共有的静态方法,用来预览。 */ public class PreviewTablePane extends BasicPane { + + private static final String DATA_DESENSITIZATION_CONFIG = Toolkit.i18nText("Fine-Design_Report_Desensitization_Config"); + private static final String LEFT_BRACKET = "("; + private static final String RIGHT_BRACKET = ")"; + private static final String COUNT = Toolkit.i18nText("Fine-Design_Report_Desensitization_Count"); + private TableData tableData; private DataModel dataModel; private UINumberField maxPreviewNumberField; @@ -78,6 +97,54 @@ public class PreviewTablePane extends BasicPane { private static PreviewTablePane THIS; private EmbeddedTableData previewTableData; + private UILabel desensitizationLabel; + + /** + * 用于refreshLabel的鼠标监听 + */ + private final MouseAdapter refreshLabelMouseAdapter = new MouseAdapter() { + boolean mouseEntered = false; + boolean buttonPressed = false; + + @Override + public void mouseEntered(MouseEvent e) { // 当鼠标进入时候调用. + mouseEntered = true; + if (!buttonPressed) { + refreshLabel.setBackground(java.awt.Color.WHITE); + refreshLabel.setOpaque(true); + refreshLabel.setBorder(BorderFactory.createLineBorder(java.awt.Color.GRAY)); + } + } + + @Override + public void mouseExited(MouseEvent e) { + mouseEntered = false; + refreshLabel.setOpaque(false); + refreshLabel.setBorder(BorderFactory.createEmptyBorder()); + } + + @Override + public void mousePressed(MouseEvent e) { + buttonPressed = true; + refreshLabel.setBackground(java.awt.Color.lightGray); + } + + @Override + public void mouseReleased(MouseEvent e) { + buttonPressed = false; + if (mouseEntered) { + refreshLabel.setBackground(java.awt.Color.WHITE); + try { + populate(tableData); + if (dataModel != null) { + setRowsLimitTableModel(); + } + } catch (Exception ignore) { + } + } + } + }; + public static final PreviewTablePane getInstance() { if (THIS == null) { THIS = new PreviewTablePane(); @@ -87,91 +154,175 @@ public class PreviewTablePane extends BasicPane { private PreviewTablePane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); + // northPane + this.add(initNorthPane(), BorderLayout.NORTH); + // centerPane + this.add(initCenterPane(), BorderLayout.CENTER); + // dialog + initDialog(); + // progressBar + initProgressBar(); + } - // elalke:预览行数 - JPanel previewNumberPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - this.add(previewNumberPanel, BorderLayout.NORTH); + /** + * 初始化northPane + * + * @return + */ + private JComponent initNorthPane() { + JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + // 预览行数面板 + northPane.add(initPreviewNumberPane(), BorderLayout.CENTER); + // 脱敏预览设置面板 + northPane.add(initDesensitizationPane(), BorderLayout.EAST); + return northPane; + } + /** + * 初始化预览行数面板 + * + * @return + */ + private JComponent initPreviewNumberPane() { + JPanel previewNumberPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + // 当前行数 JPanel currentPreviewPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - previewNumberPanel.add(currentPreviewPanel); currentPreviewPanel.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Current_Preview_Rows") + ":")); - currentRowsField = new UINumberField(); currentPreviewPanel.add(currentRowsField); currentRowsField.setEditable(false); currentRowsField.setColumns(4); currentRowsField.setInteger(true); - + // 最大行数 JPanel maxPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - previewNumberPanel.add(maxPanel); maxPanel.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Datasource_Maximum_Number_of_Preview_Rows") + ":")); - maxPreviewNumberField = new UINumberField(); maxPanel.add(maxPreviewNumberField); maxPreviewNumberField.setColumns(4); maxPreviewNumberField.setInteger(true); - - DesignerEnvManager designerEnvManager = DesignerEnvManager.getEnvManager(); - maxPreviewNumberField.setValue(designerEnvManager.getMaxNumberOrPreviewRow()); - + maxPreviewNumberField.setValue(DesignerEnvManager.getEnvManager().getMaxNumberOrPreviewRow()); maxPreviewNumberField.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent evt) { DesignerEnvManager designerEnvManager = DesignerEnvManager.getEnvManager(); designerEnvManager.setMaxNumberOrPreviewRow((int) ((UINumberField) evt.getSource()).getValue()); } }); + // 刷新按钮 + initRefreshLabel(); - Icon refreshImage = BaseUtils.readIcon("/com/fr/design/images/control/refresh.png"); - refreshLabel = new UILabel(refreshImage); + previewNumberPanel.add(currentPreviewPanel); + previewNumberPanel.add(maxPanel); previewNumberPanel.add(refreshLabel); - refreshLabel.addMouseListener(new MouseAdapter() { - boolean mouseEntered = false; - boolean buttonPressed = false; - - public void mouseEntered(MouseEvent e) { // 当鼠标进入时候调用. - mouseEntered = true; - if (!buttonPressed) { - refreshLabel.setBackground(java.awt.Color.WHITE); - refreshLabel.setOpaque(true); - refreshLabel.setBorder(BorderFactory.createLineBorder(java.awt.Color.GRAY)); - } - } - - public void mouseExited(MouseEvent e) { - mouseEntered = false; - refreshLabel.setOpaque(false); - refreshLabel.setBorder(BorderFactory.createEmptyBorder()); - } + return previewNumberPanel; + } - public void mousePressed(MouseEvent e) { - buttonPressed = true; - refreshLabel.setBackground(java.awt.Color.lightGray); - } + private void initRefreshLabel() { + Icon refreshImage = IconUtils.readIcon("/com/fr/design/images/control/refresh"); + refreshLabel = new UILabel(refreshImage); + refreshLabel.addMouseListener(refreshLabelMouseAdapter); + } - public void mouseReleased(MouseEvent e) { - buttonPressed = false; - if (mouseEntered) { - refreshLabel.setBackground(java.awt.Color.WHITE); - try { - populate(tableData); - if (dataModel != null) { - setRowsLimitTableModel(); + /** + * 初始化脱敏设置面板 + * + * @return + */ + private JComponent initDesensitizationPane() { + JPanel desensitizationPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + // 初始化Label + desensitizationLabel = new UILabel(DATA_DESENSITIZATION_CONFIG); + desensitizationLabel.setForeground(UIConstants.NORMAL_BLUE); + desensitizationLabel.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + TableDataDesensitizationSettingPane settingPane = new TableDataDesensitizationSettingPane((DesensitizationTableData) tableData); + settingPane.populateBean((DesensitizationTableData) tableData); + BasicDialog dialog = settingPane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(PreviewTablePane.this), new DialogActionAdapter() { + @Override + public void doOk() { + // 保存脱敏规则配置 + settingPane.updateBean(); + // 改变模板保存状态 + JTemplate editingTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + if (Objects.nonNull(editingTemplate)) { + editingTemplate.fireTargetModified(true); } - } catch (Exception e1) { } - } + + @Override + public void doCancel() { + + } + }, BasicDialog.DEFAULT); + dialog.setVisible(true); + // 关闭预览页面 + PreviewTablePane.this.dialog.setVisible(false); } }); + // 初始化分隔符 + ToolBarDef toolbarDef = new ToolBarDef(); + toolbarDef.addShortCut(SeparatorDef.DEFAULT); + UIToolbar toolBar = ToolBarDef.createJToolBar(); + toolBar.setBorderPainted(false); + toolbarDef.updateToolBar(toolBar); + + // 初始化预览按钮 + UIToggleButton previewToggle = new UIToggleButton(new Icon[]{IconUtils.readIcon("/com/fr/design/images/m_file/preview"), IconUtils.readIcon("/com/fr/design/images/m_file/preview")}, true); + previewToggle.setToolTipText(Toolkit.i18nText("Fine-Design_Report_Desensitization_Preview")); + previewToggle.setSelected(false); + previewToggle.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + // 切换TableModel的脱敏状态 + togglePreviewTableModelDesensitizeStatus(); + // 刷新页面,展示 + refreshTable(); + } + }); + + desensitizationPane.add(desensitizationLabel); + desensitizationPane.add(toolBar); + desensitizationPane.add(previewToggle); + return desensitizationPane; + } + + /** + * 设置脱敏设置的个数 + * + * @param model + */ + private void setDesensitizationCount(TableModel model) { + if (isDesensitizeOpened()) { + int count = model instanceof DesensitizedPreviewTableModel ? ((DesensitizedPreviewTableModel) model).getDesensitizeColumnsCount() : 0; + desensitizationLabel.setText(DATA_DESENSITIZATION_CONFIG + LEFT_BRACKET + count + RIGHT_BRACKET + COUNT); + } else { + desensitizationLabel.setText(DATA_DESENSITIZATION_CONFIG); + } + } + + /** + * 初始化centerPane + * + * @return + */ + private JComponent initCenterPane() { preveiwTable = new CopyableJTable(new TableSorter()); preveiwTable.setRowSelectionAllowed(false); preveiwTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); + return new JScrollPane(preveiwTable); + } - this.add(new JScrollPane(preveiwTable), BorderLayout.CENTER); + private void initDialog() { if (this.dialog == null) { this.dialog = this.showWindow(new JFrame()); } + } + + private void initProgressBar() { progressBar = new AutoProgressBar(this, Toolkit.i18nText("Fine-Design_Basic_Loading_Data"), "", 0, 100) { + @Override public void doMonitorCanceled() { if (getWorker() != null) { getWorker().cancel(true); @@ -182,7 +333,7 @@ public class PreviewTablePane extends BasicPane { } public AutoProgressBar getProgressBar() { - return this.progressBar; + return PreviewTablePane.progressBar; } @Override @@ -223,9 +374,10 @@ public class PreviewTablePane extends BasicPane { } /** - * elake:为预览表的columnIndex列着色. - * @param columnIndex - * @param c + * 为预览表的columnIndex列着色. + * + * @param columnIndex 列索引值 + * @param c 颜色 */ private void setPreviewTableColumnColor(final int columnIndex, final Color c) { addLoadedListener(new LoadedEventListener() { @@ -233,6 +385,7 @@ public class PreviewTablePane extends BasicPane { public void fireLoaded() { TableColumn column = preveiwTable.getColumnModel().getColumn(columnIndex); DefaultTableCellRenderer cellRenderer = new DefaultTableCellRenderer() { + @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { JComponent comp = (JComponent) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); comp.setBackground(c); @@ -253,7 +406,7 @@ public class PreviewTablePane extends BasicPane { getInstance().preveiwTable = new SortableJTable(new TableSorter()); getInstance().preveiwTable.setRowSelectionAllowed(false); getInstance().preveiwTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); - getInstance().progressBar.close(); + PreviewTablePane.progressBar.close(); getInstance().repaint(); } @@ -335,6 +488,7 @@ public class PreviewTablePane extends BasicPane { private void previewTableDataSQL() throws Exception { connectionBar = new AutoProgressBar(this, Toolkit.i18nText("Fine-Design_Basic_Utils_Now_Create_Connection"), "", 0, 100) { + @Override public void doMonitorCanceled() { getWorker().cancel(true); getDialog().setVisible(false); @@ -349,42 +503,49 @@ public class PreviewTablePane extends BasicPane { private void setPreviewTableColumnValue(final Graphics g) { for (int i = 0; i < preveiwTable.getColumnModel().getColumnCount(); i++) { TableColumn column = preveiwTable.getColumnModel().getColumn(i); - DefaultTableCellRenderer cellRenderer = new DefaultTableCellRenderer() { - public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { - JComponent comp = (JComponent) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); - Font f = table.getFont(); - - //默认在系统不支持 无法显示时 如自造的字 ,字体设置为空. - Font defaultShowFont = FRFont.getInstance("", f.getStyle(), f.getSize()); - if (value instanceof String) { - String str = (String) value; - for (int j = 0; j < str.length(); j++) { - char c = str.charAt(j); - if (!f.canDisplay(c)) { - table.setFont(defaultShowFont); - } + DefaultTableCellRenderer cellRenderer = getDefaultTableCellRenderer(); + column.setCellRenderer(cellRenderer); + } + } + + /** + * 默认表格格子渲染器 + * + * @return + */ + private DefaultTableCellRenderer getDefaultTableCellRenderer() { + return new DefaultTableCellRenderer() { + @Override + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { + JComponent comp = (JComponent) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); + Font f = table.getFont(); + + //默认在系统不支持 无法显示时 如自造的字 ,字体设置为空. + Font defaultShowFont = FRFont.getInstance("", f.getStyle(), f.getSize()); + if (value instanceof String) { + String str = (String) value; + for (int j = 0; j < str.length(); j++) { + char c = str.charAt(j); + if (!f.canDisplay(c)) { + table.setFont(defaultShowFont); } } - return comp; } - }; - column.setCellRenderer(cellRenderer); - } + return comp; + } + }; } private void setWorker() { - worker = new SwingWorker() { - protected PreviewTableModel doInBackground() throws Exception { + worker = new SwingWorker() { + + @Override + protected TableModel doInBackground() throws Exception { connectionBar.start(); try { - if (tableData instanceof DBTableData) { - boolean status = DataOperator.getInstance().testConnection(((DBTableData) tableData).getDatabase()); - if (!status) { - throw new Exception(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed")); - } - } + testDBTableDataConnection(tableData); } finally { // 将close操作放到EDT线程中 UIUtil.invokeLaterIfNeeded(() -> connectionBar.close()); @@ -394,22 +555,20 @@ public class PreviewTablePane extends BasicPane { // parameterInputDialog // update之后的parameters,转成一个parameterMap,用于预览TableData PreviewTableModel previewModel = new PreviewTableModel(previewTableData.createDataModel(null), (int) maxPreviewNumberField.getValue()); - for (int i = 0; i < previewTableData.getColumnCount(); i++) { - Class cls = previewTableData.getColumnClass(i); - if (cls == Date.class || cls == TIME.class || cls == Timestamp.class) { - previewModel.dateIndexs.add(i); - } + if (TableDataPreviewDesensitizeManager.getInstance().needDesensitize(tableData)) { + // 数据集预览脱敏 + previewModel = TableDataPreviewDesensitizeManager.getInstance().desensitizeTableModel(tableData, previewModel); } + dealWithPreviewTableModelColumnClass(previewModel, previewTableData); return previewModel; } + @Override public void done() { try { - PreviewTableModel model = get(); - setModel(model); - setCurrentRows(model.getRowCount()); + TableModel model = get(); + setPreviewTableModel(model); setPreviewTableColumnValue(getParent().getGraphics()); - fireLoadedListener(); } catch (Exception e) { if (!(e instanceof CancellationException)) { FineLoggerFactory.getLogger().error(e.getMessage(), e); @@ -424,6 +583,36 @@ public class PreviewTablePane extends BasicPane { }; } + /** + * 检查DBTableData连接 + * + * @param tableData + * @throws Exception + */ + private void testDBTableDataConnection(TableData tableData) throws Exception { + if (tableData instanceof DBTableData) { + boolean status = DataOperator.getInstance().testConnection(((DBTableData) tableData).getDatabase()); + if (!status) { + throw new Exception(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed")); + } + } + } + + /** + * 处理预览Model的列类型 + * + * @param previewModel + * @param previewTableData + */ + private void dealWithPreviewTableModelColumnClass(PreviewTableModel previewModel, EmbeddedTableData previewTableData) { + for (int i = 0; i < previewTableData.getColumnCount(); i++) { + Class cls = previewTableData.getColumnClass(i); + if (cls == Date.class || cls == TIME.class || cls == Timestamp.class) { + previewModel.dateIndexs.add(i); + } + } + } + /** * 直接预览存储过程的一个返回数据集,没有实际值和显示值 * @@ -454,7 +643,7 @@ public class PreviewTablePane extends BasicPane { /** * 直接预览数据集的结果集 * - * @param dataModel 结果集 + * @param dataModel 结果集 * @param keyIndex * @param valueIndex */ @@ -532,9 +721,62 @@ public class PreviewTablePane extends BasicPane { } catch (Exception e) { previewModel = new PreviewTableModel((int) maxPreviewNumberField.getValue()); } - setModel(previewModel); - setCurrentRows(previewModel.getRowCount()); + setPreviewTableModel(previewModel); + + } + + /** + * 切换TableModel的展示状态 + */ + private void togglePreviewTableModelDesensitizeStatus() { + if (!isDesensitizeOpened()) { + // 未启用数据脱敏时,不需要切换 + return; + } + TableSorter tableSorter = (TableSorter) preveiwTable.getModel(); + TableModel originTableModel = tableSorter.getTableModel(); + if (originTableModel instanceof DesensitizedPreviewTableModel) { + ((DesensitizedPreviewTableModel) originTableModel).toggleNeedDesensite(); + } + } + + /** + * 刷新一下预览页面,用于切换脱敏和非脱敏时的显示 + */ + private void refreshTable() { + TableModel originTableModel = getCurrentTableModel(); + setPreviewTableModel(originTableModel); + } + + /** + * 获取当前的TableModel,已经除掉了TableSorter的包装 + * + * @return + */ + private TableModel getCurrentTableModel() { + TableSorter tableSorter = (TableSorter) preveiwTable.getModel(); + return tableSorter.getTableModel(); + } + + /** + * 设置预览TableModel + * + * @param previewTableModel + */ + private void setPreviewTableModel(TableModel previewTableModel) { + setDesensitizationCount(previewTableModel); + setModel(previewTableModel); + setCurrentRows(previewTableModel.getRowCount()); fireLoadedListener(); + } + /** + * 数据脱敏是否启用 + * + * @return + */ + private boolean isDesensitizeOpened() { + return tableData instanceof DesensitizationTableData && + ((DesensitizationTableData) tableData).getDesensitizationConfig().isDesensitizeOpened(); } } From 58ae83fdbbcc7d39834d74f32e029f1178e64221 Mon Sep 17 00:00:00 2001 From: "Coral.Chen" Date: Mon, 14 Nov 2022 15:45:31 +0800 Subject: [PATCH 172/310] =?UTF-8?q?REPORT-83625=20=E9=80=82=E9=85=8DBaseCr?= =?UTF-8?q?iteria=E5=9C=A8cbb=E4=B8=AD=E7=9A=84=E5=8C=85=E5=90=8D=E6=94=B9?= =?UTF-8?q?=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/loghandler/DesignerLogHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java index 621956ce6a..b36ca47294 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java @@ -1,6 +1,6 @@ package com.fr.design.mainframe.loghandler; -import com.finebi.cbb.base.tuple.Pair; +import com.fr.stable.collections.combination.Pair; import com.fr.base.BaseUtils; import com.fr.base.TRL; import com.fr.design.file.HistoryTemplateListCache; From 0ba7784424ff8d712b59cf861d8f7ae7acf31d3f Mon Sep 17 00:00:00 2001 From: "Coral.Chen" Date: Mon, 14 Nov 2022 15:52:59 +0800 Subject: [PATCH 173/310] =?UTF-8?q?REPORT-83625=20=E9=80=82=E9=85=8DBaseCr?= =?UTF-8?q?iteria=E5=9C=A8cbb=E4=B8=AD=E7=9A=84=E5=8C=85=E5=90=8D=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=20=E5=9B=9E=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/loghandler/DesignerLogHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java index b36ca47294..621956ce6a 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java @@ -1,6 +1,6 @@ package com.fr.design.mainframe.loghandler; -import com.fr.stable.collections.combination.Pair; +import com.finebi.cbb.base.tuple.Pair; import com.fr.base.BaseUtils; import com.fr.base.TRL; import com.fr.design.file.HistoryTemplateListCache; From 34f9aba6eb86c4b242c575de5ac192547e41a250 Mon Sep 17 00:00:00 2001 From: "Coral.Chen" Date: Mon, 14 Nov 2022 15:59:05 +0800 Subject: [PATCH 174/310] =?UTF-8?q?REPORT-83625=20=E9=80=82=E9=85=8DBaseCr?= =?UTF-8?q?iteria=E5=9C=A8cbb=E4=B8=AD=E7=9A=84=E5=8C=85=E5=90=8D=E6=94=B9?= =?UTF-8?q?=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/loghandler/DesignerLogHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java index 621956ce6a..b36ca47294 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java @@ -1,6 +1,6 @@ package com.fr.design.mainframe.loghandler; -import com.finebi.cbb.base.tuple.Pair; +import com.fr.stable.collections.combination.Pair; import com.fr.base.BaseUtils; import com.fr.base.TRL; import com.fr.design.file.HistoryTemplateListCache; From 56e2d9acbd75d23c2262ed33fd9e34aa321a3281 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 14 Nov 2022 16:57:18 +0800 Subject: [PATCH 175/310] =?UTF-8?q?REPORT-83391=20=E9=A1=B6=E9=83=A8?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF=E4=BD=93=E9=AA=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/topparam/MobileTopParamPane.java | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileTopParamPane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileTopParamPane.java index 7f19bd3683..34a5f9758b 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileTopParamPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileTopParamPane.java @@ -2,8 +2,12 @@ package com.fr.design.mainframe.mobile.ui.topparam; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; import com.fr.form.ui.mobile.impl.MobileTopParamStyle; import javax.swing.*; @@ -11,6 +15,13 @@ import java.awt.*; public class MobileTopParamPane extends BasicBeanPane { private UICheckBox autoCommitCheckBox; + private UISpinner maxDirectShowCountSpinner; + private UILabel showCountTextField; + private static final int MAX_VALUE = 4; + private static final int MIN_VALUE = 0; + private static final int DEFAULT_DIERTA = 1; + private static final int DEFAULT_VALUE = 0; + private static final int GAP = 2; public MobileTopParamPane() { this.init(); @@ -21,19 +32,29 @@ public class MobileTopParamPane extends BasicBeanPane { JPanel panel = FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Plugin-TopParam_Setting")); panel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); autoCommitCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Plugin-TopParam_AutoCommit"), true); - panel.add(autoCommitCheckBox); + maxDirectShowCountSpinner = new UISpinner(MIN_VALUE, MAX_VALUE, DEFAULT_DIERTA, DEFAULT_VALUE); + showCountTextField = new UILabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_Show_Count")); + Component[][] components = {{autoCommitCheckBox},{showCountTextField, maxDirectShowCountSpinner}}; + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double[] portRowSize = {p, p}; + double[] portColumnSize = {p, f}; + JPanel portComPane = TableLayoutHelper.createCommonTableLayoutPane(components, portRowSize, portColumnSize, GAP); + panel.add(portComPane); this.add(panel, BorderLayout.CENTER); } @Override public void populateBean(MobileTopParamStyle topParamStyle) { autoCommitCheckBox.setSelected(topParamStyle.isAutoCommit()); + maxDirectShowCountSpinner.setValue(topParamStyle.getMaxDirectShowCount()); } @Override public MobileTopParamStyle updateBean() { MobileTopParamStyle topParamStyle = new MobileTopParamStyle(); topParamStyle.setAutoCommit(autoCommitCheckBox.isSelected()); + topParamStyle.setMaxDirectShowCount((int) maxDirectShowCountSpinner.getValue()); return topParamStyle; } From 7a96c504410d4e1fa9fb8a8ba2da2c4a2343ab3e Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 14 Nov 2022 17:17:35 +0800 Subject: [PATCH 176/310] =?UTF-8?q?REPORT-83391=20=E9=A1=B6=E9=83=A8?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF=E4=BD=93=E9=AA=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=20=E4=BF=AE=E6=94=B9=E4=B8=8B=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/mobile/ui/topparam/MobileTopParamPane.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileTopParamPane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileTopParamPane.java index 34a5f9758b..c0fb6028ed 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileTopParamPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileTopParamPane.java @@ -37,10 +37,10 @@ public class MobileTopParamPane extends BasicBeanPane { Component[][] components = {{autoCommitCheckBox},{showCountTextField, maxDirectShowCountSpinner}}; double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double[] portRowSize = {p, p}; - double[] portColumnSize = {p, f}; - JPanel portComPane = TableLayoutHelper.createCommonTableLayoutPane(components, portRowSize, portColumnSize, GAP); - panel.add(portComPane); + double[] rowSize = {p, p}; + double[] columnSize = {p, f}; + JPanel paraPane = TableLayoutHelper.createCommonTableLayoutPane(components, rowSize, columnSize, GAP); + panel.add(paraPane); this.add(panel, BorderLayout.CENTER); } From 6c53a08939474a426042844e1612743d5d2f94c3 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 14 Nov 2022 17:24:46 +0800 Subject: [PATCH 177/310] =?UTF-8?q?REPORT-83391=20=E9=A1=B6=E9=83=A8?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF=E4=BD=93=E9=AA=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=20=E4=BF=AE=E6=94=B9.*=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/mobile/ui/topparam/MobileTopParamPane.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileTopParamPane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileTopParamPane.java index c0fb6028ed..f367365f75 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileTopParamPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileTopParamPane.java @@ -10,8 +10,10 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.form.ui.mobile.impl.MobileTopParamStyle; -import javax.swing.*; -import java.awt.*; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.FlowLayout; public class MobileTopParamPane extends BasicBeanPane { private UICheckBox autoCommitCheckBox; From a0d5a41d7dd4c82d0b992b5a3b9619821255b41e Mon Sep 17 00:00:00 2001 From: lucian Date: Mon, 14 Nov 2022 17:38:08 +0800 Subject: [PATCH 178/310] =?UTF-8?q?REPORT-84031=20=E5=A1=AB=E6=8A=A5-?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=A0=E9=99=A4=E8=A1=8C-&A1+=5F=E3=80=81?= =?UTF-8?q?=5F=E5=85=AC=E5=BC=8F=E5=9C=A8=E6=8F=92=E5=85=A5=E8=A1=8C?= =?UTF-8?q?=E5=90=8E=E6=97=A0=E6=B3=95=E9=87=8D=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/formula/FormulaPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java index d4737f084a..be1005574e 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java +++ b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java @@ -58,7 +58,7 @@ import com.fr.stable.EncodeConstants; import com.fr.stable.EssentialUtils; import com.fr.stable.ParameterProvider; import com.fr.stable.StringUtils; -import com.fr.stable.script.CRAddress; +import com.fr.parser.CRAddress; import com.fr.stable.script.ColumnRowRange; import com.fr.stable.script.Expression; import com.fr.stable.script.Node; From 2294d1532d66f14c7f4eba0741b06e3feb6183c1 Mon Sep 17 00:00:00 2001 From: Carlson Date: Mon, 14 Nov 2022 18:10:23 +0800 Subject: [PATCH 179/310] =?UTF-8?q?REPORT-82933=20fix:=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E5=90=8CpopulateBean?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chartx/component/correlation/AbstractCorrelationPane.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/correlation/AbstractCorrelationPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/correlation/AbstractCorrelationPane.java index 3371854a9d..195eb6085f 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/correlation/AbstractCorrelationPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/correlation/AbstractCorrelationPane.java @@ -129,7 +129,9 @@ public abstract class AbstractCorrelationPane extends BasicBeanPane { public void clearAllBoxList() { this.correlationPane.getTable().clear(); - this.correlationPane.getTable().updateUI(); + this.correlationPane.validate(); + this.correlationPane.repaint(); + this.correlationPane.revalidate(); } } From b3836e0a3994f1001f9898d7fea674f77ec5719a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvan-=E6=AC=A7=E9=98=B3=E5=B8=86?= Date: Tue, 15 Nov 2022 11:00:40 +0800 Subject: [PATCH 180/310] =?UTF-8?q?REPORT-75091=20-=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=84=B1=E6=95=8F=EF=BC=88=E6=8A=A5=E8=A1=A8=EF=BC=89=20?= =?UTF-8?q?=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E5=A4=84?= =?UTF-8?q?=E7=90=86=E6=96=B0=E5=A2=9E=E4=BB=A3=E7=A0=81=E8=A1=8C=E6=95=B0?= =?UTF-8?q?=E5=A4=AA=E5=A4=9A=E7=9A=84=E9=97=AE=E9=A2=98=20=E3=80=90?= =?UTF-8?q?=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E5=B0=86=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E7=9A=84UI=E9=9D=A2=E6=9D=BF=E6=8B=86=E5=87=BA?= =?UTF-8?q?=E6=9D=A5=20=E3=80=90review=E5=BB=BA=E8=AE=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datapane/preview/PreviewTablePane.java | 115 ++++++----------- .../view/PreviewTableDesensitizationPane.java | 120 ++++++++++++++++++ 2 files changed, 156 insertions(+), 79 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/PreviewTableDesensitizationPane.java diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java index 6859c77874..e4d1667405 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java @@ -12,10 +12,10 @@ import com.fr.data.impl.EmbeddedTableData; import com.fr.data.impl.NameDataModel; import com.fr.data.operator.DataOperator; import com.fr.design.DesignerEnvManager; -import com.fr.design.constants.UIConstants; import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.datapane.preview.desensitization.TableDataPreviewDesensitizeManager; import com.fr.design.data.datapane.preview.desensitization.model.DesensitizedPreviewTableModel; +import com.fr.design.data.datapane.preview.desensitization.view.PreviewTableDesensitizationPane; import com.fr.design.data.datapane.preview.desensitization.view.setting.TableDataDesensitizationSettingPane; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicPane; @@ -23,19 +23,15 @@ import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.frpane.UITabbedPane; -import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.iprogressbar.AutoProgressBar; import com.fr.design.gui.itable.SortableJTable; import com.fr.design.gui.itable.TableSorter; import com.fr.design.gui.itextfield.UINumberField; -import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; -import com.fr.design.menu.SeparatorDef; -import com.fr.design.menu.ToolBarDef; import com.fr.design.ui.util.UIUtil; import com.fr.function.TIME; import com.fr.general.FRFont; @@ -61,8 +57,6 @@ import java.awt.Color; import java.awt.Component; import java.awt.Font; import java.awt.Graphics; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.sql.Timestamp; @@ -77,11 +71,6 @@ import java.util.concurrent.CancellationException; */ public class PreviewTablePane extends BasicPane { - private static final String DATA_DESENSITIZATION_CONFIG = Toolkit.i18nText("Fine-Design_Report_Desensitization_Config"); - private static final String LEFT_BRACKET = "("; - private static final String RIGHT_BRACKET = ")"; - private static final String COUNT = Toolkit.i18nText("Fine-Design_Report_Desensitization_Count"); - private TableData tableData; private DataModel dataModel; private UINumberField maxPreviewNumberField; @@ -97,7 +86,7 @@ public class PreviewTablePane extends BasicPane { private static PreviewTablePane THIS; private EmbeddedTableData previewTableData; - private UILabel desensitizationLabel; + private PreviewTableDesensitizationPane desensitizationPane; /** * 用于refreshLabel的鼠标监听 @@ -201,12 +190,9 @@ public class PreviewTablePane extends BasicPane { maxPreviewNumberField.setColumns(4); maxPreviewNumberField.setInteger(true); maxPreviewNumberField.setValue(DesignerEnvManager.getEnvManager().getMaxNumberOrPreviewRow()); - maxPreviewNumberField.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent evt) { - DesignerEnvManager designerEnvManager = DesignerEnvManager.getEnvManager(); - designerEnvManager.setMaxNumberOrPreviewRow((int) ((UINumberField) evt.getSource()).getValue()); - } + maxPreviewNumberField.addActionListener(event -> { + DesignerEnvManager designerEnvManager = DesignerEnvManager.getEnvManager(); + designerEnvManager.setMaxNumberOrPreviewRow((int) ((UINumberField) event.getSource()).getValue()); }); // 刷新按钮 initRefreshLabel(); @@ -229,63 +215,36 @@ public class PreviewTablePane extends BasicPane { * @return */ private JComponent initDesensitizationPane() { - JPanel desensitizationPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - // 初始化Label - desensitizationLabel = new UILabel(DATA_DESENSITIZATION_CONFIG); - desensitizationLabel.setForeground(UIConstants.NORMAL_BLUE); - desensitizationLabel.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent e) { - TableDataDesensitizationSettingPane settingPane = new TableDataDesensitizationSettingPane((DesensitizationTableData) tableData); - settingPane.populateBean((DesensitizationTableData) tableData); - BasicDialog dialog = settingPane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(PreviewTablePane.this), new DialogActionAdapter() { - @Override - public void doOk() { - // 保存脱敏规则配置 - settingPane.updateBean(); - // 改变模板保存状态 - JTemplate editingTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - if (Objects.nonNull(editingTemplate)) { - editingTemplate.fireTargetModified(true); - } - } - - @Override - public void doCancel() { + desensitizationPane = new PreviewTableDesensitizationPane(this); + return desensitizationPane; + } - } - }, BasicDialog.DEFAULT); - dialog.setVisible(true); - // 关闭预览页面 - PreviewTablePane.this.dialog.setVisible(false); + /** + * 点击脱敏配置后的操作 + */ + public void clickDesensitizationLabel() { + TableDataDesensitizationSettingPane settingPane = new TableDataDesensitizationSettingPane((DesensitizationTableData) tableData); + settingPane.populateBean((DesensitizationTableData) tableData); + BasicDialog dialog = settingPane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(PreviewTablePane.this), new DialogActionAdapter() { + @Override + public void doOk() { + // 保存脱敏规则配置 + settingPane.updateBean(); + // 改变模板保存状态 + JTemplate editingTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + if (Objects.nonNull(editingTemplate)) { + editingTemplate.fireTargetModified(true); + } } - }); - // 初始化分隔符 - ToolBarDef toolbarDef = new ToolBarDef(); - toolbarDef.addShortCut(SeparatorDef.DEFAULT); - UIToolbar toolBar = ToolBarDef.createJToolBar(); - toolBar.setBorderPainted(false); - toolbarDef.updateToolBar(toolBar); - - // 初始化预览按钮 - UIToggleButton previewToggle = new UIToggleButton(new Icon[]{IconUtils.readIcon("/com/fr/design/images/m_file/preview"), IconUtils.readIcon("/com/fr/design/images/m_file/preview")}, true); - previewToggle.setToolTipText(Toolkit.i18nText("Fine-Design_Report_Desensitization_Preview")); - previewToggle.setSelected(false); - previewToggle.addActionListener(new ActionListener() { @Override - public void actionPerformed(ActionEvent e) { - // 切换TableModel的脱敏状态 - togglePreviewTableModelDesensitizeStatus(); - // 刷新页面,展示 - refreshTable(); - } - }); + public void doCancel() { - desensitizationPane.add(desensitizationLabel); - desensitizationPane.add(toolBar); - desensitizationPane.add(previewToggle); - return desensitizationPane; + } + }, BasicDialog.DEFAULT); + dialog.setVisible(true); + // 关闭预览页面 + PreviewTablePane.this.dialog.setVisible(false); } /** @@ -294,12 +253,10 @@ public class PreviewTablePane extends BasicPane { * @param model */ private void setDesensitizationCount(TableModel model) { - if (isDesensitizeOpened()) { - int count = model instanceof DesensitizedPreviewTableModel ? ((DesensitizedPreviewTableModel) model).getDesensitizeColumnsCount() : 0; - desensitizationLabel.setText(DATA_DESENSITIZATION_CONFIG + LEFT_BRACKET + count + RIGHT_BRACKET + COUNT); - } else { - desensitizationLabel.setText(DATA_DESENSITIZATION_CONFIG); - } + desensitizationPane.setDesensitizationCount(isDesensitizeOpened(), + model instanceof DesensitizedPreviewTableModel ? + ((DesensitizedPreviewTableModel) model).getDesensitizeColumnsCount() : + 0); } /** @@ -728,7 +685,7 @@ public class PreviewTablePane extends BasicPane { /** * 切换TableModel的展示状态 */ - private void togglePreviewTableModelDesensitizeStatus() { + public void togglePreviewTableModelDesensitizeStatus() { if (!isDesensitizeOpened()) { // 未启用数据脱敏时,不需要切换 return; @@ -743,7 +700,7 @@ public class PreviewTablePane extends BasicPane { /** * 刷新一下预览页面,用于切换脱敏和非脱敏时的显示 */ - private void refreshTable() { + public void refreshTable() { TableModel originTableModel = getCurrentTableModel(); setPreviewTableModel(originTableModel); } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/PreviewTableDesensitizationPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/PreviewTableDesensitizationPane.java new file mode 100644 index 0000000000..1bf150dd51 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/PreviewTableDesensitizationPane.java @@ -0,0 +1,120 @@ +package com.fr.design.data.datapane.preview.desensitization.view; + +import com.fr.base.svg.IconUtils; +import com.fr.design.constants.UIConstants; +import com.fr.design.data.datapane.preview.PreviewTablePane; +import com.fr.design.gui.ibutton.UIToggleButton; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itoolbar.UIToolbar; +import com.fr.design.i18n.Toolkit; +import com.fr.design.menu.SeparatorDef; +import com.fr.design.menu.ToolBarDef; + +import javax.swing.Icon; +import javax.swing.JPanel; +import java.awt.Component; +import java.awt.FlowLayout; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +/** + * 数据集预览-脱敏配置面板,主要展示当前脱敏开启状态、当前脱敏设定数量等 + * + * @author Yvan + * @version 11.0 + * Created by Yvan on 2022/11/14 + */ +public class PreviewTableDesensitizationPane extends JPanel { + + private static final String DATA_DESENSITIZATION_CONFIG = Toolkit.i18nText("Fine-Design_Report_Desensitization_Config"); + private static final String LEFT_BRACKET = "("; + private static final String RIGHT_BRACKET = ")"; + private static final String COUNT = Toolkit.i18nText("Fine-Design_Report_Desensitization_Count"); + + /** + * 预览面板 + */ + private PreviewTablePane previewTablePane; + + /** + * "数据脱敏设置"-标签 + */ + private UILabel desensitizationLabel; + + /** + * 脱敏效果预览按钮 + */ + private UIToggleButton previewToggle; + + + public PreviewTableDesensitizationPane(PreviewTablePane previewTablePane) { + this.previewTablePane = previewTablePane; + initComponents(); + } + + /** + * 初始化面板 + */ + private void initComponents() { + this.setLayout(new FlowLayout(FlowLayout.LEFT)); + this.add(initDesensitizationLabel()); + this.add(initToolBar()); + this.add(initPreviewButton()); + } + + /** + * 初始化Label + * + * @return + */ + private Component initDesensitizationLabel() { + // 初始化Label + desensitizationLabel = new UILabel(DATA_DESENSITIZATION_CONFIG); + desensitizationLabel.setForeground(UIConstants.NORMAL_BLUE); + desensitizationLabel.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + previewTablePane.clickDesensitizationLabel(); + } + }); + return desensitizationLabel; + } + + /** + * 初始化分隔符 + * + * @return + */ + private UIToolbar initToolBar() { + ToolBarDef toolbarDef = new ToolBarDef(); + toolbarDef.addShortCut(SeparatorDef.DEFAULT); + UIToolbar toolBar = ToolBarDef.createJToolBar(); + toolBar.setBorderPainted(false); + toolbarDef.updateToolBar(toolBar); + return toolBar; + } + + /** + * 初始化脱敏效果预览按钮 + * + * @return + */ + private UIToggleButton initPreviewButton() { + previewToggle = new UIToggleButton(new Icon[]{IconUtils.readIcon("/com/fr/design/images/m_file/preview"), IconUtils.readIcon("/com/fr/design/images/m_file/preview")}, true); + previewToggle.setToolTipText(Toolkit.i18nText("Fine-Design_Report_Desensitization_Preview")); + previewToggle.setSelected(false); + previewToggle.addActionListener(e -> { + // 切换TableModel的脱敏状态 + previewTablePane.togglePreviewTableModelDesensitizeStatus(); + // 刷新预览页面,展示 + previewTablePane.refreshTable(); + }); + return previewToggle; + } + + public void setDesensitizationCount(boolean desensitizeOpen, int count) { + desensitizationLabel.setText(desensitizeOpen ? + DATA_DESENSITIZATION_CONFIG + LEFT_BRACKET + count + RIGHT_BRACKET + COUNT : + DATA_DESENSITIZATION_CONFIG); + } +} From 0c28b413e0945ca193e0a87d71825def65f1daff Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 15 Nov 2022 15:48:15 +0800 Subject: [PATCH 181/310] =?UTF-8?q?REPORT-83483=20FVS=E5=86=85=E7=BD=AE?= =?UTF-8?q?=E7=B4=A0=E6=9D=90=E6=96=B0=E5=A2=9E=E5=95=86=E7=94=A8=E5=85=8D?= =?UTF-8?q?=E8=B4=B9=E5=AD=97=E4=BD=93=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/fun/DefaultValueAdjustProvider.java | 9 +++++++++ .../com/fr/design/gui/style/ComponentTitleStylePane.java | 3 ++- .../main/java/com/fr/design/gui/style/FRFontPane.java | 3 ++- .../ui/SidebarMobileBookMarkStyleCustomDefinePane.java | 5 +++-- .../fr/design/mainframe/mobile/utils/FontConfigPane.java | 3 ++- .../design/mainframe/theme/edit/chart/ChartFontPane.java | 3 ++- .../design/mainframe/widget/MobileTabFontConfPane.java | 3 ++- .../main/java/com/fr/design/style/FontFamilyPane.java | 3 ++- .../src/main/java/com/fr/design/utils/DesignUtils.java | 9 +++++++++ .../com/fr/design/chart/axis/ChartAlertValuePane.java | 3 ++- .../chart/series/SeriesCondition/DataLabelStylePane.java | 3 ++- .../mainframe/chart/gui/style/ChartTextAttrPane.java | 3 ++- .../style/background/VanChartAlertValuePane.java | 3 ++- .../designer/style/VanChartWordCloudSeriesPane.java | 3 ++- .../com/fr/design/gui/xpane/CardTagLayoutBorderPane.java | 3 ++- .../java/com/fr/design/gui/xpane/LayoutBorderPane.java | 3 ++- .../design/actions/cell/style/ReportFontNameAction.java | 3 ++- .../java/com/fr/design/cell/editor/RichTextToolBar.java | 3 ++- 18 files changed, 51 insertions(+), 17 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/fun/DefaultValueAdjustProvider.java b/designer-base/src/main/java/com/fr/design/fun/DefaultValueAdjustProvider.java index 0a93616293..1e553735dd 100644 --- a/designer-base/src/main/java/com/fr/design/fun/DefaultValueAdjustProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/DefaultValueAdjustProvider.java @@ -1,5 +1,6 @@ package com.fr.design.fun; +import com.fr.base.Utils; import com.fr.base.chart.BaseChartCollection; import com.fr.chartx.attr.ChartProvider; import com.fr.general.FRFont; @@ -53,4 +54,12 @@ public interface DefaultValueAdjustProvider extends Selectable { */ Font transformFontByResolution(FRFont font, int resolution); + /** + * 修改设计可用字体默认列表 + * @return + */ + default String[] getAvailableFontFamilyNames4Report() { + return Utils.getAvailableFontFamilyNames4Report(); + } + } diff --git a/designer-base/src/main/java/com/fr/design/gui/style/ComponentTitleStylePane.java b/designer-base/src/main/java/com/fr/design/gui/style/ComponentTitleStylePane.java index 33af029ad6..1f2fb91b82 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/ComponentTitleStylePane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/ComponentTitleStylePane.java @@ -12,6 +12,7 @@ import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.utils.DesignUtils; import com.fr.design.widget.FRWidgetFactory; import com.fr.form.ui.LayoutBorderStyle; import com.fr.form.ui.WidgetTitle; @@ -90,7 +91,7 @@ public class ComponentTitleStylePane extends AbstractBorderPackerPane { textContentPane = new TinyFormulaPane(); - fontFamilyComboBox = new UIComboBox(Utils.getAvailableFontFamilyNames4Report()); + fontFamilyComboBox = new UIComboBox(DesignUtils.getAvailableFontFamilyNames4Report()); FRFont frFont = DEFAULT_TITLE_PACKER.getFrFont(); if (frFont != null) { String fontFamily = frFont.getFamily(); diff --git a/designer-base/src/main/java/com/fr/design/gui/style/FRFontPane.java b/designer-base/src/main/java/com/fr/design/gui/style/FRFontPane.java index f806ded065..8af5c08d40 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/FRFontPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/FRFontPane.java @@ -18,6 +18,7 @@ import com.fr.design.gui.icombobox.LineComboBox; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; import com.fr.general.DefaultValues; @@ -246,7 +247,7 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse protected void initComponents() { fontSizeStyleComboBox = new UIComboBox(fontSizeStyles); - fontNameComboBox = new UIComboBox(Utils.getAvailableFontFamilyNames4Report()); + fontNameComboBox = new UIComboBox(DesignUtils.getAvailableFontFamilyNames4Report()); fontNameComboBox.setPreferredSize(new Dimension(144, 20)); fontSizeComboBox = new UIComboBox(getFontSizes()); fontSizeComboBox.setEditable(true); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SidebarMobileBookMarkStyleCustomDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SidebarMobileBookMarkStyleCustomDefinePane.java index ae79160bbd..0ed58fa351 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SidebarMobileBookMarkStyleCustomDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SidebarMobileBookMarkStyleCustomDefinePane.java @@ -17,6 +17,7 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.style.color.ColorSelectBox; +import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.ui.mobile.MobileBookMarkStyle; import com.fr.form.ui.mobile.impl.SidebarMobileBookMarkStyle; @@ -161,7 +162,7 @@ public class SidebarMobileBookMarkStyleCustomDefinePane extends BasicBeanPane integerList = new Vector<>(); for (int i = 1; i < 100; i++) { integerList.add(i); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartFontPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartFontPane.java index 2b19b232e3..a70870a61b 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartFontPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartFontPane.java @@ -13,6 +13,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.FRFont; import com.fr.general.GeneralUtils; @@ -52,7 +53,7 @@ public class ChartFontPane extends BasicPane { } private void initState() { - fontNameComboBox = new UIComboBox(Utils.getAvailableFontFamilyNames4Report()); + fontNameComboBox = new UIComboBox(DesignUtils.getAvailableFontFamilyNames4Report()); fontSizeComboBox = new UIComboBox(FONT_SIZES); bold = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png")); italic = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png")); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/widget/MobileTabFontConfPane.java b/designer-base/src/main/java/com/fr/design/mainframe/widget/MobileTabFontConfPane.java index b4d678f985..8f10d21020 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/widget/MobileTabFontConfPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/widget/MobileTabFontConfPane.java @@ -5,6 +5,7 @@ import com.fr.base.Utils; import com.fr.design.gui.ibutton.UIColorButton; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.utils.DesignUtils; import com.fr.general.FRFont; import javax.swing.Icon; @@ -38,7 +39,7 @@ public class MobileTabFontConfPane extends JPanel { private void init() { this.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 0)); - fontFamily = new UIComboBox(Utils.getAvailableFontFamilyNames4Report()); + fontFamily = new UIComboBox(DesignUtils.getAvailableFontFamilyNames4Report()); Vector integerList = new Vector(); for (int i = 1; i < 100; i++) { integerList.add(i); diff --git a/designer-base/src/main/java/com/fr/design/style/FontFamilyPane.java b/designer-base/src/main/java/com/fr/design/style/FontFamilyPane.java index 37076c66fb..ba496ae138 100644 --- a/designer-base/src/main/java/com/fr/design/style/FontFamilyPane.java +++ b/designer-base/src/main/java/com/fr/design/style/FontFamilyPane.java @@ -3,6 +3,7 @@ package com.fr.design.style; import com.fr.base.Utils; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.FRFont; @@ -26,7 +27,7 @@ public class FontFamilyPane extends JPanel { familyField = new UITextField(); familyField.setEditable(false); - familyList = new JList(Utils.getAvailableFontFamilyNames4Report()); + familyList = new JList(DesignUtils.getAvailableFontFamilyNames4Report()); familyList.setVisibleRowCount(4); familyList.addListSelectionListener(listener); diff --git a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java index dfeeacc608..dd7aaf3fcb 100644 --- a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java @@ -2,6 +2,7 @@ package com.fr.design.utils; import com.fr.base.FeedBackInfo; import com.fr.base.ServerConfig; +import com.fr.base.Utils; import com.fr.concurrent.NamedThreadFactory; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; @@ -481,4 +482,12 @@ public class DesignUtils { return null; } + public static String[] getAvailableFontFamilyNames4Report() { + DefaultValueAdjustProvider valueAdjust = DesignUtils.getValueAdjust(); + if (valueAdjust != null) { + return valueAdjust.getAvailableFontFamilyNames4Report(); + } + return Utils.getAvailableFontFamilyNames4Report(); + } + } diff --git a/designer-chart/src/main/java/com/fr/design/chart/axis/ChartAlertValuePane.java b/designer-chart/src/main/java/com/fr/design/chart/axis/ChartAlertValuePane.java index d0244cebab..59250c9725 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/axis/ChartAlertValuePane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/axis/ChartAlertValuePane.java @@ -18,6 +18,7 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.style.AlphaPane; import com.fr.design.style.FRFontPane; import com.fr.design.style.color.ColorSelectBox; +import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.FRFont; @@ -114,7 +115,7 @@ public class ChartAlertValuePane extends BasicBeanPane { fontNameBox.setPreferredSize(new Dimension(80,20)); fontNameBox.addItem("SimSun"); // TODO 这边字体中没有在列表内 - String[] names = Utils.getAvailableFontFamilyNames4Report(); + String[] names = DesignUtils.getAvailableFontFamilyNames4Report(); for(int i = 0; i < names.length; i++) { fontNameBox.addItem(names[i]); } diff --git a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/DataLabelStylePane.java b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/DataLabelStylePane.java index a2047b4e1c..c2036b7292 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/DataLabelStylePane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/DataLabelStylePane.java @@ -9,6 +9,7 @@ import com.fr.chart.base.TextAttr; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.dialog.BasicPane; +import com.fr.design.utils.DesignUtils; import com.fr.general.FRFont; import com.fr.design.style.FRFontPane; @@ -36,7 +37,7 @@ public class DataLabelStylePane extends BasicPane { private void initPane(boolean isSurpportFontColor) { this.setLayout(FRGUIPaneFactory.createBoxFlowLayout()); - this.add(nameBox = new UIComboBox(Utils.getAvailableFontFamilyNames4Report())); + this.add(nameBox = new UIComboBox(DesignUtils.getAvailableFontFamilyNames4Report())); nameBox.setPreferredSize(new Dimension(80, 20)); String[] styles = { diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java index 5a15bc1720..63b259e7aa 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java @@ -14,6 +14,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.mainframe.chart.mode.ChartEditContext; +import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.FRFont; import com.fr.general.GeneralUtils; @@ -190,7 +191,7 @@ public class ChartTextAttrPane extends BasicPane { } protected void initState() { - fontNameComboBox = new UIComboBox(Utils.getAvailableFontFamilyNames4Report()); + fontNameComboBox = new UIComboBox(DesignUtils.getAvailableFontFamilyNames4Report()); fontSizeComboBox = new UIComboBox(getFontSizeComboBoxModel()); bold = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png")); italic = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png")); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java index 387d974d28..49e7f3fa99 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java @@ -17,6 +17,7 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.style.color.ColorSelectBox; +import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.FRFont; import com.fr.general.GeneralUtils; @@ -99,7 +100,7 @@ public class VanChartAlertValuePane extends BasicBeanPane { alertText.setPreferredSize(new Dimension(TEXT_WD, HT)); fontSize = new UIComboBox(FRFontPane.FONT_SIZES); - fontName = new UIComboBox(Utils.getAvailableFontFamilyNames4Report()); + fontName = new UIComboBox(DesignUtils.getAvailableFontFamilyNames4Report()); fontColor = new ColorSelectBox(100); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudSeriesPane.java index 543b8139f6..29624a5867 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudSeriesPane.java @@ -14,6 +14,7 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.backgroundpane.ImageBackgroundQuickPane; import com.fr.design.mainframe.chart.gui.ChartStylePane; +import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.FRFont; import com.fr.general.IOUtils; @@ -94,7 +95,7 @@ public class VanChartWordCloudSeriesPane extends VanChartColorValueSeriesPane { double[] northC = {f, e}; double[] northR = {p, p}; - fontNameComboBox = new UIComboBox(Utils.getAvailableFontFamilyNames4Report()); + fontNameComboBox = new UIComboBox(DesignUtils.getAvailableFontFamilyNames4Report()); defineFontSize = new UIButtonGroup(new String[]{AUTO_FONT_SIZE, CUSTOM_FONT_SIZE}); Component[][] northComps = new Component[][]{ new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font")), fontNameComboBox}, diff --git a/designer-form/src/main/java/com/fr/design/gui/xpane/CardTagLayoutBorderPane.java b/designer-form/src/main/java/com/fr/design/gui/xpane/CardTagLayoutBorderPane.java index fd0507c812..4d9d104abb 100644 --- a/designer-form/src/main/java/com/fr/design/gui/xpane/CardTagLayoutBorderPane.java +++ b/designer-form/src/main/java/com/fr/design/gui/xpane/CardTagLayoutBorderPane.java @@ -12,6 +12,7 @@ import com.fr.design.gui.style.FRFontPane; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.ui.LayoutBorderStyle; @@ -32,7 +33,7 @@ public class CardTagLayoutBorderPane extends LayoutBorderPane { protected UIScrollPane initRightBottomPane(){ this.setFontSizeComboBox(new UIComboBox(FRFontPane.FONT_SIZES)); - this.setFontNameComboBox(new UIComboBox(Utils.getAvailableFontFamilyNames4Report())); + this.setFontNameComboBox(new UIComboBox(DesignUtils.getAvailableFontFamilyNames4Report())); JPanel fontSizeTypePane = new JPanel(new BorderLayout(10,0)); fontSizeTypePane.add(this.getFontSizeComboBox(), BorderLayout.CENTER); fontSizeTypePane.add(this.getFontNameComboBox(), BorderLayout.EAST); diff --git a/designer-form/src/main/java/com/fr/design/gui/xpane/LayoutBorderPane.java b/designer-form/src/main/java/com/fr/design/gui/xpane/LayoutBorderPane.java index 7a00075d61..5294687e33 100644 --- a/designer-form/src/main/java/com/fr/design/gui/xpane/LayoutBorderPane.java +++ b/designer-form/src/main/java/com/fr/design/gui/xpane/LayoutBorderPane.java @@ -33,6 +33,7 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.VerticalFlowLayout; import com.fr.design.mainframe.JForm; import com.fr.design.mainframe.JTemplate; +import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.ui.LayoutBorderStyle; import com.fr.form.ui.WidgetTitle; @@ -437,7 +438,7 @@ public class LayoutBorderPane extends BasicPane { protected UIScrollPane initRightBottomPane(){ formulaPane = new TinyFormulaPane(); fontSizeComboBox = new UIComboBox(FRFontPane.FONT_SIZES); - fontNameComboBox = new UIComboBox(Utils.getAvailableFontFamilyNames4Report()); + fontNameComboBox = new UIComboBox(DesignUtils.getAvailableFontFamilyNames4Report()); fontNameComboBox.setPreferredSize(new Dimension(160, 30)); JPanel fontSizeTypePane = new JPanel(new BorderLayout(10,0)); fontSizeTypePane.add(fontSizeComboBox, BorderLayout.CENTER); diff --git a/designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontNameAction.java b/designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontNameAction.java index 5023e6f4f1..2b423e0ab0 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontNameAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontNameAction.java @@ -3,6 +3,7 @@ */ package com.fr.design.actions.cell.style; +import com.fr.design.utils.DesignUtils; import com.fr.stable.os.OperatingSystem; import java.awt.Dimension; @@ -80,7 +81,7 @@ public class ReportFontNameAction extends AbstractStyleAction { public JComponent createToolBarComponent() { Object object = this.getValue(UIComboBox.class.getName()); if (object == null || !(object instanceof UIComboBox)) { - UIComboBox itemComponent = new UIComboBox(Utils.getAvailableFontFamilyNames4Report()); + UIComboBox itemComponent = new UIComboBox(DesignUtils.getAvailableFontFamilyNames4Report()); this.putValue(UIComboBox.class.getName(), itemComponent); //设置最佳宽度. itemComponent.setPreferredSize(new Dimension( diff --git a/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java b/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java index ebaf13b7f8..0a5a93602d 100644 --- a/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java +++ b/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java @@ -21,6 +21,7 @@ import com.fr.design.mainframe.DesignerContext; import com.fr.design.report.RichTextEditingPane; import com.fr.design.style.color.UIToolbarColorButton; import com.fr.design.utils.DesignUtils; +import com.fr.design.utils.DesignUtils; import com.fr.general.FRFont; import com.fr.log.FineLoggerFactory; import com.fr.report.cell.cellattr.core.RichTextConverter; @@ -104,7 +105,7 @@ public class RichTextToolBar extends BasicPane { } private void initAllButton() { - fontNameComboBox = new UIComboBox(Utils.getAvailableFontFamilyNames4Report()); + fontNameComboBox = new UIComboBox(DesignUtils.getAvailableFontFamilyNames4Report()); fontNameComboBox.setPreferredSize(new Dimension(144, 20)); fontSizeComboBox = new UIComboBox(FRFontPane.getFontSizes()); colorSelectPane = new UIToolbarColorButton(BaseUtils.readIcon("/com/fr/design/images/gui/color/foreground.png")); From 74b88a3cae195c98b73fa685612e3687baee6de8 Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 15 Nov 2022 18:19:04 +0800 Subject: [PATCH 182/310] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/utils/DesignUtils.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java index dd7aaf3fcb..4779f91916 100644 --- a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java @@ -482,6 +482,10 @@ public class DesignUtils { return null; } + /** + * 获取设计器可用字体 + * @return + */ public static String[] getAvailableFontFamilyNames4Report() { DefaultValueAdjustProvider valueAdjust = DesignUtils.getValueAdjust(); if (valueAdjust != null) { From 0fbd8b0c6bb88422991de31f81f694592595d716 Mon Sep 17 00:00:00 2001 From: Harrison Date: Tue, 15 Nov 2022 20:03:33 +0800 Subject: [PATCH 183/310] =?UTF-8?q?REPORT-83197=E3=80=90=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E3=80=91=E5=90=AF=E5=8A=A8=E9=A1=B5=E6=80=A7=E8=83=BD?= =?UTF-8?q?=E4=BC=98=E5=8C=96=201=E3=80=81DesignerEnvManager=20=E5=BC=82?= =?UTF-8?q?=E6=AD=A5=E5=8A=A0=E8=BD=BD=202=E3=80=81=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96,=20?= =?UTF-8?q?=E6=94=B9=E6=88=90=E5=BC=82=E6=AD=A5=203=E3=80=81=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E9=A1=B5=E5=90=AF=E5=8A=A8=E6=97=B6=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E5=8F=98=E5=8C=96=204=E3=80=81=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E5=BC=82=E6=AD=A5=E9=9D=A2=E6=9D=BF=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/DesignerEnvManager.java | 292 +++++++++++++++--- .../fr/design/actions/core/ActionFactory.java | 40 ++- .../env/LocalDesignerWorkspaceInfo.java | 7 + .../main/java/com/fr/start/BaseDesigner.java | 3 +- .../fr/start/common/DesignerStartupPool.java | 21 +- .../fr/startup/ui/StartupLoadingPanel.java | 113 +++++++ .../com/fr/startup/ui/StartupPageWindow.java | 87 +++--- .../main/java/com/fr/start/MainDesigner.java | 30 +- .../fr/start/module/DesignerActivator.java | 39 ++- .../com/fr/start/module/DesignerStartup.java | 2 +- .../DesignerStartupPageActivator.java | 54 +++- .../com/fr/start/preload/PreLoadService.java | 20 +- 12 files changed, 566 insertions(+), 142 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/startup/ui/StartupLoadingPanel.java diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index f7bff1f5b5..b4a9f5934f 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -5,6 +5,7 @@ package com.fr.design; import com.fr.base.BaseXMLUtils; import com.fr.base.Utils; +import com.fr.collections.api.Callback; import com.fr.design.actions.help.alphafine.AlphaFineConfigManager; import com.fr.design.carton.SwitchForSwingChecker; import com.fr.design.constants.UIConstants; @@ -21,8 +22,8 @@ import com.fr.design.locale.impl.ProductImproveMark; import com.fr.design.login.DesignerLoginType; import com.fr.design.login.config.DesignerLoginConfigManager; import com.fr.design.mainframe.ComponentReuseNotifyUtil; -import com.fr.design.mainframe.simple.SimpleDesignerConfig; import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo; +import com.fr.design.mainframe.simple.SimpleDesignerConfig; import com.fr.design.mainframe.vcs.VcsConfigManager; import com.fr.design.notification.SnapChatConfig; import com.fr.design.os.impl.SupportOSImpl; @@ -41,6 +42,12 @@ import com.fr.general.SupportLocale; import com.fr.general.locale.LocaleCenter; import com.fr.general.locale.LocaleMark; import com.fr.general.xml.GeneralXMLTools; +import com.fr.general.xml.async.AsyncXmlElement; +import com.fr.general.xml.async.AsyncXmlReadable; +import com.fr.general.xml.async.SimpleXmlElement; +import com.fr.general.xml.async.XmlElement; +import com.fr.general.xml.async.XmlException; +import com.fr.general.xml.async.XmlInitialFactory; import com.fr.log.FineLoggerFactory; import com.fr.log.LogHandler; import com.fr.stable.CommonUtils; @@ -58,8 +65,10 @@ import com.fr.stable.xml.XMLTools; import com.fr.stable.xml.XMLWriter; import com.fr.stable.xml.XMLableReader; import com.fr.start.common.DesignerStartupConfig; +import com.fr.start.common.DesignerStartupPool; import com.fr.third.apache.logging.log4j.core.appender.FileAppender; import com.fr.third.apache.logging.log4j.core.layout.PatternLayout; +import com.fr.third.org.apache.commons.io.FileUtils; import com.fr.third.org.apache.commons.io.FilenameUtils; import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContextCallback; @@ -90,8 +99,8 @@ import java.util.Map.Entry; /** * The manager of Designer GUI. */ -public class DesignerEnvManager implements XMLReadable, XMLWriter { - +public class DesignerEnvManager implements XMLReadable, XMLWriter, AsyncXmlReadable { + private static final int MAX_SHOW_NUM = 10; private static final String VERSION_80 = "80"; private static final String VERSION_90 = "90"; @@ -104,21 +113,26 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { * 指定默认工作空间 */ public static final String DEFAULT_WORKSPACE_PATH = "fr.designer.workspace.default"; - + + public static final String LAST_EAST_REGION_LAYOUT = "LastEastRegionLayout"; + public static final String LAST_WEST_REGION_LAYOUT = "LastWestRegionLayout"; + private static DesignerEnvManager designerEnvManager; // gui. private String activationKey = null; private String logLocation = null; private Rectangle windowBounds = null; // window bounds. private String DialogCurrentDirectory = null; private String CurrentDirectoryPrefix = null; + private Map> recentOpenedFileListMap = new HashMap<>(); private List tempRecentOpenedFilePathList = new ArrayList(); + private XmlElement>> recentOpenedMapping = SimpleXmlElement.of(recentOpenedFileListMap); + private boolean showPaintToolBar = true; private int maxNumberOrPreviewRow = 200; - // name和Env的键值对 - private Map nameEnvMap = new ListMap<>(); - // marks: 当前报表服务器名字 - private String curEnvName = null; + + private XmlElement envConfig = SimpleXmlElement.of(new EnvConfiguration()); + private boolean showProjectPane = true; private boolean showDataPane = true; //p:这是当前选择的数据库连接的名字,这个在新建数据源的时候用到. @@ -181,7 +195,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { /** * alphafine */ - private AlphaFineConfigManager alphaFineConfigManager = AlphaFineConfigManager.getInstance(); + private XmlElement alphaFineConfigManager; /** * 阅后即焚的配置项 @@ -230,7 +244,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { private boolean propertiesUsable; - private SimpleDesignerConfig fvsDesignerConfig = SimpleDesignerConfig.getInstance("FvsDesignerConfig"); + private XmlElement fvsDesignerConfig = SimpleXmlElement.of(SimpleDesignerConfig.getInstance("FvsDesignerConfig")); /** * DesignerEnvManager. @@ -245,12 +259,18 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { //REPORT-15332有一个国际化调用比较早,需要在这边就设置好locale,由于后台GeneralContext默认是China GeneralContext.setLocale(designerEnvManager.getLanguage()); try { - XMLTools.readFileXML(designerEnvManager, designerEnvManager.getDesignerEnvFile()); - } catch (FileNotFoundException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - XmlHandler.Self.handle(e); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); + designerEnvManager.initElements(designerEnvManager.getDesignerEnvFile()); + } catch (Exception retryEx) { + FineLoggerFactory.getLogger().debug("try async init DesignerEnvManager failed", retryEx); + + try { + XMLTools.readFileXML(designerEnvManager, designerEnvManager.getDesignerEnvFile()); + } catch (FileNotFoundException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + XmlHandler.Self.handle(e); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } } // james:如果没有env定义,要设置一个默认的 @@ -273,7 +293,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { } public static void checkNameEnvMap() { - if (designerEnvManager == null || designerEnvManager.nameEnvMap.size() > 0) { + + if (designerEnvManager == null || designerEnvManager.getNameEnvMap().size() > 0) { return; } String installHome = StableUtils.getInstallHome(); @@ -443,8 +464,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { FineLoggerFactory.getLogger().error(e.getMessage(), e); } // 清空前一个版本中的工作目录和最近打开 - nameEnvMap = new ListMap(); - curEnvName = null; + getEnvConfig().setNameEnvMap(new ListMap<>()); + getEnvConfig().setCurEnvName(null); designerEnvManager.saveXMLFile(); } @@ -606,7 +627,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { String installHome = StableUtils.getInstallHome(); String defaultenvPath = getDefaultenvPath(installHome); defaultenvPath = new File(defaultenvPath).getPath(); - Iterator> entryIt = nameEnvMap.entrySet().iterator(); + Iterator> entryIt = getNameEnvMap().entrySet().iterator(); while (entryIt.hasNext()) { Entry entry = entryIt.next(); DesignerWorkspaceInfo env = entry.getValue(); @@ -627,8 +648,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { String installHome = StableUtils.getInstallHome(); String defaultenvPath = getDefaultenvPath(installHome); defaultenvPath = new File(defaultenvPath).getPath(); - if (nameEnvMap.size() >= 0) { - Iterator> entryIt = nameEnvMap.entrySet().iterator(); + if (getNameEnvMap().size() >= 0) { + Iterator> entryIt = getNameEnvMap().entrySet().iterator(); while (entryIt.hasNext()) { Entry entry = entryIt.next(); DesignerWorkspaceInfo env = entry.getValue(); @@ -1019,21 +1040,21 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { } public SimpleDesignerConfig getFvsDesignerConfig() { - return fvsDesignerConfig; + return fvsDesignerConfig.getValue(); } /** * 返回环境名称迭代器 */ public Iterator getEnvNameIterator() { - return this.nameEnvMap.keySet().iterator(); + return this.getNameEnvMap().keySet().iterator(); } /** * 根据名称返回环境 */ public DesignerWorkspaceInfo getWorkspaceInfo(String name) { - return this.nameEnvMap.get(name); + return this.getNameEnvMap().get(name); } /** @@ -1044,7 +1065,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { */ public void putEnv(String name, DesignerWorkspaceInfo info) { - this.nameEnvMap.put(name, info); + this.getNameEnvMap().put(name, info); } /** @@ -1053,14 +1074,14 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { * @param name 环境的名字 */ public void removeEnv(String name) { - this.nameEnvMap.remove(name); + this.getNameEnvMap().remove(name); } /** * 清除全部环境 */ public void clearAllEnv() { - this.nameEnvMap.clear(); + this.getNameEnvMap().clear(); } /** @@ -1082,14 +1103,14 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { * 返回当前环境的名称. */ public String getCurEnvName() { - return this.curEnvName; + return getEnvConfig().getCurEnvName(); } /** * 设置当前环境的名称 */ public void setCurEnvName(String envName) { - this.curEnvName = envName; + getEnvConfig().setCurEnvName(envName); } /** @@ -1146,12 +1167,12 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { if (StringUtils.isEmpty(envName)) { return tempRecentOpenedFilePathList; } else { - if (!recentOpenedFileListMap.containsKey(envName)) { - recentOpenedFileListMap.put(envName, tempRecentOpenedFilePathList); + if (!recentOpenedMapping.getValue().containsKey(envName)) { + recentOpenedMapping.getValue().put(envName, tempRecentOpenedFilePathList); } } - return recentOpenedFileListMap.get(envName); + return recentOpenedMapping.getValue().get(envName); } /** @@ -1755,11 +1776,11 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { } public AlphaFineConfigManager getAlphaFineConfigManager() { - return alphaFineConfigManager; + return alphaFineConfigManager.getValue(); } public void setAlphaFineConfigManager(AlphaFineConfigManager alphaFineConfigManager) { - this.alphaFineConfigManager = alphaFineConfigManager; + this.alphaFineConfigManager.setValue(alphaFineConfigManager); } public boolean isImageCompress() { @@ -1801,7 +1822,99 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { public void setLayoutTemplateStyle(int layoutTemplateStyle) { this.layoutTemplateStyle = layoutTemplateStyle; } - + + @Override + public void initElements(File xmlFile) throws XmlException { + + try { + backupOldXmlFile(); + XmlInitialFactory xmlInitialFactory = XmlInitialFactory.create(xmlFile); + xmlInitialFactory + .init("XMLVersion", DesignerEnvManager.this::readXMLVersion) + .init("Attributes", DesignerEnvManager.this::readAttributes) + .init("ReportPaneAttributions", DesignerEnvManager.this::readReportPaneAttributions) + .init("RecentOpenedFilePath", (e) -> { + this.recentOpenedMapping = AsyncXmlElement.of(DesignerStartupPool.common(), () -> { + DesignerEnvManager.this.readRecentOpenFileList0(e); + return recentOpenedFileListMap; + }).callback(new Callback>>() { + @Override + public void exec(Map> stringListMap) { + checkRecentOpenedFileNum(); + } + }); + }) + .init("EnvConfigMap", (e) -> { + + final EnvConfiguration previousConfig = this.envConfig.getValue(); + this.envConfig = AsyncXmlElement.of(DesignerStartupPool.common(), () -> { + DesignerEnvManager.this.readEnvConfigMap(e, previousConfig); + return previousConfig; + }); + }) + .init("LogLocation", DesignerEnvManager.this::readLogLocation) + .init("Language", DesignerEnvManager.this::readLanguage) + .init("JettyServerPort", DesignerEnvManager.this::readJettyPort) + .init("PLengthUnit", DesignerEnvManager.this::readPageLengthUnit) + .init("RLengthUnit", DesignerEnvManager.this::readReportLengthUnit) + .init("LastOpenFilePath", DesignerEnvManager.this::readLastOpenFile) + .init("EncryptionKey", DesignerEnvManager.this::readEncrytionKey) + .init("jdkHome", (e) -> this.jdkHome = e.getElementValue()) + .init("lastBBSTime", DesignerEnvManager.this::readLastBBSTime) + .init("lastBBSNewsTime", DesignerEnvManager.this::readLastBBSNewsTime) + .init("ActivationKey", DesignerEnvManager.this::readActiveKey) + .init("status", DesignerEnvManager.this::readActiveStatus) + .init(CAS_PARAS, DesignerEnvManager.this::readHttpsParas) + .init("AlphaFineConfigManager", (e) -> { + this.alphaFineConfigManager = AsyncXmlElement.of(DesignerStartupPool.common(), () -> { + AlphaFineConfigManager config = AlphaFineConfigManager.getInstance(); + e.readXMLObject(config); + return config; + }); + }) + .init("RecentColors", DesignerEnvManager.this::readRecentColor) + .init("OpenDebug", DesignerEnvManager.this::readOpenDebug) + .init(ComponentReuseNotificationInfo.XML_TAG, DesignerEnvManager.this::readComponentReuseNotificationInfo) + .init(DesignerPushUpdateConfigManager.XML_TAG, DesignerEnvManager.this::readDesignerPushUpdateAttr) + .init(VcsConfigManager.XML_TAG, DesignerEnvManager.this::readVcsAttr) + .init(DesignerPort.XML_TAG, DesignerEnvManager.this::readDesignerPort) + .init(SnapChatConfig.XML_TAG, DesignerEnvManager.this::readSnapChatConfig) + .init(DesignerLoginConfigManager.XML_TAG, DesignerEnvManager.this::readDesignerLoginAttr) + .init(fvsDesignerConfig.getValue().getName(), (e) -> { + SimpleDesignerConfig config = this.fvsDesignerConfig.getValue(); + this.fvsDesignerConfig = AsyncXmlElement.of(() -> { + e.readXMLObject(config); + return config; + }); + }) + .init(SwitchForSwingChecker.XML_TAG, DesignerEnvManager.this::readSwitchForSwingCheckerAttr) + .init(LAST_WEST_REGION_LAYOUT, DesignerEnvManager.this::readLastWestRegionLayout) + .init(LAST_EAST_REGION_LAYOUT, DesignerEnvManager.this::readLastEastRegionLayout); + } catch (Exception e) { + throw new XmlException(e); + } + } + + /** + * 备份老的 xml 文件, 防止第一次修改存在问题 + * 但是,只备份一次。其他都走老逻辑 + */ + private void backupOldXmlFile() { + + try { + File oldFile = getEnvFile(); + String newFilePath = ProductConstants.getEnvHome() + File.separator + ProductConstants.APP_NAME + "Env_backup.xml"; + File newFile = new File(newFilePath); + if (newFile.exists()) { + return; + } + if (oldFile.exists()) { + FileUtils.copyFile(oldFile, newFile); + } + } catch (Exception ignored) { + } + } + /** * Read XML.
* The method will be invoked when read data from XML file.
@@ -1865,7 +1978,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { readComponentReuseNotificationInfo(reader); } else if (name.equals(DesignerPushUpdateConfigManager.XML_TAG)) { readDesignerPushUpdateAttr(reader); - } else if (name.equals(vcsConfigManager.XML_TAG)) { + } else if (name.equals(VcsConfigManager.XML_TAG)) { readVcsAttr(reader); } else if (DesignerPort.XML_TAG.equals(name)) { readDesignerPort(reader); @@ -1873,7 +1986,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { readSnapChatConfig(reader); } else if (name.equals(DesignerLoginConfigManager.XML_TAG)) { readDesignerLoginAttr(reader); - } else if (name.equals(fvsDesignerConfig.getName())) { + } else if (name.equals(fvsDesignerConfig.getValue().getName())) { readFvsDesignerConfig(reader); } else if (name.equals(SwitchForSwingChecker.XML_TAG)) { readSwitchForSwingCheckerAttr(reader); @@ -1893,7 +2006,10 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { } private void readAlphaFineAttr(XMLableReader reader) { - reader.readXMLObject(this.alphaFineConfigManager = AlphaFineConfigManager.getInstance()); + + AlphaFineConfigManager config = AlphaFineConfigManager.getInstance(); + reader.readXMLObject(config); + this.alphaFineConfigManager = SimpleXmlElement.of(config); } private void readEnvDetectorConfig(XMLableReader reader) { @@ -1918,9 +2034,9 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { private void readLayout(XMLableReader reader, String name) { - if ("LastEastRegionLayout".equals(name)) { + if (LAST_EAST_REGION_LAYOUT.equals(name)) { this.readLastEastRegionLayout(reader); - } else if ("LastWestRegionLayout".equals(name)) { + } else if (LAST_WEST_REGION_LAYOUT.equals(name)) { this.readLastWestRegionLayout(reader); } } @@ -2015,6 +2131,40 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { this.setPaginationLineColor(new Color(Integer.parseInt(tmpVal))); } } + + private void readEnvConfigMap(XMLableReader reader, EnvConfiguration envConfigs) { + + String currentEnv = reader.getAttrAsString("currentEnv", StringUtils.EMPTY); + envConfigs.setCurEnvName(currentEnv); + reader.readXMLObject(new XMLReadable() { + @Override + public void readXML(XMLableReader reader) { + if (reader.isAttr()) { + envConfigs.getNameEnvMap().clear(); + } else if (reader.isChildNode()) { + String tagName = reader.getTagName(); + if ("EnvConfigElement".equals(tagName)) { + final String name = reader.getAttrAsString("name", StringUtils.EMPTY); + reader.readXMLObject(new XMLReadable() { + @Override + public void readXML(XMLableReader reader) { + if (reader.isChildNode()) { + String tagName = reader.getTagName(); + if (DesignerWorkspaceType.Local.toString().equals(tagName)) { + LocalDesignerWorkspaceInfo envConfig = (LocalDesignerWorkspaceInfo) GeneralXMLTools.readXMLable(reader); + envConfigs.getNameEnvMap().put(name, envConfig); + } else if (DesignerWorkspaceType.Remote.toString().equals(tagName)) { + RemoteDesignerWorkspaceInfo envConfig = (RemoteDesignerWorkspaceInfo) GeneralXMLTools.readXMLable(reader); + envConfigs.getNameEnvMap().put(name, envConfig); + } + } + } + }); + } + } + } + }); + } private void readEnvConfigMap(XMLableReader reader) { String currentEnv = reader.getAttrAsString("currentEnv", StringUtils.EMPTY); @@ -2048,8 +2198,15 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { } }); } - + private void readRecentOpenFileList(XMLableReader reader) { + + readRecentOpenFileList0(reader); + checkRecentOpenedFileNum(); + } + + private void readRecentOpenFileList0(XMLableReader reader) { + reader.readXMLObject(new XMLReadable() { @Override public void readXML(XMLableReader reader) { @@ -2081,7 +2238,6 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { } } }); - checkRecentOpenedFileNum(); } private void readDesignerPushUpdateAttr(XMLableReader reader) { @@ -2151,7 +2307,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { private void writeAlphaFineAttr(XMLPrintWriter writer) { if (this.alphaFineConfigManager != null) { - this.alphaFineConfigManager.writeXML(writer); + this.alphaFineConfigManager.getValue().writeXML(writer); } } @@ -2228,10 +2384,10 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { writer.end(); writer.startTAG("EnvConfigMap"); - if (this.curEnvName != null) { - writer.attr("currentEnv", this.curEnvName); + if (this.getCurEnvName() != null) { + writer.attr("currentEnv", this.getCurEnvName()); } - for (Entry entry : nameEnvMap.entrySet()) { + for (Entry entry : getNameEnvMap().entrySet()) { writer.startTAG("EnvConfigElement").attr("name", entry.getKey()); DesignerWorkspaceInfo envConfig = entry.getValue(); GeneralXMLTools.writeXMLable(writer, envConfig, envConfig.getType().toString()); @@ -2440,11 +2596,14 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { } private void readFvsDesignerConfig(XMLableReader reader) { - reader.readXMLObject(fvsDesignerConfig); + + SimpleDesignerConfig config = fvsDesignerConfig.getValue(); + reader.readXMLObject(config); + fvsDesignerConfig = SimpleXmlElement.of(config); } private void writeFvsDesignerConfig(XMLPrintWriter writer) { - this.fvsDesignerConfig.writeXML(writer); + this.fvsDesignerConfig.getValue().writeXML(writer); } private void writeSwitchForSwingChecker(XMLPrintWriter writer) { @@ -2479,4 +2638,39 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { public SnapChatConfig getSnapChatConfig() { return snapChatConfig; } + + private EnvConfiguration getEnvConfig() { + + return envConfig.getValue(); + } + + private Map getNameEnvMap() { + + return getEnvConfig().getNameEnvMap(); + } + + private static class EnvConfiguration { + + // name和Env的键值对 + private Map nameEnvMap = new ListMap<>(); + // marks: 当前报表服务器名字 + private String curEnvName = null; + + public Map getNameEnvMap() { + return nameEnvMap; + } + + public void setNameEnvMap(Map nameEnvMap) { + this.nameEnvMap = nameEnvMap; + } + + public String getCurEnvName() { + return curEnvName; + } + + public void setCurEnvName(String curEnvName) { + this.curEnvName = curEnvName; + } + } + } diff --git a/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java b/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java index 2d4554afdd..db1dbbc7a0 100644 --- a/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java +++ b/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java @@ -8,6 +8,11 @@ import com.fr.design.menu.MenuKeySet; import com.fr.design.selection.QuickEditor; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; +import com.fr.start.common.DesignerStartupPool; +import com.fr.third.checkerframework.checker.nullness.qual.Nullable; +import com.fr.third.guava.util.concurrent.FutureCallback; +import com.fr.third.guava.util.concurrent.Futures; +import com.fr.third.guava.util.concurrent.ListenableFutureTask; import javax.swing.Action; import javax.swing.KeyStroke; @@ -18,6 +23,7 @@ import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.concurrent.Callable; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.CopyOnWriteArraySet; @@ -32,6 +38,7 @@ public class ActionFactory { private static Set> actionClasses = new CopyOnWriteArraySet<>(); private static Set> floatActionClasses = new CopyOnWriteArraySet<>(); private static Class chartCollectionClass = null; + /** * 无需每次实例化的悬浮元素编辑器 */ @@ -57,7 +64,6 @@ public class ActionFactory { private ActionFactory() { } - /** * 元素编辑器释放模板对象 */ @@ -69,7 +75,37 @@ public class ActionFactory { entry.getValue().release(); } } - + + /** + * 注册异步加载的单元格编辑器 + * 首先放到 classMap 中,当初始化成功后,则移除,并放到 cellEditor 中 + * 如果已经存在,则覆盖 + * + * @param keyClazz 作为 key 的类 + * @param editorClazz 作为 编辑器 的类 + */ + public static void registerAsyncInitCellEditorClass(Class keyClazz, Class editorClazz) { + + cellEditorClass.put(keyClazz, editorClazz); + Callable callable = new Callable() { + @Override + public QuickEditor call() throws Exception { + return editorClazz.newInstance(); + } + }; + ListenableFutureTask future = ListenableFutureTask.create(callable); + Futures.addCallback(future, new FutureCallback() { + @Override + public void onSuccess(@Nullable QuickEditor quickEditor) { + cellEditorClass.remove(keyClazz); + cellEditor.put(keyClazz, quickEditor); + } + + @Override + public void onFailure(Throwable throwable) { + } + }, DesignerStartupPool.designer()); + } /** * 注册无需每次实例化的单元格元素编辑器 diff --git a/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java b/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java index ec8d997c3c..bd1c48ce72 100644 --- a/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java +++ b/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java @@ -1,6 +1,7 @@ package com.fr.design.env; import com.fr.general.ComparatorUtils; +import com.fr.stable.CommonUtils; import com.fr.stable.CoreConstants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; @@ -98,6 +99,12 @@ public class LocalDesignerWorkspaceInfo implements DesignerWorkspaceInfo { @Override public boolean checkValid(){ + + // 如果当前是 debug 模式,就不检测这个逻辑 + if (CommonUtils.isDebug()) { + return true; + } + File file = new File(this.path); //判断不是文件夹/路径不在WEB-INF下/代码启动三种情况 if(!file.isDirectory() || !ComparatorUtils.equals(file.getName(), "WEB-INF") || this.path.startsWith(".")) { diff --git a/designer-base/src/main/java/com/fr/start/BaseDesigner.java b/designer-base/src/main/java/com/fr/start/BaseDesigner.java index 016c6bd6d1..4f71962f60 100644 --- a/designer-base/src/main/java/com/fr/start/BaseDesigner.java +++ b/designer-base/src/main/java/com/fr/start/BaseDesigner.java @@ -39,6 +39,7 @@ import org.jetbrains.annotations.Nullable; import java.awt.Window; import java.lang.reflect.Method; +import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; /** @@ -136,7 +137,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock { DesignerFrame df = DesignerContext.getDesignerFrame(); isException = openFile(df, isException, file); df.fireDesignerOpened(); - FineLoggerFactory.getLogger().debug("show designer cost {} ms", DesignerStartupContext.getRecorder().getTime()); + FineLoggerFactory.getLogger().info("Designer showed.Time used {} ms", DesignerStartupContext.getRecorder().getTime(TimeUnit.MILLISECONDS)); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); if (!isException) { diff --git a/designer-base/src/main/java/com/fr/start/common/DesignerStartupPool.java b/designer-base/src/main/java/com/fr/start/common/DesignerStartupPool.java index 524c474df1..6625a5a31b 100644 --- a/designer-base/src/main/java/com/fr/start/common/DesignerStartupPool.java +++ b/designer-base/src/main/java/com/fr/start/common/DesignerStartupPool.java @@ -4,17 +4,36 @@ import com.fr.concurrent.FineExecutors; import com.fr.concurrent.NamedThreadFactory; import java.util.concurrent.Executor; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.TimeUnit; /** * created by Harrison on 2022/07/03 **/ public class DesignerStartupPool { - private static final Executor COMMON_EXECUTOR = FineExecutors.newCachedThreadPool(new NamedThreadFactory("startup-common")); + private static final int MAX_THREAD_COUNT = Runtime.getRuntime().availableProcessors() * 2; + private static final Executor COMMON_EXECUTOR = FineExecutors.newThreadPoolExecutor(MAX_THREAD_COUNT, MAX_THREAD_COUNT, 10L, TimeUnit.SECONDS, new LinkedBlockingQueue<>(), new NamedThreadFactory("startup-common")); + + private static final Executor DESIGNER_EXECUTOR = FineExecutors.newThreadPoolExecutor(MAX_THREAD_COUNT, MAX_THREAD_COUNT, 10L, TimeUnit.SECONDS, new LinkedBlockingQueue<>(), new NamedThreadFactory("startup-designer")); + + /** + * + * @return 启动通用线程池 + */ public static Executor common() { return COMMON_EXECUTOR; } + + /** + * + * @return 启动设计器线程池 + */ + public static Executor designer() { + + return DESIGNER_EXECUTOR; + } } diff --git a/designer-base/src/main/java/com/fr/startup/ui/StartupLoadingPanel.java b/designer-base/src/main/java/com/fr/startup/ui/StartupLoadingPanel.java new file mode 100644 index 0000000000..97c0b26a0a --- /dev/null +++ b/designer-base/src/main/java/com/fr/startup/ui/StartupLoadingPanel.java @@ -0,0 +1,113 @@ +package com.fr.startup.ui; + +import com.fr.concurrent.FineExecutors; +import com.fr.concurrent.NamedThreadFactory; +import com.fr.design.gui.iprogressbar.ProgressDialog; +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.DesignerContext; +import com.fr.event.Event; +import com.fr.event.EventDispatcher; +import com.fr.event.Listener; +import com.fr.module.ModuleEvent; + +import java.awt.Frame; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; + +/** + * created by Harrison on 2022/11/08 + **/ +public class StartupLoadingPanel { + + /** + * 每次更新的步伐 + */ + private static final int STEP = 1; + + /** + * 40ms更新进度 + */ + private static final int STEP_HEARTBEAT = 40; + + private final Listener MODULE_LISTENER = new Listener() { + @Override + public void on(Event event, String param) { + moduleId = param; + } + }; + + private ProgressDialog progressDialog; + private String moduleId; + private int progress; + + public StartupLoadingPanel(Frame frame) { + this.progressDialog = new ProgressDialog(frame); + this.moduleId = Toolkit.i18nText("Fine-Design_Basic_Initializing"); + + initListeners(); + } + + /** + * 隐藏 + */ + public void hide() { + this.progress = progressDialog.getProgressMaximum(); + } + + /** + * 展示 + */ + public void show() { + + final ScheduledExecutorService scheduler = FineExecutors.newScheduledThreadPool(1, + new NamedThreadFactory("StartupLoadingPanel")); + scheduler.scheduleAtFixedRate(new Runnable() { + @Override + public void run() { + if (isComplete()) { + scheduler.shutdown(); + progressDialog.dispose(); + resetListeners(); + return; + } + if (!progressDialog.isVisible()) { + progressDialog = new ProgressDialog(DesignerContext.getDesignerFrame()); + progressDialog.setVisible(true); + String moduleId = getModuleId(); + progressDialog.updateLoadingText(moduleId); + } + progressDialog.setProgressValue(incrementProgress()); + } + }, 0, STEP_HEARTBEAT, TimeUnit.MILLISECONDS); + + } + + private void initListeners() { + + EventDispatcher.listen(ModuleEvent.MajorModuleStarting, MODULE_LISTENER); + } + + private void resetListeners() { + + EventDispatcher.stopListen(MODULE_LISTENER); + } + + private boolean isComplete() { + return this.progress >= progressDialog.getProgressMaximum(); + } + + private String getModuleId() { + + return this.moduleId; + } + + private int incrementProgress() { + + if (progress != progressDialog.getProgressMaximum()) { + progress += STEP; + } + return progress; + } + + +} diff --git a/designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java b/designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java index 0a0cdb4aac..84350d1726 100644 --- a/designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java +++ b/designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java @@ -2,7 +2,6 @@ package com.fr.startup.ui; import com.fr.base.svg.IconUtils; import com.fr.design.DesignerEnvManager; -import com.fr.design.components.loading.LoadingPane; import com.fr.design.dialog.UIExpandDialog; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; @@ -25,7 +24,6 @@ import org.jetbrains.annotations.NotNull; import javax.swing.BorderFactory; import javax.swing.JComponent; import javax.swing.JFrame; -import javax.swing.JLayeredPane; import javax.swing.JPanel; import javax.swing.JSeparator; import javax.swing.ScrollPaneConstants; @@ -34,7 +32,6 @@ import javax.swing.SwingWorker; import javax.swing.border.EmptyBorder; import java.awt.BorderLayout; import java.awt.Color; -import java.awt.Component; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Font; @@ -84,41 +81,42 @@ public class StartupPageWindow extends JFrame { private JPanel body; - private LoadingPane loadingPane = new LoadingPane(); - - private JLayeredPane layeredPane = new JLayeredPane() { - @Override - public void doLayout() { - for (Component comp : getComponents()) { - comp.setBounds(0, 0, getWidth(), getHeight()); - } - } - }; + private StartupLoadingPanel loadingPanel; public StartupPageWindow(StartupPageModel pageModel) { patchUIAction(pageModel); setLayout(new BorderLayout()); + + initCenter(pageModel); + + loadingPanel = new StartupLoadingPanel(this); + + // Workspace-detail + setSize(SCREEN_SIZE); + setDefaultTitle(); + addDefaultListeners(); + + repaint(); + validate(); + revalidate(); + + setFullScreen(); + + } + + private void initCenter(StartupPageModel pageModel) { this.body = FRGUIPaneFactory.createBorderLayout_S_Pane(); this.body.setBackground(new Color(0, 0, 0, 0)); - // Header - UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Startup_Page_Select_Workspace")); - Font font = label.getFont(); - Font titleFont = font.deriveFont(font.getStyle(), TITLE_FONT_SIZE); - label.setFont(titleFont); - JPanel headerPanel = new JPanel(); - LayoutManager centerFlowLayout = FRGUIPaneFactory.createCenterFlowLayout(); - headerPanel.setLayout(centerFlowLayout); - headerPanel.add(label); - headerPanel.setBackground(new Color(0, 0, 0, 0)); + JPanel headerPanel = createHeader(); this.body.add(headerPanel, BorderLayout.NORTH); // Workspace-description this.workspacePanel = generateWorkspacePanel(pageModel); this.body.add(workspacePanel, BorderLayout.CENTER); - + workspacePanel.setSelectWorkspaceRunnable(new Runnable() { @Override public void run() { @@ -144,25 +142,24 @@ public class StartupPageWindow extends JFrame { this.contentPane.setLayout(getCenterLayout(body)); this.contentPane.add(this.body, BorderLayout.CENTER); this.contentPane.setPreferredSize(this.body.getPreferredSize()); - - this.layeredPane.setName("layered-pane"); - this.layeredPane.add(this.contentPane, CONTENT_LAYER); - this.layeredPane.add(this.loadingPane, TRANSPARENT_LAYER); - this.layeredPane.moveToFront(this.contentPane); - - add(this.layeredPane, BorderLayout.CENTER); - // Workspace-detail - setSize(SCREEN_SIZE); - setDefaultTitle(); - addDefaultListeners(); - - repaint(); - validate(); - revalidate(); + add(this.contentPane, BorderLayout.CENTER); + } + + @NotNull + private static JPanel createHeader() { - setFullScreen(); - + // Header + UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Startup_Page_Select_Workspace")); + Font font = label.getFont(); + Font titleFont = font.deriveFont(font.getStyle(), TITLE_FONT_SIZE); + label.setFont(titleFont); + JPanel headerPanel = new JPanel(); + LayoutManager centerFlowLayout = FRGUIPaneFactory.createCenterFlowLayout(); + headerPanel.setLayout(centerFlowLayout); + headerPanel.add(label); + headerPanel.setBackground(new Color(0, 0, 0, 0)); + return headerPanel; } private void setFullScreen() { @@ -214,9 +211,8 @@ public class StartupPageWindow extends JFrame { } private void enterWorkspace(Runnable action) { - - loadingPane.start(); - layeredPane.moveToFront(loadingPane); + + loadingPanel.show(); SwingWorker task = new SwingWorker() { @Override protected Void doInBackground() throws Exception { @@ -245,9 +241,8 @@ public class StartupPageWindow extends JFrame { .setVisible(true); }); FineLoggerFactory.getLogger().error(e.getMessage(), e); - layeredPane.moveToFront(contentPane); } finally { - loadingPane.stop(); + loadingPanel.hide(); } } }; 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 24c02893bc..926bbbcc66 100644 --- a/designer-realize/src/main/java/com/fr/start/MainDesigner.java +++ b/designer-realize/src/main/java/com/fr/start/MainDesigner.java @@ -72,17 +72,15 @@ import com.fr.start.common.SplashCommon; import com.fr.start.module.StartupArgs; import com.fr.start.preload.PreLoadService; import com.fr.start.server.ServerTray; -import com.fr.third.org.apache.commons.lang3.time.StopWatch; import com.fr.van.chart.map.server.ChartMapEditorAction; import com.fr.workspace.WorkContext; -import javax.swing.JPanel; + import javax.swing.JComponent; +import javax.swing.JPanel; import javax.swing.border.MatteBorder; import java.awt.Component; import java.awt.Dimension; import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.GraphicsEnvironment; import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -119,11 +117,11 @@ public class MainDesigner extends BaseDesigner { * @param args 参数 */ public static void main(String[] args) { - StopWatch watch = new StopWatch(); - watch.start(); DesignerStartupContext.getRecorder().start(); - showSplash(); + + DesignerEnvManager.getEnvManager(); + startPreload0(); DesignerLifecycleMonitorContext.getMonitor().beforeStart(); @@ -143,7 +141,7 @@ public class MainDesigner extends BaseDesigner { }); Module designerRoot = ModuleContext.parseRoot("designer-startup.xml"); - FineLoggerFactory.getLogger().debug("designer-startup prepared cost {} ms", DesignerStartupContext.getRecorder().getTime(TimeUnit.MILLISECONDS)); + FineLoggerFactory.getLogger().debug("Designer prepared.Time used {} ms", DesignerStartupContext.getRecorder().getTime(TimeUnit.MILLISECONDS)); //传递启动参数 designerRoot.setSingleton(StartupArgs.class, new StartupArgs(args)); try { @@ -156,8 +154,7 @@ public class MainDesigner extends BaseDesigner { //初始化一下serverTray ServerTray.init(); } - FineLoggerFactory.getLogger().info("Designer started.Time used {} ms", watch.getTime()); - watch.stop(); + FineLoggerFactory.getLogger().info("Designer started.Time used {} ms", DesignerStartupContext.getRecorder().getTime(TimeUnit.MILLISECONDS)); SwitchForSwingChecker.initThreadMonitoring(); } @@ -168,7 +165,9 @@ public class MainDesigner extends BaseDesigner { private static void startPreload1() { CompletableFuture initLookAndFeel = CompletableFuture.runAsync(DesignUtils::initLookAndFeel); - PreLoadService.getInstance().addFuture(initLookAndFeel); + PreLoadService.getInstance().addUIFuture(initLookAndFeel); + + showSplash(); } /** @@ -189,17 +188,12 @@ public class MainDesigner extends BaseDesigner { action.run(); } }); - - Runnable fontLoad = () -> { - Font[] fonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts(); - }; - PreLoadService.getInstance().addRunnable(fontLoad); - } private static void showSplash() { + // 快快显示启动画面 - UIUtil.invokeAndWaitIfNeeded(new Runnable() { + UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { SplashContext.getInstance().registerSplash(createSplash()); diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java index 66fb549e69..16a923df37 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java @@ -146,13 +146,14 @@ import com.fr.start.common.DesignerStartupPool; import com.fr.task.Once; import com.fr.workspace.WorkContext; import com.fr.xml.ReportXMLUtils; + +import javax.swing.SwingWorker; import java.awt.Image; import java.awt.image.BufferedImage; import java.util.ArrayList; import java.util.List; import java.util.Set; import java.util.concurrent.CompletableFuture; -import javax.swing.SwingWorker; /** * Created by juhaoyu on 2018/1/31. @@ -191,7 +192,9 @@ public class DesignerActivator extends Activator implements Prepare { }, DesignerStartupPool.common()); CompletableFuture mainDesignerPrepare = CompletableFuture.runAsync(this::designerModuleStart, DesignerStartupPool.common()); - + + CompletableFuture extendDesignerPrepare = CompletableFuture.runAsync(this::designerExtendStart, DesignerStartupPool.common()); + CompletableFuture otherFeaturesPrepare = CompletableFuture.runAsync(() -> { startBBSLoginAuthServer(); migrateBBSInfoFromFineDB(); @@ -207,7 +210,7 @@ public class DesignerActivator extends Activator implements Prepare { storePassport(); AlphaFineHelper.switchConfig4Locale(); RecoverManager.register(new RecoverForDesigner()); - }); + }, DesignerStartupPool.common()); CompletableFuture resourcePrepare = CompletableFuture.runAsync(() -> { pushUpdateTask.run(); @@ -218,7 +221,7 @@ public class DesignerActivator extends Activator implements Prepare { }, DesignerStartupPool.common()); CompletableFuture - .allOf(mainDesignerPrepare, themeConfigPrepare, otherFeaturesPrepare, resourcePrepare) + .allOf(mainDesignerPrepare, extendDesignerPrepare, themeConfigPrepare, otherFeaturesPrepare, resourcePrepare) .join(); } @@ -272,8 +275,12 @@ public class DesignerActivator extends Activator implements Prepare { designerRegister(); - InformationCollector.getInstance().collectStartTime(); + } + + private void designerExtendStart() { + SharableManager.start(); + InformationCollector.getInstance().collectStartTime(); GuideRegister.register(); } @@ -413,16 +420,16 @@ public class DesignerActivator extends Activator implements Prepare { */ private static void registerCellEditor() { - ActionFactory.registerCellEditor(String.class, new CellStringQuickEditor()); - ActionFactory.registerCellEditor(Number.class, new CellStringQuickEditor()); - ActionFactory.registerCellEditor(BaseFormula.class, new CellFormulaQuickEditor()); - ActionFactory.registerCellEditor(SubReport.class, new CellSubReportEditor()); - ActionFactory.registerCellEditor(RichText.class, new CellRichTextEditor()); - ActionFactory.registerCellEditor(DSColumn.class, new CellDSColumnEditor()); - ActionFactory.registerCellEditor(Image.class, new CellImageQuickEditor()); - ActionFactory.registerCellEditor(BiasTextPainter.class, new CellBiasTextPainterEditor()); - ActionFactory.registerCellEditor(BufferedImage.class, new CellImageQuickEditor()); - ActionFactory.registerCellEditor(CellImagePainter.class, new CellImageQuickEditor()); + ActionFactory.registerAsyncInitCellEditorClass(String.class, CellStringQuickEditor.class); + ActionFactory.registerAsyncInitCellEditorClass(Number.class, CellStringQuickEditor.class); + ActionFactory.registerAsyncInitCellEditorClass(BaseFormula.class, CellFormulaQuickEditor.class); + ActionFactory.registerAsyncInitCellEditorClass(SubReport.class, CellSubReportEditor.class); + ActionFactory.registerAsyncInitCellEditorClass(RichText.class, CellRichTextEditor.class); + ActionFactory.registerAsyncInitCellEditorClass(DSColumn.class, CellDSColumnEditor.class); + ActionFactory.registerAsyncInitCellEditorClass(Image.class, CellImageQuickEditor.class); + ActionFactory.registerAsyncInitCellEditorClass(BiasTextPainter.class, CellBiasTextPainterEditor.class); + ActionFactory.registerAsyncInitCellEditorClass(BufferedImage.class, CellImageQuickEditor.class); + ActionFactory.registerAsyncInitCellEditorClass(CellImagePainter.class, CellImageQuickEditor.class); Set providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING); for (ElementUIProvider provider : providers) { @@ -430,7 +437,7 @@ public class DesignerActivator extends Activator implements Prepare { if (provider.quickEditor() == null) { continue; } - ActionFactory.registerCellEditor(provider.targetObjectClass(), provider.quickEditor().newInstance()); + ActionFactory.registerAsyncInitCellEditorClass(provider.targetObjectClass(), provider.quickEditor()); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java b/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java index 4a4fbac2b0..834f1ee30a 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java @@ -67,7 +67,7 @@ public class DesignerStartup extends Activator { registerDaoSelector(); Stopwatch beforeWatch = Stopwatch.createStarted(); - PreLoadService.getInstance().waitForAll(); + PreLoadService.getInstance().waitForCommon(); FineLoggerFactory.getLogger().debug( "DesignerStartup cost {} ms to wait load", beforeWatch.elapsed(TimeUnit.MILLISECONDS)); if (DesignUtils.isStarted()) { diff --git a/designer-realize/src/main/java/com/fr/start/module/optimized/DesignerStartupPageActivator.java b/designer-realize/src/main/java/com/fr/start/module/optimized/DesignerStartupPageActivator.java index e41dafcc8f..87f84c9d60 100644 --- a/designer-realize/src/main/java/com/fr/start/module/optimized/DesignerStartupPageActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/optimized/DesignerStartupPageActivator.java @@ -5,9 +5,11 @@ import com.fr.design.mainframe.DesignerContext; import com.fr.design.ui.util.UIUtil; import com.fr.log.FineLoggerFactory; import com.fr.module.Activator; +import com.fr.module.engine.base.ActivatorContext; import com.fr.start.SplashContext; import com.fr.start.common.DesignerStartupContext; import com.fr.start.module.StartupArgs; +import com.fr.start.preload.PreLoadService; import com.fr.start.util.DesignerStartupPageUtil; import com.fr.startup.metric.DesignerMetrics; import com.fr.startup.metric.DesignerStartupModel; @@ -18,6 +20,7 @@ import com.fr.third.org.apache.commons.lang3.time.StopWatch; import com.fr.value.NotNullLazyValue; import org.jetbrains.annotations.NotNull; +import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; /** @@ -37,6 +40,13 @@ public class DesignerStartupPageActivator extends Activator { } }; + /** + * 上下文 + */ + private final ActivatorContext activatorContext = new ActivatorContext(); + + private final CountDownLatch LATCH = new CountDownLatch(1); + @Override public void start() { @@ -64,14 +74,25 @@ public class DesignerStartupPageActivator extends Activator { // 即时暂停 suspendRecorder(context); + + addMutable(ActivatorContext.KEY, activatorContext); + + PreLoadService.getInstance().waitForUI(); UIUtil.invokeLaterIfNeeded(() -> { StartupPageModel model = StartupPageModel.create(); context.setStartupPageModel(model); - + + StopWatch suspendWatch = new StopWatch(); + final Runnable recordSuspend = () -> { + long suspendTime = suspendWatch.getTime(TimeUnit.MILLISECONDS); + activatorContext.setSuspendTime(suspendTime); + }; + // selectAndOpenLast model.setOpenLastTemplateRunnable(() -> { + recordSuspend.run(); context.setOpenLastFile(true); handleModel(model); launchAfterWarmup(); @@ -79,6 +100,7 @@ public class DesignerStartupPageActivator extends Activator { // selectAndOpenEmpty model.setOpenEmptyTemplateRunnable(() -> { + recordSuspend.run(); context.setOpenEmpty(true); handleModel(model); launchAfterWarmup(); @@ -86,6 +108,7 @@ public class DesignerStartupPageActivator extends Activator { // selectAndCreateNew model.setCreateNewTemplateRunnable(() -> { + recordSuspend.run(); context.setCreateNew(true); handleModel(model); launchAfterWarmup(); @@ -94,8 +117,11 @@ public class DesignerStartupPageActivator extends Activator { StartupPageWindow window = new StartupPageWindow(model); window.setVisible(true); context.setOnWaiting(true); - + suspendWatch.start(); + }); + + waitSubTask(); } private void suspendRecorder(DesignerStartupContext context) { @@ -136,9 +162,9 @@ public class DesignerStartupPageActivator extends Activator { DesignerStartupContext.getInstance().setOnStartup(false); recordStartupEnd(stopWatch); }); + markComplete(); } - FineLoggerFactory.getLogger().debug("designer-startup-page started cost {} ms", DesignerStartupContext.getRecorder().getTime(TimeUnit.MILLISECONDS)); } private void recordStartupEnd(StopWatch stopWatch) { @@ -150,6 +176,28 @@ public class DesignerStartupPageActivator extends Activator { model.fill(); } + /** + * 阻塞住当前的方法。 + * 只有 UI 交互开始执行的时候,才会停止阻塞 + */ + private void waitSubTask() { + + try { + LATCH.await(); + } catch (InterruptedException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + + private void markComplete() { + + try { + LATCH.countDown(); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + @Override public void stop() { diff --git a/designer-realize/src/main/java/com/fr/start/preload/PreLoadService.java b/designer-realize/src/main/java/com/fr/start/preload/PreLoadService.java index b750210749..7f69e750ea 100644 --- a/designer-realize/src/main/java/com/fr/start/preload/PreLoadService.java +++ b/designer-realize/src/main/java/com/fr/start/preload/PreLoadService.java @@ -11,7 +11,9 @@ import java.util.concurrent.CompletableFuture; **/ public class PreLoadService { - private List> futures = new ArrayList<>(); + private List> commonFutures = new ArrayList<>(); + + private List> uIFutures = new ArrayList<>(); public static PreLoadService getInstance() { return PreLoadServiceHolder.INSTANCE; @@ -21,16 +23,24 @@ public class PreLoadService { private static final PreLoadService INSTANCE = new PreLoadService(); } + public void addUIFuture(CompletableFuture future) { + uIFutures.add(future); + } + public void addFuture(CompletableFuture future) { - futures.add(future); + commonFutures.add(future); } public void addRunnable(Runnable runnable) { - futures.add(CompletableFuture.runAsync(runnable, DesignerStartupPool.common())); + commonFutures.add(CompletableFuture.runAsync(runnable, DesignerStartupPool.common())); + } + + public void waitForCommon() { + CompletableFuture.allOf(commonFutures.toArray(new CompletableFuture[0])).join(); } - public void waitForAll() { - CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).join(); + public void waitForUI() { + CompletableFuture.allOf(uIFutures.toArray(new CompletableFuture[0])).join(); } } From 227ef1d472fe4b799c3d73daa3ca11964e5fd3ac Mon Sep 17 00:00:00 2001 From: Harrison Date: Tue, 15 Nov 2022 20:35:46 +0800 Subject: [PATCH 184/310] =?UTF-8?q?REPORT-83197=E3=80=90=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E3=80=91=E5=90=AF=E5=8A=A8=E9=A1=B5=E6=80=A7=E8=83=BD?= =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E6=A0=B9=E6=8D=AE=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=EF=BC=8C=E4=BF=AE=E5=A4=8D=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=B4=A8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/DesignerEnvManager.java | 2 + .../fr/design/actions/core/ActionFactory.java | 3 +- .../fr/startup/ui/StartupLoadingPanel.java | 2 + .../com/fr/startup/ui/StartupPageWindow.java | 50 +++++++++++++------ .../com/fr/start/preload/PreLoadService.java | 16 ++++++ 5 files changed, 55 insertions(+), 18 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index b4a9f5934f..5504a52bf1 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -97,6 +97,8 @@ import java.util.Map; import java.util.Map.Entry; /** + * @author anonymous + * @version 11.0 * The manager of Designer GUI. */ public class DesignerEnvManager implements XMLReadable, XMLWriter, AsyncXmlReadable { diff --git a/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java b/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java index db1dbbc7a0..5b1aaf6f52 100644 --- a/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java +++ b/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java @@ -9,7 +9,6 @@ import com.fr.design.selection.QuickEditor; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import com.fr.start.common.DesignerStartupPool; -import com.fr.third.checkerframework.checker.nullness.qual.Nullable; import com.fr.third.guava.util.concurrent.FutureCallback; import com.fr.third.guava.util.concurrent.Futures; import com.fr.third.guava.util.concurrent.ListenableFutureTask; @@ -96,7 +95,7 @@ public class ActionFactory { ListenableFutureTask future = ListenableFutureTask.create(callable); Futures.addCallback(future, new FutureCallback() { @Override - public void onSuccess(@Nullable QuickEditor quickEditor) { + public void onSuccess(QuickEditor quickEditor) { cellEditorClass.remove(keyClazz); cellEditor.put(keyClazz, quickEditor); } diff --git a/designer-base/src/main/java/com/fr/startup/ui/StartupLoadingPanel.java b/designer-base/src/main/java/com/fr/startup/ui/StartupLoadingPanel.java index 97c0b26a0a..0c82174465 100644 --- a/designer-base/src/main/java/com/fr/startup/ui/StartupLoadingPanel.java +++ b/designer-base/src/main/java/com/fr/startup/ui/StartupLoadingPanel.java @@ -15,6 +15,8 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; /** + * @author Harrison + * @version 11.0 * created by Harrison on 2022/11/08 **/ public class StartupLoadingPanel { diff --git a/designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java b/designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java index 84350d1726..0b57247ac0 100644 --- a/designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java +++ b/designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java @@ -107,11 +107,44 @@ public class StartupPageWindow extends JFrame { } private void initCenter(StartupPageModel pageModel) { - + + initHeaderPanel(); + + initWorkspacePanel(pageModel); + + initRecentOpenPanel(pageModel); + initContentPanel(); + } + + private void initHeaderPanel() { this.body = FRGUIPaneFactory.createBorderLayout_S_Pane(); this.body.setBackground(new Color(0, 0, 0, 0)); JPanel headerPanel = createHeader(); this.body.add(headerPanel, BorderLayout.NORTH); + } + + private void initRecentOpenPanel(StartupPageModel pageModel) { + + this.recentOpenPanel = generateRecentOpenPanel(pageModel); + this.body.add(recentOpenPanel, BorderLayout.SOUTH); + } + + private void initContentPanel() { + this.contentPane = new JPanel() { + @Override + protected void paintComponent(Graphics g) { + super.paintComponent(g); + g.drawImage(BACKGROUND_IMAGE, 0, 0, SCREEN_SIZE.width, SCREEN_SIZE.height, this); + } + }; + this.contentPane.setLayout(getCenterLayout(body)); + this.contentPane.add(this.body, BorderLayout.CENTER); + this.contentPane.setPreferredSize(this.body.getPreferredSize()); + + add(this.contentPane, BorderLayout.CENTER); + } + + private void initWorkspacePanel(StartupPageModel pageModel) { // Workspace-description this.workspacePanel = generateWorkspacePanel(pageModel); @@ -129,21 +162,6 @@ public class StartupPageWindow extends JFrame { repaint(); } }); - - this.recentOpenPanel = generateRecentOpenPanel(pageModel); - this.body.add(recentOpenPanel, BorderLayout.SOUTH); - this.contentPane = new JPanel() { - @Override - protected void paintComponent(Graphics g) { - super.paintComponent(g); - g.drawImage(BACKGROUND_IMAGE, 0, 0, SCREEN_SIZE.width, SCREEN_SIZE.height, this); - } - }; - this.contentPane.setLayout(getCenterLayout(body)); - this.contentPane.add(this.body, BorderLayout.CENTER); - this.contentPane.setPreferredSize(this.body.getPreferredSize()); - - add(this.contentPane, BorderLayout.CENTER); } @NotNull diff --git a/designer-realize/src/main/java/com/fr/start/preload/PreLoadService.java b/designer-realize/src/main/java/com/fr/start/preload/PreLoadService.java index 7f69e750ea..e2abb816fd 100644 --- a/designer-realize/src/main/java/com/fr/start/preload/PreLoadService.java +++ b/designer-realize/src/main/java/com/fr/start/preload/PreLoadService.java @@ -23,6 +23,11 @@ public class PreLoadService { private static final PreLoadService INSTANCE = new PreLoadService(); } + /** + * 添加 UI 的异步任务 + * + * @param future 任务 + */ public void addUIFuture(CompletableFuture future) { uIFutures.add(future); } @@ -31,14 +36,25 @@ public class PreLoadService { commonFutures.add(future); } + /** + * 添加通用的异步任务 + * + * @param runnable 任务 + */ public void addRunnable(Runnable runnable) { commonFutures.add(CompletableFuture.runAsync(runnable, DesignerStartupPool.common())); } + /** + * 等待通用的异步任务执行 + */ public void waitForCommon() { CompletableFuture.allOf(commonFutures.toArray(new CompletableFuture[0])).join(); } + /** + * 等待UI异步任务执行 + */ public void waitForUI() { CompletableFuture.allOf(uIFutures.toArray(new CompletableFuture[0])).join(); } From 87022f0cb95be1c046ebc9d05ebd4358eb0f7917 Mon Sep 17 00:00:00 2001 From: Harrison Date: Tue, 15 Nov 2022 20:53:44 +0800 Subject: [PATCH 185/310] =?UTF-8?q?REPORT-83197=E3=80=90=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E3=80=91=E5=90=AF=E5=8A=A8=E9=A1=B5=E6=80=A7=E8=83=BD?= =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E6=A0=B9=E6=8D=AE=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=EF=BC=8C=E4=BF=AE=E5=A4=8D=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=B4=A8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/DesignerEnvManager.java | 5 ++++- .../src/main/java/com/fr/startup/ui/StartupLoadingPanel.java | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index 5504a52bf1..9d0f1f4644 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -97,9 +97,12 @@ import java.util.Map; import java.util.Map.Entry; /** + * The manager of Designer GUI. + * 下面的作者日期都是随手写的,具体作者已经无法考究。 + * * @author anonymous * @version 11.0 - * The manager of Designer GUI. + * created by anonymous on 2002/11/08 */ public class DesignerEnvManager implements XMLReadable, XMLWriter, AsyncXmlReadable { diff --git a/designer-base/src/main/java/com/fr/startup/ui/StartupLoadingPanel.java b/designer-base/src/main/java/com/fr/startup/ui/StartupLoadingPanel.java index 0c82174465..fa44903dc9 100644 --- a/designer-base/src/main/java/com/fr/startup/ui/StartupLoadingPanel.java +++ b/designer-base/src/main/java/com/fr/startup/ui/StartupLoadingPanel.java @@ -15,6 +15,8 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; /** + * 启动加载面板 + * * @author Harrison * @version 11.0 * created by Harrison on 2022/11/08 From 55e30fc5792fa3cc0dc7eb69513c4e62966f5785 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 16 Nov 2022 11:26:47 +0800 Subject: [PATCH 186/310] =?UTF-8?q?REPORT-83391=20=E9=A1=B6=E9=83=A8?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF=E4=BD=93=E9=AA=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=20=E4=BA=A4=E4=BA=92=E6=9B=B4=E6=96=B0=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=81=94=E5=8A=A8=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/ispinner/UISpinner.java | 9 ++++++++ .../ui/topparam/MobileTopParamPane.java | 21 ++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java b/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java index 4a722fc50d..18207011fe 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java +++ b/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java @@ -312,6 +312,15 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver componentInitListeners(); } + /** + * 设置最大值 + * @param maxValue 最大值 + */ + public void setMaxValue(double maxValue) { + this.maxValue = maxValue; + textField.setMaxValue(maxValue); + } + private void componentInitListeners() { preButton.addActionListener(new ActionListener() { @Override diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileTopParamPane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileTopParamPane.java index f367365f75..6bef041371 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileTopParamPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileTopParamPane.java @@ -11,15 +11,20 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.form.ui.mobile.impl.MobileTopParamStyle; import javax.swing.JPanel; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; import java.awt.BorderLayout; import java.awt.Component; import java.awt.FlowLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; public class MobileTopParamPane extends BasicBeanPane { private UICheckBox autoCommitCheckBox; private UISpinner maxDirectShowCountSpinner; private UILabel showCountTextField; private static final int MAX_VALUE = 4; + private static final int MAX_VALUE_AUTO = 3; private static final int MIN_VALUE = 0; private static final int DEFAULT_DIERTA = 1; private static final int DEFAULT_VALUE = 0; @@ -34,7 +39,7 @@ public class MobileTopParamPane extends BasicBeanPane { JPanel panel = FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Plugin-TopParam_Setting")); panel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); autoCommitCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Plugin-TopParam_AutoCommit"), true); - maxDirectShowCountSpinner = new UISpinner(MIN_VALUE, MAX_VALUE, DEFAULT_DIERTA, DEFAULT_VALUE); + maxDirectShowCountSpinner = new UISpinner(MIN_VALUE, MAX_VALUE_AUTO, DEFAULT_DIERTA, DEFAULT_VALUE); showCountTextField = new UILabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_Show_Count")); Component[][] components = {{autoCommitCheckBox},{showCountTextField, maxDirectShowCountSpinner}}; double p = TableLayout.PREFERRED; @@ -44,6 +49,20 @@ public class MobileTopParamPane extends BasicBeanPane { JPanel paraPane = TableLayoutHelper.createCommonTableLayoutPane(components, rowSize, columnSize, GAP); panel.add(paraPane); this.add(panel, BorderLayout.CENTER); + + autoCommitCheckBox.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + if (autoCommitCheckBox.isSelected()) { + maxDirectShowCountSpinner.setMaxValue(MAX_VALUE_AUTO); + if (maxDirectShowCountSpinner.getValue() >= MAX_VALUE) { + maxDirectShowCountSpinner.setValue(MAX_VALUE_AUTO); + } + } else { + maxDirectShowCountSpinner.setMaxValue(MAX_VALUE); + } + } + }); } @Override From 0f33a0fee9c109d257420e0090aa7a0d7e5b643d Mon Sep 17 00:00:00 2001 From: Harrison Date: Wed, 16 Nov 2022 18:36:44 +0800 Subject: [PATCH 187/310] =?UTF-8?q?REPORT-83197=E3=80=90=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E3=80=91=E5=90=AF=E5=8A=A8=E9=A1=B5=E6=80=A7=E8=83=BD?= =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E5=B0=86=E5=BC=82=E6=AD=A5=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E6=94=BE=E5=88=B0=20UIUtil=20=E4=B8=AD=E5=8E=BB?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E3=80=82=E9=81=BF=E5=85=8D=E5=A4=9A=E7=BA=BF?= =?UTF-8?q?=E7=A8=8B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/actions/core/ActionFactory.java | 36 ++++++++----------- .../fr/startup/ui/StartupLoadingPanel.java | 29 +++++++-------- 2 files changed, 30 insertions(+), 35 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java b/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java index 5b1aaf6f52..e4b8b9ed62 100644 --- a/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java +++ b/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java @@ -6,12 +6,10 @@ import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.mainframe.JTemplate; import com.fr.design.menu.MenuKeySet; import com.fr.design.selection.QuickEditor; +import com.fr.design.ui.util.UIUtil; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import com.fr.start.common.DesignerStartupPool; -import com.fr.third.guava.util.concurrent.FutureCallback; -import com.fr.third.guava.util.concurrent.Futures; -import com.fr.third.guava.util.concurrent.ListenableFutureTask; import javax.swing.Action; import javax.swing.KeyStroke; @@ -22,7 +20,7 @@ import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Set; -import java.util.concurrent.Callable; +import java.util.concurrent.CompletableFuture; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.CopyOnWriteArraySet; @@ -86,23 +84,19 @@ public class ActionFactory { public static void registerAsyncInitCellEditorClass(Class keyClazz, Class editorClazz) { cellEditorClass.put(keyClazz, editorClazz); - Callable callable = new Callable() { - @Override - public QuickEditor call() throws Exception { - return editorClazz.newInstance(); - } - }; - ListenableFutureTask future = ListenableFutureTask.create(callable); - Futures.addCallback(future, new FutureCallback() { - @Override - public void onSuccess(QuickEditor quickEditor) { - cellEditorClass.remove(keyClazz); - cellEditor.put(keyClazz, quickEditor); - } - - @Override - public void onFailure(Throwable throwable) { - } + CompletableFuture.runAsync(() -> { + UIUtil.invokeAndWaitIfNeeded(new Runnable() { + @Override + public void run() { + try { + QuickEditor quickEditor = editorClazz.newInstance(); + cellEditorClass.remove(keyClazz); + cellEditor.put(keyClazz, quickEditor); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + }); }, DesignerStartupPool.designer()); } diff --git a/designer-base/src/main/java/com/fr/startup/ui/StartupLoadingPanel.java b/designer-base/src/main/java/com/fr/startup/ui/StartupLoadingPanel.java index fa44903dc9..59f86fc467 100644 --- a/designer-base/src/main/java/com/fr/startup/ui/StartupLoadingPanel.java +++ b/designer-base/src/main/java/com/fr/startup/ui/StartupLoadingPanel.java @@ -4,7 +4,7 @@ import com.fr.concurrent.FineExecutors; import com.fr.concurrent.NamedThreadFactory; import com.fr.design.gui.iprogressbar.ProgressDialog; import com.fr.design.i18n.Toolkit; -import com.fr.design.mainframe.DesignerContext; +import com.fr.design.ui.util.UIUtil; import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; @@ -68,19 +68,20 @@ public class StartupLoadingPanel { scheduler.scheduleAtFixedRate(new Runnable() { @Override public void run() { - if (isComplete()) { - scheduler.shutdown(); - progressDialog.dispose(); - resetListeners(); - return; - } - if (!progressDialog.isVisible()) { - progressDialog = new ProgressDialog(DesignerContext.getDesignerFrame()); - progressDialog.setVisible(true); - String moduleId = getModuleId(); - progressDialog.updateLoadingText(moduleId); - } - progressDialog.setProgressValue(incrementProgress()); + UIUtil.invokeAndWaitIfNeeded(() -> { + if (isComplete()) { + scheduler.shutdown(); + progressDialog.dispose(); + resetListeners(); + return; + } + if (!progressDialog.isVisible()) { + progressDialog.setVisible(true); + String moduleId = getModuleId(); + progressDialog.updateLoadingText(moduleId); + } + progressDialog.setProgressValue(incrementProgress()); + }); } }, 0, STEP_HEARTBEAT, TimeUnit.MILLISECONDS); From 90d09befcc10c94a8bd05ca06aef907c79a3f066 Mon Sep 17 00:00:00 2001 From: Harrison Date: Wed, 16 Nov 2022 19:03:38 +0800 Subject: [PATCH 188/310] =?UTF-8?q?REPORT-83197=E3=80=90=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E3=80=91=E5=90=AF=E5=8A=A8=E9=A1=B5=E6=80=A7=E8=83=BD?= =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E5=92=8C=20vito=20=E8=AE=A8=E8=AE=BA?= =?UTF-8?q?=EF=BC=8C=E8=BF=99=E9=87=8C=E7=9A=84=E5=BC=82=E6=AD=A5=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E7=9B=B4=E6=8E=A5=E6=94=B9=E6=88=90=20invokeLater=20?= =?UTF-8?q?=E7=9C=81=E5=BF=83=E7=9C=81=E5=8A=9B=EF=BC=8C=20get?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/actions/core/ActionFactory.java | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java b/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java index e4b8b9ed62..3a8137f9d0 100644 --- a/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java +++ b/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java @@ -9,7 +9,6 @@ import com.fr.design.selection.QuickEditor; import com.fr.design.ui.util.UIUtil; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; -import com.fr.start.common.DesignerStartupPool; import javax.swing.Action; import javax.swing.KeyStroke; @@ -20,7 +19,6 @@ import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Set; -import java.util.concurrent.CompletableFuture; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.CopyOnWriteArraySet; @@ -84,20 +82,21 @@ public class ActionFactory { public static void registerAsyncInitCellEditorClass(Class keyClazz, Class editorClazz) { cellEditorClass.put(keyClazz, editorClazz); - CompletableFuture.runAsync(() -> { - UIUtil.invokeAndWaitIfNeeded(new Runnable() { - @Override - public void run() { - try { - QuickEditor quickEditor = editorClazz.newInstance(); - cellEditorClass.remove(keyClazz); - cellEditor.put(keyClazz, quickEditor); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } + // 这里直接用 invokeLater 放到 UI 线程中去调用。 + // 不阻塞主逻辑的启动 + UIUtil.invokeLaterIfNeeded(new Runnable() { + @Override + public void run() { + + try { + QuickEditor quickEditor = editorClazz.newInstance(); + cellEditorClass.remove(keyClazz); + cellEditor.put(keyClazz, quickEditor); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); } - }); - }, DesignerStartupPool.designer()); + } + }); } /** From 1e21b3e083ba0d35ef2b19cec627caf6ce7d2cc4 Mon Sep 17 00:00:00 2001 From: Carlson Date: Thu, 17 Nov 2022 09:30:13 +0800 Subject: [PATCH 189/310] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E7=BB=99superman=E6=A3=80=E6=B5=8B=E5=8A=A0=E4=B8=AA=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=20&&=20=E5=8A=A0=E4=B8=AA=E8=80=83=E8=99=91=E5=88=B0?= =?UTF-8?q?=E6=9C=89=E4=BA=9B=E7=94=A8=E6=88=B7=E9=9C=80=E8=A6=81=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E7=89=88=E6=9C=AC=E6=8E=A7=E5=88=B6=E6=89=BE=E5=9B=9E?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=EF=BC=8C=E8=BF=98=E5=8E=9F=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E7=9A=84=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/vcs/common/VcsHelper.java | 4 ---- .../chartx/component/correlation/AbstractCorrelationPane.java | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java b/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java index 4fec2080b9..980ccb5a3a 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java @@ -1,7 +1,6 @@ package com.fr.design.mainframe.vcs.common; -import com.fr.base.extension.FileExtension; import com.fr.concurrent.NamedThreadFactory; import com.fr.design.DesignerEnvManager; import com.fr.design.file.HistoryTemplateListCache; @@ -136,9 +135,6 @@ public class VcsHelper implements JTemplateActionListener { public void run() { String fileName = getEditingFilename(); - if (FileExtension.VIS.matchExtension(fileName)) { // fvs文件先不做版本控制 - return; - } VcsOperator operator = WorkContext.getCurrent().get(VcsOperator.class); VcsEntity entity = operator.getFileVersionByIndex(fileName, 0); int latestFileVersion = 0; diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/correlation/AbstractCorrelationPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/correlation/AbstractCorrelationPane.java index 195eb6085f..2cb52f4542 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/correlation/AbstractCorrelationPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/correlation/AbstractCorrelationPane.java @@ -127,6 +127,9 @@ public abstract class AbstractCorrelationPane extends BasicBeanPane { return StringUtils.EMPTY; } + /** + * 清空 “系列名使用字段名” 表格 + */ public void clearAllBoxList() { this.correlationPane.getTable().clear(); this.correlationPane.validate(); From b00edd1c97fdda77ee1330443fc5a38d3133367e Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 17 Nov 2022 10:50:18 +0800 Subject: [PATCH 190/310] =?UTF-8?q?REPORT-83391=20=E9=A1=B6=E9=83=A8?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF=E4=BD=93=E9=AA=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=20=E4=BA=A4=E4=BA=92=E6=9B=B4=E6=96=B0=EF=BC=8C?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=9F=A5=E6=89=BE=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=E6=9C=80=E5=A4=A7=E5=80=BC=E4=B8=BA4=EF=BC=8C=E6=9C=80?= =?UTF-8?q?=E5=B0=8F=E5=80=BC=E4=B8=BA1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/mobile/ui/topparam/MobileTopParamPane.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileTopParamPane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileTopParamPane.java index 6bef041371..60647c74ea 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileTopParamPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileTopParamPane.java @@ -25,7 +25,7 @@ public class MobileTopParamPane extends BasicBeanPane { private UILabel showCountTextField; private static final int MAX_VALUE = 4; private static final int MAX_VALUE_AUTO = 3; - private static final int MIN_VALUE = 0; + private static final int MIN_VALUE = 1; private static final int DEFAULT_DIERTA = 1; private static final int DEFAULT_VALUE = 0; private static final int GAP = 2; @@ -39,7 +39,7 @@ public class MobileTopParamPane extends BasicBeanPane { JPanel panel = FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Plugin-TopParam_Setting")); panel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); autoCommitCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Plugin-TopParam_AutoCommit"), true); - maxDirectShowCountSpinner = new UISpinner(MIN_VALUE, MAX_VALUE_AUTO, DEFAULT_DIERTA, DEFAULT_VALUE); + maxDirectShowCountSpinner = new UISpinner(MIN_VALUE, MAX_VALUE, DEFAULT_DIERTA, DEFAULT_VALUE); showCountTextField = new UILabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_Show_Count")); Component[][] components = {{autoCommitCheckBox},{showCountTextField, maxDirectShowCountSpinner}}; double p = TableLayout.PREFERRED; @@ -53,7 +53,7 @@ public class MobileTopParamPane extends BasicBeanPane { autoCommitCheckBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - if (autoCommitCheckBox.isSelected()) { + if (!autoCommitCheckBox.isSelected()) { maxDirectShowCountSpinner.setMaxValue(MAX_VALUE_AUTO); if (maxDirectShowCountSpinner.getValue() >= MAX_VALUE) { maxDirectShowCountSpinner.setValue(MAX_VALUE_AUTO); From 4a23adaeccec116e81a77eda9325a3b945d81363 Mon Sep 17 00:00:00 2001 From: Harrison Date: Thu, 17 Nov 2022 14:13:40 +0800 Subject: [PATCH 191/310] =?UTF-8?q?REPORT-83197=E3=80=90=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E3=80=91=E5=90=AF=E5=8A=A8=E9=A1=B5=E6=80=A7=E8=83=BD?= =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E9=81=97=E6=BC=8F=E4=BA=86=E4=B8=A4?= =?UTF-8?q?=E9=83=A8=E5=88=86=EF=BC=8C=E4=BB=A3=E7=A0=81=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=B8=8B=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/DesignerEnvManager.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index 9d0f1f4644..43e59f2263 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -1870,6 +1870,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter, AsyncXmlReada .init("ActivationKey", DesignerEnvManager.this::readActiveKey) .init("status", DesignerEnvManager.this::readActiveStatus) .init(CAS_PARAS, DesignerEnvManager.this::readHttpsParas) + .init(EnvDetectorConfig.XML_TAG, DesignerEnvManager.this::readEnvDetectorConfig) + .init(DesignerStartupConfig.XML_TAG, DesignerEnvManager.this::readStartupConfig) .init("AlphaFineConfigManager", (e) -> { this.alphaFineConfigManager = AsyncXmlElement.of(DesignerStartupPool.common(), () -> { AlphaFineConfigManager config = AlphaFineConfigManager.getInstance(); From 908d9baca0247f9bce0a48d1da08200472b00ab2 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 17 Nov 2022 16:00:29 +0800 Subject: [PATCH 192/310] =?UTF-8?q?REPORT-83391=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=91=BD=E5=90=8D=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mobile/ui/topparam/MobileTopParamPane.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileTopParamPane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileTopParamPane.java index 60647c74ea..8330d2aca5 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileTopParamPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileTopParamPane.java @@ -11,8 +11,6 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.form.ui.mobile.impl.MobileTopParamStyle; import javax.swing.JPanel; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; import java.awt.BorderLayout; import java.awt.Component; import java.awt.FlowLayout; @@ -23,11 +21,11 @@ public class MobileTopParamPane extends BasicBeanPane { private UICheckBox autoCommitCheckBox; private UISpinner maxDirectShowCountSpinner; private UILabel showCountTextField; - private static final int MAX_VALUE = 4; - private static final int MAX_VALUE_AUTO = 3; + private static final int MAX_VALUE_AUTO = 4; + private static final int MAX_VALUE = 3; private static final int MIN_VALUE = 1; private static final int DEFAULT_DIERTA = 1; - private static final int DEFAULT_VALUE = 0; + private static final int DEFAULT_VALUE = 4; private static final int GAP = 2; public MobileTopParamPane() { @@ -39,7 +37,7 @@ public class MobileTopParamPane extends BasicBeanPane { JPanel panel = FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Plugin-TopParam_Setting")); panel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); autoCommitCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Plugin-TopParam_AutoCommit"), true); - maxDirectShowCountSpinner = new UISpinner(MIN_VALUE, MAX_VALUE, DEFAULT_DIERTA, DEFAULT_VALUE); + maxDirectShowCountSpinner = new UISpinner(MIN_VALUE, MAX_VALUE_AUTO, DEFAULT_DIERTA, DEFAULT_VALUE); showCountTextField = new UILabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_Show_Count")); Component[][] components = {{autoCommitCheckBox},{showCountTextField, maxDirectShowCountSpinner}}; double p = TableLayout.PREFERRED; @@ -54,12 +52,12 @@ public class MobileTopParamPane extends BasicBeanPane { @Override public void actionPerformed(ActionEvent e) { if (!autoCommitCheckBox.isSelected()) { - maxDirectShowCountSpinner.setMaxValue(MAX_VALUE_AUTO); - if (maxDirectShowCountSpinner.getValue() >= MAX_VALUE) { - maxDirectShowCountSpinner.setValue(MAX_VALUE_AUTO); + maxDirectShowCountSpinner.setMaxValue(MAX_VALUE); + if (maxDirectShowCountSpinner.getValue() >= MAX_VALUE_AUTO) { + maxDirectShowCountSpinner.setValue(MAX_VALUE); } } else { - maxDirectShowCountSpinner.setMaxValue(MAX_VALUE); + maxDirectShowCountSpinner.setMaxValue(MAX_VALUE_AUTO); } } }); From 6d83456d3dc974edf639745b69a244f934acba9d Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Mon, 21 Nov 2022 19:50:00 +0800 Subject: [PATCH 193/310] =?UTF-8?q?REPORT-84407=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF-=E5=8D=95=E5=85=83=E6=A0=BC=E5=85=83?= =?UTF-8?q?=E7=B4=A0=EF=BC=8C=E5=9B=BD=E9=99=85=E5=8C=96=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91UIlabe?= =?UTF-8?q?l=E9=AB=98=E5=BA=A6=E8=A2=AB=E9=BB=98=E8=AE=A4=E5=A2=9E?= =?UTF-8?q?=E5=8A=A03=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF?= =?UTF-8?q?=E3=80=91UIlabel=E9=AB=98=E5=BA=A6=E5=87=8F=E5=B0=913=20?= =?UTF-8?q?=E3=80=90review=E5=BB=BA=E8=AE=AE=E3=80=91=E6=97=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/quickeditor/CellQuickEditor.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java index 67a65672f1..1793efa17d 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java @@ -67,6 +67,7 @@ public abstract class CellQuickEditor extends QuickEditor { private static final int CONTENT_PANE_WIDTH_GAP = 3; private static final int MOUSE_WHEEL_SPEED = 5; private static final int SCROLLBAR_WIDTH = 7; + private final int HTML_SHIFT_HEIGHT = -3; private UILabel cellLabel; private int maxHeight = 280; @@ -285,10 +286,11 @@ public abstract class CellQuickEditor extends QuickEditor { if (selectedOneCell) { columnRowTextField.setPreferredSize(null); cellLabel.setPreferredSize(null); - multipleLabelTip.setPreferredSize(new Dimension()); + // 使用UILabel.getPreferredSize时,若文本为html高度被默认增加3 + multipleLabelTip.setPreferredSize(new Dimension(0, HTML_SHIFT_HEIGHT)); } else { - columnRowTextField.setPreferredSize(new Dimension()); - cellLabel.setPreferredSize(new Dimension()); + columnRowTextField.setPreferredSize(new Dimension(0, HTML_SHIFT_HEIGHT)); + cellLabel.setPreferredSize(new Dimension(0, HTML_SHIFT_HEIGHT)); multipleLabelTip.setPreferredSize(null); } } From 947e420b837868876e34d549adda6a87cd15f0a3 Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Tue, 22 Nov 2022 13:36:43 +0800 Subject: [PATCH 194/310] =?UTF-8?q?REPORT-84407=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E9=9A=90=E8=97=8F=E9=9D=A2=E6=9D=BF=E6=97=B6=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E5=AE=BD=E5=BA=A6=E3=80=81=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/quickeditor/CellQuickEditor.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java index 1793efa17d..0b0650478b 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java @@ -58,6 +58,9 @@ import java.util.Set; public abstract class CellQuickEditor extends QuickEditor { protected static final Dimension LABEL_DIMENSION = new Dimension(GraphHelper.getWidth(Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")), 20); + + // 使用UILabel.getPreferredSize时,若文本为html高度被默认增加3 + protected static final Dimension HIDDEN_LABEL_DIMENSION = new Dimension(0, -3); protected static final int VGAP = 10, HGAP = 8, VGAP_INNER = 3; /** @@ -67,7 +70,6 @@ public abstract class CellQuickEditor extends QuickEditor { private static final int CONTENT_PANE_WIDTH_GAP = 3; private static final int MOUSE_WHEEL_SPEED = 5; private static final int SCROLLBAR_WIDTH = 7; - private final int HTML_SHIFT_HEIGHT = -3; private UILabel cellLabel; private int maxHeight = 280; @@ -286,11 +288,10 @@ public abstract class CellQuickEditor extends QuickEditor { if (selectedOneCell) { columnRowTextField.setPreferredSize(null); cellLabel.setPreferredSize(null); - // 使用UILabel.getPreferredSize时,若文本为html高度被默认增加3 - multipleLabelTip.setPreferredSize(new Dimension(0, HTML_SHIFT_HEIGHT)); + multipleLabelTip.setPreferredSize(HIDDEN_LABEL_DIMENSION); } else { - columnRowTextField.setPreferredSize(new Dimension(0, HTML_SHIFT_HEIGHT)); - cellLabel.setPreferredSize(new Dimension(0, HTML_SHIFT_HEIGHT)); + columnRowTextField.setPreferredSize(HIDDEN_LABEL_DIMENSION); + cellLabel.setPreferredSize(HIDDEN_LABEL_DIMENSION); multipleLabelTip.setPreferredSize(null); } } From 36cc1394381b2a7332688930bd4098cd38d1a5af Mon Sep 17 00:00:00 2001 From: Harrison Date: Tue, 22 Nov 2022 17:00:40 +0800 Subject: [PATCH 195/310] =?UTF-8?q?fix:=20REPORT-83197=E3=80=90=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E3=80=91=E5=90=AF=E5=8A=A8=E9=A1=B5=E6=80=A7?= =?UTF-8?q?=E8=83=BD=E4=BC=98=E5=8C=96=20=E5=A4=84=E7=90=86=E4=B8=80?= =?UTF-8?q?=E9=83=A8=E5=88=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/DesignerEnvManager.java | 2 +- .../com/fr/design/env/LocalDesignerWorkspaceInfo.java | 10 +++++----- .../src/main/java/com/fr/start/MainDesigner.java | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index 43e59f2263..6b681699be 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -200,7 +200,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter, AsyncXmlReada /** * alphafine */ - private XmlElement alphaFineConfigManager; + private XmlElement alphaFineConfigManager = SimpleXmlElement.of(AlphaFineConfigManager.getInstance()); /** * 阅后即焚的配置项 diff --git a/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java b/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java index bd1c48ce72..d3fb4268da 100644 --- a/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java +++ b/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java @@ -100,16 +100,16 @@ public class LocalDesignerWorkspaceInfo implements DesignerWorkspaceInfo { @Override public boolean checkValid(){ - // 如果当前是 debug 模式,就不检测这个逻辑 - if (CommonUtils.isDebug()) { - return true; - } - File file = new File(this.path); //判断不是文件夹/路径不在WEB-INF下/代码启动三种情况 if(!file.isDirectory() || !ComparatorUtils.equals(file.getName(), "WEB-INF") || this.path.startsWith(".")) { return false; } + + // 如果当前是 debug 模式,就不检测是否 mainVersion 不一致 + if (CommonUtils.isDebug()) { + return true; + } File engineLib = new File(StableUtils.pathJoin(this.path, ProjectConstants.LIB_NAME, REPORT_ENGINE_JAR)); // 非安装版本允许自由切换 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 926bbbcc66..bd4ed7116e 100644 --- a/designer-realize/src/main/java/com/fr/start/MainDesigner.java +++ b/designer-realize/src/main/java/com/fr/start/MainDesigner.java @@ -193,7 +193,8 @@ public class MainDesigner extends BaseDesigner { private static void showSplash() { // 快快显示启动画面 - UIUtil.invokeLaterIfNeeded(new Runnable() { + // vito: 这里必须用 wait, 不然会导致莫名其妙的问题 + UIUtil.invokeAndWaitIfNeeded(new Runnable() { @Override public void run() { SplashContext.getInstance().registerSplash(createSplash()); From 92052935d258db9d85cf0fc1e3b3da2d00917301 Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 22 Nov 2022 18:12:16 +0800 Subject: [PATCH 196/310] =?UTF-8?q?REPORT-84617=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E5=8D=A1=E6=85=A2=E6=9B=B4=E6=96=B0=E8=BF=AD?= =?UTF-8?q?=E4=BB=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/gui/itree/filetree/TemplateFileTree.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java index f273fa2092..9e17611ce2 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java @@ -144,7 +144,7 @@ public class TemplateFileTree extends EnvFileTree { Set supportTypes = createFileExtensionFilter(); return FRContext.getFileNodes().list( path, - supportTypes.toArray(new FileExtension[supportTypes.size()]) + supportTypes.toArray(new FileExtension[supportTypes.size()]),false,true ); } From 4b7169ebce70be8423069255f68418bcabcfdeea Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 22 Nov 2022 18:35:03 +0800 Subject: [PATCH 197/310] =?UTF-8?q?fix=EF=BC=9A=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/itree/filetree/TemplateFileTree.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java index 9e17611ce2..b87a70b5b6 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java @@ -144,8 +144,8 @@ public class TemplateFileTree extends EnvFileTree { Set supportTypes = createFileExtensionFilter(); return FRContext.getFileNodes().list( path, - supportTypes.toArray(new FileExtension[supportTypes.size()]),false,true - ); + supportTypes.toArray(new FileExtension[supportTypes.size()]), false, true + ); } private Set createFileExtensionFilter() { From c633c8f8aa295f72ad7249fdfdcad0def3bcfe7a Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 23 Nov 2022 09:58:59 +0800 Subject: [PATCH 198/310] =?UTF-8?q?REPORT-84428=20=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=83=8F&=E6=A8=A1=E6=9D=BF=E5=86=85=E5=AE=B9=E9=A2=91?= =?UTF-8?q?=E7=B9=81=E5=88=87=E6=8D=A2=E4=BC=9A=E5=87=BA=E7=8E=B0=E7=A9=BA?= =?UTF-8?q?=E7=99=BD=E6=88=96=E5=85=A8=E9=80=89=E7=9A=84=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../replace/ui/ITReplaceWestPanel.java | 33 +++++++++---------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java index 1c9ed16523..a01fa3909e 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java @@ -14,11 +14,11 @@ import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.JPanel; import javax.swing.SwingConstants; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; import java.awt.Color; import java.awt.Cursor; import java.awt.GridLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.awt.event.MouseEvent; import java.util.List; @@ -49,31 +49,28 @@ public class ITReplaceWestPanel { contentButton = new UIToggleButton(Toolkit.i18nText("Fine-Design_Basic_Templates_Content")); settingButton = new UIToggleButton(Toolkit.i18nText("Fine-Design_Replace_Setting")); contentButton.setText(CONTENT_TEXT); - contentButton.addActionListener(new ActionListener() { + contentButton.addChangeListener(new ChangeListener() { @Override - public void actionPerformed(ActionEvent e) { - if (!contentButton.isSelected()) { + public void stateChanged(ChangeEvent e) { + if (contentButton.isSelected()) { showSelectPanel(ITReplaceNorthPanel.CARD_CONTENT, ITReplaceMainDialog.getSearchContentResultList()); + settingButton.setSelected(!contentButton.isSelected()); + changeColor4SelectContent(); } else { - showSelectPanel(ITReplaceNorthPanel.CARD_SETTING, ITReplaceMainDialog.getSearchSettingResultList()); + contentButton.setSelected(true); } - changeColor4SelectContent(); - settingButton.setSelected(contentButton.isSelected()); - } }); - - settingButton.addActionListener(new ActionListener() { + settingButton.addChangeListener(new ChangeListener() { @Override - public void actionPerformed(ActionEvent e) { - if (!settingButton.isSelected()) { + public void stateChanged(ChangeEvent e) { + if (settingButton.isSelected()) { showSelectPanel(ITReplaceNorthPanel.CARD_SETTING, ITReplaceMainDialog.getSearchSettingResultList()); + contentButton.setSelected(!settingButton.isSelected()); + changeColor4SelectContent(); } else { - showSelectPanel(ITReplaceNorthPanel.CARD_CONTENT, ITReplaceMainDialog.getSearchContentResultList()); + settingButton.setSelected(true); } - changeColor4SelectContent(); - contentButton.setSelected(settingButton.isSelected()); - } }); leftPanel.setBackground(Color.WHITE); @@ -118,7 +115,7 @@ public class ITReplaceWestPanel { * 切换面板时改变颜色 */ public void changeColor4SelectContent() { - if (!contentButton.isSelected()) { + if (contentButton.isSelected()) { contentButton.setText(CONTENT_TEXT); settingButton.setText(Toolkit.i18nText("Fine-Design_Replace_Setting")); } else { From 9d9551b7666b2509a5683f740dfba18210fc2700 Mon Sep 17 00:00:00 2001 From: Harrison Date: Wed, 23 Nov 2022 10:32:53 +0800 Subject: [PATCH 199/310] =?UTF-8?q?REPORT-85210=20&&=20REPORT-85293=201-?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E6=9D=A1=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96?= =?UTF-8?q?=202-=E5=90=AF=E5=8A=A8=E5=BC=82=E5=B8=B8=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E4=BC=98=E5=8C=96=203-=E7=BB=99=E5=BC=82=E6=AD=A5=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=20envmanager=20=E6=8F=90=E4=BE=9B=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/DesignerEnvManager.java | 52 +++++++++++++----- .../gui/iprogressbar/ProgressDialog.java | 4 ++ .../com/fr/startup/ui/StartupPageWindow.java | 14 +++-- .../gui/iprogressbar/ProgressDialogTest.java | 55 +++++++++++++++++++ .../DesignerStartupPageActivator.java | 6 +- 5 files changed, 113 insertions(+), 18 deletions(-) create mode 100644 designer-base/src/test/java/com/fr/design/gui/iprogressbar/ProgressDialogTest.java diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index 6b681699be..199834fb77 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -4,6 +4,7 @@ package com.fr.design; import com.fr.base.BaseXMLUtils; +import com.fr.base.OptimizeUtil; import com.fr.base.Utils; import com.fr.collections.api.Callback; import com.fr.design.actions.help.alphafine.AlphaFineConfigManager; @@ -95,6 +96,7 @@ import java.util.ListIterator; import java.util.Locale; import java.util.Map; import java.util.Map.Entry; +import java.util.concurrent.atomic.AtomicBoolean; /** * The manager of Designer GUI. @@ -263,19 +265,10 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter, AsyncXmlReada designerEnvManager = new DesignerEnvManager(); //REPORT-15332有一个国际化调用比较早,需要在这边就设置好locale,由于后台GeneralContext默认是China GeneralContext.setLocale(designerEnvManager.getLanguage()); - try { - designerEnvManager.initElements(designerEnvManager.getDesignerEnvFile()); - } catch (Exception retryEx) { - FineLoggerFactory.getLogger().debug("try async init DesignerEnvManager failed", retryEx); - - try { - XMLTools.readFileXML(designerEnvManager, designerEnvManager.getDesignerEnvFile()); - } catch (FileNotFoundException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - XmlHandler.Self.handle(e); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } + + if (!asyncInitEnvManager()) { + // 如果异步读取失败, 则恢复原来的逻辑 + compatibleInitEnvManager(); } // james:如果没有env定义,要设置一个默认的 @@ -292,6 +285,39 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter, AsyncXmlReada return designerEnvManager; } + + private static void compatibleInitEnvManager() { + + try { + XMLTools.readFileXML(designerEnvManager, designerEnvManager.getDesignerEnvFile()); + } catch (FileNotFoundException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + XmlHandler.Self.handle(e); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + + /** + * 异步初始化环境管理, 提供配置, 帮助处理预期外的问题 + * 1-当优化开启时,才走异步逻辑 + * 2-如果异步执行中出错,则返回异常 false, 否则返回 true + * + * @return 是/否 + */ + private static boolean asyncInitEnvManager() { + + AtomicBoolean noEx = new AtomicBoolean(false); + OptimizeUtil.open(DesignerEnvManager.class.getSimpleName().toLowerCase(), OptimizeUtil.Module.COMMON, () -> { + try { + designerEnvManager.initElements(designerEnvManager.getDesignerEnvFile()); + noEx.set(true); + } catch (Throwable retryEx) { + FineLoggerFactory.getLogger().debug("try async init DesignerEnvManager failed", retryEx); + } + }); + return noEx.get(); + } public ColorSelectConfigManager getColorConfigManager() { return this.configManager; diff --git a/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java b/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java index 2c1e6abf56..10ece3d3ab 100644 --- a/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java +++ b/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java @@ -20,6 +20,10 @@ import java.awt.Frame; /** * 加载进度弹窗 + * 使用注意点: + * 1-需要等到 父frame 启动好之后,才能启动进度条。 + * 2-或者到使用时再初始化,不要作为属性存在 + * 见 {@link com.fr.design.gui.iprogressbar.ProgressDialogTest} */ public class ProgressDialog extends UIDialog { protected static final FRFont font = DesignUtils diff --git a/designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java b/designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java index 0b57247ac0..8905d6004c 100644 --- a/designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java +++ b/designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java @@ -91,8 +91,6 @@ public class StartupPageWindow extends JFrame { initCenter(pageModel); - loadingPanel = new StartupLoadingPanel(this); - // Workspace-detail setSize(SCREEN_SIZE); setDefaultTitle(); @@ -103,7 +101,10 @@ public class StartupPageWindow extends JFrame { revalidate(); setFullScreen(); - + + // 必须放最后 + // 见 https://work.fineres.com/browse/REPORT-85293 + loadingPanel = new StartupLoadingPanel(this); } private void initCenter(StartupPageModel pageModel) { @@ -230,7 +231,11 @@ public class StartupPageWindow extends JFrame { private void enterWorkspace(Runnable action) { - loadingPanel.show(); + UIUtil.invokeAndWaitIfNeeded(() -> { + loadingPanel.show(); + setEnabled(false); + }); + SwingWorker task = new SwingWorker() { @Override protected Void doInBackground() throws Exception { @@ -257,6 +262,7 @@ public class StartupPageWindow extends JFrame { .modal(false) .build() .setVisible(true); + setEnabled(true); }); FineLoggerFactory.getLogger().error(e.getMessage(), e); } finally { diff --git a/designer-base/src/test/java/com/fr/design/gui/iprogressbar/ProgressDialogTest.java b/designer-base/src/test/java/com/fr/design/gui/iprogressbar/ProgressDialogTest.java new file mode 100644 index 0000000000..336850f26b --- /dev/null +++ b/designer-base/src/test/java/com/fr/design/gui/iprogressbar/ProgressDialogTest.java @@ -0,0 +1,55 @@ +package com.fr.design.gui.iprogressbar; + +import com.fr.design.utils.DevUtils; + +import java.awt.Dimension; +import java.awt.Frame; +import java.util.function.Consumer; + +/** + * @author Harrison + * @version 11.0 + * Created by Harrison on 2022/11/23 + */ +public class ProgressDialogTest { + + public static void main(String[] args) { + + mockInitSize(); + } + + /** + * 模拟 frame 的大小未初始化好的情况 + */ + private static void mockNotInitSize() { + + DevUtils.show(new Consumer() { + @Override + public void accept(Frame frame) { + + Dimension origin = frame.getSize(); + frame.setSize(0, 0); + ProgressDialog progressDialog = new ProgressDialog(frame); + progressDialog.setVisible(true); + progressDialog.updateLoadingText("test"); + frame.setSize(origin); + } + }); + } + + /** + * 模拟 frame 的大小初始化好的情况 + */ + private static void mockInitSize() { + + DevUtils.show(new Consumer() { + @Override + public void accept(Frame frame) { + + ProgressDialog progressDialog = new ProgressDialog(frame); + progressDialog.setVisible(true); + progressDialog.updateLoadingText("test"); + } + }); + } +} \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/start/module/optimized/DesignerStartupPageActivator.java b/designer-realize/src/main/java/com/fr/start/module/optimized/DesignerStartupPageActivator.java index 87f84c9d60..d861fa052a 100644 --- a/designer-realize/src/main/java/com/fr/start/module/optimized/DesignerStartupPageActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/optimized/DesignerStartupPageActivator.java @@ -149,7 +149,11 @@ public class DesignerStartupPageActivator extends Activator { StopWatch stopWatch = StopWatch.createStarted(); try { - DesignerStartupContext.getRecorder().resume(); + + StopWatch recorder = DesignerStartupContext.getRecorder(); + if (recorder.isSuspended()) { + recorder.resume(); + } // 等待中切换 DesignerStartupContext.getInstance().setOnWaiting(false); From 3a5752a973c29879760476b55c382067e03bf78a Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 23 Nov 2022 14:29:24 +0800 Subject: [PATCH 200/310] =?UTF-8?q?REPORT-84427=20=E3=80=90=E6=9F=A5?= =?UTF-8?q?=E6=89=BE=E4=B8=8E=E6=9B=BF=E6=8D=A2=E3=80=91=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E6=9F=A5=E6=89=BE=E5=86=85=E5=AE=B9=E4=BC=9A=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E5=AE=9A=E4=BD=8D=E7=9A=84=E6=83=85=E5=86=B5?= =?UTF-8?q?=EF=BC=88=E7=89=B9=E6=AE=8A=E5=9C=BA=E6=99=AF=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/replace/ui/ITReplaceSouthPanel.java | 2 +- .../design/actions/replace/ui/ITTableButton.java | 13 ------------- .../design/actions/replace/ui/ITTableEditor.java | 2 +- .../actions/replace/ui/ITTableEditorPane.java | 14 ++++++++++++++ 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java index 2a555a4387..57b81077dd 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java @@ -29,7 +29,7 @@ public class ITReplaceSouthPanel { RowSorter sorter = new TableRowSorter(itTableEditor) { @Override public boolean isSortable(int column) { - return column != CHECKBOX_INDEX || column != CONTENT_INDEX; + return column != CHECKBOX_INDEX && column != CONTENT_INDEX; } }; tableEditorPane.getEditTable().setRowSorter(sorter); diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java index ce11d184d0..5cee5af04f 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java @@ -38,19 +38,6 @@ public class ITTableButton extends AbstractCellEditor implements TableCellEditor paraButton = new UIButton("" + Toolkit.i18nText("Fine-Design_Chart_Location") + " "); paraButton.setVisible(true); paraButton.setBorderPainted(false); - paraButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - ITContent content = (ITContent) getEditTable().getValueAt(getEditTable().getEditingRow(), ITReplaceSouthPanel.CONTENT_INDEX); - if (StringUtils.isNotEmpty(GeneralUtils.objectToString(content.getTrlString()))) { - ITReplaceMainDialog.setITReplaceFlag(true); - TRL trl = new TRL(GeneralUtils.objectToString(content.getTrlString())); - DesignerContext.getDesignerFrame().openOrActiveTemplate(content.getTemplatePath()); - HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().navigate(trl); - } - ITReplaceMainDialog.setITReplaceFlag(false); - } - }); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java index 7f4960d21b..d805d430ee 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java @@ -94,7 +94,7 @@ public class ITTableEditor extends UITableModelAdapter { */ @Override public boolean isCellEditable(int row, int col) { - return col == ITReplaceSouthPanel.CONTENT_INDEX || col == ITReplaceSouthPanel.CHECKBOX_INDEX; + return col == ITReplaceSouthPanel.CHECKBOX_INDEX; } /** diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java index f46ea95ac4..ef32da98d6 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java @@ -1,17 +1,21 @@ package com.fr.design.actions.replace.ui; +import com.fr.base.TRL; import com.fr.design.actions.replace.info.base.ITContent; import com.fr.design.border.UIRoundedBorder; import com.fr.design.constants.UIConstants; import com.fr.design.dialog.BasicPane; +import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itableeditorpane.UITableEditAction; import com.fr.design.gui.itableeditorpane.UITableModelAdapter; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.share.ui.base.MouseClickListener; +import com.fr.general.GeneralUtils; import com.fr.stable.StringUtils; @@ -75,6 +79,16 @@ public class ITTableEditorPane extends BasicPane { //改变面板的各个状态 changeComponentStatus(content, row, col); } + if (col == ITReplaceSouthPanel.CONTENT_INDEX) { + ITContent content = (ITContent) editTable.getValueAt(row, ITReplaceSouthPanel.CONTENT_INDEX); + if (StringUtils.isNotEmpty(GeneralUtils.objectToString(content.getTrlString()))) { + ITReplaceMainDialog.setITReplaceFlag(true); + TRL trl = new TRL(GeneralUtils.objectToString(content.getTrlString())); + DesignerContext.getDesignerFrame().openOrActiveTemplate(content.getTemplatePath()); + HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().navigate(trl); + } + ITReplaceMainDialog.setITReplaceFlag(false); + } } }); From 295d9a8c411fce8f4ba0486de3ce25faebcea422 Mon Sep 17 00:00:00 2001 From: Harrison Date: Thu, 24 Nov 2022 11:09:02 +0800 Subject: [PATCH 201/310] =?UTF-8?q?REPORT-85293=E3=80=90=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E3=80=91=E8=B5=B7=E5=A7=8B=E9=A1=B5=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=BD=BD=E8=BF=9B=E5=BA=A6=E6=9D=A1=E8=A7=86?= =?UTF-8?q?=E8=A7=89=E6=95=88=E6=9E=9C=E7=A1=AE=E8=AE=A4=20ProgressDialog?= =?UTF-8?q?=20=E7=94=A8=E9=94=99=E4=BA=86=EF=BC=8C=E8=BF=99=E4=B8=AA?= =?UTF-8?q?=E5=8F=AA=E8=83=BD=E6=98=AF=E4=BD=BF=E7=94=A8=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=E6=89=8D=E5=88=9B=E5=BB=BA=20=E4=B8=8D=E7=84=B6?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E6=9C=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/iprogressbar/ProgressDialog.java | 4 +- .../com/fr/startup/ui/StartupPageWindow.java | 79 +++++++++---------- 2 files changed, 41 insertions(+), 42 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java b/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java index 10ece3d3ab..44e697d043 100644 --- a/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java +++ b/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java @@ -21,8 +21,8 @@ import java.awt.Frame; /** * 加载进度弹窗 * 使用注意点: - * 1-需要等到 父frame 启动好之后,才能启动进度条。 - * 2-或者到使用时再初始化,不要作为属性存在 + * 必须到使用时再初始化,不要作为属性存在 + * 因为涉及到 大小/位置 相对于 parent 的相对判断 * 见 {@link com.fr.design.gui.iprogressbar.ProgressDialogTest} */ public class ProgressDialog extends UIDialog { diff --git a/designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java b/designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java index 8905d6004c..6c2f4ba91f 100644 --- a/designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java +++ b/designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java @@ -81,8 +81,6 @@ public class StartupPageWindow extends JFrame { private JPanel body; - private StartupLoadingPanel loadingPanel; - public StartupPageWindow(StartupPageModel pageModel) { patchUIAction(pageModel); @@ -102,9 +100,6 @@ public class StartupPageWindow extends JFrame { setFullScreen(); - // 必须放最后 - // 见 https://work.fineres.com/browse/REPORT-85293 - loadingPanel = new StartupLoadingPanel(this); } private void initCenter(StartupPageModel pageModel) { @@ -232,45 +227,49 @@ public class StartupPageWindow extends JFrame { private void enterWorkspace(Runnable action) { UIUtil.invokeAndWaitIfNeeded(() -> { + + // 必须直接初始化 + // 见 https://work.fineres.com/browse/REPORT-85293 + StartupLoadingPanel loadingPanel = new StartupLoadingPanel(this); loadingPanel.show(); setEnabled(false); - }); - - SwingWorker task = new SwingWorker() { - @Override - protected Void doInBackground() throws Exception { - action.run(); - return null; - } - @Override - protected void done() { - - try { - Void result = get(); - setVisible(false); - } catch (Exception e) { - // 处理错误 - UIUtil.invokeLaterIfNeeded(() -> { - UIExpandDialog.Builder() - .owner(StartupPageWindow.this) - .title(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Try")) - .message(Toolkit.i18nText("Fine-Design_Basic_Connection_Failed")) - .messageType(UIExpandDialog.WARNING_MESSAGE) - .detail(e.getMessage()) - .expand(true) - .modal(false) - .build() - .setVisible(true); - setEnabled(true); - }); - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } finally { - loadingPanel.hide(); + SwingWorker task = new SwingWorker() { + @Override + protected Void doInBackground() throws Exception { + action.run(); + return null; } - } - }; - task.execute(); + + @Override + protected void done() { + + try { + Void result = get(); + setVisible(false); + } catch (Exception e) { + // 处理错误 + UIUtil.invokeLaterIfNeeded(() -> { + UIExpandDialog.Builder() + .owner(StartupPageWindow.this) + .title(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Try")) + .message(Toolkit.i18nText("Fine-Design_Basic_Connection_Failed")) + .messageType(UIExpandDialog.WARNING_MESSAGE) + .detail(e.getMessage()) + .expand(true) + .modal(false) + .build() + .setVisible(true); + setEnabled(true); + }); + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } finally { + loadingPanel.hide(); + } + } + }; + task.execute(); + }); } private JPanel generateRecentOpenPanel(StartupPageModel pageModel) { From a7848db6a8d466acfedf2c9501c1dfc309f76c15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvan-=E6=AC=A7=E9=98=B3=E5=B8=86?= Date: Thu, 24 Nov 2022 16:35:20 +0800 Subject: [PATCH 202/310] =?UTF-8?q?REPORT-75091=20&&=20REPORT-80693=20?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=84=B1=E6=95=8F=E4=B8=80=E6=9C=9F&?= =?UTF-8?q?=E4=BA=8C=E6=9C=9F=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0=E3=80=91=E8=BF=AD=E4=BB=A3=E5=BB=B6=E6=9C=9F=EF=BC=8C?= =?UTF-8?q?=E5=B1=8F=E8=94=BD=E5=8A=9F=E8=83=BD=E5=85=A5=E5=8F=A3=20?= =?UTF-8?q?=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E5=90=8C?= =?UTF-8?q?=E4=B8=8A=20=E3=80=90review=E5=BB=BA=E8=AE=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/data/datapane/preview/PreviewTablePane.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java index e4d1667405..027afdf5b2 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java @@ -162,8 +162,10 @@ public class PreviewTablePane extends BasicPane { JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); // 预览行数面板 northPane.add(initPreviewNumberPane(), BorderLayout.CENTER); + /// 迭代延期,暂时屏蔽下功能入口 // 脱敏预览设置面板 - northPane.add(initDesensitizationPane(), BorderLayout.EAST); +// northPane.add(initDesensitizationPane(), BorderLayout.EAST); + initDesensitizationPane(); return northPane; } From 1f23a69f4103b9bb451f0a7adafe212ca32f425d Mon Sep 17 00:00:00 2001 From: Harrison Date: Thu, 24 Nov 2022 18:00:51 +0800 Subject: [PATCH 203/310] =?UTF-8?q?REPORT-85293=E3=80=90=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E3=80=91=E8=B5=B7=E5=A7=8B=E9=A1=B5=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=BD=BD=E8=BF=9B=E5=BA=A6=E6=9D=A1=E8=A7=86?= =?UTF-8?q?=E8=A7=89=E6=95=88=E6=9E=9C=E7=A1=AE=E8=AE=A4=20=E5=85=A8?= =?UTF-8?q?=E5=B1=8F=E6=95=88=E6=9E=9C=E5=9C=A8=20windows=20=E4=B8=8A?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E5=A4=84=E7=90=86=E4=B8=80=E4=B8=8B=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/startup/ui/StartupPageWindow.java | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java b/designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java index 6c2f4ba91f..41cd758905 100644 --- a/designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java +++ b/designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java @@ -11,12 +11,14 @@ import com.fr.design.layout.VerticalFlowLayout; import com.fr.design.ui.util.UIUtil; import com.fr.design.utils.ColorUtils; import com.fr.design.utils.ThemeUtils; +import com.fr.design.utils.gui.GUICoreUtils; import com.fr.exit.DesignerExiter; import com.fr.general.GeneralUtils; import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.ProductConstants; import com.fr.stable.collections.CollectionUtils; +import com.fr.stable.os.OperatingSystem; import com.fr.start.common.DesignerStartupContext; import com.fr.startup.metric.DesignerMetrics; import org.jetbrains.annotations.NotNull; @@ -56,9 +58,6 @@ import java.util.Map; **/ public class StartupPageWindow extends JFrame { - private static final int CONTENT_LAYER = 0; - private static final int TRANSPARENT_LAYER = 1; - private static final Color HOVER_COLOR = new Color(65, 155, 249); private static final Color SEP_COLOR = new Color(224, 224, 225); @@ -176,11 +175,18 @@ public class StartupPageWindow extends JFrame { return headerPanel; } + /** + * 1-mac启动时全屏 + * 2-windows 则居中处理 + */ private void setFullScreen() { - - Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize(); - this.setLocation(0, 0); - this.setSize(screenSize.width, screenSize.height); + + if (OperatingSystem.isMacos()) { + this.setLocation(0, 0); + this.setSize(SCREEN_SIZE.width, SCREEN_SIZE.height); + } else { + GUICoreUtils.setWindowFullScreen(this); + } } private void addDefaultListeners() { From a39d9a12949550eb8969e20c4d1e37c88132c812 Mon Sep 17 00:00:00 2001 From: Harrison Date: Thu, 24 Nov 2022 19:11:31 +0800 Subject: [PATCH 204/310] =?UTF-8?q?REPORT-85600=E4=BF=AE=E5=A4=8D=E4=B8=80?= =?UTF-8?q?=E4=B8=8B=E9=94=99=E8=AF=AF=E7=9A=84=E5=90=8D=E7=A7=B0=20?= =?UTF-8?q?=E9=A1=BA=E5=B8=A6=E7=9D=80=E6=94=B9=E4=B8=AA=E5=90=8D=E5=AD=97?= =?UTF-8?q?=EF=BC=8C=E7=9C=8B=E7=9D=80=E9=9A=BE=E5=8F=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../file/CloseCurrentTemplateAction.java | 8 ++-- .../fr/design/actions/file/RenameAction.java | 5 +-- .../design/file/HistoryTemplateListCache.java | 18 ++++---- ...TabPane.java => MultiTemplateTabPane.java} | 43 ++++++++++--------- .../mainframe/CenterRegionContainerPane.java | 4 +- .../fr/design/mainframe/DesignerFrame.java | 4 +- .../DesignerFrameFileDealerPane.java | 10 ++--- .../vcs/ui/FileVersionCellEditor.java | 8 ++-- .../mainframe/vcs/ui/FileVersionsPanel.java | 8 ++-- .../com/fr/design/worker/open/OpenWorker.java | 4 +- .../designer/toolbar/TemplateTransformer.java | 8 ++-- .../main/java/com/fr/start/BaseDesigner.java | 6 +-- .../start/common/DesignerOpenEmptyPanel.java | 4 +- .../fr/design/fit/common/TemplateTool.java | 4 +- .../fr/design/preview/DeveloperPreview.java | 4 +- .../com/fr/design/mainframe/JWorkBook.java | 7 +-- .../main/java/com/fr/start/MainDesigner.java | 8 ++-- 17 files changed, 75 insertions(+), 78 deletions(-) rename designer-base/src/main/java/com/fr/design/file/{MutilTempalteTabPane.java => MultiTemplateTabPane.java} (97%) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/CloseCurrentTemplateAction.java b/designer-base/src/main/java/com/fr/design/actions/file/CloseCurrentTemplateAction.java index 58fe5666a4..22263a871e 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/CloseCurrentTemplateAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/CloseCurrentTemplateAction.java @@ -3,7 +3,7 @@ package com.fr.design.actions.file; import com.fr.design.actions.UpdateAction; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListPane; -import com.fr.design.file.MutilTempalteTabPane; +import com.fr.design.file.MultiTemplateTabPane; import com.fr.design.mainframe.JTemplate; import com.fr.design.menu.KeySetUtils; @@ -28,9 +28,9 @@ public class CloseCurrentTemplateAction extends UpdateAction { * @param e 事件 */ public void actionPerformed(ActionEvent e) { - MutilTempalteTabPane.getInstance().setIsCloseCurrent(true); - MutilTempalteTabPane.getInstance().closeFormat(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); - MutilTempalteTabPane.getInstance().closeSpecifiedTemplate(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); + MultiTemplateTabPane.getInstance().setIsCloseCurrent(true); + MultiTemplateTabPane.getInstance().closeFormat(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); + MultiTemplateTabPane.getInstance().closeSpecifiedTemplate(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); } @Override diff --git a/designer-base/src/main/java/com/fr/design/actions/file/RenameAction.java b/designer-base/src/main/java/com/fr/design/actions/file/RenameAction.java index e9adc880a7..c1efc4f5eb 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/RenameAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/RenameAction.java @@ -7,7 +7,7 @@ import com.fr.design.actions.UpdateAction; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.file.FileOperations; import com.fr.design.file.HistoryTemplateListCache; -import com.fr.design.file.MutilTempalteTabPane; +import com.fr.design.file.MultiTemplateTabPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UITextField; @@ -16,7 +16,6 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerFrameFileDealerPane; -import com.fr.design.mainframe.manager.search.TemplateTreeSearchManager; import com.fr.design.mainframe.vcs.common.VcsHelper; import com.fr.design.utils.TemplateUtils; import com.fr.design.utils.gui.GUICoreUtils; @@ -89,7 +88,7 @@ public class RenameAction extends UpdateAction { } new FileRenameDialog(node); - MutilTempalteTabPane.getInstance().repaint(); + MultiTemplateTabPane.getInstance().repaint(); DesignerFrameFileDealerPane.getInstance().stateChange(); } diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java index d7f46ea76b..86820aa227 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java @@ -75,7 +75,7 @@ public class HistoryTemplateListCache implements CallbackEvent { historyList.remove(contains(selected)); selected.getEditingFILE().closeTemplate(); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Template_Closed_Warn_Text", selected.getEditingFILE().getName())); - MutilTempalteTabPane.getInstance().refreshOpenedTemplate(historyList); + MultiTemplateTabPane.getInstance().refreshOpenedTemplate(historyList); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } @@ -134,10 +134,10 @@ public class HistoryTemplateListCache implements CallbackEvent { if (contains(jt) == -1) { addHistory(); } - MutilTempalteTabPane.getInstance().refreshOpenedTemplate(historyList); + MultiTemplateTabPane.getInstance().refreshOpenedTemplate(historyList); //设置tab栏为当前选中的那一栏 if (editingTemplate != null) { - MutilTempalteTabPane.getInstance().setSelectedIndex(contains(jt)); + MultiTemplateTabPane.getInstance().setSelectedIndex(contains(jt)); } } @@ -274,7 +274,7 @@ public class HistoryTemplateListCache implements CallbackEvent { historyList.set(i, new JVirtualTemplate(overTemplate.getEditingFILE())); } } - MutilTempalteTabPane.getInstance().refreshOpenedTemplate(historyList); + MultiTemplateTabPane.getInstance().refreshOpenedTemplate(historyList); } @@ -297,7 +297,7 @@ public class HistoryTemplateListCache implements CallbackEvent { int index = iterator.nextIndex(); if (size == index + 1 && index > 0) { //如果删除的是后一个Tab,则定位到前一个 - MutilTempalteTabPane.getInstance().setSelectedIndex(index - 1); + MultiTemplateTabPane.getInstance().setSelectedIndex(index - 1); } } } @@ -307,13 +307,13 @@ public class HistoryTemplateListCache implements CallbackEvent { DesignerContext.getDesignerFrame().addAndActivateJTemplate(); } - JTemplate selectedFile = MutilTempalteTabPane.getInstance().getSelectedFile(); + JTemplate selectedFile = MultiTemplateTabPane.getInstance().getSelectedFile(); if (!isCurrentEditingFile(selectedFile.getPath())) { //如果此时面板上的实时刷新的selectedIndex得到的和历史的不一样 DesignerContext.getDesignerFrame().activateJTemplate(selectedFile); } - MutilTempalteTabPane.getInstance().repaint(); + MultiTemplateTabPane.getInstance().repaint(); } @@ -474,7 +474,7 @@ public class HistoryTemplateListCache implements CallbackEvent { int index = contains(this.editingTemplate); this.editingTemplate = jt; historyList.set(index, jt); - MutilTempalteTabPane.getInstance().refreshOpenedTemplate(historyList); - MutilTempalteTabPane.getInstance().setSelectedIndex(contains(jt)); + MultiTemplateTabPane.getInstance().refreshOpenedTemplate(historyList); + MultiTemplateTabPane.getInstance().setSelectedIndex(contains(jt)); } } diff --git a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java b/designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java similarity index 97% rename from designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java rename to designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java index 3589d9812e..646f0e517a 100644 --- a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java +++ b/designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java @@ -18,14 +18,13 @@ import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.TemplateSavingChecker; import com.fr.design.mainframe.manager.search.TemplateTreeSearchManager; import com.fr.design.utils.DesignUtils; +import com.fr.design.utils.TemplateUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUIPaintUtils; import com.fr.design.worker.WorkerManager; -import com.fr.design.utils.TemplateUtils; import com.fr.design.worker.save.CallbackSaveWorker; import com.fr.file.FILE; import com.fr.general.ComparatorUtils; -import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.Constants; @@ -69,7 +68,6 @@ import java.awt.geom.Line2D; import java.awt.geom.Path2D; import java.awt.geom.RoundRectangle2D; import java.util.List; -import java.util.Locale; import static com.fr.design.dialog.FineJOptionPane.showConfirmDialog; import static javax.swing.JOptionPane.OK_CANCEL_OPTION; @@ -77,11 +75,14 @@ import static javax.swing.JOptionPane.OK_OPTION; import static javax.swing.JOptionPane.WARNING_MESSAGE; /** - * Author : daisy - * Date: 13-8-5 - * Time: 下午6:12 - */ -public class MutilTempalteTabPane extends JComponent { + * 改个名字,一个拼写 n 个错误 + * + * @author daisy + * @version 11.0 + *

+ * created by daisy on 2013/08/05 + **/ +public class MultiTemplateTabPane extends JComponent { private static Icon LIST_DOWN = BaseUtils.readIcon("/com/fr/design/images/buttonicon/list_normal.png"); private static Icon MOUSE_OVER_LIST_DOWN = BaseUtils.readIcon("/com/fr/design/images/buttonicon/list_pressed.png"); @@ -110,7 +111,7 @@ public class MutilTempalteTabPane extends JComponent { private static final int MINWIDTH = 100; - private static MutilTempalteTabPane THIS; + private static MultiTemplateTabPane THIS; //用于存放工作簿 private java.util.List> openedTemplate; //选中的Tab项 @@ -144,9 +145,9 @@ public class MutilTempalteTabPane extends JComponent { private JTemplate temTemplate = null; - public static MutilTempalteTabPane getInstance() { + public static MultiTemplateTabPane getInstance() { if (THIS == null) { - THIS = new MutilTempalteTabPane(); + THIS = new MultiTemplateTabPane(); } return THIS; } @@ -155,7 +156,7 @@ public class MutilTempalteTabPane extends JComponent { /** * 多工作簿面板 */ - public MutilTempalteTabPane() { + public MultiTemplateTabPane() { this.setLayout(new BorderLayout(0, 0)); this.addMouseListener(new MultiTemplateTabMouseListener()); this.addMouseMotionListener(new MultiTemplateTabMouseMotionListener()); @@ -169,7 +170,7 @@ public class MutilTempalteTabPane extends JComponent { public void eventDispatched(AWTEvent event) { if (event instanceof MouseEvent) { MouseEvent mv = (MouseEvent) event; - if (mv.getClickCount() > 0 && !ComparatorUtils.equals(mv.getSource(), MutilTempalteTabPane.this)) { + if (mv.getClickCount() > 0 && !ComparatorUtils.equals(mv.getSource(), MultiTemplateTabPane.this)) { isShowList = false; } } @@ -203,7 +204,7 @@ public class MutilTempalteTabPane extends JComponent { //根据当前i18n语言环境,动态调整popupMenu的宽度 menu.setPreferredSize(new Dimension((int) DesignSizeI18nManager.getInstance(). i18nDimension("com.fr.design.file.MultiTemplateTabPane.popUpMenu").getWidth(), height)); - GUICoreUtils.showPopupMenu(menu, MutilTempalteTabPane.getInstance(), e.getX(), MutilTempalteTabPane.getInstance().getY() - 1 + MutilTempalteTabPane.getInstance().getHeight()); + GUICoreUtils.showPopupMenu(menu, MultiTemplateTabPane.getInstance(), e.getX(), MultiTemplateTabPane.getInstance().getY() - 1 + MultiTemplateTabPane.getInstance().getHeight()); } } } @@ -335,7 +336,7 @@ public class MutilTempalteTabPane extends JComponent { DesignerContext.getDesignerFrame().activateJTemplate(currentTemplate); } - MutilTempalteTabPane.getInstance().repaint(); + MultiTemplateTabPane.getInstance().repaint(); } } @@ -349,7 +350,7 @@ public class MutilTempalteTabPane extends JComponent { //判断关闭的模板是不是格式刷的被参照的模板 openedTemplate.remove(jTemplate); if (jTemplate != currentTemplate) { - MutilTempalteTabPane.getInstance().closeFormat(jTemplate); + MultiTemplateTabPane.getInstance().closeFormat(jTemplate); HistoryTemplateListCache.getInstance().closeSelectedReport(jTemplate); closeAndFreeLock(jTemplate); } @@ -530,7 +531,7 @@ public class MutilTempalteTabPane extends JComponent { for (int i = 0; i < items.length; i++) { menu.add(items[i]); } - GUICoreUtils.showPopupMenu(menu, MutilTempalteTabPane.getInstance(), MutilTempalteTabPane.getInstance().getWidth() - menu.getPreferredSize().width, getY() - 1 + getHeight()); + GUICoreUtils.showPopupMenu(menu, MultiTemplateTabPane.getInstance(), MultiTemplateTabPane.getInstance().getWidth() - menu.getPreferredSize().width, getY() - 1 + getHeight()); } @@ -1106,7 +1107,7 @@ public class MutilTempalteTabPane extends JComponent { listDownMode = LIST_DOWN; closeIconIndex = -1; mouseOveredIndex = -1; - MutilTempalteTabPane.this.repaint(); + MultiTemplateTabPane.this.repaint(); } /** @@ -1185,7 +1186,7 @@ public class MutilTempalteTabPane extends JComponent { DesignerContext.getDesignerFrame().addAndActivateJTemplate(openedTemplate.get(tempSelectedIndex)); FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Form_Authority_Edited_Cannot_Be_Supported") + "!", Toolkit.i18nText("Fine-Design_Basic_Alert"), JOptionPane.WARNING_MESSAGE); - MutilTempalteTabPane.this.repaint(); + MultiTemplateTabPane.this.repaint(); return; } JTemplate evtXTemplate = openedTemplate.get(getTemplateIndex(evtX)); @@ -1193,7 +1194,7 @@ public class MutilTempalteTabPane extends JComponent { } isShowList = false; } - MutilTempalteTabPane.this.repaint(); + MultiTemplateTabPane.this.repaint(); } @@ -1234,7 +1235,7 @@ public class MutilTempalteTabPane extends JComponent { boolean isOverCloseIcon = isOverCloseIcon(evtX); clodeMode = isOverCloseIcon ? MOUSE_OVER_CLOSE : CLOSE; closeIconIndex = isOverCloseIcon ? mouseOveredIndex : -1; - MutilTempalteTabPane.this.repaint(); + MultiTemplateTabPane.this.repaint(); } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java index 0e06cc87a0..b18b346525 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java @@ -4,7 +4,7 @@ import com.fr.design.DesignState; import com.fr.design.base.mode.DesignModeContext; import com.fr.design.constants.UIConstants; import com.fr.design.file.HistoryTemplateListCache; -import com.fr.design.file.MutilTempalteTabPane; +import com.fr.design.file.MultiTemplateTabPane; import com.fr.design.file.NewTemplatePane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.imenu.UIMenuHighLight; @@ -87,7 +87,7 @@ public class CenterRegionContainerPane extends JPanel { eastCenterPane.add(combineUp, BorderLayout.NORTH); templateTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); templateTabPane.add(newWorkBookPane = getToolBarMenuDock().getNewTemplatePane(), BorderLayout.WEST); - templateTabPane.add(MutilTempalteTabPane.getInstance(), BorderLayout.CENTER); + templateTabPane.add(MultiTemplateTabPane.getInstance(), BorderLayout.CENTER); eastCenterPane.add(templateTabPane, BorderLayout.CENTER); eastPane.add(eastCenterPane, BorderLayout.CENTER); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 5040a5cbd4..e88d0c946c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -21,7 +21,7 @@ import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedListener; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListPane; -import com.fr.design.file.MutilTempalteTabPane; +import com.fr.design.file.MultiTemplateTabPane; import com.fr.design.file.SaveSomeTemplatePane; import com.fr.design.file.TemplateTreePane; import com.fr.design.fun.OemProcessor; @@ -1110,7 +1110,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta // 新的form不往前兼容 if (inValidDesigner(jt)) { this.addAndActivateJTemplate(); - MutilTempalteTabPane.getInstance().setTemTemplate( + MultiTemplateTabPane.getInstance().setTemTemplate( HistoryTemplateListCache.getInstance().getCurrentEditingTemplate()); } else { this.addAndActivateJTemplate(jt); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index b3086ce7b8..87864ffd21 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java @@ -21,7 +21,7 @@ import com.fr.design.file.FileOperations; import com.fr.design.file.FileToolbarStateChangeListener; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListPane; -import com.fr.design.file.MutilTempalteTabPane; +import com.fr.design.file.MultiTemplateTabPane; import com.fr.design.file.TemplateTreePane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; @@ -275,7 +275,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()); HistoryTemplateListPane.getInstance().setCurrentEditingTemplate(jt); //处理自动新建的模板 - MutilTempalteTabPane.getInstance().doWithtemTemplate(); + MultiTemplateTabPane.getInstance().doWithtemTemplate(); if (DesignerMode.isAuthorityEditing()) { RolesAlreadyEditedPane.getInstance().refreshDockingView(); } @@ -547,10 +547,10 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt for (JTemplate jTemplate : HistoryTemplateListCache.getInstance().getHistoryList()) { if (ComparatorUtils.equals(jTemplate.getEditingFILE().getPath(), path)) { if (isCurrentEditing) { - MutilTempalteTabPane.getInstance().setIsCloseCurrent(true); + MultiTemplateTabPane.getInstance().setIsCloseCurrent(true); } - MutilTempalteTabPane.getInstance().closeFormat(jTemplate); - MutilTempalteTabPane.getInstance().closeSpecifiedTemplate(jTemplate); + MultiTemplateTabPane.getInstance().closeFormat(jTemplate); + MultiTemplateTabPane.getInstance().closeSpecifiedTemplate(jTemplate); return; } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionCellEditor.java b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionCellEditor.java index bf5b8ba45b..8cff3ffbb1 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionCellEditor.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionCellEditor.java @@ -1,7 +1,7 @@ package com.fr.design.mainframe.vcs.ui; import com.fr.design.file.HistoryTemplateListCache; -import com.fr.design.file.MutilTempalteTabPane; +import com.fr.design.file.MultiTemplateTabPane; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerFrameFileDealerPane; import com.fr.design.mainframe.JTemplate; @@ -57,9 +57,9 @@ public class FileVersionCellEditor extends AbstractCellEditor implements TableCe jt.stopEditing(); //只有模板路径一致时关闭当前模板 if (ComparatorUtils.equals(fileOfVersion, jt.getPath())) { - MutilTempalteTabPane.getInstance().setIsCloseCurrent(true); - MutilTempalteTabPane.getInstance().closeFormat(jt); - MutilTempalteTabPane.getInstance().closeSpecifiedTemplate(jt); + MultiTemplateTabPane.getInstance().setIsCloseCurrent(true); + MultiTemplateTabPane.getInstance().closeFormat(jt); + MultiTemplateTabPane.getInstance().closeSpecifiedTemplate(jt); } //再打开cache中的模板 diff --git a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionsPanel.java b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionsPanel.java index 4d9b6e35e6..4dd14bce6d 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionsPanel.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionsPanel.java @@ -5,7 +5,7 @@ import com.fr.design.base.mode.DesignModeContext; import com.fr.design.base.mode.DesignerMode; import com.fr.design.dialog.BasicPane; import com.fr.design.file.HistoryTemplateListCache; -import com.fr.design.file.MutilTempalteTabPane; +import com.fr.design.file.MultiTemplateTabPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; @@ -115,9 +115,9 @@ public class FileVersionsPanel extends BasicPane { // 关闭当前打开的版本 JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - MutilTempalteTabPane.getInstance().setIsCloseCurrent(true); - MutilTempalteTabPane.getInstance().closeFormat(jt); - MutilTempalteTabPane.getInstance().closeSpecifiedTemplate(jt); + MultiTemplateTabPane.getInstance().setIsCloseCurrent(true); + MultiTemplateTabPane.getInstance().closeFormat(jt); + MultiTemplateTabPane.getInstance().closeSpecifiedTemplate(jt); updateDesignerFrame(true); diff --git a/designer-base/src/main/java/com/fr/design/worker/open/OpenWorker.java b/designer-base/src/main/java/com/fr/design/worker/open/OpenWorker.java index b070b7f078..d9c8568bf9 100644 --- a/designer-base/src/main/java/com/fr/design/worker/open/OpenWorker.java +++ b/designer-base/src/main/java/com/fr/design/worker/open/OpenWorker.java @@ -3,7 +3,7 @@ package com.fr.design.worker.open; import com.fr.base.chart.exception.ChartNotFoundException; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.file.HistoryTemplateListCache; -import com.fr.design.file.MutilTempalteTabPane; +import com.fr.design.file.MultiTemplateTabPane; import com.fr.design.file.TemplateTreePane; import com.fr.design.i18n.Toolkit; import com.fr.design.lock.LockInfoDialog; @@ -87,7 +87,7 @@ public class OpenWorker extends SwingWorker { UIManager.getIcon("OptionPane.errorIcon")); } if (cause.getCause() instanceof TplLockedException) { - MutilTempalteTabPane.getInstance().closeCurrentTpl(); + MultiTemplateTabPane.getInstance().closeCurrentTpl(); TemplateTreePane.getInstance().getFileNode().setLock(UUID.randomUUID().toString()); LockInfoDialog.show(null); } diff --git a/designer-base/src/main/java/com/fr/nx/app/designer/toolbar/TemplateTransformer.java b/designer-base/src/main/java/com/fr/nx/app/designer/toolbar/TemplateTransformer.java index 42490fe7d5..1a6e2bf1c8 100644 --- a/designer-base/src/main/java/com/fr/nx/app/designer/toolbar/TemplateTransformer.java +++ b/designer-base/src/main/java/com/fr/nx/app/designer/toolbar/TemplateTransformer.java @@ -2,7 +2,7 @@ package com.fr.nx.app.designer.toolbar; import com.fr.base.extension.FileExtension; import com.fr.design.file.HistoryTemplateListCache; -import com.fr.design.file.MutilTempalteTabPane; +import com.fr.design.file.MultiTemplateTabPane; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; import com.fr.file.FILE; @@ -103,9 +103,9 @@ public enum TemplateTransformer { DesignerContext.getDesignerFrame().openTemplate(file); return; } - MutilTempalteTabPane.getInstance().setIsCloseCurrent(true); - MutilTempalteTabPane.getInstance().closeFormat(jt); - MutilTempalteTabPane.getInstance().closeSpecifiedTemplate(jt); + MultiTemplateTabPane.getInstance().setIsCloseCurrent(true); + MultiTemplateTabPane.getInstance().closeFormat(jt); + MultiTemplateTabPane.getInstance().closeSpecifiedTemplate(jt); DesignerContext.getDesignerFrame().openTemplate(file); } diff --git a/designer-base/src/main/java/com/fr/start/BaseDesigner.java b/designer-base/src/main/java/com/fr/start/BaseDesigner.java index 4f71962f60..44228c2a4a 100644 --- a/designer-base/src/main/java/com/fr/start/BaseDesigner.java +++ b/designer-base/src/main/java/com/fr/start/BaseDesigner.java @@ -8,7 +8,7 @@ import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; import com.fr.design.constants.DesignerLaunchStatus; import com.fr.design.file.HistoryTemplateListPane; -import com.fr.design.file.MutilTempalteTabPane; +import com.fr.design.file.MultiTemplateTabPane; import com.fr.design.file.TemplateTreePane; import com.fr.design.fun.DesignerStartOpenFileProcessor; import com.fr.design.fun.impl.DesignerStartWithEmptyFile; @@ -193,7 +193,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock { } else { df.addAndActivateJTemplate(); // 如果没有模板,则需要确认一下 - MutilTempalteTabPane.getInstance().setTemTemplate(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); + MultiTemplateTabPane.getInstance().setTemTemplate(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); } } @@ -253,7 +253,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock { private boolean createNewTemplate(DesignerFrame df) { df.addAndActivateJTemplate(); // 如果没有模板,则需要确认一下 - MutilTempalteTabPane.getInstance().setTemTemplate(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); + MultiTemplateTabPane.getInstance().setTemTemplate(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); return true; } diff --git a/designer-base/src/main/java/com/fr/start/common/DesignerOpenEmptyPanel.java b/designer-base/src/main/java/com/fr/start/common/DesignerOpenEmptyPanel.java index 7f4a0eeb97..b42cc4ed8f 100644 --- a/designer-base/src/main/java/com/fr/start/common/DesignerOpenEmptyPanel.java +++ b/designer-base/src/main/java/com/fr/start/common/DesignerOpenEmptyPanel.java @@ -3,7 +3,7 @@ package com.fr.start.common; import com.fr.base.svg.IconUtils; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListPane; -import com.fr.design.file.MutilTempalteTabPane; +import com.fr.design.file.MultiTemplateTabPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.DesignSizeI18nManager; import com.fr.design.i18n.Toolkit; @@ -59,7 +59,7 @@ public class DesignerOpenEmptyPanel extends JPanel { HistoryTemplateListCache.getInstance().setCurrentEditingTemplate(null); df.addAndActivateJTemplate(); // 如果没有模板,则需要确认一下 - MutilTempalteTabPane.getInstance().setTemTemplate(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); + MultiTemplateTabPane.getInstance().setTemTemplate(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); } }); createButton.setBorder(new EmptyBorder(0, 10, 0, 10)); diff --git a/designer-form/src/main/java/com/fr/design/fit/common/TemplateTool.java b/designer-form/src/main/java/com/fr/design/fit/common/TemplateTool.java index 47512348f4..04633435be 100644 --- a/designer-form/src/main/java/com/fr/design/fit/common/TemplateTool.java +++ b/designer-form/src/main/java/com/fr/design/fit/common/TemplateTool.java @@ -1,7 +1,7 @@ package com.fr.design.fit.common; import com.fr.design.file.HistoryTemplateListCache; -import com.fr.design.file.MutilTempalteTabPane; +import com.fr.design.file.MultiTemplateTabPane; import com.fr.design.fit.NewJForm; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; @@ -86,7 +86,7 @@ public class TemplateTool { JTemplate oldJTemplate = jTemplateList.get(i); if (oldJTemplate != null && ComparatorUtils.equals(oldJTemplate.getEditingFILE(), newJTemplate.getEditingFILE())) { jTemplateList.set(i, newJTemplate); - MutilTempalteTabPane.getInstance().refreshOpenedTemplate(jTemplateList); + MultiTemplateTabPane.getInstance().refreshOpenedTemplate(jTemplateList); return; } } diff --git a/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java b/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java index 176c44fe01..260ba183d4 100644 --- a/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java +++ b/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java @@ -1,7 +1,7 @@ package com.fr.design.preview; import com.fr.design.file.HistoryTemplateListCache; -import com.fr.design.file.MutilTempalteTabPane; +import com.fr.design.file.MultiTemplateTabPane; import com.fr.design.fun.impl.AbstractPreviewProvider; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.JForm; @@ -66,7 +66,7 @@ public class DeveloperPreview extends AbstractPreviewProvider { } private void onPreview(JTemplate jt) { - MutilTempalteTabPane.getInstance().closeCurrentTpl(); + MultiTemplateTabPane.getInstance().closeCurrentTpl(); jt.generateForBiddenTemplate(); } 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 8fb64a3d10..cab4c6a185 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 @@ -6,8 +6,6 @@ import com.fr.base.Parameter; import com.fr.base.ScreenResolution; import com.fr.base.TRL; import com.fr.base.extension.FileExtension; -import com.fr.base.theme.FineColorGather; -import com.fr.base.theme.FineColorManager; import com.fr.base.theme.FineColorSynchronizer; import com.fr.base.theme.ReportTheme; import com.fr.base.theme.TemplateTheme; @@ -41,7 +39,7 @@ import com.fr.design.designer.TargetComponent; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListPane; -import com.fr.design.file.MutilTempalteTabPane; +import com.fr.design.file.MultiTemplateTabPane; import com.fr.design.fun.PreviewProvider; import com.fr.design.fun.PropertyItemPaneProvider; import com.fr.design.fun.ReportSupportedFileUIProvider; @@ -80,7 +78,6 @@ import com.fr.file.FILEChooserPane; import com.fr.file.FileNodeFILE; import com.fr.file.filetree.FileNode; import com.fr.file.filter.ChooseFileFilter; -import com.fr.form.main.Form; import com.fr.general.ComparatorUtils; import com.fr.general.ModuleContext; import com.fr.grid.Grid; @@ -1178,7 +1175,7 @@ public class JWorkBook extends JTemplate { public boolean saveShareFile() { FILE newFile = createNewEmptyFile(); //如果文件已经打开, 那么就覆盖关闭掉他 - MutilTempalteTabPane.getInstance().closeFileTemplate(newFile); + MultiTemplateTabPane.getInstance().closeFileTemplate(newFile); final WorkBook tpl = this.getTarget(); // 弹出输入参数 java.util.Map parameterMap = inputParameters(tpl); 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 bd4ed7116e..02116dc41c 100644 --- a/designer-realize/src/main/java/com/fr/start/MainDesigner.java +++ b/designer-realize/src/main/java/com/fr/start/MainDesigner.java @@ -16,7 +16,7 @@ import com.fr.design.constants.UIConstants; import com.fr.design.deeplink.DeepLinkManager; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListPane; -import com.fr.design.file.MutilTempalteTabPane; +import com.fr.design.file.MultiTemplateTabPane; import com.fr.design.fun.MenuHandler; import com.fr.design.fun.OemProcessor; import com.fr.design.gui.ibutton.UIButton; @@ -387,7 +387,7 @@ public class MainDesigner extends BaseDesigner { for (int i = 0; i < items.length; i++) { menu.add(items[i]); } - GUICoreUtils.showPopupMenu(menu, MutilTempalteTabPane.getInstance(), MutilTempalteTabPane.getInstance().getX() - PREVIEW_DOWN_X_GAP, MutilTempalteTabPane.getInstance().getY() - 1 + MutilTempalteTabPane.getInstance().getHeight()); + GUICoreUtils.showPopupMenu(menu, MultiTemplateTabPane.getInstance(), MultiTemplateTabPane.getInstance().getX() - PREVIEW_DOWN_X_GAP, MultiTemplateTabPane.getInstance().getY() - 1 + MultiTemplateTabPane.getInstance().getHeight()); } @Override @@ -409,8 +409,8 @@ public class MainDesigner extends BaseDesigner { return; } saveButton.setEnabled(!jt.isSaved() && !DesignModeContext.isVcsMode() && jt.checkEnable()); - MutilTempalteTabPane.getInstance().refreshOpenedTemplate(HistoryTemplateListCache.getInstance().getHistoryList()); - MutilTempalteTabPane.getInstance().repaint(); + MultiTemplateTabPane.getInstance().refreshOpenedTemplate(HistoryTemplateListCache.getInstance().getHistoryList()); + MultiTemplateTabPane.getInstance().repaint(); if (DesignerEnvManager.getEnvManager().isSupportUndo()) { undo.setEnabled(jt.canUndo()); redo.setEnabled(jt.canRedo()); From 418a11c4e6a7ce795b0d0d591dae2298ad7d4271 Mon Sep 17 00:00:00 2001 From: shine Date: Fri, 25 Nov 2022 14:22:09 +0800 Subject: [PATCH 205/310] =?UTF-8?q?nojira=20fvs=20plugin=20=E6=89=93?= =?UTF-8?q?=E5=8C=85=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/file/MutilTempalteTabPane.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java diff --git a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java new file mode 100644 index 0000000000..36e0b58754 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java @@ -0,0 +1,24 @@ +package com.fr.design.file; + +/** + * @author shine + * @version 10.0 + * Created by shine on 2022/11/25 + * fvs plugin jartime升级到2022-12-2之后就可以删了 + */ +@Deprecated +public class MutilTempalteTabPane { + + public static MutilTempalteTabPane getInstance() { + return new MutilTempalteTabPane(); + } + + public void setIsCloseCurrent(boolean b) { + MultiTemplateTabPane.getInstance().setIsCloseCurrent(b); + + } + + public void activePrevTemplateAfterClose() { + MultiTemplateTabPane.getInstance().activePrevTemplateAfterClose(); + } +} From 01a066534f65f7859307cb079e70e842c0b1fff3 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 30 Nov 2022 09:56:53 +0800 Subject: [PATCH 206/310] =?UTF-8?q?REPORT-85880=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=A1=A8=E7=8E=B0=E4=B8=8E=E5=A4=84=E7=90=86-=E5=85=AC?= =?UTF-8?q?=E5=BC=8F-=E5=85=AC=E5=BC=8F=E7=BC=96=E8=BE=91=E5=8C=BA?= =?UTF-8?q?=E5=9F=9F=E6=98=BE=E7=A4=BA=E4=B8=8D=E6=AD=A3=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/formula/FormulaPane.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java index be1005574e..4818174b25 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java +++ b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java @@ -1278,6 +1278,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { initDescriptionTextArea(); UIScrollPane desScrollPane = new UIScrollPane(descriptionTextArea); + desScrollPane.setPreferredSize(descriptionTextArea.getPreferredSize()); desScrollPane.setBorder(null); panel.add(this.createNamePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FormulaPane_Formula_Description") + ":", desScrollPane), BorderLayout.CENTER); initVariablesTreeSelectionListener(); From 2beb2d09a0087f0f5423629cfb54c61f61533314 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 30 Nov 2022 14:44:08 +0800 Subject: [PATCH 207/310] =?UTF-8?q?REPORT-85880=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=A1=A8=E7=8E=B0=E4=B8=8E=E5=A4=84=E7=90=86-=E5=85=AC?= =?UTF-8?q?=E5=BC=8F-=E5=85=AC=E5=BC=8F=E7=BC=96=E8=BE=91=E5=8C=BA?= =?UTF-8?q?=E5=9F=9F=E6=98=BE=E7=A4=BA=E4=B8=8D=E6=AD=A3=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/formula/FormulaPane.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java index 4818174b25..f53930602c 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java +++ b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java @@ -156,6 +156,8 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { private DefaultCompletionProvider completionProvider; private static final Map PARAM_PREFIX_MAP = new HashMap<>(); + public static final int DESCRIPTION_TEXT_AREA_ROW = 16, DESCRIPTION_TEXT_AREA_COLUMN = 27; + public FormulaPane() { initComponents(); } @@ -1194,8 +1196,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { private void initDescriptionTextArea() { // Description - descriptionTextArea = new UITextArea(); - + descriptionTextArea = new UITextArea(DESCRIPTION_TEXT_AREA_ROW,DESCRIPTION_TEXT_AREA_COLUMN); descriptionTextArea.setBackground(Color.white); descriptionTextArea.setLineWrap(true); descriptionTextArea.setWrapStyleWord(true); @@ -1278,7 +1279,6 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { initDescriptionTextArea(); UIScrollPane desScrollPane = new UIScrollPane(descriptionTextArea); - desScrollPane.setPreferredSize(descriptionTextArea.getPreferredSize()); desScrollPane.setBorder(null); panel.add(this.createNamePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FormulaPane_Formula_Description") + ":", desScrollPane), BorderLayout.CENTER); initVariablesTreeSelectionListener(); From 76b290c4ad63f304f76ea9511be043bdd0b4c0d9 Mon Sep 17 00:00:00 2001 From: Carlson Date: Wed, 30 Nov 2022 16:33:39 +0800 Subject: [PATCH 208/310] =?UTF-8?q?REPORT-85902=20fix:=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=90=8D=E6=95=B0=E6=8D=AE=E9=9D=A2=E6=9D=BF=E5=A4=9A=E4=BA=86?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/data/table/SeriesNameUseFieldNamePane.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java index 65031b1408..ec63cda9b9 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java @@ -161,7 +161,9 @@ public class SeriesNameUseFieldNamePane extends FurtherBasicBeanPane Date: Thu, 1 Dec 2022 09:48:48 +0800 Subject: [PATCH 209/310] =?UTF-8?q?REPORT-85774=20sqlserver=E6=AD=BB?= =?UTF-8?q?=E9=94=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/connect/ConnectionListPane.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java index c38c27811f..23c22144b5 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java @@ -209,7 +209,7 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh * @return */ private boolean needUpdate0(Connection origin, Connection connection) { - return !connection.equals(origin) || !isEmbedConnection(connection); + return !connection.equals(origin) || !isEmbedConnection(connection); } /** @@ -257,12 +257,21 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh } private boolean saveByOldWay(List removedConnNames, List addedOrUpdatedConnections) { + final int remaining = ConnectionConfig.getInstance().getRemainingCon(removedConnNames.size(), addedOrUpdatedConnections.size()); try { return Configurations.modify(new WorkerFacade(ConnectionConfig.class) { @Override public void run() { removedConnNames.forEach(n -> ConnectionConfig.getInstance().removeConnection(n)); - addedOrUpdatedConnections.forEach(cb -> ConnectionConfig.getInstance().addConnection(cb.getName(), cb.getConnection())); + int innerRemaining = remaining; + for (ConnectionBean cb : addedOrUpdatedConnections) { + if (innerRemaining > 0) { + ConnectionConfig.getInstance().addConnectionWithoutCheck(cb.getName(), cb.getConnection()); + innerRemaining--; + } else { + break; + } + } } }); } catch (Exception e) { From 33c86b3f23900f627bba73536ad8238593f15e0a Mon Sep 17 00:00:00 2001 From: Harrison Date: Thu, 1 Dec 2022 11:14:16 +0800 Subject: [PATCH 210/310] =?UTF-8?q?REPORT-85960=20=E8=B5=B7=E5=A7=8B?= =?UTF-8?q?=E9=A1=B5=EF=BC=8C=E7=82=B9=E5=87=BB=E6=9C=80=E8=BF=91=E6=89=93?= =?UTF-8?q?=E5=BC=80=E7=9A=84fvs=E6=A8=A1=E6=9D=BF=EF=BC=8C=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E6=89=93=E5=BC=80=E5=A4=B1=E8=B4=A5=20=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E5=8A=A9=E6=89=8B=E6=89=93=E5=BC=80=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E6=97=B6=E4=BC=9A=E8=8E=B7=E5=8F=96=20path,=20=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E5=BD=93=E5=89=8D=E6=98=AF=E4=BD=BF=E7=94=A8=E7=A9=BA?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=89=93=E5=BC=80=EF=BC=8C=E5=88=99=E4=BC=9A?= =?UTF-8?q?=20npe,=20=E5=9C=A8=E4=B8=BBJAR=E5=85=BC=E5=AE=B9=E4=B8=80?= =?UTF-8?q?=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JNullTemplate.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JNullTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JNullTemplate.java index d10df810a2..e4eb797404 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JNullTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JNullTemplate.java @@ -204,4 +204,9 @@ public class JNullTemplate extends JTemplate { public int getToolBarHeight() { return 0; } + + @Override + public String getPath() { + return null; + } } From 7d1591436a936a8579da856b79d6f586381a3837 Mon Sep 17 00:00:00 2001 From: "John.Ying" Date: Thu, 1 Dec 2022 14:24:52 +0800 Subject: [PATCH 211/310] =?UTF-8?q?REPORT-85960=20=E8=B5=B7=E5=A7=8B?= =?UTF-8?q?=E9=A1=B5=EF=BC=8C=E7=82=B9=E5=87=BB=E6=9C=80=E8=BF=91=E6=89=93?= =?UTF-8?q?=E5=BC=80=E7=9A=84fvs=E6=A8=A1=E6=9D=BF=EF=BC=8C=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E6=89=93=E5=BC=80=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/carton/EventDispatchThreadHangMonitor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/carton/EventDispatchThreadHangMonitor.java b/designer-base/src/main/java/com/fr/design/carton/EventDispatchThreadHangMonitor.java index 56ccaa2c48..118c0858ef 100644 --- a/designer-base/src/main/java/com/fr/design/carton/EventDispatchThreadHangMonitor.java +++ b/designer-base/src/main/java/com/fr/design/carton/EventDispatchThreadHangMonitor.java @@ -314,7 +314,7 @@ public final class EventDispatchThreadHangMonitor extends EventQueue { * 将swing中默认的EventQueue换成自己的 */ public static void initMonitoring() { - Toolkit.getDefaultToolkit().getSystemEventQueue().push(INSTANCE); + SwingUtilities.invokeLater(() -> Toolkit.getDefaultToolkit().getSystemEventQueue().push(INSTANCE)); } /** From c19949c130d37df20acf63ecb11ece136a682120 Mon Sep 17 00:00:00 2001 From: Harrison Date: Thu, 1 Dec 2022 15:23:39 +0800 Subject: [PATCH 212/310] =?UTF-8?q?REPORT-86023=20=E8=B5=B7=E5=A7=8B?= =?UTF-8?q?=E9=A1=B5=E5=85=88=E8=BF=9B=E5=85=A5=E6=9C=AC=E5=9C=B0=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=EF=BC=8C=E5=86=8D=E8=BF=9B=E5=85=A5=E6=AC=A1=E7=AE=A1?= =?UTF-8?q?=E8=BF=9C=E7=A8=8B=E7=9B=AE=E5=BD=95=EF=BC=8C=E4=BC=9A=E6=9C=89?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=99=A8=E9=80=89=E9=A1=B9=20=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E6=98=AF=E4=B8=8D=E4=BC=9A=E5=88=B7=E6=96=B0=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E6=A0=8F=E7=9A=84=E3=80=82=E8=BF=99=E9=87=8C=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E4=B8=80=E4=B8=8B=E3=80=82=20(=E5=90=90=E6=A7=BD?= =?UTF-8?q?=E4=B8=80=E4=B8=8B=EF=BC=9A=E6=9D=83=E9=99=90=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=9C=89=E7=82=B9=E5=A4=AA=E6=95=A3=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JNullTemplate.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JNullTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JNullTemplate.java index e4eb797404..656344b186 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JNullTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JNullTemplate.java @@ -209,4 +209,9 @@ public class JNullTemplate extends JTemplate { public String getPath() { return null; } + + @Override + public void refreshToolArea() { + DesignerContext.getDesignerFrame().resetToolkitByPlus(this); + } } From a687873a777e4bf176f870b6670f7bc3aad1ffdd Mon Sep 17 00:00:00 2001 From: "John.Ying" Date: Thu, 1 Dec 2022 15:30:54 +0800 Subject: [PATCH 213/310] =?UTF-8?q?REPORT-85960=20=E8=B5=B7=E5=A7=8B?= =?UTF-8?q?=E9=A1=B5=EF=BC=8C=E7=82=B9=E5=87=BB=E6=9C=80=E8=BF=91=E6=89=93?= =?UTF-8?q?=E5=BC=80=E7=9A=84fvs=E6=A8=A1=E6=9D=BF=EF=BC=8C=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E6=89=93=E5=BC=80=E5=A4=B1=E8=B4=A5--=E6=9B=B4?= =?UTF-8?q?=E6=94=B9=E4=B8=80=E4=B8=8B=E5=B7=A5=E5=85=B7=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/carton/EventDispatchThreadHangMonitor.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/carton/EventDispatchThreadHangMonitor.java b/designer-base/src/main/java/com/fr/design/carton/EventDispatchThreadHangMonitor.java index 118c0858ef..a7bf03b407 100644 --- a/designer-base/src/main/java/com/fr/design/carton/EventDispatchThreadHangMonitor.java +++ b/designer-base/src/main/java/com/fr/design/carton/EventDispatchThreadHangMonitor.java @@ -1,6 +1,7 @@ package com.fr.design.carton; import com.fr.concurrent.FineExecutors; +import com.fr.design.ui.util.UIUtil; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; @@ -314,7 +315,7 @@ public final class EventDispatchThreadHangMonitor extends EventQueue { * 将swing中默认的EventQueue换成自己的 */ public static void initMonitoring() { - SwingUtilities.invokeLater(() -> Toolkit.getDefaultToolkit().getSystemEventQueue().push(INSTANCE)); + UIUtil.invokeLaterIfNeeded(() -> Toolkit.getDefaultToolkit().getSystemEventQueue().push(INSTANCE)); } /** From 8c91578dc48063685179ccd8ddb82aa7ae1c186e Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Thu, 1 Dec 2022 15:55:23 +0800 Subject: [PATCH 214/310] =?UTF-8?q?REPORT-84965=20=E6=8F=92=E4=BB=B6-?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E7=AE=A1=E7=90=86-=E6=8F=92=E4=BB=B6id?= =?UTF-8?q?=E9=87=8C=E6=9C=89=E4=B8=8B=E5=88=92=E7=BA=BF=EF=BC=8C=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E4=B9=8B=E5=90=8E=E6=97=A0=E6=B3=95=E5=88=A0=E9=99=A4?= =?UTF-8?q?=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E8=A7=A3=E6=9E=90'=5F'=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E4=BB=85=E8=80=83=E8=99=91=E6=9C=89=E4=B8=80=E4=B8=AA'=5F'=20?= =?UTF-8?q?=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=9C=80=E5=90=8E=E5=87=BA=E7=8E=B0=E7=9A=84'=5F'?= =?UTF-8?q?=E5=88=86=E9=9A=94id=E5=92=8Cversion=20=E3=80=90review=E5=BB=BA?= =?UTF-8?q?=E8=AE=AE=E3=80=91=E6=97=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/extra/PluginUtils.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/extra/PluginUtils.java b/designer-base/src/main/java/com/fr/design/extra/PluginUtils.java index 521821eadf..f12f8f8446 100644 --- a/designer-base/src/main/java/com/fr/design/extra/PluginUtils.java +++ b/designer-base/src/main/java/com/fr/design/extra/PluginUtils.java @@ -10,8 +10,8 @@ import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.plugin.PluginVerifyException; import com.fr.plugin.basic.version.Version; -import com.fr.plugin.basic.version.VersionIntervalType; import com.fr.plugin.basic.version.VersionIntervalFactory; +import com.fr.plugin.basic.version.VersionIntervalType; import com.fr.plugin.context.PluginContext; import com.fr.plugin.context.PluginMarker; import com.fr.plugin.error.PluginBaseErrorCode; @@ -23,7 +23,7 @@ import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; -import javax.swing.*; +import javax.swing.JOptionPane; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; @@ -47,9 +47,10 @@ public class PluginUtils { public static PluginMarker createPluginMarker(String pluginInfo) { - //todo 判空 - String[] plugin = pluginInfo.split("_"); - return PluginMarker.create(plugin[0], plugin[1]); + int splitIndex = pluginInfo.lastIndexOf("_"); + String pluginID = pluginInfo.substring(0, splitIndex); + String version = pluginInfo.substring(splitIndex + 1); + return PluginMarker.create(pluginID, version); } public static JSONObject getLatestPluginInfo(String pluginID) throws Exception { From f31f140aadfb6bf4901e6c551f73501ec7b669d3 Mon Sep 17 00:00:00 2001 From: Starryi Date: Thu, 1 Dec 2022 15:47:57 +0800 Subject: [PATCH 215/310] =?UTF-8?q?REPORT-85708=20FR10=E5=86=B3=E7=AD=96?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8-=E8=AE=BE=E8=AE=A1=E7=94=BB=E5=B8=83?= =?UTF-8?q?=E5=86=85=E7=9A=84=E6=8A=A5=E8=A1=A8=E5=9D=97=E7=9A=84=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 问题产生的原因有两点: 1. 生成的截图内容不全,只包含了表格可见部分内容 2. 使用报表块的尺寸对原始截图裁切时,裁切的尺寸不对 10.0/11.0都有此问题 【改动思路】 1. 对表格进行截图时,要使得表格可以绘制所有有内容的单元格 2. 当报表块创建或尺寸改变时,在handleSizeChange方法中通知修改裁切尺寸 --- .../design/designer/creator/XElementCase.java | 1 - .../form/FormElementCaseDesigner.java | 67 +++++++++++++------ 2 files changed, 48 insertions(+), 20 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java b/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java index 6b452bd08d..d1198d6094 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java @@ -51,7 +51,6 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme public XElementCase(ElementCaseEditor widget, Dimension initSize) { super(widget, initSize); - widget.getElementCaseImage().adjustImageSize(initSize.width, initSize.height, false); } protected void initXCreatorProperties() { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCaseDesigner.java b/designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCaseDesigner.java index 71d34ff445..02668947f9 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCaseDesigner.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCaseDesigner.java @@ -3,6 +3,8 @@ */ package com.fr.design.mainframe.form; +import com.fr.base.DynamicUnitList; +import com.fr.base.GraphHelper; import com.fr.base.TRL; import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignState; @@ -33,11 +35,14 @@ import com.fr.form.FormElementCaseProvider; import com.fr.form.fit.common.LightTool; import com.fr.form.main.Form; import com.fr.grid.Grid; +import com.fr.grid.GridUtils; import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.Selection; import com.fr.log.FineLoggerFactory; +import com.fr.report.ReportHelper; import com.fr.report.cell.CellElement; +import com.fr.report.elementcase.ElementCase; import com.fr.report.elementcase.TemplateElementCase; import com.fr.report.worksheet.FormElementCase; import com.fr.report.worksheet.WorkSheet; @@ -132,16 +137,23 @@ public class FormElementCaseDesigner } /** - * 获取当前ElementCase的缩略图 + * 获取当前ElementCase的缩略图, 缩略图中包含所有有内容的单元格 * * @param size 缩略图的大小 */ @Override public BufferedImage getElementCaseImage(Dimension size) { + Grid grid = this.elementCasePane != null ? this.elementCasePane.getGrid() : null; + if (grid == null) { + return new BufferedImage(0, 0, BufferedImage.TYPE_INT_RGB); + } + + resetGrid(grid); + BufferedImage image = null; try { - int width = size.width; - int height = size.height; + int width = Math.max(grid.getWidth(), size.width); + int height = Math.max(grid.getHeight(), size.width); // 使用TYPE_INT_RGB和new Color(255, 255, 255, 1)设置有透明背景buffer image, // 使得创建出来的透明像素是(255, 255, 255, 1),而不是(0, 0, 0, 0) @@ -157,20 +169,16 @@ public class FormElementCaseDesigner // 使得创建出来的透明像素是(255, 255, 255, 1),而不是(0, 0, 0, 0) // 这样不支持透明通道缩略图的旧设计器打开新设计器创建的模版时,就不会创建出拥有黑色背景的缩略图 g2d.setColor(new Color(255, 255, 255, 1)); - g2d.fillRect(0, 0, (int) size.getWidth(), (int) size.getHeight()); - - Grid grid = this.elementCasePane != null ? this.elementCasePane.getGrid() : null; - if (grid != null) { - resetGrid(grid); - boolean oldTranslucent = grid.isTranslucent(); - boolean oldShowExtraGridLine = grid.isShowExtraGridLine(); - // 截缩图图时grid需支持半透明,不能用默认白色填充画布,否则会遮挡组件样式背景 - grid.setTranslucent(true); - grid.setShowExtraGridLine(false); - grid.paint(g2d); - grid.setTranslucent(oldTranslucent); - grid.setShowExtraGridLine(oldShowExtraGridLine); - } + g2d.fillRect(0, 0, width, height); + + boolean oldTranslucent = grid.isTranslucent(); + boolean oldShowExtraGridLine = grid.isShowExtraGridLine(); + // 截缩图图时grid需支持半透明,不能用默认白色填充画布,否则会遮挡组件样式背景 + grid.setTranslucent(true); + grid.setShowExtraGridLine(false); + grid.paint(g2d); + grid.setTranslucent(oldTranslucent); + grid.setShowExtraGridLine(oldShowExtraGridLine); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); @@ -180,12 +188,33 @@ public class FormElementCaseDesigner } private void resetGrid(Grid grid) { - grid.setResolution(Constants.DEFAULT_WEBWRITE_AND_SCREEN_RESOLUTION); - grid.updateUI(); grid.setAdsorbHeight(0); grid.setAdsorbWidth(0); + grid.setVerticalValue(0); grid.setHorizontalValue(0); + + FormElementCasePaneDelegate reportPane = getEditingElementCasePane(); + ColumnRow lastColumnRow = GridUtils.getAdjustLastColumnRowOfReportPane(reportPane); + + int lastColumn = lastColumnRow.getColumn(); + int lastRow = lastColumnRow.getRow(); + + grid.setVerticalExtent(lastRow); + grid.setHorizontalExtent(lastColumn); + + ElementCase report = reportPane.getEditingElementCase(); + DynamicUnitList rowHeightList = ReportHelper.getRowHeightList(report); + DynamicUnitList columnWidthList = ReportHelper.getColumnWidthList(report); + + int resolution = grid.getResolution(); + int width = columnWidthList.getRangeValueFromZero(lastColumn).toPixI(resolution); + int height = rowHeightList.getRangeValueFromZero(lastRow).toPixI(resolution); + + int gridLineWidth = GraphHelper.getLineStyleSize(Constants.LINE_THIN); + grid.setSize(width + gridLineWidth, height + gridLineWidth); + + grid.updateUI(); } /** From dc66634a7eda5c1269c1ee87fedf481aa036d4ec Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 1 Dec 2022 17:22:13 +0800 Subject: [PATCH 216/310] =?UTF-8?q?REPORT-82895=20=E3=80=9011.0.11?= =?UTF-8?q?=E5=BB=B6=E6=9C=9F=E3=80=91=E5=8D=95=E5=85=83=E6=A0=BC=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E5=86=BB=E7=BB=93=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/freeze/FreezeAndRepeatPane.java | 13 ++ .../design/report/freeze/FreezePagePane.java | 16 ++ .../freeze/RepeatAndFreezeSettingPane.java | 209 +++++++++++++----- 3 files changed, 184 insertions(+), 54 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/report/freeze/FreezeAndRepeatPane.java b/designer-realize/src/main/java/com/fr/design/report/freeze/FreezeAndRepeatPane.java index a23de219be..c0af78bf06 100644 --- a/designer-realize/src/main/java/com/fr/design/report/freeze/FreezeAndRepeatPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/freeze/FreezeAndRepeatPane.java @@ -3,6 +3,8 @@ package com.fr.design.report.freeze; import java.awt.Dimension; import javax.swing.JComponent; import com.fr.design.gui.ilable.UILabel; + +import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.ispinner.UISpinner; @@ -27,6 +29,14 @@ public abstract class FreezeAndRepeatPane extends BasicBeanPane { Dimension size = new Dimension(43, 21); if (start instanceof UISpinner) { start.setPreferredSize(size); + ((UISpinner) start).addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + if (end instanceof UISpinner) { + ((UISpinner) end).setValue(Math.max(((UISpinner) start).getValue(), ((UISpinner) end).getValue())); + } + } + }); } if (end instanceof UISpinner) { end.setPreferredSize(size); @@ -63,6 +73,9 @@ public abstract class FreezeAndRepeatPane extends BasicBeanPane { * 给UISpinner添加Listener */ public void addListener(ChangeListener l) { + if (start instanceof UISpinner) { + ((UISpinner) start).addChangeListener(l); + } if (end instanceof UISpinner) { ((UISpinner) end).addChangeListener(l); } diff --git a/designer-realize/src/main/java/com/fr/design/report/freeze/FreezePagePane.java b/designer-realize/src/main/java/com/fr/design/report/freeze/FreezePagePane.java index edfacb396e..fdaa8c12aa 100644 --- a/designer-realize/src/main/java/com/fr/design/report/freeze/FreezePagePane.java +++ b/designer-realize/src/main/java/com/fr/design/report/freeze/FreezePagePane.java @@ -9,6 +9,7 @@ import com.fr.stable.StableUtils; public class FreezePagePane extends FreezeAndRepeatPane { private boolean isNumber; + private boolean isFoot; public FreezePagePane(boolean isNumber) { this.isNumber = isNumber; @@ -17,6 +18,14 @@ public class FreezePagePane extends FreezeAndRepeatPane { super.initComponent(); } + public FreezePagePane(boolean isNumber, boolean isFoot) { + this.isFoot = isFoot; + this.isNumber = isNumber; + start = new UILabel(isNumber ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Frozen_N.O.")+" 1" : com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Frozen_N.O.")+" A", SwingConstants.CENTER); + end = new UILabel(isNumber ? " 1"+com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Row") : " A"+com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column"), SwingConstants.CENTER); + super.initComponent(); + } + @Override protected String title4PopupWindow() { return "FreezePage"; @@ -29,6 +38,13 @@ public class FreezePagePane extends FreezeAndRepeatPane { } else { ((UILabel) end).setText(StableUtils.convertIntToABC(ob.getTo() + 1)+com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column")); } + if (isFoot) { + if (isNumber) { + ((UILabel) start).setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Frozen_N.O.")+String.valueOf(ob.getFrom() + 1)); + } else { + ((UILabel) start).setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Frozen_N.O.")+StableUtils.convertIntToABC(ob.getFrom() + 1)); + } + } } @Override diff --git a/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java b/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java index 17cf8566a9..5bece96b2a 100644 --- a/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java @@ -1,11 +1,14 @@ package com.fr.design.report.freeze; import com.fr.base.FRContext; +import com.fr.design.constants.UIConstants; import com.fr.design.dialog.BasicPane; import com.fr.design.extra.WebViewDlgHelper; +import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.ActionLabel; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.page.ReportPageAttrProvider; @@ -29,6 +32,9 @@ public class RepeatAndFreezeSettingPane extends BasicPane { //边框高度 private static final int LABEL_HEIGHT = 45; + //tab + private UITabbedPane tabbedPane; + // 重复标题行 private RepeatRowPane repeatTitleRowPane; // 重复标题列 @@ -41,6 +47,10 @@ public class RepeatAndFreezeSettingPane extends BasicPane { private FreezePagePane freezePageRowPane; // 分页冻结列 private FreezePagePane freezePageColPane; + //分页冻结结尾行 + private FreezePagePane freezeFootRowPane; + //分页冻结结尾列 + private FreezePagePane freezeFootColPane; // 填报冻结行 private FreezeWriteRowPane freezeWriteRowPane; // 填报冻结列 @@ -53,12 +63,21 @@ public class RepeatAndFreezeSettingPane extends BasicPane { private UICheckBox useRepeatFinisCCheckBox; // 分页冻结 - private UICheckBox usePageFrozenCCheckBox; - private UICheckBox usePageFrozenRCheckBox; + private UICheckBox usePageHeadFrozenCCheckBox; + private UICheckBox usePageHeadFrozenRCheckBox; + private UICheckBox usePageFootFrozenCCheckBox; + private UICheckBox usePageFootFrozenRCheckBox; // 填报冻结 private UICheckBox useWriteFrozenCCheckBox; private UICheckBox useWriteFrozenRCheckBox; + private static final int REPEAT_AND_FROZEN_WIDTH = 600, REPEAT_AND_FROZEN_HEIGHT = 100; + + //标题区域 + private static final String REPEAT_AND_FROZEN_HEAD = Toolkit.i18nText("Fine-Design_Report_Repeat_Head"); + //结尾区域 + private static final String REPEAT_AND_FROZEN_FOOT = Toolkit.i18nText("Fine-Design_Report_Repeat_Foot"); + /** * 重复标题行 */ @@ -137,30 +156,41 @@ public class RepeatAndFreezeSettingPane extends BasicPane { * 分页冻结Pane */ private JPanel initPageFrozenPane() { - JPanel pagePanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); // 分页冻结 - UILabel pageLabel = new UILabel(getPageFrozenTitle()); - JPanel pageLabelPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - pageLabelPanel.add(pageLabel); - pagePanel.add(pageLabelPanel, BorderLayout.NORTH); JPanel pagecon = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1); pagecon.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); - pagePanel.add(pagecon, BorderLayout.CENTER); - UILabel warningx = new UILabel("(" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Please_Set_Repeat_First") + ")"); - warningx.setForeground(Color.red); - pageLabelPanel.add(warningx); JPanel pageRowGridPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - pageRowGridPane.add(this.usePageFrozenRCheckBox = new UICheckBox()); - pagecon.add(pageRowGridPane); + pageRowGridPane.add(this.usePageHeadFrozenRCheckBox = new UICheckBox()); // 显示行冻结信息的panel freezePageRowPane = new FreezePagePane(true); pageRowGridPane.add(freezePageRowPane); + pagecon.add(pageRowGridPane); addPageFrozenCol(pagecon); + addBorder(pagecon, REPEAT_AND_FROZEN_HEAD); + return pagecon; + } - return pagePanel; + private JPanel initPageFrozenFootPane() { + JPanel pageContentPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1); + pageContentPanel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); + // 行冻结 + JPanel pageRowPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + pageRowPane.add(this.usePageFootFrozenRCheckBox = new UICheckBox()); + // 列冻结 + JPanel pageColPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + pageColPane.add(this.usePageFootFrozenCCheckBox = new UICheckBox()); + pageContentPanel.add(pageRowPane); + freezeFootRowPane = new FreezePagePane(true, true); + pageRowPane.add(freezeFootRowPane); + pageContentPanel.add(pageColPane); + freezeFootColPane = new FreezePagePane(false, true); + pageColPane.add(freezeFootColPane); + addBorder(pageContentPanel, REPEAT_AND_FROZEN_FOOT); + return pageContentPanel; } + /** * 分页冻结列 */ @@ -168,7 +198,7 @@ public class RepeatAndFreezeSettingPane extends BasicPane { // 显示列冻结信息的panel freezePageColPane = new FreezePagePane(false); JPanel pageColGridPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - pageColGridPane.add(this.usePageFrozenCCheckBox = new UICheckBox()); + pageColGridPane.add(this.usePageHeadFrozenCCheckBox = new UICheckBox()); pagecon.add(pageColGridPane); pageColGridPane.add(freezePageColPane); } @@ -209,13 +239,17 @@ public class RepeatAndFreezeSettingPane extends BasicPane { JPanel cenrepeatPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); outrepeatPanel.add(cenrepeatPanel); JPanel outfreezePanel = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Frozen")); - this.add(outrepeatPanel, BorderLayout.NORTH); - this.add(outfreezePanel, BorderLayout.CENTER); - JPanel repeatPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1); - repeatPanel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); - JPanel freezePanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); - - outfreezePanel.add(freezePanel); + JPanel pagePanel = new JPanel(FRGUIPaneFactory.createBorderLayout()); + JPanel repeatHeadPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1); + JPanel repeatFootPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1); + + //添加上方的边界线 + addBorder(repeatHeadPanel, REPEAT_AND_FROZEN_HEAD); + addBorder(repeatFootPanel, REPEAT_AND_FROZEN_FOOT); + + pagePanel.add(outrepeatPanel, BorderLayout.NORTH); + pagePanel.add(outfreezePanel, BorderLayout.CENTER); + // 重复打印部分 // 重复打印标题的起始行 JPanel labelPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); @@ -223,17 +257,26 @@ public class RepeatAndFreezeSettingPane extends BasicPane { UILabel warning = new UILabel("(" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_FreezeWarning") + ")"); warning.setForeground(Color.red); labelPanel.add(warning); - cenrepeatPanel.add(labelPanel, BorderLayout.NORTH); - cenrepeatPanel.add(repeatPanel, BorderLayout.CENTER); - - repeatPanel.add(initRowStartPane()); - addColStart(repeatPanel); - repeatPanel.add(initFootRowStarPane()); - addFootColStart(repeatPanel); - - freezePanel.add(initPageFrozenPane(), BorderLayout.NORTH); - addWriteFrozen(freezePanel); - + cenrepeatPanel.add(repeatHeadPanel, BorderLayout.NORTH); + cenrepeatPanel.add(repeatFootPanel, BorderLayout.CENTER); + + repeatHeadPanel.add(initRowStartPane()); + addColStart(repeatHeadPanel); + repeatFootPanel.add(initFootRowStarPane()); + addFootColStart(repeatFootPanel); + + + outfreezePanel.add(initPageFrozenPane(), BorderLayout.NORTH); + outfreezePanel.add(initPageFrozenFootPane(),BorderLayout.CENTER); + JPanel writePanel = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Frozen")); + addWriteFrozen(writePanel); + + tabbedPane = new UITabbedPane(); + //去除对应的焦点虚线边框 + tabbedPane.setFocusable(false); + tabbedPane.addTab(Toolkit.i18nText("Fine-Design_Basic_M_Page_Preview"), pagePanel); + tabbedPane.addTab(Toolkit.i18nText("Fine-Design_Basic_M_Write_Preview"), writePanel); + this.add(tabbedPane); initPageRwoListener(); initPageColListener(); initWriteListener(); @@ -253,8 +296,11 @@ public class RepeatAndFreezeSettingPane extends BasicPane { private void initPageRwoListener() { repeatTitleRowPane.addListener(freezePageRowListener); - // 分页重复冻结行 - usePageFrozenRCheckBox.addChangeListener(usePageFrozenRListener); + repeatFinisRowPane.addListener(freezePageFootRowListener); + // 分页重复冻结标题行 + usePageHeadFrozenRCheckBox.addChangeListener(usePageFrozenRListener); + //分页重复冻结结尾行 + usePageFootFrozenRCheckBox.addChangeListener(freezePageFootRowListener); //重复标题行 useRepeatTitleRCheckBox.addChangeListener(useRepeatTitleRListener); //重复结尾行 @@ -263,8 +309,11 @@ public class RepeatAndFreezeSettingPane extends BasicPane { protected void initPageColListener() { repeatTitleColPane.addListener(freezePageColListener); - // 分页重复冻结列 - usePageFrozenCCheckBox.addChangeListener(usePageFrozenCListener); + repeatFinisColPane.addListener(freezePageFootColListener); + // 分页重复冻结标题列 + usePageHeadFrozenCCheckBox.addChangeListener(usePageFrozenCListener); + //分页重复冻结结尾列 + usePageFootFrozenCCheckBox.addChangeListener(freezePageFootColListener); //重复标题列 useRepeatTitleCCheckBox.addChangeListener(useRepeatTitleCListener); //重复结尾列 @@ -287,7 +336,14 @@ public class RepeatAndFreezeSettingPane extends BasicPane { @Override public void stateChanged(ChangeEvent e) { - repeatFinisColPane.setEnabled(useRepeatFinisCCheckBox.isSelected()); + boolean flag = useRepeatFinisCCheckBox.isSelected(); + repeatFinisColPane.setEnabled(flag); + if (!flag) { + usePageFootFrozenCCheckBox.setSelected(false); + usePageFootFrozenCCheckBox.setEnabled(false); + } else { + usePageFootFrozenCCheckBox.setEnabled(true); + } } }; @@ -296,8 +352,14 @@ public class RepeatAndFreezeSettingPane extends BasicPane { @Override public void stateChanged(ChangeEvent e) { - repeatFinisRowPane.setEnabled(useRepeatFinisRCheckBox.isSelected()); - + boolean flag = useRepeatFinisRCheckBox.isSelected(); + repeatFinisRowPane.setEnabled(flag); + if (!flag) { + usePageFootFrozenRCheckBox.setSelected(false); + usePageFootFrozenRCheckBox.setEnabled(false); + } else { + usePageFootFrozenRCheckBox.setEnabled(true); + } } }; @@ -308,10 +370,10 @@ public class RepeatAndFreezeSettingPane extends BasicPane { boolean flag = useRepeatTitleCCheckBox.isSelected(); repeatTitleColPane.setEnabled(flag); if (!flag) { - usePageFrozenCCheckBox.setSelected(false); - usePageFrozenCCheckBox.setEnabled(false); + usePageHeadFrozenCCheckBox.setSelected(false); + usePageHeadFrozenCCheckBox.setEnabled(false); } else { - usePageFrozenCCheckBox.setEnabled(true); + usePageHeadFrozenCCheckBox.setEnabled(true); } } }; @@ -323,10 +385,10 @@ public class RepeatAndFreezeSettingPane extends BasicPane { boolean flag = useRepeatTitleRCheckBox.isSelected(); repeatTitleRowPane.setEnabled(flag); if (!flag) { - usePageFrozenRCheckBox.setSelected(false); - usePageFrozenRCheckBox.setEnabled(false); + usePageHeadFrozenRCheckBox.setSelected(false); + usePageHeadFrozenRCheckBox.setEnabled(false); } else { - usePageFrozenRCheckBox.setEnabled(true); + usePageHeadFrozenRCheckBox.setEnabled(true); } } }; @@ -352,14 +414,14 @@ public class RepeatAndFreezeSettingPane extends BasicPane { ChangeListener usePageFrozenCListener = new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { - freezePageColPane.setEnabled(usePageFrozenCCheckBox.isSelected()); + freezePageColPane.setEnabled(usePageHeadFrozenCCheckBox.isSelected()); } }; ChangeListener usePageFrozenRListener = new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { - freezePageRowPane.setEnabled(usePageFrozenRCheckBox.isSelected()); + freezePageRowPane.setEnabled(usePageHeadFrozenRCheckBox.isSelected()); } }; @@ -383,6 +445,28 @@ public class RepeatAndFreezeSettingPane extends BasicPane { } }; + // 分页重复冻结列数据联动(结尾行) + ChangeListener freezePageFootRowListener = new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + FT ft = repeatFinisRowPane.updateBean(); + int to = ft.getTo(); + int maxFrom = Math.max(ft.getFrom(), -1); + freezeFootRowPane.populateBean(new FT(maxFrom, Math.max(maxFrom, to))); + } + }; + + // 分页重复冻结列数据联动(结尾列) + ChangeListener freezePageFootColListener = new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + FT ft = repeatFinisColPane.updateBean(); + int to = ft.getTo(); + int maxFrom = Math.max(ft.getFrom(), -1); + freezeFootColPane.populateBean(new FT(maxFrom, Math.max(maxFrom, to))); + } + }; + /** * 窗口标题 * @@ -407,7 +491,8 @@ public class RepeatAndFreezeSettingPane extends BasicPane { if (isDefalut(ft)) { this.repeatTitleRowPane.populateBean(defaultFT); this.repeatTitleRowPane.setEnabled(false); - usePageFrozenRCheckBox.setEnabled(false); + usePageHeadFrozenRCheckBox.setEnabled(false); + usePageFootFrozenRCheckBox.setEnabled(false); } else { this.repeatTitleRowPane.populateBean(ft); useRepeatTitleRCheckBox.setSelected(true); @@ -423,7 +508,8 @@ public class RepeatAndFreezeSettingPane extends BasicPane { useRepeatFinisRCheckBox.setSelected(true); } - this.usePageFrozenRCheckBox.setSelected(attribute.isUsePageFrozenRow()); + this.usePageHeadFrozenRCheckBox.setSelected(attribute.isUsePageFrozenRow()); + this.usePageFootFrozenRCheckBox.setSelected(attribute.isUsePageFrozenRow()); this.freezePageRowPane.setEnabled(attribute.isUsePageFrozenRow()); } @@ -432,7 +518,8 @@ public class RepeatAndFreezeSettingPane extends BasicPane { if (isDefalut(ft)) { this.repeatTitleColPane.populateBean(defaultFT); this.repeatTitleColPane.setEnabled(false); - usePageFrozenCCheckBox.setEnabled(false); + usePageHeadFrozenCCheckBox.setEnabled(false); + usePageFootFrozenCCheckBox.setEnabled(false); } else { this.repeatTitleColPane.populateBean(ft); useRepeatTitleCCheckBox.setSelected(true); @@ -448,7 +535,8 @@ public class RepeatAndFreezeSettingPane extends BasicPane { useRepeatFinisCCheckBox.setSelected(true); } - this.usePageFrozenCCheckBox.setSelected(attribute.isUsePageFrozenColumn()); + this.usePageHeadFrozenCCheckBox.setSelected(attribute.isUsePageFrozenColumn()); + this.usePageFootFrozenCCheckBox.setSelected(attribute.isUsePageFrozenColumn()); this.freezePageColPane.setEnabled(attribute.isUsePageFrozenColumn()); } @@ -494,6 +582,17 @@ public class RepeatAndFreezeSettingPane extends BasicPane { return attribute; } + /** + * 给内部的重复与冻结选项添加指定的边框 + * + * @param jPanel 重复或冻结对应的界面 + * @param title 边框的文字 + */ + public static void addBorder(JPanel jPanel, String title) { + jPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createMatteBorder(1,0,0,0, UIConstants.TITLED_BORDER_COLOR), title)); + jPanel.setPreferredSize(new Dimension(REPEAT_AND_FROZEN_WIDTH,REPEAT_AND_FROZEN_HEIGHT)); + } + protected void updateRowPane(ReportPageAttrProvider attribute) { // 重复标题行 int titleFrom = valid(useRepeatTitleRCheckBox, this.repeatTitleRowPane.updateBean().getFrom()); @@ -506,7 +605,8 @@ public class RepeatAndFreezeSettingPane extends BasicPane { attribute.setRepeatFooterRowFrom(finishFrom); attribute.setRepeatFooterRowTo(finishTo); - attribute.setUsePageFrozenRow(this.usePageFrozenRCheckBox.isSelected()); + attribute.setUsePageFrozenRow(this.usePageHeadFrozenRCheckBox.isSelected() || this.usePageFootFrozenRCheckBox.isSelected()); + attribute.setUsePageFootFrozen(this.usePageFootFrozenRCheckBox.isSelected() || this.usePageFootFrozenCCheckBox.isSelected()); } private int valid(UICheckBox checkBox, int num) { @@ -524,7 +624,8 @@ public class RepeatAndFreezeSettingPane extends BasicPane { attribute.setRepeatFooterColumnFrom(finishFrom); attribute.setRepeatFooterColumnTo(finishTo); - attribute.setUsePageFrozenColumn(this.usePageFrozenCCheckBox.isSelected()); + attribute.setUsePageFrozenColumn(this.usePageHeadFrozenCCheckBox.isSelected() || this.usePageFootFrozenCCheckBox.isSelected()); + attribute.setUsePageFootFrozen(this.usePageFootFrozenRCheckBox.isSelected() || this.usePageFootFrozenCCheckBox.isSelected()); } /** From 60052676215c907d2ad3b313a7610f65843d8b16 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 1 Dec 2022 17:33:45 +0800 Subject: [PATCH 217/310] =?UTF-8?q?REPORT-82895=20=E3=80=9011.0.11?= =?UTF-8?q?=E5=BB=B6=E6=9C=9F=E3=80=91=E5=8D=95=E5=85=83=E6=A0=BC=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E5=86=BB=E7=BB=93=E4=BC=98=E5=8C=96=20=E6=9B=B4?= =?UTF-8?q?=E6=94=B9=E5=8F=98=E9=87=8F=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/report/freeze/FreezePagePane.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/report/freeze/FreezePagePane.java b/designer-realize/src/main/java/com/fr/design/report/freeze/FreezePagePane.java index fdaa8c12aa..03c279ec07 100644 --- a/designer-realize/src/main/java/com/fr/design/report/freeze/FreezePagePane.java +++ b/designer-realize/src/main/java/com/fr/design/report/freeze/FreezePagePane.java @@ -9,7 +9,7 @@ import com.fr.stable.StableUtils; public class FreezePagePane extends FreezeAndRepeatPane { private boolean isNumber; - private boolean isFoot; + private boolean foot; public FreezePagePane(boolean isNumber) { this.isNumber = isNumber; @@ -18,8 +18,8 @@ public class FreezePagePane extends FreezeAndRepeatPane { super.initComponent(); } - public FreezePagePane(boolean isNumber, boolean isFoot) { - this.isFoot = isFoot; + public FreezePagePane(boolean isNumber, boolean foot) { + this.foot = foot; this.isNumber = isNumber; start = new UILabel(isNumber ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Frozen_N.O.")+" 1" : com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Frozen_N.O.")+" A", SwingConstants.CENTER); end = new UILabel(isNumber ? " 1"+com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Row") : " A"+com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column"), SwingConstants.CENTER); @@ -38,7 +38,7 @@ public class FreezePagePane extends FreezeAndRepeatPane { } else { ((UILabel) end).setText(StableUtils.convertIntToABC(ob.getTo() + 1)+com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column")); } - if (isFoot) { + if (foot) { if (isNumber) { ((UILabel) start).setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Frozen_N.O.")+String.valueOf(ob.getFrom() + 1)); } else { From 72f18c340dcc10203be9a2fd010094e3dee6e762 Mon Sep 17 00:00:00 2001 From: Carlson Date: Fri, 2 Dec 2022 16:41:06 +0800 Subject: [PATCH 218/310] =?UTF-8?q?REPORT-85754=20fix:=E6=89=A9=E5=B1=95?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E5=9C=BA=E6=99=AF=E8=AE=BE=E7=BD=AE-js-?= =?UTF-8?q?=E9=AB=98=E7=BA=A7=E7=BC=96=E8=BE=91=E7=95=8C=E9=9D=A2=E4=B8=8D?= =?UTF-8?q?=E5=BA=94=E8=AF=A5=E7=BD=AE=E5=BA=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/javascript/JSContentPane.java | 9 +++++++++ .../com/fr/design/javascript/JavaScriptImplPane.java | 6 +++++- .../chart/custom/component/VanChartHyperLinkPane.java | 6 +++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java b/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java index c9344f5ca8..a31ebe8450 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java @@ -31,6 +31,7 @@ import java.awt.BorderLayout; import java.awt.Cursor; import java.awt.Dimension; import java.awt.FontMetrics; +import java.awt.Window; import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import java.awt.event.MouseAdapter; @@ -54,6 +55,7 @@ public class JSContentPane extends BasicPane { private JSImplUpdateAction jsImplUpdateAction; private JSImplPopulateAction jsImplPopulateAction; private boolean modal; + private Window parentWindow; BasicDialog advancedEditorDialog ; public JSContentPane(){} @@ -122,6 +124,9 @@ public class JSContentPane extends BasicPane { super.doCancel(); } },new Dimension(900,800)); + if (parentWindow != null) { + parentWindow.setVisible(false); + } advancedEditorDialog.setModal(modal); advancedEditorDialog.setResizable(true); advancedEditorDialog.pack(); @@ -133,6 +138,10 @@ public class JSContentPane extends BasicPane { labelPane.add(advancedEditorLabel,BorderLayout.EAST); } + public void setParentWindow(Window parentWindow) { + this.parentWindow = parentWindow; + } + protected UIScrollPane createContentTextAreaPanel(){ contentTextArea = new RSyntaxTextArea(); contentTextArea.setCloseCurlyBraces(true); diff --git a/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java b/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java index 6a83ad3d24..fa7e30dc44 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java @@ -29,6 +29,7 @@ import javax.swing.JPanel; import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelListener; +import java.awt.Window; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -49,6 +50,7 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane { public JavaScriptImplPane(HashMap hyperLinkEditorMap, boolean needRenamePane) { super(hyperLinkEditorMap, needRenamePane); this.defaultArgs = new String[0]; + this.modal = true; initComponents(); } @@ -149,7 +151,9 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane { return importedJsPane; } - + public void setParentWindow4ContentPane(Window parentWindow) { + jsPane.setParentWindow(parentWindow); + } /** * 参数改变 diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java index 6e5b346a18..1a23ca8162 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java @@ -77,7 +77,11 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane { Constructor constructor = null; try { constructor = creator.getUpdatePane().getConstructor(HashMap.class, boolean.class); - return constructor.newInstance(getHyperLinkEditorMap(), false); + BasicBeanPane pane = constructor.newInstance(getHyperLinkEditorMap(), false); + if (pane instanceof JavaScriptImplPane) { + ((JavaScriptImplPane) pane).setParentWindow4ContentPane(getPopupEditDialog()); + } + return pane; } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); From 2148c6a8300406a1bef370bdd7ef4b05fa2b16e4 Mon Sep 17 00:00:00 2001 From: "John.Ying" Date: Tue, 6 Dec 2022 17:24:17 +0800 Subject: [PATCH 219/310] =?UTF-8?q?KERNEL-13706=20=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E6=97=B6=EF=BC=8C=E4=B8=8D=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E5=AF=B9=E6=AF=8F=E4=B8=80=E4=B8=AA=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E9=83=BD=E5=8E=BB=E8=AF=B7=E6=B1=82=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/DesignModelAdapter.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/DesignModelAdapter.java b/designer-base/src/main/java/com/fr/design/DesignModelAdapter.java index 013c703fb2..bd4130a853 100644 --- a/designer-base/src/main/java/com/fr/design/DesignModelAdapter.java +++ b/designer-base/src/main/java/com/fr/design/DesignModelAdapter.java @@ -276,22 +276,28 @@ public abstract class DesignModelAdapter map, Filter filter) { Iterator it = this.getBook().getTableDataNameIterator(); + List names = new ArrayList<>(); try { - // 清空下缓存 - tableDataParametersMap.clear(); + List tableDatas = new ArrayList<>(); while (it.hasNext()) { String name = it.next(); TableData tableData = this.getBook().getTableData(name); - ParameterProvider[] parameterProviders = DataOperator.getInstance().getTableDataParameters(tableData); + tableDatas.add(tableData); + names.add(name); + } + ParameterProvider[][] totalParameterProviders = DataOperator.getInstance().getTotalTableDataParameters(tableDatas); + tableDataParametersMap.clear(); + for (int i = 0; i < totalParameterProviders.length; i++) { + ParameterProvider[] parameterProviders = totalParameterProviders[i]; if (filter != null) { ParameterApplyHelper.addPara2Map(map, parameterProviders, filter, null, ParameterSource.DEFAULT_SOURCE); } else { ParameterApplyHelper.addPara2Map(map, parameterProviders, null, ParameterSource.TEMPLATE_SOURCE); } - tableDataParametersMap.put(name, parameterProviders); + tableDataParametersMap.put(names.get(i), parameterProviders); } } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e, e.getMessage()); } } From fcd0863d2909e9caefdb664a3383a2f92b380424 Mon Sep 17 00:00:00 2001 From: Carlson Date: Wed, 7 Dec 2022 15:44:42 +0800 Subject: [PATCH 220/310] =?UTF-8?q?REPORT-85754=20fix:=E5=8F=82=E8=80=83cp?= =?UTF-8?q?t=E5=9B=BE=E8=A1=A8=E7=9A=84=E7=B1=BB=E4=BC=BC=E5=86=99?= =?UTF-8?q?=E6=B3=95=EF=BC=8C=E5=BC=95=E5=85=A5=E7=84=A6=E7=82=B9=E4=B8=A2?= =?UTF-8?q?=E5=A4=B1=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/gui/controlpane/UIControlPane.java | 98 ++++++++++--------- .../fr/design/javascript/JSContentPane.java | 18 +--- .../design/javascript/JavaScriptImplPane.java | 17 +--- .../component/VanChartHyperLinkPane.java | 18 +++- .../fr/design/condition/HyperlinkPane.java | 11 ++- 5 files changed, 82 insertions(+), 80 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java index f9a3ed0db3..12f904922d 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java @@ -31,7 +31,6 @@ import java.awt.Color; import java.awt.Cursor; import java.awt.Dimension; import java.awt.FlowLayout; -import java.awt.Font; import java.awt.Frame; import java.awt.Graphics; import java.awt.Graphics2D; @@ -241,51 +240,12 @@ public abstract class UIControlPane extends JControlPane { } private void hideDialog() { - // 检查是否有子弹窗,如果有,则不隐藏 - for (Window window : getOwnedWindows()) { - if (window.isVisible()) { - return; - } - } - // 如果有可见模态对话框,则不隐藏 - for (Window window : DesignerContext.getDesignerFrame().getOwnedWindows()) { - if (window instanceof JDialog && window.isVisible() && ((JDialog) window).isModal()) { - return; - } - } - - try { - //没有指定owner的弹出框用的是SwingUtilities.getSharedOwnerFrame() - Frame sharedOwnerFrame = Reflect.on(SwingUtilities.class).call("getSharedOwnerFrame").get(); - for (Window window : sharedOwnerFrame.getOwnedWindows()) { - if (window instanceof JDialog && window.isVisible() && ((JDialog) window).isModal()) { - // 如果有可见模态对话框,则不隐藏 - return; - } - } - } catch (Exception ignore) { - //do nothing - } - - // 要隐藏 先检查有没有非法输入 - // 非法输入检查放在最后,因为可能出现面板弹出新弹框而失去焦点的情况,比如 输入公式时,弹出公式编辑对话框 - try { - checkValid(); - } catch (Exception exp) { - // 存在非法输入 拒绝隐藏 - this.setAlwaysOnTop(true); - FineJOptionPane.showMessageDialog(this, exp.getMessage()); - this.requestFocus(); - return; - } - if (JavaFxNativeFileChooser.isShowDialogState()) { - JavaFxNativeFileChooser.setShowDialogState(false); - return; + if (needToHidePopupEditDialog()) { + saveSettings(); + setVisible(false); + PopupDialogSaveAction saveAction = OSSupportCenter.getAction(PopupDialogSaveAction.class); + saveAction.unregister(); } - saveSettings(); - setVisible(false); - PopupDialogSaveAction saveAction = OSSupportCenter.getAction(PopupDialogSaveAction.class); - saveAction.unregister(); } private void initListener() { @@ -302,6 +262,54 @@ public abstract class UIControlPane extends JControlPane { } } + /** + * 是否需要隐藏popupEditDialog + */ + protected boolean needToHidePopupEditDialog() { + // 检查是否有子弹窗,如果有,则不隐藏 + for (Window window : popupEditDialog.getOwnedWindows()) { + if (window.isVisible()) { + return false; + } + } + // 如果有可见模态对话框,则不隐藏 + for (Window window : DesignerContext.getDesignerFrame().getOwnedWindows()) { + if (window instanceof JDialog && window.isVisible() && ((JDialog) window).isModal()) { + return false; + } + } + + try { + //没有指定owner的弹出框用的是SwingUtilities.getSharedOwnerFrame() + Frame sharedOwnerFrame = Reflect.on(SwingUtilities.class).call("getSharedOwnerFrame").get(); + for (Window window : sharedOwnerFrame.getOwnedWindows()) { + if (window instanceof JDialog && window.isVisible() && ((JDialog) window).isModal()) { + // 如果有可见模态对话框,则不隐藏 + return false; + } + } + } catch (Exception ignore) { + //do nothing + } + + // 要隐藏 先检查有没有非法输入 + // 非法输入检查放在最后,因为可能出现面板弹出新弹框而失去焦点的情况,比如 输入公式时,弹出公式编辑对话框 + try { + checkValid(); + } catch (Exception exp) { + // 存在非法输入 拒绝隐藏 + popupEditDialog.setAlwaysOnTop(true); + FineJOptionPane.showMessageDialog(this, exp.getMessage()); + popupEditDialog.requestFocus(); + return false; + } + if (JavaFxNativeFileChooser.isShowDialogState()) { + JavaFxNativeFileChooser.setShowDialogState(false); + return false; + } + return true; + } + // 移动弹出编辑面板的工具条 private class PopupToolPane extends JPanel { private JDialog parentDialog; // 如果不在对话框中,值为null diff --git a/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java b/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java index a31ebe8450..31c45da762 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java @@ -24,23 +24,21 @@ import com.fr.design.javascript.jsapi.JSImplUpdateAction; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.general.IOUtils; - import com.fr.js.JavaScriptImpl; +import javax.swing.JPanel; +import javax.swing.KeyStroke; +import javax.swing.SwingConstants; +import javax.swing.SwingWorker; import java.awt.BorderLayout; import java.awt.Cursor; import java.awt.Dimension; import java.awt.FontMetrics; -import java.awt.Window; import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.ArrayList; -import javax.swing.JPanel; -import javax.swing.KeyStroke; -import javax.swing.SwingConstants; -import javax.swing.SwingWorker; public class JSContentPane extends BasicPane { protected RSyntaxTextArea contentTextArea; @@ -55,7 +53,6 @@ public class JSContentPane extends BasicPane { private JSImplUpdateAction jsImplUpdateAction; private JSImplPopulateAction jsImplPopulateAction; private boolean modal; - private Window parentWindow; BasicDialog advancedEditorDialog ; public JSContentPane(){} @@ -124,9 +121,6 @@ public class JSContentPane extends BasicPane { super.doCancel(); } },new Dimension(900,800)); - if (parentWindow != null) { - parentWindow.setVisible(false); - } advancedEditorDialog.setModal(modal); advancedEditorDialog.setResizable(true); advancedEditorDialog.pack(); @@ -138,10 +132,6 @@ public class JSContentPane extends BasicPane { labelPane.add(advancedEditorLabel,BorderLayout.EAST); } - public void setParentWindow(Window parentWindow) { - this.parentWindow = parentWindow; - } - protected UIScrollPane createContentTextAreaPanel(){ contentTextArea = new RSyntaxTextArea(); contentTextArea.setCloseCurlyBraces(true); diff --git a/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java b/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java index fa7e30dc44..37bca2f6eb 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java @@ -14,22 +14,18 @@ import com.fr.design.javascript.jsapi.JSImplUpdateAction; import com.fr.design.mainframe.DesignerContext; import com.fr.design.scrollruler.ModLineBorder; import com.fr.design.utils.gui.GUICoreUtils; - import com.fr.js.JavaScriptImpl; import com.fr.stable.ParameterProvider; import com.fr.stable.StringUtils; - -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.GridBagConstraints; -import java.awt.GridLayout; import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelListener; - -import java.awt.Window; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.GridBagConstraints; +import java.awt.GridLayout; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -50,7 +46,6 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane { public JavaScriptImplPane(HashMap hyperLinkEditorMap, boolean needRenamePane) { super(hyperLinkEditorMap, needRenamePane); this.defaultArgs = new String[0]; - this.modal = true; initComponents(); } @@ -151,10 +146,6 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane { return importedJsPane; } - public void setParentWindow4ContentPane(Window parentWindow) { - jsPane.setParentWindow(parentWindow); - } - /** * 参数改变 * diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java index 1a23ca8162..7b74d1576a 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java @@ -39,6 +39,8 @@ import com.fr.stable.Nameable; import com.fr.stable.bridge.StableFactory; import com.fr.van.chart.designer.component.VanChartUIListControlPane; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; @@ -77,11 +79,7 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane { Constructor constructor = null; try { constructor = creator.getUpdatePane().getConstructor(HashMap.class, boolean.class); - BasicBeanPane pane = constructor.newInstance(getHyperLinkEditorMap(), false); - if (pane instanceof JavaScriptImplPane) { - ((JavaScriptImplPane) pane).setParentWindow4ContentPane(getPopupEditDialog()); - } - return pane; + return constructor.newInstance(getHyperLinkEditorMap(), false); } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); @@ -190,6 +188,16 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane { } this.populate(nameObjects.toArray(new NameObject[nameObjects.size()])); + if (popupEditDialog instanceof HyperDialog) { + popupEditDialog.addWindowFocusListener(new WindowAdapter() { + @Override + public void windowLostFocus(WindowEvent e) { + if (needToHidePopupEditDialog()) { + popupEditDialog.setVisible(false); + } + } + }); + } doLayout(); } diff --git a/designer-realize/src/main/java/com/fr/design/condition/HyperlinkPane.java b/designer-realize/src/main/java/com/fr/design/condition/HyperlinkPane.java index 643ad78906..41e2ada868 100644 --- a/designer-realize/src/main/java/com/fr/design/condition/HyperlinkPane.java +++ b/designer-realize/src/main/java/com/fr/design/condition/HyperlinkPane.java @@ -9,12 +9,16 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.HyperlinkGroupPaneActionImpl; - -import com.fr.js.*; +import com.fr.js.EmailJavaScript; +import com.fr.js.JavaScript; +import com.fr.js.JavaScriptImpl; +import com.fr.js.NameJavaScriptGroup; +import com.fr.js.ReportletHyperlink; +import com.fr.js.WebHyperlink; import com.fr.report.cell.cellattr.highlight.HighlightAction; import com.fr.report.cell.cellattr.highlight.HyperlinkHighlightAction; -import javax.swing.*; +import javax.swing.SwingUtilities; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -47,6 +51,7 @@ public class HyperlinkPane extends ConditionAttrSingleConditionPane Date: Thu, 8 Dec 2022 20:28:08 +0800 Subject: [PATCH 221/310] =?UTF-8?q?REPORT-82895=20=E3=80=9011.0.11?= =?UTF-8?q?=E5=BB=B6=E6=9C=9F=E3=80=91=E5=8D=95=E5=85=83=E6=A0=BC=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E5=86=BB=E7=BB=93=E4=BC=98=E5=8C=96=20=E5=90=8E?= =?UTF-8?q?=E7=AB=AF=E6=96=B9=E6=A1=88=E9=87=8D=E8=AE=BE=EF=BC=8C=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E6=89=A9=E5=B1=95=E5=90=8E=E7=9A=84=E8=A1=8C=E5=88=97?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/report/freeze/RepeatAndFreezeSettingPane.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java b/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java index 5bece96b2a..11a3aba60c 100644 --- a/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java @@ -607,6 +607,8 @@ public class RepeatAndFreezeSettingPane extends BasicPane { attribute.setUsePageFrozenRow(this.usePageHeadFrozenRCheckBox.isSelected() || this.usePageFootFrozenRCheckBox.isSelected()); attribute.setUsePageFootFrozen(this.usePageFootFrozenRCheckBox.isSelected() || this.usePageFootFrozenCCheckBox.isSelected()); + + attribute.setUsePageFootRowFrozen(this.usePageFootFrozenRCheckBox.isSelected()); } private int valid(UICheckBox checkBox, int num) { @@ -626,6 +628,8 @@ public class RepeatAndFreezeSettingPane extends BasicPane { attribute.setUsePageFrozenColumn(this.usePageHeadFrozenCCheckBox.isSelected() || this.usePageFootFrozenCCheckBox.isSelected()); attribute.setUsePageFootFrozen(this.usePageFootFrozenRCheckBox.isSelected() || this.usePageFootFrozenCCheckBox.isSelected()); + + attribute.setUsePageFootColFrozen(this.usePageFootFrozenCCheckBox.isSelected()); } /** From 1d234a2c6b0f3f8cfc8d9e8a0b41cf36a7af7ea2 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 12 Dec 2022 15:53:50 +0800 Subject: [PATCH 222/310] =?UTF-8?q?REPORT-82895=20=E3=80=9011.0.11?= =?UTF-8?q?=E5=BB=B6=E6=9C=9F=E3=80=91=E5=8D=95=E5=85=83=E6=A0=BC=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E5=86=BB=E7=BB=93=E4=BC=98=E5=8C=96=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=87=8D=E5=A4=8D=E5=88=A4=E6=96=AD,=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/report/freeze/FreezePagePane.java | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/report/freeze/FreezePagePane.java b/designer-realize/src/main/java/com/fr/design/report/freeze/FreezePagePane.java index 03c279ec07..f40e384f04 100644 --- a/designer-realize/src/main/java/com/fr/design/report/freeze/FreezePagePane.java +++ b/designer-realize/src/main/java/com/fr/design/report/freeze/FreezePagePane.java @@ -4,6 +4,7 @@ import com.fr.design.gui.ilable.UILabel; import javax.swing.SwingConstants; +import com.fr.design.i18n.Toolkit; import com.fr.stable.FT; import com.fr.stable.StableUtils; @@ -21,8 +22,14 @@ public class FreezePagePane extends FreezeAndRepeatPane { public FreezePagePane(boolean isNumber, boolean foot) { this.foot = foot; this.isNumber = isNumber; - start = new UILabel(isNumber ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Frozen_N.O.")+" 1" : com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Frozen_N.O.")+" A", SwingConstants.CENTER); - end = new UILabel(isNumber ? " 1"+com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Row") : " A"+com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column"), SwingConstants.CENTER); + if (foot) { + start = new UILabel(isNumber ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Frozen_N.O.")+" 1" : com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Frozen_N.O.")+" A", SwingConstants.CENTER); + end = new UILabel(); + } else { + start = new UILabel(isNumber ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Frozen_N.O.")+" 1" : com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Frozen_N.O.")+" A", SwingConstants.CENTER); + end = new UILabel(isNumber ? " 1"+com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Row") : " A"+com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column"), SwingConstants.CENTER); + } + super.initComponent(); } @@ -33,17 +40,18 @@ public class FreezePagePane extends FreezeAndRepeatPane { @Override public void populateBean(FT ob) { - if (isNumber) { - ((UILabel) end).setText(String.valueOf(ob.getTo() + 1)+com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Row")); - } else { - ((UILabel) end).setText(StableUtils.convertIntToABC(ob.getTo() + 1)+com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column")); - } if (foot) { if (isNumber) { ((UILabel) start).setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Frozen_N.O.")+String.valueOf(ob.getFrom() + 1)); } else { ((UILabel) start).setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Frozen_N.O.")+StableUtils.convertIntToABC(ob.getFrom() + 1)); } + } else { + if (isNumber) { + ((UILabel) end).setText(String.valueOf(ob.getTo() + 1)+com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Row")); + } else { + ((UILabel) end).setText(StableUtils.convertIntToABC(ob.getTo() + 1)+com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column")); + } } } @@ -58,6 +66,11 @@ public class FreezePagePane extends FreezeAndRepeatPane { @Override public String getLabeshow() { - return isNumber ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Row_To") : com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column_To"); + if (foot) { + return isNumber ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Last_Row") : com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Last_Col"); + } else { + return isNumber ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Row_To") : com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column_To"); + } + } } From d7f7d1985c759821b99179074aca9c1d6082ddbe Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 13 Dec 2022 15:29:24 +0800 Subject: [PATCH 223/310] =?UTF-8?q?REPORT-85953=20=E3=80=90=E4=B8=8A?= =?UTF-8?q?=E6=B5=B7=E7=90=86=E5=85=89=E3=80=91=E6=A8=A1=E6=9D=BF=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E9=97=AE=E9=A2=98=20=E4=BF=9D=E5=AD=98=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=E4=B8=8D=E5=85=81=E8=AE=B8=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-realize/src/main/java/com/fr/start/MainDesigner.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 02116dc41c..d90ceb0556 100644 --- a/designer-realize/src/main/java/com/fr/start/MainDesigner.java +++ b/designer-realize/src/main/java/com/fr/start/MainDesigner.java @@ -368,7 +368,7 @@ public class MainDesigner extends BaseDesigner { @Override protected void upButtonClickEvent() { JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - if (jt == null) { + if (jt == null || jt.isSaving()) { return; } WebPreviewUtils.preview(jt); From 8bac6c7db46074f099562157a3f56413dd0dfaf4 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 13 Dec 2022 21:11:11 +0800 Subject: [PATCH 224/310] =?UTF-8?q?REPORT-82895=20=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E9=87=8D=E5=A4=8D=E5=86=BB=E7=BB=93=E4=BC=98=E5=8C=96?= =?UTF-8?q?=20=E5=86=B3=E7=AD=96=E6=8A=A5=E8=A1=A8=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E7=BB=93=E5=B0=BE=E5=86=BB=E7=BB=93=E5=AE=9E=E7=8E=B0=EF=BC=8C?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/ispinner/UISpinner.java | 10 ++++++++++ .../report/freeze/FreezeAndRepeatPane.java | 18 +++++++++++++++--- .../freeze/RepeatAndFreezeSettingPane.java | 10 +++++----- 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java b/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java index 18207011fe..a19db05060 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java +++ b/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java @@ -321,6 +321,16 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver textField.setMaxValue(maxValue); } + /** + * 设置最小值 + * + * @param minValue 最小值 + */ + public void setMinValue(double minValue) { + this.minValue = minValue; + textField.setMinValue(minValue); + } + private void componentInitListeners() { preButton.addActionListener(new ActionListener() { @Override diff --git a/designer-realize/src/main/java/com/fr/design/report/freeze/FreezeAndRepeatPane.java b/designer-realize/src/main/java/com/fr/design/report/freeze/FreezeAndRepeatPane.java index c0af78bf06..cf32a24b65 100644 --- a/designer-realize/src/main/java/com/fr/design/report/freeze/FreezeAndRepeatPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/freeze/FreezeAndRepeatPane.java @@ -32,14 +32,18 @@ public abstract class FreezeAndRepeatPane extends BasicBeanPane { ((UISpinner) start).addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { - if (end instanceof UISpinner) { - ((UISpinner) end).setValue(Math.max(((UISpinner) start).getValue(), ((UISpinner) end).getValue())); - } + updateEndValue(); } }); } if (end instanceof UISpinner) { end.setPreferredSize(size); + ((UISpinner) end).addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + updateEndValue(); + } + }); } this.setLayout(FRGUIPaneFactory.createBoxFlowLayout()); this.add(start); @@ -81,4 +85,12 @@ public abstract class FreezeAndRepeatPane extends BasicBeanPane { } } + + private void updateEndValue() { + if (end instanceof UISpinner) { + ((UISpinner) end).setMinValue(((UISpinner) start).getValue()); + ((UISpinner) end).setValue(((UISpinner) end).getValue()); + + } + } } \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java b/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java index 11a3aba60c..be7606a22d 100644 --- a/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java @@ -242,6 +242,7 @@ public class RepeatAndFreezeSettingPane extends BasicPane { JPanel pagePanel = new JPanel(FRGUIPaneFactory.createBorderLayout()); JPanel repeatHeadPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1); JPanel repeatFootPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1); + tabbedPane = new UITabbedPane(); //添加上方的边界线 addBorder(repeatHeadPanel, REPEAT_AND_FROZEN_HEAD); @@ -268,14 +269,12 @@ public class RepeatAndFreezeSettingPane extends BasicPane { outfreezePanel.add(initPageFrozenPane(), BorderLayout.NORTH); outfreezePanel.add(initPageFrozenFootPane(),BorderLayout.CENTER); + tabbedPane.addTab(Toolkit.i18nText("Fine-Design_Basic_M_Page_Preview"), pagePanel); JPanel writePanel = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Frozen")); addWriteFrozen(writePanel); - tabbedPane = new UITabbedPane(); //去除对应的焦点虚线边框 tabbedPane.setFocusable(false); - tabbedPane.addTab(Toolkit.i18nText("Fine-Design_Basic_M_Page_Preview"), pagePanel); - tabbedPane.addTab(Toolkit.i18nText("Fine-Design_Basic_M_Write_Preview"), writePanel); this.add(tabbedPane); initPageRwoListener(); initPageColListener(); @@ -322,6 +321,7 @@ public class RepeatAndFreezeSettingPane extends BasicPane { protected void addWriteFrozen(JPanel freezePanel) { freezePanel.add(initWriteFrozenPane(), BorderLayout.CENTER); + tabbedPane.addTab(Toolkit.i18nText("Fine-Design_Basic_M_Write_Preview"), freezePanel); } protected void addFootColStart(JPanel repeatPanel) { @@ -509,7 +509,7 @@ public class RepeatAndFreezeSettingPane extends BasicPane { } this.usePageHeadFrozenRCheckBox.setSelected(attribute.isUsePageFrozenRow()); - this.usePageFootFrozenRCheckBox.setSelected(attribute.isUsePageFrozenRow()); + this.usePageFootFrozenRCheckBox.setSelected(attribute.isUsePageFootRowFrozen()); this.freezePageRowPane.setEnabled(attribute.isUsePageFrozenRow()); } @@ -536,7 +536,7 @@ public class RepeatAndFreezeSettingPane extends BasicPane { } this.usePageHeadFrozenCCheckBox.setSelected(attribute.isUsePageFrozenColumn()); - this.usePageFootFrozenCCheckBox.setSelected(attribute.isUsePageFrozenColumn()); + this.usePageFootFrozenCCheckBox.setSelected(attribute.isUsePageFootColFrozen()); this.freezePageColPane.setEnabled(attribute.isUsePageFrozenColumn()); } From 303894c472f869d9083162ef95233bcd03a0a993 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 14 Dec 2022 10:37:57 +0800 Subject: [PATCH 225/310] =?UTF-8?q?REPORT-86364=20=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/actions/help/AboutPane.java | 4 +-- .../platform/ServicePlatformAction.java | 29 +++++++++++++++++++ .../mainframe/toolbar/ToolBarMenuDock.java | 7 +++-- .../images/platform/platform_normal.svg | 3 ++ 4 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/platform/ServicePlatformAction.java create mode 100644 designer-base/src/main/resources/com/fr/design/images/platform/platform_normal.svg diff --git a/designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java b/designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java index 6158540888..d24665f69b 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java @@ -126,8 +126,8 @@ public class AboutPane extends JPanel { if (GeneralContext.getLocale().equals(Locale.TAIWAN)) { return; } - boxCenterAlignmentPane = new BoxCenterAligmentPane("QQ: " + CloudCenter.getInstance().acquireUrlByKind("help.qq")); - contentPane.add(boxCenterAlignmentPane); + JPanel servicePlatformPane = getURLActionPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Service_Platform")+ ":", CloudCenter.getInstance().acquireUrlByKind("service.platform")); + contentPane.add(servicePlatformPane); } // 是否显示鸣谢面板 diff --git a/designer-base/src/main/java/com/fr/design/mainframe/platform/ServicePlatformAction.java b/designer-base/src/main/java/com/fr/design/mainframe/platform/ServicePlatformAction.java new file mode 100644 index 0000000000..b9fb5fd0e1 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/platform/ServicePlatformAction.java @@ -0,0 +1,29 @@ +package com.fr.design.mainframe.platform; + +import com.fr.design.actions.UpdateAction; +import com.fr.design.i18n.Toolkit; +import com.fr.general.CloudCenter; + +import java.awt.Desktop; +import java.awt.event.ActionEvent; +import java.net.URI; + +/** + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-12-14 + */ +public class ServicePlatformAction extends UpdateAction { + public ServicePlatformAction() { + this.setName(Toolkit.i18nText("Fine-Design_Basic_Service_Platform")); + this.setSmallIcon("/com/fr/design/images/platform/platform"); + } + + @Override + public void actionPerformed(ActionEvent e) { + try { + Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("service.platform"))); + } catch (Exception exp) { + } + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index 904c281560..ba734af660 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -56,6 +56,7 @@ import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.locale.impl.SupportLocaleImpl; import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.ToolBarNewTemplatePane; +import com.fr.design.mainframe.platform.ServicePlatformAction; import com.fr.design.menu.MenuDef; import com.fr.design.menu.SeparatorDef; import com.fr.design.menu.ShortCut; @@ -571,9 +572,11 @@ public abstract class ToolBarMenuDock { if (AlphaFineConfigManager.isALPHALicAvailable()) { shortCuts.add(new AlphaFineAction()); } - + shortCuts.add(new EnvDetectorAction()); - + //服务平台 + shortCuts.add(new ServicePlatformAction()); + shortCuts.add(SeparatorDef.DEFAULT); if (DesignerEnvManager.getEnvManager().isOpenDebug()) { OSSupportCenter.buildAction(objects -> shortCuts.add(new FineUIAction()), SupportOSImpl.FINEUI); diff --git a/designer-base/src/main/resources/com/fr/design/images/platform/platform_normal.svg b/designer-base/src/main/resources/com/fr/design/images/platform/platform_normal.svg new file mode 100644 index 0000000000..ab95e95f3c --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/platform/platform_normal.svg @@ -0,0 +1,3 @@ + + + From 19e6c4206cb07fa440d162c0bb4bece0d8d2e782 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 14 Dec 2022 10:44:34 +0800 Subject: [PATCH 226/310] =?UTF-8?q?REPORT-86364=20=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/actions/help/AboutPane.java | 2 +- .../fr/design/mainframe/platform/ServicePlatformAction.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java b/designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java index d24665f69b..dbb7798f3b 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java @@ -126,7 +126,7 @@ public class AboutPane extends JPanel { if (GeneralContext.getLocale().equals(Locale.TAIWAN)) { return; } - JPanel servicePlatformPane = getURLActionPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Service_Platform")+ ":", CloudCenter.getInstance().acquireUrlByKind("service.platform")); + JPanel servicePlatformPane = getURLActionPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Service_Platform"), CloudCenter.getInstance().acquireUrlByKind("service.platform")); contentPane.add(servicePlatformPane); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/platform/ServicePlatformAction.java b/designer-base/src/main/java/com/fr/design/mainframe/platform/ServicePlatformAction.java index b9fb5fd0e1..214b355680 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/platform/ServicePlatformAction.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/platform/ServicePlatformAction.java @@ -9,13 +9,15 @@ import java.awt.event.ActionEvent; import java.net.URI; /** + * 帮助-服务平台 + * * @author Destiny.Lin * @version 11.0 * created by Destiny.Lin on 2022-12-14 */ public class ServicePlatformAction extends UpdateAction { public ServicePlatformAction() { - this.setName(Toolkit.i18nText("Fine-Design_Basic_Service_Platform")); + this.setName(Toolkit.i18nText("Fine-Design_Basic_Service_Platform_Title")); this.setSmallIcon("/com/fr/design/images/platform/platform"); } From d34c6db4de185ca029a2e6d135ec9e22f3927ada Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 14 Dec 2022 10:51:30 +0800 Subject: [PATCH 227/310] =?UTF-8?q?REPORT-86364=20=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/platform/ServicePlatformAction.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/platform/ServicePlatformAction.java b/designer-base/src/main/java/com/fr/design/mainframe/platform/ServicePlatformAction.java index 214b355680..7912354501 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/platform/ServicePlatformAction.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/platform/ServicePlatformAction.java @@ -2,7 +2,9 @@ package com.fr.design.mainframe.platform; import com.fr.design.actions.UpdateAction; import com.fr.design.i18n.Toolkit; +import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; +import com.fr.log.FineLoggerFactory; import java.awt.Desktop; import java.awt.event.ActionEvent; @@ -23,9 +25,6 @@ public class ServicePlatformAction extends UpdateAction { @Override public void actionPerformed(ActionEvent e) { - try { - Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("service.platform"))); - } catch (Exception exp) { - } + BrowseUtils.browser(CloudCenter.getInstance().acquireUrlByKind("service.platform")); } } From 9f3c569080e01340d12b7c7c9d2f9e1ca6979689 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 15 Dec 2022 17:08:57 +0800 Subject: [PATCH 228/310] =?UTF-8?q?REPORT-86809=20=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E9=87=8D=E5=A4=8D=E5=86=BB=E7=BB=93-=E6=96=B0?= =?UTF-8?q?=E5=89=8D=E7=AB=AF-=E4=BA=A4=E4=BA=92=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../freeze/FormECRepeatAndFreezeSettingPane.java | 2 +- .../freeze/RepeatAndFreezeSettingPane.java | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/report/freeze/FormECRepeatAndFreezeSettingPane.java b/designer-realize/src/main/java/com/fr/design/report/freeze/FormECRepeatAndFreezeSettingPane.java index 2e9a17c4dc..250e7b6042 100644 --- a/designer-realize/src/main/java/com/fr/design/report/freeze/FormECRepeatAndFreezeSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/freeze/FormECRepeatAndFreezeSettingPane.java @@ -28,7 +28,7 @@ public class FormECRepeatAndFreezeSettingPane extends RepeatAndFreezeSettingPane } - protected void addWriteFrozen(JPanel freezePanel) { + protected void addWriteFrozen(JPanel freezePanel, JPanel pagePanel) { } diff --git a/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java b/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java index be7606a22d..ede5d7671d 100644 --- a/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java @@ -269,13 +269,13 @@ public class RepeatAndFreezeSettingPane extends BasicPane { outfreezePanel.add(initPageFrozenPane(), BorderLayout.NORTH); outfreezePanel.add(initPageFrozenFootPane(),BorderLayout.CENTER); - tabbedPane.addTab(Toolkit.i18nText("Fine-Design_Basic_M_Page_Preview"), pagePanel); + outfreezePanel.add(new UILabel(" "+ Toolkit.i18nText("Fine-Design_Report_Engine_Freeze_Tip") + ""),BorderLayout.SOUTH); JPanel writePanel = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Frozen")); - addWriteFrozen(writePanel); + addWriteFrozen(writePanel, pagePanel); - //去除对应的焦点虚线边框 - tabbedPane.setFocusable(false); - this.add(tabbedPane); + if (tabbedPane.getTabSize() == 0) { + this.add(pagePanel); + } initPageRwoListener(); initPageColListener(); initWriteListener(); @@ -319,9 +319,13 @@ public class RepeatAndFreezeSettingPane extends BasicPane { useRepeatFinisCCheckBox.addChangeListener(useRepeatFinisCListener); } - protected void addWriteFrozen(JPanel freezePanel) { + protected void addWriteFrozen(JPanel freezePanel, JPanel pagePanel) { freezePanel.add(initWriteFrozenPane(), BorderLayout.CENTER); + tabbedPane.addTab(Toolkit.i18nText("Fine-Design_Basic_M_Page_Preview"), pagePanel); tabbedPane.addTab(Toolkit.i18nText("Fine-Design_Basic_M_Write_Preview"), freezePanel); + //去除对应的焦点虚线边框 + tabbedPane.setFocusable(false); + this.add(tabbedPane); } protected void addFootColStart(JPanel repeatPanel) { From ee4d41fbe8ea50fe6e2e6ffaf97f7467eb4a7a80 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Fri, 16 Dec 2022 14:09:33 +0800 Subject: [PATCH 229/310] =?UTF-8?q?REPORT-85618=20=E3=80=90FR=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8-=E7=A7=BB=E5=8A=A8=E7=AB=AF=E3=80=91?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E9=A1=BA=E5=BA=8F-frm=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=EF=BC=8C=E7=BB=84=E4=BB=B6=E4=BF=AE=E6=94=B9=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E5=90=8E=EF=BC=8Cbody-=E7=A7=BB=E5=8A=A8=E7=AB=AF-=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E9=A1=BA=E5=BA=8F=E4=BC=9A=E6=8E=92=E5=88=B0=E6=9C=80?= =?UTF-8?q?=E5=90=8E=E4=B8=80=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/widget/ui/FormSingleWidgetCardPane.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java index 81e3a53641..dc5a4cb81a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java @@ -31,6 +31,7 @@ import com.fr.design.widget.ui.designer.component.WidgetCardTagBoundPane; import com.fr.form.ui.ChartEditor; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WScaleLayout; +import com.fr.form.ui.container.WSortLayout; import com.fr.form.ui.container.WTitleLayout; import com.fr.form.ui.widget.CRBoundsWidget; import com.fr.general.ComparatorUtils; @@ -241,7 +242,12 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane { showNameInvalidDialog(Toolkit.i18nText("Fine-Design_Form_Chart_Widget_Rename_Failure")); return; } + String oldName = widget.getWidgetName(); widgetPropertyPane.update(widget); + Widget innerWidget = WSortLayout.getInnerWidget(widget); + if (!StringUtils.equals(oldName, innerWidget.getWidgetName())) { + innerWidget.setMobileOldWidgetName(oldName); + } // 上面一行更新了组件 这里必须重新调用getWidgetName xCreator.resetCreatorName(widget.getWidgetName()); xCreator.resetVisible(widget.isVisible()); From d75a4f345a3be06bbe583119914e8d5021b4d0a2 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Fri, 16 Dec 2022 14:40:39 +0800 Subject: [PATCH 230/310] =?UTF-8?q?REPORT-85618=20=E3=80=90FR=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8-=E7=A7=BB=E5=8A=A8=E7=AB=AF=E3=80=91?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E9=A1=BA=E5=BA=8F-frm=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=EF=BC=8C=E7=BB=84=E4=BB=B6=E4=BF=AE=E6=94=B9=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E5=90=8E=EF=BC=8Cbody-=E7=A7=BB=E5=8A=A8=E7=AB=AF-=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E9=A1=BA=E5=BA=8F=E4=BC=9A=E6=8E=92=E5=88=B0=E6=9C=80?= =?UTF-8?q?=E5=90=8E=E4=B8=80=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/widget/ui/FormSingleWidgetCardPane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java index dc5a4cb81a..98c539f278 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java @@ -28,6 +28,7 @@ import com.fr.design.widget.Operator; import com.fr.design.widget.ui.designer.component.WidgetAbsoluteBoundPane; import com.fr.design.widget.ui.designer.component.WidgetBoundPane; import com.fr.design.widget.ui.designer.component.WidgetCardTagBoundPane; +import com.fr.form.main.WidgetUtil; import com.fr.form.ui.ChartEditor; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WScaleLayout; @@ -244,7 +245,7 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane { } String oldName = widget.getWidgetName(); widgetPropertyPane.update(widget); - Widget innerWidget = WSortLayout.getInnerWidget(widget); + Widget innerWidget = WidgetUtil.getInnerWidget(widget); if (!StringUtils.equals(oldName, innerWidget.getWidgetName())) { innerWidget.setMobileOldWidgetName(oldName); } From 6f7c26a886e0e99c24587f63ba10c48ca2a9529a Mon Sep 17 00:00:00 2001 From: WeiYanglu <> Date: Fri, 16 Dec 2022 14:55:18 +0800 Subject: [PATCH 231/310] =?UTF-8?q?REPORT-87060=20Swing=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E5=9C=A8Swing=E7=BA=BF=E7=A8=8B=E9=81=BF?= =?UTF-8?q?=E5=85=8D=E7=BA=BF=E7=A8=8B=E5=8D=A1=E6=AD=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/data/DesignTableDataManager.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java index 2ce2a7d828..91c2080479 100644 --- a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java +++ b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java @@ -41,6 +41,7 @@ import com.fr.stable.StringUtils; import com.fr.stable.xml.XMLPrintWriter; import javax.swing.JFrame; +import javax.swing.SwingUtilities; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.io.ByteArrayOutputStream; @@ -649,13 +650,15 @@ public abstract class DesignTableDataManager { } private static void showParaWindow(final Map parameterMap, ParameterProvider[] inParameters) { - final ParameterInputPane pPane = new ParameterInputPane(inParameters); - pPane.showSmallWindow(new JFrame(), new DialogActionAdapter() { - @Override - public void doOk() { - parameterMap.putAll(pPane.update()); - } - }).setVisible(true); + SwingUtilities.invokeLater(() -> { + final ParameterInputPane pPane = new ParameterInputPane(inParameters); + pPane.showSmallWindow(new JFrame(), new DialogActionAdapter() { + @Override + public void doOk() { + parameterMap.putAll(pPane.update()); + } + }).setVisible(true); + }); } public static void setThreadLocal(String value) { From a89021bdeb17860386a62fc25d16a48ea4b5eec6 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Fri, 16 Dec 2022 16:01:14 +0800 Subject: [PATCH 232/310] =?UTF-8?q?REPORT-87124=20=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=9C=80=E8=A6=81=E5=AF=B9?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=B9=B3=E5=8F=B0=E5=81=9A=E4=B8=8B=E9=9A=90?= =?UTF-8?q?=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/toolbar/ToolBarMenuDock.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index ba734af660..3c75eff39d 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -574,8 +574,11 @@ public abstract class ToolBarMenuDock { } shortCuts.add(new EnvDetectorAction()); - //服务平台 - shortCuts.add(new ServicePlatformAction()); + //服务平台(仅针对中国大陆) + if (GeneralContext.getLocale().equals(Locale.CHINA)) { + shortCuts.add(new ServicePlatformAction()); + } + shortCuts.add(SeparatorDef.DEFAULT); if (DesignerEnvManager.getEnvManager().isOpenDebug()) { From 42f9d5ee53dea2040500dff98449e32141cb0dbf Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Fri, 16 Dec 2022 16:40:44 +0800 Subject: [PATCH 233/310] =?UTF-8?q?REPORT-86482=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E8=8E=B7=E5=8F=96=E6=97=B6=E9=97=B4=E8=8C=83?= =?UTF-8?q?=E5=9B=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/update/ui/dialog/UpdateMainDialog.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java b/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java index 0dd70e03cd..1fa37f60f8 100644 --- a/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java +++ b/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java @@ -488,7 +488,7 @@ public class UpdateMainDialog extends UIDialog { continue; } } - if (isValidLogInfo(updateInfo[UpdateInfoTable.UPDATE_TITLE_INDEX]) && curJarDate != null) { + if (isValid(updateInfo, GeneralUtils.objectToString(curJarDate))) { updateInfoList.add(new Object[]{UPDATELOG_FORMAT.format(updateTime), updateInfo[UpdateInfoTable.UPDATE_VERSION_INDEX], updateInfo[UpdateInfoTable.UPDATE_TITLE_INDEX], updateTime.after(curJarDate)}); } } @@ -499,6 +499,11 @@ public class UpdateMainDialog extends UIDialog { } } + + private boolean isValid(String[] updateInfo, String curJarDate) { + return isValidLogInfo(updateInfo[UpdateInfoTable.UPDATE_TITLE_INDEX]) && curJarDate != null && curJarDate.compareTo(updateInfo[UpdateInfoTable.UPDATE_DATE_INDEX]) <= 0; + } + private void updateCachedInfoFile(JSONArray jsonArray) throws Exception { String cacheDirPath = StableUtils.pathJoin(WorkContext.getCurrent().getPath(), "resources", "offlineres"); File cacheFileDir = new File(cacheDirPath); @@ -554,13 +559,18 @@ public class UpdateMainDialog extends UIDialog { continue; } } - if (isValidLogInfo(updateTitle)) { + Date curDate = UPDATE_INFO_TABLE_FORMAT.parse(currentNO, new ParsePosition(currentNO.indexOf("-") + 1)); + if (isValid4GenerateInfo(updateTitle, GeneralUtils.objectToString(curDate), updateTimeStr)) { updateInfoList.add(new Object[]{updateTimeStr, updateVersionStr, updateTitle, updateTime.after(curJarDate)}); } } return new ArrayList<>(updateInfoList); } + private boolean isValid4GenerateInfo(String updateTitle, String curDate, String updateTimeStr) { + return isValidLogInfo(updateTitle) && curDate.compareTo(updateTimeStr) <= 0; + } + private boolean containsKeyword(String str, String keyword) { return str.toUpperCase().contains(keyword.toUpperCase()); } From 911468c341895888d9df7e649352975587b24737 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 19 Dec 2022 17:47:32 +0800 Subject: [PATCH 234/310] =?UTF-8?q?REPORT-87102=20=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E9=87=8D=E5=A4=8D=E5=86=BB=E7=BB=93-=E6=96=B0?= =?UTF-8?q?=E5=89=8D=E7=AB=AF-=E4=BA=A4=E4=BA=92-=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=9C=A8=E6=9C=AA=E5=8B=BE=E9=80=89=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E7=BB=93=E5=B0=BE=E8=A1=8C=E7=9A=84=E6=83=85=E5=86=B5?= =?UTF-8?q?=E4=B8=8B=E5=86=BB=E7=BB=93=E7=BB=93=E5=B0=BE=E8=A1=8C=E6=98=AF?= =?UTF-8?q?=E5=8F=AF=E9=80=89=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java b/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java index ede5d7671d..5e6376bddf 100644 --- a/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java @@ -534,6 +534,7 @@ public class RepeatAndFreezeSettingPane extends BasicPane { this.repeatFinisColPane.populateBean(defaultFT); this.repeatFinisColPane.setEnabled(false); useRepeatFinisCCheckBox.setSelected(false); + usePageFootFrozenCCheckBox.setEnabled(false); } else { this.repeatFinisColPane.populateBean(ft); useRepeatFinisCCheckBox.setSelected(true); From 3da2a0856d6411a0eb7504e1083d2f857bfd17a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvan-=E6=AC=A7=E9=98=B3=E5=B8=86?= Date: Tue, 20 Dec 2022 10:34:28 +0800 Subject: [PATCH 235/310] =?UTF-8?q?REPORT-75091=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=84=B1=E6=95=8F=E4=B8=80=E4=BA=8C=E6=9C=9F=E8=A7=A3=E9=99=A4?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=B1=8F=E8=94=BD=20=E3=80=90=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91rt=20=E3=80=90=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91rt=20=E3=80=90review?= =?UTF-8?q?=E5=BB=BA=E8=AE=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/data/datapane/preview/PreviewTablePane.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java index 027afdf5b2..f65d4a9cfa 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java @@ -162,9 +162,8 @@ public class PreviewTablePane extends BasicPane { JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); // 预览行数面板 northPane.add(initPreviewNumberPane(), BorderLayout.CENTER); - /// 迭代延期,暂时屏蔽下功能入口 // 脱敏预览设置面板 -// northPane.add(initDesensitizationPane(), BorderLayout.EAST); + northPane.add(initDesensitizationPane(), BorderLayout.EAST); initDesensitizationPane(); return northPane; } From f016fc362880566514c86589bdd4b689936f0cab Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 20 Dec 2022 17:00:20 +0800 Subject: [PATCH 236/310] =?UTF-8?q?REPORT-87102=20=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E9=87=8D=E5=A4=8D=E5=86=BB=E7=BB=93-=E6=96=B0?= =?UTF-8?q?=E5=89=8D=E7=AB=AF-=E4=BA=A4=E4=BA=92-=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=9C=A8=E6=9C=AA=E5=8B=BE=E9=80=89=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E7=BB=93=E5=B0=BE=E8=A1=8C=E7=9A=84=E6=83=85=E5=86=B5?= =?UTF-8?q?=E4=B8=8B=E5=86=BB=E7=BB=93=E7=BB=93=E5=B0=BE=E8=A1=8C=E6=98=AF?= =?UTF-8?q?=E5=8F=AF=E9=80=89=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/report/freeze/RepeatAndFreezeSettingPane.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java b/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java index 5e6376bddf..4ba6a10ebc 100644 --- a/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java @@ -496,7 +496,6 @@ public class RepeatAndFreezeSettingPane extends BasicPane { this.repeatTitleRowPane.populateBean(defaultFT); this.repeatTitleRowPane.setEnabled(false); usePageHeadFrozenRCheckBox.setEnabled(false); - usePageFootFrozenRCheckBox.setEnabled(false); } else { this.repeatTitleRowPane.populateBean(ft); useRepeatTitleRCheckBox.setSelected(true); @@ -507,6 +506,7 @@ public class RepeatAndFreezeSettingPane extends BasicPane { this.repeatFinisRowPane.populateBean(defaultFT); this.repeatFinisRowPane.setEnabled(false); useRepeatFinisRCheckBox.setSelected(false); + usePageFootFrozenRCheckBox.setEnabled(false); } else { this.repeatFinisRowPane.populateBean(ft); useRepeatFinisRCheckBox.setSelected(true); @@ -523,7 +523,6 @@ public class RepeatAndFreezeSettingPane extends BasicPane { this.repeatTitleColPane.populateBean(defaultFT); this.repeatTitleColPane.setEnabled(false); usePageHeadFrozenCCheckBox.setEnabled(false); - usePageFootFrozenCCheckBox.setEnabled(false); } else { this.repeatTitleColPane.populateBean(ft); useRepeatTitleCCheckBox.setSelected(true); From f992e29eee870ae7dacbd3b46422e6387efea9fd Mon Sep 17 00:00:00 2001 From: WeiYanglu <> Date: Wed, 21 Dec 2022 11:31:02 +0800 Subject: [PATCH 237/310] =?UTF-8?q?REPORT-87323=20=E8=BF=98=E5=8E=9F?= =?UTF-8?q?=E6=94=B9=E5=8A=A8=EF=BC=8C=E5=AF=BC=E8=87=B4=E6=9C=AA=E8=BE=93?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E5=B0=B1=E5=87=BA=E7=8E=B0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E9=A2=84=E8=A7=88=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/data/DesignTableDataManager.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java index 91c2080479..2ce2a7d828 100644 --- a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java +++ b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java @@ -41,7 +41,6 @@ import com.fr.stable.StringUtils; import com.fr.stable.xml.XMLPrintWriter; import javax.swing.JFrame; -import javax.swing.SwingUtilities; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.io.ByteArrayOutputStream; @@ -650,15 +649,13 @@ public abstract class DesignTableDataManager { } private static void showParaWindow(final Map parameterMap, ParameterProvider[] inParameters) { - SwingUtilities.invokeLater(() -> { - final ParameterInputPane pPane = new ParameterInputPane(inParameters); - pPane.showSmallWindow(new JFrame(), new DialogActionAdapter() { - @Override - public void doOk() { - parameterMap.putAll(pPane.update()); - } - }).setVisible(true); - }); + final ParameterInputPane pPane = new ParameterInputPane(inParameters); + pPane.showSmallWindow(new JFrame(), new DialogActionAdapter() { + @Override + public void doOk() { + parameterMap.putAll(pPane.update()); + } + }).setVisible(true); } public static void setThreadLocal(String value) { From 5a717baaea4cc0f968841f55dff8675ce5ac932c Mon Sep 17 00:00:00 2001 From: "Cloud.Liu" Date: Thu, 22 Dec 2022 21:46:31 +0800 Subject: [PATCH 238/310] =?UTF-8?q?KERNEL-12978=20fix:=20=E9=80=82?= =?UTF-8?q?=E9=85=8DCBB=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/actions/file/LocalePane.java | 3 ++- .../main/java/com/fr/design/actions/file/PreferencePane.java | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/LocalePane.java b/designer-base/src/main/java/com/fr/design/actions/file/LocalePane.java index 634af28b9e..843b3bf724 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/LocalePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/LocalePane.java @@ -12,6 +12,7 @@ import com.fr.design.gui.itextfield.UITextField; import com.fr.file.filetree.FileNode; import com.fr.general.GeneralUtils; +import com.fr.general.Inter; import com.fr.locale.InterProviderFactory; import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; @@ -121,7 +122,7 @@ public class LocalePane extends BasicPane { private void initPredefinedProperties() { - Map supportLocaleMap = InterProviderFactory.getProvider().getSupportLocaleMap(); + Map supportLocaleMap = Inter.getSupportLocaleMap(); // richie:暂时去掉设计器中国际化键值对的显示 Map map = new HashMap<>(); diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index 46485409bb..840de5867b 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -46,7 +46,6 @@ import com.fr.general.IOUtils; import com.fr.general.Inter; import com.fr.general.log.Log4jConfig; import com.fr.io.attr.ImageExportAttr; -import com.fr.locale.InterProviderFactory; import com.fr.log.FineLoggerFactory; import com.fr.report.ReportConfigManager; import com.fr.stable.Constants; @@ -634,7 +633,7 @@ public class PreferencePane extends BasicPane { } private UIDictionaryComboBox createLanguageComboBox() { - Map map = InterProviderFactory.getProvider().getSupportLocaleMap(); + Map map = Inter.getSupportLocaleMap(); int size = map.size(); Locale[] keys = new Locale[size]; String[] values = new String[size]; From 187e9170416f32ac094f0f58a74675e0501fe3e8 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Fri, 23 Dec 2022 17:29:12 +0800 Subject: [PATCH 239/310] =?UTF-8?q?REPORT-82895=20=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E9=87=8D=E5=A4=8D=E5=86=BB=E7=BB=93=E4=BC=98=E5=8C=96?= =?UTF-8?q?=20=E6=8A=BD=E5=8F=96=E5=88=A4=E6=96=AD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../freeze/RepeatAndFreezeSettingPane.java | 48 ++++++++++++++++++- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java b/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java index 4ba6a10ebc..b9806ddb39 100644 --- a/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java @@ -583,9 +583,53 @@ public class RepeatAndFreezeSettingPane extends BasicPane { updateRowPane(attribute); updateColPane(attribute); + //单独将重复、分页、填报处理一下,原先的判断逻辑比较混乱,抽出来方便判断 + updateUseAttr(attribute); + return attribute; } + private void updateUseAttr(ReportPageAttrProvider attribute) { + attribute.setUseRepeat(isUseRepeat()); + attribute.setUsePageFrozen(isUsePageFrozen()); + attribute.setUseWriteFrozen(isUseWriteFrozen()); + } + + /** + * 是否使用填报冻结 + * + * @return 使用则返回true + */ + private boolean isUseWriteFrozen() { + return this.useWriteFrozenCCheckBox.isSelected() + || this.useWriteFrozenRCheckBox.isSelected(); + } + + + /** + * 是否使用分页冻结 + * + * @return 使用则返回true + */ + private boolean isUsePageFrozen() { + return this.usePageHeadFrozenRCheckBox.isSelected() + || this.usePageHeadFrozenCCheckBox.isSelected() + || this.usePageFootFrozenRCheckBox.isSelected() + || this.usePageFootFrozenCCheckBox.isSelected(); + } + + /** + * 是否使用重复 + * + * @return 使用返回true + */ + private boolean isUseRepeat() { + return this.useRepeatTitleRCheckBox.isSelected() + || this.useRepeatFinisRCheckBox.isSelected() + || this.useRepeatTitleCCheckBox.isSelected() + || this.useRepeatFinisCCheckBox.isSelected(); + } + /** * 给内部的重复与冻结选项添加指定的边框 * @@ -609,7 +653,7 @@ public class RepeatAndFreezeSettingPane extends BasicPane { attribute.setRepeatFooterRowFrom(finishFrom); attribute.setRepeatFooterRowTo(finishTo); - attribute.setUsePageFrozenRow(this.usePageHeadFrozenRCheckBox.isSelected() || this.usePageFootFrozenRCheckBox.isSelected()); + attribute.setUsePageFrozenRow(this.usePageHeadFrozenRCheckBox.isSelected()); attribute.setUsePageFootFrozen(this.usePageFootFrozenRCheckBox.isSelected() || this.usePageFootFrozenCCheckBox.isSelected()); attribute.setUsePageFootRowFrozen(this.usePageFootFrozenRCheckBox.isSelected()); @@ -630,7 +674,7 @@ public class RepeatAndFreezeSettingPane extends BasicPane { attribute.setRepeatFooterColumnFrom(finishFrom); attribute.setRepeatFooterColumnTo(finishTo); - attribute.setUsePageFrozenColumn(this.usePageHeadFrozenCCheckBox.isSelected() || this.usePageFootFrozenCCheckBox.isSelected()); + attribute.setUsePageFrozenColumn(this.usePageHeadFrozenCCheckBox.isSelected()); attribute.setUsePageFootFrozen(this.usePageFootFrozenRCheckBox.isSelected() || this.usePageFootFrozenCCheckBox.isSelected()); attribute.setUsePageFootColFrozen(this.usePageFootFrozenCCheckBox.isSelected()); From 11cc506f1aaa860c8eada9a3cb52a424ccf1357c Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 26 Dec 2022 18:27:40 +0800 Subject: [PATCH 240/310] =?UTF-8?q?REPORT-87566=20=E3=80=90=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=A0=BC=E9=87=8D=E5=A4=8D=E5=86=BB=E7=BB=93=E3=80=91?= =?UTF-8?q?FRM-22.12.26=E7=9A=84release=E5=88=86=E6=94=AF=EF=BC=8CFRM?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=86=BB=E7=BB=93=E7=9A=84=E7=AA=97=E5=8F=A3?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E6=97=B6=E6=97=A0=E5=93=8D=E5=BA=94=E4=B8=94?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=9C=89=E7=A9=BA=E6=8C=87=E9=92=88=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/report/freeze/FormECRepeatAndFreezeSettingPane.java | 2 +- .../com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/report/freeze/FormECRepeatAndFreezeSettingPane.java b/designer-realize/src/main/java/com/fr/design/report/freeze/FormECRepeatAndFreezeSettingPane.java index 250e7b6042..6e53599492 100644 --- a/designer-realize/src/main/java/com/fr/design/report/freeze/FormECRepeatAndFreezeSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/freeze/FormECRepeatAndFreezeSettingPane.java @@ -29,7 +29,7 @@ public class FormECRepeatAndFreezeSettingPane extends RepeatAndFreezeSettingPane } protected void addWriteFrozen(JPanel freezePanel, JPanel pagePanel) { - + super.initWriteFrozenPane(); } } \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java b/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java index b9806ddb39..0d5ca8de7f 100644 --- a/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java @@ -206,7 +206,7 @@ public class RepeatAndFreezeSettingPane extends BasicPane { /** * 填报冻结Pane */ - private JPanel initWriteFrozenPane() { + protected JPanel initWriteFrozenPane() { JPanel writePanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); // 填报冻结 UILabel writeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Face_Write_Frozen") + ":"); From 91383d8d020026dee17b8ce0c6a42fd48344a2d7 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 30 Dec 2022 13:38:05 +0800 Subject: [PATCH 241/310] =?UTF-8?q?KERNEL-13094=20=E6=94=AF=E6=8C=81frm?= =?UTF-8?q?=E7=9A=84=E7=BB=84=E4=BB=B6copy=E5=88=B0fvs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../beans/models/ClipboardProvider.java | 18 ++++++++ .../models/DashboardClipboardManager.java | 45 +++++++++++++++++++ .../beans/models/FormSelectionClipboard.java | 45 +++++++++++++++++++ .../designer/beans/models/SelectionModel.java | 26 ++++++----- 4 files changed, 122 insertions(+), 12 deletions(-) create mode 100644 designer-form/src/main/java/com/fr/design/designer/beans/models/ClipboardProvider.java create mode 100644 designer-form/src/main/java/com/fr/design/designer/beans/models/DashboardClipboardManager.java create mode 100644 designer-form/src/main/java/com/fr/design/designer/beans/models/FormSelectionClipboard.java diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/ClipboardProvider.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/ClipboardProvider.java new file mode 100644 index 0000000000..4382fc35f7 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/ClipboardProvider.java @@ -0,0 +1,18 @@ +package com.fr.design.designer.beans.models; + +public interface ClipboardProvider { + + /** + * 剪切到剪贴板 + * + * @param o 剪切对象 + */ + void cut2Clipboard(Object o); + + /** + * 复制到剪贴板 + * + * @param o 复制对象 + */ + void copy2Clipboard(Object o); +} diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/DashboardClipboardManager.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/DashboardClipboardManager.java new file mode 100644 index 0000000000..55cf2f12c7 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/DashboardClipboardManager.java @@ -0,0 +1,45 @@ +package com.fr.design.designer.beans.models; + +import java.util.ArrayList; +import java.util.List; + +/** + * 用来管理不同剪贴板,以及之间的数据同步 + */ +public class DashboardClipboardManager { + private static class Holder { + private static final DashboardClipboardManager HOLDER = new DashboardClipboardManager(); + } + + private static final List CLIPBOARD_LIST = new ArrayList<>(); + + + public void registerDashboardClipboard(ClipboardProvider clipboard) { + CLIPBOARD_LIST.add(clipboard); + } + + public void removeDashboardClipboard(ClipboardProvider clipboard) { + CLIPBOARD_LIST.remove(clipboard); + } + + public static DashboardClipboardManager getInstance() { + return Holder.HOLDER; + } + + private DashboardClipboardManager() { + } + + public void cut2Clipboard(Object o) { + for (ClipboardProvider clipboard : CLIPBOARD_LIST) { + //同步其他剪贴板 + clipboard.cut2Clipboard(o); + } + } + + public void copy2Clipboard(Object o) { + for (ClipboardProvider clipboard : CLIPBOARD_LIST) { + //同步其他剪贴板 + clipboard.copy2Clipboard(o); + } + } +} diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/FormSelectionClipboard.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/FormSelectionClipboard.java new file mode 100644 index 0000000000..a190532769 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/FormSelectionClipboard.java @@ -0,0 +1,45 @@ +package com.fr.design.designer.beans.models; + +import com.fr.design.mainframe.FormSelection; + +public class FormSelectionClipboard implements ClipboardProvider { + private static final FormSelection FRM_CLIPBOARD = new FormSelection(); + + static { + DashboardClipboardManager.getInstance().registerDashboardClipboard(FormSelectionClipboard.getInstance()); + } + + private static class Holder { + private static final FormSelectionClipboard HOLDER = new FormSelectionClipboard(); + } + + public static FormSelectionClipboard getInstance() { + return Holder.HOLDER; + } + + private FormSelectionClipboard() { + } + + + public boolean isEmpty() { + return FRM_CLIPBOARD.isEmpty(); + } + + public FormSelection getClipboard() { + return FRM_CLIPBOARD; + } + + @Override + public void cut2Clipboard(Object o) { + if (o instanceof FormSelection) { + ((FormSelection) o).cut2ClipBoard(FRM_CLIPBOARD); + } + } + + @Override + public void copy2Clipboard(Object o) { + if (o instanceof FormSelection) { + ((FormSelection) o).copy2ClipBoard(FRM_CLIPBOARD); + } + } +} diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java index f75e08d723..807325a3b4 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java @@ -46,12 +46,14 @@ public class SelectionModel { //被粘贴组件在所选组件位置处往下、往右各错开20像素。执行多次粘贴时,在上一次粘贴的位置处错开20像素。 private static final int DELTA_X_Y = 20; //粘贴时候的偏移距离 private static final double OFFSET_RELATIVE = 0.80; - private static FormSelection clipboard = new FormSelection(); + private static FormSelectionClipboard formClipboard = FormSelectionClipboard.getInstance(); private FormDesigner designer; private FormSelection selection; private Rectangle hotspotBounds; private FormWidgetOptionProvider provider; + + public SelectionModel(FormDesigner designer) { this.designer = designer; selection = new FormSelection(); @@ -71,7 +73,7 @@ public class SelectionModel { * @return 是否为空 */ public static boolean isEmpty() { - return clipboard.isEmpty(); + return formClipboard.isEmpty(); } /** @@ -161,7 +163,7 @@ public class SelectionModel { if (hasSelectionComponent()) { FormSelection cutSelection = ClipboardFilter.cut(selection); if (cutSelection != null) { - cutSelection.cut2ClipBoard(clipboard); + DashboardClipboardManager.getInstance().cut2Clipboard(cutSelection); designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_CUTED); setSelectedCreator(hasSelectedParaComponent() ? designer.getParaComponent() : designer.getRootComponent()); designer.repaint(); @@ -192,7 +194,7 @@ public class SelectionModel { if (!selection.isEmpty()) { FormSelection copySelection = ClipboardFilter.copy(selection); if (copySelection != null) { - copySelection.copy2ClipBoard(clipboard); + DashboardClipboardManager.getInstance().copy2Clipboard(copySelection); } } } @@ -203,7 +205,7 @@ public class SelectionModel { * @return 否 */ public boolean pasteFromClipBoard() { - FormSelection pasteSelection = ClipboardFilter.paste(clipboard); + FormSelection pasteSelection = ClipboardFilter.paste(formClipboard.getClipboard()); if (pasteSelection != null && !pasteSelection.isEmpty()) { if (!hasSelectedPasteSource()) { //未选 @@ -240,7 +242,7 @@ public class SelectionModel { //编辑器外面还有两层容器,使用designer.getRootComponent()获取到的是编辑器中层的容器,不是编辑器表层 //当前选择的就是编辑器表层 FormSelectionUtils.paste2Container(designer, (XLayoutContainer) selection.getSelectedCreator(), - clipboard, + formClipboard.getClipboard(), DELTA_X_Y, DELTA_X_Y); } @@ -248,7 +250,7 @@ public class SelectionModel { //cpt本地组件复用,编辑器就一层,是最底层,使用designer.getRootComponent()就可以获取到 //使用selection.getSelectedCreator()也应该是可以获取到的。 FormSelectionUtils.paste2Container(designer, designer.getRootComponent(), - clipboard, + formClipboard.getClipboard(), DELTA_X_Y, DELTA_X_Y); } @@ -266,7 +268,7 @@ public class SelectionModel { if (hasSelectedPasteSource()) { selectedPaste(); } else { - FormSelectionUtils.paste2Container(designer, container, clipboard, + FormSelectionUtils.paste2Container(designer, container, formClipboard.getClipboard(), rectangle.x + rectangle.width / 2, rectangle.y + DELTA_X_Y); } @@ -281,7 +283,7 @@ public class SelectionModel { selectedPaste(); } else { FormSelectionUtils.paste2Container(designer, designer.getRootComponent(), - clipboard, + formClipboard.getClipboard(), rectangle.x + rectangle.width / 2, rectangle.y + DELTA_X_Y); } @@ -314,13 +316,13 @@ public class SelectionModel { positionX = selectionRec.x - containerRec.x + selectionRec.width / 2; positionY = (int) (selectionRec.y - containerRec.y + selectionRec.height * OFFSET_RELATIVE); } - FormSelectionUtils.paste2Container(designer, container, clipboard, positionX, positionY); + FormSelectionUtils.paste2Container(designer, container, formClipboard.getClipboard(), positionX, positionY); } else if (container != null && selection.getSelectedCreator().getParent() instanceof XWAbsoluteLayout) { //绝对布局 Rectangle rec = selection.getSelctionBounds(); - FormSelectionUtils.paste2Container(designer, container, clipboard, rec.x + DELTA_X_Y, rec.y + DELTA_X_Y); + FormSelectionUtils.paste2Container(designer, container, formClipboard.getClipboard(), rec.x + DELTA_X_Y, rec.y + DELTA_X_Y); } else if (isExtraContainer(container)) { - provider.paste2Container(clipboard); + provider.paste2Container(formClipboard.getClipboard()); } } From fde70048f5afc823badc0ac2e085bfc4f8806e25 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 3 Jan 2023 10:19:06 +0800 Subject: [PATCH 242/310] =?UTF-8?q?REPORT-82895=20=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E9=87=8D=E5=A4=8D=E5=86=BB=E7=BB=93=E4=BC=98=E5=8C=96?= =?UTF-8?q?=20=E6=89=93=E5=BC=80=E6=8A=A5=E9=94=99=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/report/freeze/FreezeAndRepeatPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/report/freeze/FreezeAndRepeatPane.java b/designer-realize/src/main/java/com/fr/design/report/freeze/FreezeAndRepeatPane.java index cf32a24b65..a946b63b16 100644 --- a/designer-realize/src/main/java/com/fr/design/report/freeze/FreezeAndRepeatPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/freeze/FreezeAndRepeatPane.java @@ -87,7 +87,7 @@ public abstract class FreezeAndRepeatPane extends BasicBeanPane { private void updateEndValue() { - if (end instanceof UISpinner) { + if (end instanceof UISpinner && start instanceof UISpinner) { ((UISpinner) end).setMinValue(((UISpinner) start).getValue()); ((UISpinner) end).setValue(((UISpinner) end).getValue()); From 20fbc3032c9b86236fe2e6c46d869415ba989a3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=2EYing-=E5=BA=94=E5=BF=97=E6=B5=A9?= Date: Tue, 3 Jan 2023 15:31:31 +0800 Subject: [PATCH 243/310] =?UTF-8?q?REPORT-87787=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E6=8A=A5=E9=94=99=EF=BC=8C=20File=20not=20ex?= =?UTF-8?q?ists:/com/fr/design/images/platform/platform?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/platform/ServicePlatformAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/platform/ServicePlatformAction.java b/designer-base/src/main/java/com/fr/design/mainframe/platform/ServicePlatformAction.java index 7912354501..c6dc9a9b66 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/platform/ServicePlatformAction.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/platform/ServicePlatformAction.java @@ -20,7 +20,7 @@ import java.net.URI; public class ServicePlatformAction extends UpdateAction { public ServicePlatformAction() { this.setName(Toolkit.i18nText("Fine-Design_Basic_Service_Platform_Title")); - this.setSmallIcon("/com/fr/design/images/platform/platform"); + this.setSmallIcon("/com/fr/design/images/platform/platform", false); } @Override From 022637b26f2776cf601f3138c72b6ebe3e3847d5 Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 3 Jan 2023 15:37:55 +0800 Subject: [PATCH 244/310] =?UTF-8?q?REPORT-86045=20FR11=E5=86=B3=E7=AD=96?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E5=81=87=E4=BF=9D=E5=AD=98-=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E5=9D=97=E5=86=85=E6=92=A4=E9=94=80=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E5=86=8D=E7=BC=96=E8=BE=91=E9=99=A4=E6=AD=A4=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E5=9D=97=E5=A4=96=E9=83=A8=E5=88=86=EF=BC=8C=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=20=E5=AE=9E=E9=99=85=E6=9C=AA=E4=BF=9D?= =?UTF-8?q?=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 在报表块编辑模式下重置Form对象,比如setTarget,需要做些额外 的工作,才能确保新的target完全可用,主要是要确保散落 在formDesign中各处的对象,如selectedCreators等,要有新的 target对象保持一致,否则再回到表单编辑界面时,就不能通过 这些creators,对target对象进行修改了。 【改动思路】 将表单编辑界面的一些修改操作也放到报表块编辑模式场景下执行, 确保该更新的都能更新到 --- .../java/com/fr/design/mainframe/JForm.java | 88 ++++++++++--------- 1 file changed, 47 insertions(+), 41 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index e3162e9ef6..4e9c45ce44 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -6,8 +6,6 @@ import com.fr.base.Parameter; import com.fr.base.Releasable; import com.fr.base.extension.FileExtension; import com.fr.base.iofile.attr.ExtendSharableAttrMark; -import com.fr.base.theme.FineColorGather; -import com.fr.base.theme.FineColorManager; import com.fr.base.theme.FineColorSynchronizer; import com.fr.base.theme.FormTheme; import com.fr.base.theme.TemplateTheme; @@ -17,8 +15,8 @@ import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignModelAdapter; import com.fr.design.DesignState; import com.fr.design.DesignerEnvManager; -import com.fr.design.actions.FormMobileAttrAction; import com.fr.design.actions.FormECParallelCalAction; +import com.fr.design.actions.FormMobileAttrAction; import com.fr.design.actions.TemplateParameterAction; import com.fr.design.actions.core.WorkBookSupportable; import com.fr.design.actions.file.export.EmbeddedFormExportExportAction; @@ -56,8 +54,8 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.form.FormECCompositeProvider; import com.fr.design.mainframe.form.FormECDesignerProvider; import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo; -import com.fr.design.mainframe.share.collect.ComponentCollector; import com.fr.design.mainframe.share.ComponentShareUtil; +import com.fr.design.mainframe.share.collect.ComponentCollector; import com.fr.design.mainframe.template.info.JFormProcessInfo; import com.fr.design.mainframe.template.info.TemplateProcessInfo; import com.fr.design.mainframe.theme.dialog.TemplateThemeUsingDialog; @@ -71,7 +69,6 @@ import com.fr.design.parameter.ParameterPropertyPane; import com.fr.design.preview.FormPreview; import com.fr.design.preview.MobilePreview; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; -import com.fr.design.ui.util.UIUtil; import com.fr.design.utils.gui.LayoutUtils; import com.fr.file.FILE; import com.fr.file.FILEChooserPane; @@ -110,7 +107,14 @@ import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.SwingConstants; import javax.swing.tree.TreePath; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Insets; +import java.awt.Rectangle; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.image.BufferedImage; @@ -1266,46 +1270,48 @@ public class JForm extends JTemplate implements BaseJForm Date: Wed, 4 Jan 2023 10:19:09 +0800 Subject: [PATCH 245/310] =?UTF-8?q?REPORT-87843=20=E5=A4=8D=E5=88=B6?= =?UTF-8?q?=E7=89=B9=E5=AE=9A=E6=96=87=E4=BB=B6=E5=A4=B9=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=EF=BC=8C=E2=80=9C=E7=9A=84=E5=89=AF=E6=9C=AC=E2=80=9D=E5=90=8E?= =?UTF-8?q?=E7=BC=80=E4=BD=8D=E7=BD=AE=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/file/FileOperationHelper.java | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/FileOperationHelper.java b/designer-base/src/main/java/com/fr/design/file/FileOperationHelper.java index 21eb34d902..a3abaf4606 100644 --- a/designer-base/src/main/java/com/fr/design/file/FileOperationHelper.java +++ b/designer-base/src/main/java/com/fr/design/file/FileOperationHelper.java @@ -127,7 +127,7 @@ public class FileOperationHelper { WARNING_MESSAGE); return StringUtils.EMPTY; } - String name = getNoRepeatedName4Paste(targetDir, sourceFile.getName()); + String name = getNoRepeatedName4Paste(targetDir, sourceFile); String targetFile = StableUtils.pathJoin(targetDir, name); if (sourceFile.isDirectory()) { copyDir(sourcePath, targetFile, withCopyVcs); @@ -177,19 +177,22 @@ public class FileOperationHelper { * 重名处理 * * @param targetDir - * @param oldName + * @param sourceFile * @return */ - private String getNoRepeatedName4Paste(String targetDir, String oldName) { + private String getNoRepeatedName4Paste(String targetDir, FileNode sourceFile) { + String oldName = sourceFile.getName(); while (isNameRepeaded(targetDir, oldName)) { - int index = oldName.lastIndexOf("."); - if (index > 0) { - String oName = oldName.substring(0, index); - oName = oName + Toolkit.i18nText("Fine-Design_Table_Data_Copy_Of_Table_Data"); - oldName = oName.concat(oldName.substring(index)); - } else { + if (sourceFile.isDirectory()) { //目录重名 oldName = oldName + Toolkit.i18nText("Fine-Design_Table_Data_Copy_Of_Table_Data"); + } else { + int index = oldName.lastIndexOf("."); + if (index > 0) { + String oName = oldName.substring(0, index); + oName = oName + Toolkit.i18nText("Fine-Design_Table_Data_Copy_Of_Table_Data"); + oldName = oName.concat(oldName.substring(index)); + } } } return oldName; From 12ba3a29ea7a467a5e657b2bc68a1ae27cce4c67 Mon Sep 17 00:00:00 2001 From: Carlson Date: Wed, 4 Jan 2023 11:35:34 +0800 Subject: [PATCH 246/310] =?UTF-8?q?REPORT-87768=20fix:=E8=A7=84=E9=81=BF?= =?UTF-8?q?=E4=B8=8BtemplateID=E7=9A=84=E9=87=8D=E5=A4=8D=E7=94=9F?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JTemplate.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 b59df2cf08..d59d616357 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 @@ -330,7 +330,9 @@ public abstract class JTemplate> * 为另存的模板创建新的模板id */ private void generateNewTemplateIdForSaveAs() { - generateTemplateId(); + if (StringUtils.isEmpty(template.getTemplateID())) { + generateTemplateId(); + } } /** From 2e5d636edc2d748f3a4056b2a27249d07beeb7db Mon Sep 17 00:00:00 2001 From: Yann Date: Wed, 4 Jan 2023 11:46:34 +0800 Subject: [PATCH 247/310] =?UTF-8?q?REPORT-87576=20=E5=8F=96=E8=89=B2?= =?UTF-8?q?=E6=9D=BF=E4=BD=BF=E7=94=A8=E5=90=8E=E4=BC=9A=E8=AE=A9fr?= =?UTF-8?q?=E5=8D=A1=E4=BD=8F=E3=80=82=E5=8F=AF=E7=A8=B3=E5=AE=9A=E5=A4=8D?= =?UTF-8?q?=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/style/BorderPane.java | 41 +++++++++---------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java b/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java index 6d62593935..d2a302ea01 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java @@ -265,34 +265,31 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse int lineStyle = currentLineCombo.getSelectedLineStyle(); Color lineColor = currentLineColorPane.getSelectObject(); CellBorderStyle cellBorderStyle = new CellBorderStyle(); - if (topToggleButton.isSelected()) { - cellBorderStyle.setTopColor(lineColor); + if (lineColor != null) { + if (topToggleButton.isSelected()) { + cellBorderStyle.setTopColor(lineColor); + } + if (bottomToggleButton.isSelected()) { + cellBorderStyle.setBottomColor(lineColor); + } + if (leftToggleButton.isSelected()) { + cellBorderStyle.setLeftColor(lineColor); + } + if (rightToggleButton.isSelected()) { + cellBorderStyle.setRightColor(lineColor); + } + if (verticalToggleButton.isSelected()) { + cellBorderStyle.setVerticalColor(lineColor); + } + if (horizontalToggleButton.isSelected()) { + cellBorderStyle.setHorizontalColor(lineColor); + } } cellBorderStyle.setTopStyle(topToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); - - if (bottomToggleButton.isSelected()) { - cellBorderStyle.setBottomColor(lineColor); - } cellBorderStyle.setBottomStyle(bottomToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); - - if (leftToggleButton.isSelected()) { - cellBorderStyle.setLeftColor(lineColor); - } cellBorderStyle.setLeftStyle(leftToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); - - if (rightToggleButton.isSelected()) { - cellBorderStyle.setRightColor(lineColor); - } cellBorderStyle.setRightStyle(rightToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); - - if (verticalToggleButton.isSelected()) { - cellBorderStyle.setVerticalColor(lineColor); - } cellBorderStyle.setVerticalStyle(verticalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); - - if (horizontalToggleButton.isSelected()) { - cellBorderStyle.setHorizontalColor(lineColor); - } cellBorderStyle.setHorizontalStyle(horizontalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); outerToggleButton.setSelected(leftToggleButton.isSelected() && bottomToggleButton.isSelected() && rightToggleButton.isSelected() && topToggleButton.isSelected()); From bffc93847ee3f5d78f624964fcb33a77d9ab7bfb Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 4 Jan 2023 11:52:25 +0800 Subject: [PATCH 248/310] =?UTF-8?q?REPORT-87013=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A811.0.11=E6=9B=B4=E6=96=B0=E6=97=A5=E5=BF=97=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E7=9A=84=E4=BF=A1=E6=81=AF=E6=98=AF=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/update/ui/dialog/UpdateMainDialog.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java b/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java index 1fa37f60f8..033e2cb07f 100644 --- a/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java +++ b/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java @@ -118,6 +118,8 @@ public class UpdateMainDialog extends UIDialog { private ArrayList updateInfoList; + private Set titleSet; + private boolean getUpdateInfoSuccess; private UpdateInfoCachePropertyManager cacheProperty; @@ -267,6 +269,7 @@ public class UpdateMainDialog extends UIDialog { String keyword = searchUpdateInfoKeyword.getText(); if (ComparatorUtils.equals(keyword, StringUtils.EMPTY) && getUpdateInfoSuccess) { updateInfoList.clear(); + titleSet.clear(); getUpdateInfo(keyword).execute(); } } @@ -281,6 +284,7 @@ public class UpdateMainDialog extends UIDialog { public void actionPerformed(ActionEvent e) { if (getUpdateInfoSuccess) { updateInfoList.clear(); + titleSet.clear(); getUpdateInfo(searchUpdateInfoKeyword.getText()).execute(); } } @@ -388,6 +392,7 @@ public class UpdateMainDialog extends UIDialog { private SwingWorker getUpdateInfo(final String keyword) { updateInfoList = new ArrayList<>(); + titleSet = new HashSet<>(); lastUpdateCacheTime = UpdateConstants.CHANGELOG_X_START; String cacheConfigPath = getUpdateCacheConfig(); cacheProperty = new UpdateInfoCachePropertyManager(StableUtils.pathJoin(WorkContext.getCurrent().getPath(), "resources", "offlineres", cacheConfigPath)); @@ -489,6 +494,7 @@ public class UpdateMainDialog extends UIDialog { } } if (isValid(updateInfo, GeneralUtils.objectToString(curJarDate))) { + titleSet.add(updateInfo[UpdateInfoTable.UPDATE_TITLE_INDEX]); updateInfoList.add(new Object[]{UPDATELOG_FORMAT.format(updateTime), updateInfo[UpdateInfoTable.UPDATE_VERSION_INDEX], updateInfo[UpdateInfoTable.UPDATE_TITLE_INDEX], updateTime.after(curJarDate)}); } } @@ -501,7 +507,7 @@ public class UpdateMainDialog extends UIDialog { private boolean isValid(String[] updateInfo, String curJarDate) { - return isValidLogInfo(updateInfo[UpdateInfoTable.UPDATE_TITLE_INDEX]) && curJarDate != null && curJarDate.compareTo(updateInfo[UpdateInfoTable.UPDATE_DATE_INDEX]) <= 0; + return isValidLogInfo(updateInfo[UpdateInfoTable.UPDATE_TITLE_INDEX]) && curJarDate != null && curJarDate.compareTo(updateInfo[UpdateInfoTable.UPDATE_DATE_INDEX]) <= 0 && !titleSet.contains(updateInfo[UpdateInfoTable.UPDATE_TITLE_INDEX]); } private void updateCachedInfoFile(JSONArray jsonArray) throws Exception { @@ -561,6 +567,7 @@ public class UpdateMainDialog extends UIDialog { } Date curDate = UPDATE_INFO_TABLE_FORMAT.parse(currentNO, new ParsePosition(currentNO.indexOf("-") + 1)); if (isValid4GenerateInfo(updateTitle, GeneralUtils.objectToString(curDate), updateTimeStr)) { + titleSet.add(updateTitle); updateInfoList.add(new Object[]{updateTimeStr, updateVersionStr, updateTitle, updateTime.after(curJarDate)}); } } @@ -568,7 +575,7 @@ public class UpdateMainDialog extends UIDialog { } private boolean isValid4GenerateInfo(String updateTitle, String curDate, String updateTimeStr) { - return isValidLogInfo(updateTitle) && curDate.compareTo(updateTimeStr) <= 0; + return isValidLogInfo(updateTitle) && curDate.compareTo(updateTimeStr) <= 0 && !titleSet.contains(updateTitle); } private boolean containsKeyword(String str, String keyword) { From e34a0c78ae6e2c77f87a312fb1fcc53c1fe5eb14 Mon Sep 17 00:00:00 2001 From: Carlson Date: Wed, 4 Jan 2023 14:36:17 +0800 Subject: [PATCH 249/310] =?UTF-8?q?REPORT-87768=20fix:=E8=80=83=E8=99=91?= =?UTF-8?q?=E5=8F=A6=E5=AD=98=E4=B8=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JTemplate.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 d59d616357..e8cdc3ee8d 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 @@ -330,7 +330,7 @@ public abstract class JTemplate> * 为另存的模板创建新的模板id */ private void generateNewTemplateIdForSaveAs() { - if (StringUtils.isEmpty(template.getTemplateID())) { + if (StringUtils.isEmpty(template.getTemplateID()) || this.getEditingFILE().exists()) { generateTemplateId(); } } From 0a11d39fb414aa7ef3cb49bd0a892adc83bedd36 Mon Sep 17 00:00:00 2001 From: Yann Date: Wed, 4 Jan 2023 15:10:16 +0800 Subject: [PATCH 250/310] =?UTF-8?q?REPORT-87576=20=E5=8F=96=E8=89=B2?= =?UTF-8?q?=E6=9D=BF=E4=BD=BF=E7=94=A8=E5=90=8E=E4=BC=9A=E8=AE=A9fr?= =?UTF-8?q?=E5=8D=A1=E4=BD=8F=E3=80=82=E5=8F=AF=E7=A8=B3=E5=AE=9A=E5=A4=8D?= =?UTF-8?q?=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/style/BorderPane.java | 41 +++++++++---------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java b/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java index 6d62593935..d2a302ea01 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java @@ -265,34 +265,31 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse int lineStyle = currentLineCombo.getSelectedLineStyle(); Color lineColor = currentLineColorPane.getSelectObject(); CellBorderStyle cellBorderStyle = new CellBorderStyle(); - if (topToggleButton.isSelected()) { - cellBorderStyle.setTopColor(lineColor); + if (lineColor != null) { + if (topToggleButton.isSelected()) { + cellBorderStyle.setTopColor(lineColor); + } + if (bottomToggleButton.isSelected()) { + cellBorderStyle.setBottomColor(lineColor); + } + if (leftToggleButton.isSelected()) { + cellBorderStyle.setLeftColor(lineColor); + } + if (rightToggleButton.isSelected()) { + cellBorderStyle.setRightColor(lineColor); + } + if (verticalToggleButton.isSelected()) { + cellBorderStyle.setVerticalColor(lineColor); + } + if (horizontalToggleButton.isSelected()) { + cellBorderStyle.setHorizontalColor(lineColor); + } } cellBorderStyle.setTopStyle(topToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); - - if (bottomToggleButton.isSelected()) { - cellBorderStyle.setBottomColor(lineColor); - } cellBorderStyle.setBottomStyle(bottomToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); - - if (leftToggleButton.isSelected()) { - cellBorderStyle.setLeftColor(lineColor); - } cellBorderStyle.setLeftStyle(leftToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); - - if (rightToggleButton.isSelected()) { - cellBorderStyle.setRightColor(lineColor); - } cellBorderStyle.setRightStyle(rightToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); - - if (verticalToggleButton.isSelected()) { - cellBorderStyle.setVerticalColor(lineColor); - } cellBorderStyle.setVerticalStyle(verticalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); - - if (horizontalToggleButton.isSelected()) { - cellBorderStyle.setHorizontalColor(lineColor); - } cellBorderStyle.setHorizontalStyle(horizontalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); outerToggleButton.setSelected(leftToggleButton.isSelected() && bottomToggleButton.isSelected() && rightToggleButton.isSelected() && topToggleButton.isSelected()); From e260386ad110fc0dabd403316dcff3686fe882df Mon Sep 17 00:00:00 2001 From: Yann Date: Wed, 4 Jan 2023 17:52:14 +0800 Subject: [PATCH 251/310] =?UTF-8?q?REPORT-86430=20AlphaFine=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E4=B8=AD=E5=BF=83tab=E9=A1=B5=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=9C=89=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/search/manager/impl/PluginSearchManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java index babf9f4865..de8f468829 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java @@ -214,7 +214,7 @@ public class PluginSearchManager implements AlphaFineSearchProvider { } return time; } - })); + }).reversed()); } catch (Exception e) { FineLoggerFactory.getLogger().error(e, e.getMessage()); } From e1b4a4f850c188a441f744abb4f36322eba7e806 Mon Sep 17 00:00:00 2001 From: Carlson Date: Wed, 4 Jan 2023 19:33:27 +0800 Subject: [PATCH 252/310] =?UTF-8?q?REPORT-87768=20=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E5=89=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/JTemplate.java | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) 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 e8cdc3ee8d..43714f949b 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 @@ -326,15 +326,6 @@ public abstract class JTemplate> public abstract JComponent getCurrentReportComponentPane(); - /** - * 为另存的模板创建新的模板id - */ - private void generateNewTemplateIdForSaveAs() { - if (StringUtils.isEmpty(template.getTemplateID()) || this.getEditingFILE().exists()) { - generateTemplateId(); - } - } - /** * 收集图表信息 */ @@ -959,7 +950,9 @@ public abstract class JTemplate> originID = currentId; } // 在保存之前,初始化 templateID - generateNewTemplateIdForSaveAs(); + if (StringUtils.isEmpty(currentId)) { + generateTemplateId(); + } this.editingFILE = editingFILE; boolean result = this.saveToNewFile(oldName); @@ -1834,7 +1827,7 @@ public abstract class JTemplate> originID = currentId; } // 在保存之前,初始化 templateID - generateNewTemplateIdForSaveAs(); + generateTemplateId(); this.editingFILE = editingFILE; boolean result = this.saveToNewRealFile(oldName); if (result) { From 5430ede56d55f3878eb0aa32940fdc852203951c Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 3 Jan 2023 15:37:55 +0800 Subject: [PATCH 253/310] =?UTF-8?q?REPORT-86045=20FR11=E5=86=B3=E7=AD=96?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E5=81=87=E4=BF=9D=E5=AD=98-=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E5=9D=97=E5=86=85=E6=92=A4=E9=94=80=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E5=86=8D=E7=BC=96=E8=BE=91=E9=99=A4=E6=AD=A4=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E5=9D=97=E5=A4=96=E9=83=A8=E5=88=86=EF=BC=8C=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=20=E5=AE=9E=E9=99=85=E6=9C=AA=E4=BF=9D?= =?UTF-8?q?=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 在报表块编辑模式下重置Form对象,比如setTarget,需要做些额外 的工作,才能确保新的target完全可用,主要是要确保散落 在formDesign中各处的对象,如selectedCreators等,要有新的 target对象保持一致,否则再回到表单编辑界面时,就不能通过 这些creators,对target对象进行修改了。 【改动思路】 将表单编辑界面的一些修改操作也放到报表块编辑模式场景下执行, 确保该更新的都能更新到 --- .../java/com/fr/design/mainframe/JForm.java | 88 ++++++++++--------- 1 file changed, 47 insertions(+), 41 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index e3162e9ef6..4e9c45ce44 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -6,8 +6,6 @@ import com.fr.base.Parameter; import com.fr.base.Releasable; import com.fr.base.extension.FileExtension; import com.fr.base.iofile.attr.ExtendSharableAttrMark; -import com.fr.base.theme.FineColorGather; -import com.fr.base.theme.FineColorManager; import com.fr.base.theme.FineColorSynchronizer; import com.fr.base.theme.FormTheme; import com.fr.base.theme.TemplateTheme; @@ -17,8 +15,8 @@ import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignModelAdapter; import com.fr.design.DesignState; import com.fr.design.DesignerEnvManager; -import com.fr.design.actions.FormMobileAttrAction; import com.fr.design.actions.FormECParallelCalAction; +import com.fr.design.actions.FormMobileAttrAction; import com.fr.design.actions.TemplateParameterAction; import com.fr.design.actions.core.WorkBookSupportable; import com.fr.design.actions.file.export.EmbeddedFormExportExportAction; @@ -56,8 +54,8 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.form.FormECCompositeProvider; import com.fr.design.mainframe.form.FormECDesignerProvider; import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo; -import com.fr.design.mainframe.share.collect.ComponentCollector; import com.fr.design.mainframe.share.ComponentShareUtil; +import com.fr.design.mainframe.share.collect.ComponentCollector; import com.fr.design.mainframe.template.info.JFormProcessInfo; import com.fr.design.mainframe.template.info.TemplateProcessInfo; import com.fr.design.mainframe.theme.dialog.TemplateThemeUsingDialog; @@ -71,7 +69,6 @@ import com.fr.design.parameter.ParameterPropertyPane; import com.fr.design.preview.FormPreview; import com.fr.design.preview.MobilePreview; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; -import com.fr.design.ui.util.UIUtil; import com.fr.design.utils.gui.LayoutUtils; import com.fr.file.FILE; import com.fr.file.FILEChooserPane; @@ -110,7 +107,14 @@ import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.SwingConstants; import javax.swing.tree.TreePath; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Insets; +import java.awt.Rectangle; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.image.BufferedImage; @@ -1266,46 +1270,48 @@ public class JForm extends JTemplate implements BaseJForm Date: Thu, 5 Jan 2023 10:09:14 +0800 Subject: [PATCH 254/310] =?UTF-8?q?REPORT-87768=20=E7=BB=99=E5=AD=90?= =?UTF-8?q?=E7=B1=BB=E6=8F=90=E4=BE=9B=E4=B8=80=E4=B8=8B=E9=87=8D=E5=86=99?= =?UTF-8?q?=E7=9A=84=E8=83=BD=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/JTemplate.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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 43714f949b..444ef577fb 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 @@ -326,6 +326,13 @@ public abstract class JTemplate> public abstract JComponent getCurrentReportComponentPane(); + /** + * 为另存的模板创建新的模板id + */ + protected void generateNewTemplateIdForSaveAs() { + generateTemplateId(); + } + /** * 收集图表信息 */ @@ -950,9 +957,7 @@ public abstract class JTemplate> originID = currentId; } // 在保存之前,初始化 templateID - if (StringUtils.isEmpty(currentId)) { - generateTemplateId(); - } + generateNewTemplateIdForSaveAs(); this.editingFILE = editingFILE; boolean result = this.saveToNewFile(oldName); @@ -1827,7 +1832,7 @@ public abstract class JTemplate> originID = currentId; } // 在保存之前,初始化 templateID - generateTemplateId(); + generateNewTemplateIdForSaveAs(); this.editingFILE = editingFILE; boolean result = this.saveToNewRealFile(oldName); if (result) { From dfe0ea9969d615c019edf9b87c3d966d8e725a8d Mon Sep 17 00:00:00 2001 From: "Coral.Chen" Date: Mon, 9 Jan 2023 17:07:34 +0800 Subject: [PATCH 255/310] =?UTF-8?q?REPORT-86259=20=E3=80=90=E5=AF=BC?= =?UTF-8?q?=E5=87=BAexcel&word=E3=80=91=E4=BB=85=E9=99=90=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E4=B8=8B=E9=99=90=E5=88=B6=E5=A4=8D=E5=88=B6=20REPORT?= =?UTF-8?q?-86426-=E5=AF=BC=E5=87=BAexcel/pdf=20=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=85=AC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/report/ExportUniversalPane.java | 26 ++++++++++++++----- .../design/report/ReportExportAttrPane.java | 5 ++-- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java b/designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java index 3714d66a27..dce865b402 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java @@ -1,7 +1,6 @@ package com.fr.design.report; import com.fr.base.CustomConfig; -import com.fr.config.Configuration; import com.fr.design.constants.UIConstants; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.icheckbox.UICheckBox; @@ -11,16 +10,20 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; +import com.fr.io.attr.ReportExportAttr; import com.fr.transaction.Configurations; import com.fr.transaction.WorkerFacade; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import javax.swing.BorderFactory; -import javax.swing.JPanel; /** + * 通用 + * * @author hades * @version 11.0 * Created by hades on 2022/5/26 @@ -30,13 +33,15 @@ public class ExportUniversalPane extends BasicPane { private static final String HELP_URL = CloudCenter.getInstance().acquireUrlByKind("help.alt_font.zh_CN", "https://help.fanruan.com/finereport/doc-view-4707.html"); private UICheckBox specialCharacterExport; + // 密码支持公式 + private UICheckBox passwordSupportFormula; public ExportUniversalPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); - JPanel outerNorthPane =FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Design_Report_Universal_Export_Config")); + JPanel outerNorthPane = FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Design_Report_Universal_Export_Config")); JPanel northPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane(); - JPanel specialCharacterExportPane =FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); + JPanel specialCharacterExportPane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); specialCharacterExport = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Universal_Export_Special_Character")); specialCharacterExport.setSelected(true); specialCharacterExportPane.add(specialCharacterExport); @@ -55,6 +60,11 @@ public class ExportUniversalPane extends BasicPane { labelPane.add(centerLabel, BorderLayout.CENTER); labelPane.add(rightLabel, BorderLayout.EAST); northPane.add(labelPane); + JPanel passwordSupportPane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); + passwordSupportFormula = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Universal_Export_Password_Support_Formula")); + passwordSupportFormula.setSelected(false); + passwordSupportPane.add(passwordSupportFormula); + northPane.add(passwordSupportPane); outerNorthPane.add(northPane); this.add(outerNorthPane); } @@ -64,15 +74,17 @@ public class ExportUniversalPane extends BasicPane { return "ExportUniversalPane"; } - public void populate() { + public void populate(ReportExportAttr reportExportAttr) { this.specialCharacterExport.setSelected(CustomConfig.getInstance().isOptimizedSpecialCharacterExport()); + this.passwordSupportFormula.setSelected(reportExportAttr.isPwdSupportFormula()); } - public void update() { + public void update(ReportExportAttr reportExportAttr) { Configurations.modify(new WorkerFacade(CustomConfig.class) { @Override public void run() { CustomConfig.getInstance().setOptimizedSpecialCharacterExport(specialCharacterExport.isSelected()); + reportExportAttr.setPwdSupportFormula(passwordSupportFormula.isSelected()); } }); } diff --git a/designer-realize/src/main/java/com/fr/design/report/ReportExportAttrPane.java b/designer-realize/src/main/java/com/fr/design/report/ReportExportAttrPane.java index 2de520d273..cd992c3fdf 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ReportExportAttrPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ReportExportAttrPane.java @@ -61,7 +61,7 @@ public class ReportExportAttrPane extends BasicPane { } if (this.exportUniversalPane != null) { - this.exportUniversalPane.populate(); + this.exportUniversalPane.populate(reportExportAttr); } if (this.excelExportPane != null) { @@ -84,9 +84,8 @@ public class ReportExportAttrPane extends BasicPane { public ReportExportAttr update() { ReportExportAttr reportExportAttr = new ReportExportAttr(); - if (this.exportUniversalPane != null) { - this.exportUniversalPane.update(); + this.exportUniversalPane.update(reportExportAttr); } if (this.excelExportPane != null) { From e18d9c5a16025fb81a16461ac645b9fadcbd0bc7 Mon Sep 17 00:00:00 2001 From: "Coral.Chen" Date: Mon, 9 Jan 2023 17:18:41 +0800 Subject: [PATCH 256/310] =?UTF-8?q?REPORT-86426-=E5=AF=BC=E5=87=BAexcel/pd?= =?UTF-8?q?f=20=E5=AF=86=E7=A0=81=E6=94=AF=E6=8C=81=E5=85=AC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/report/ExportUniversalPane.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java b/designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java index dce865b402..5fe52560dc 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java @@ -74,11 +74,21 @@ public class ExportUniversalPane extends BasicPane { return "ExportUniversalPane"; } + /** + * 填充数据 + * + * @param reportExportAttr 报表导出属性 + */ public void populate(ReportExportAttr reportExportAttr) { this.specialCharacterExport.setSelected(CustomConfig.getInstance().isOptimizedSpecialCharacterExport()); this.passwordSupportFormula.setSelected(reportExportAttr.isPwdSupportFormula()); } + /** + * 更新界面 + * + * @param reportExportAttr 报表导出属性 + */ public void update(ReportExportAttr reportExportAttr) { Configurations.modify(new WorkerFacade(CustomConfig.class) { @Override From 8f8f92959af47676c17d00637ce32fa6005c8a21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvan-=E6=AC=A7=E9=98=B3=E5=B8=86?= Date: Wed, 11 Jan 2023 10:44:35 +0800 Subject: [PATCH 257/310] =?UTF-8?q?REPORT-83316=20&&=20REPORT-83320=20&&?= =?UTF-8?q?=20REPORT-83488=20&&=20REPORT-83493=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=84=B1=E6=95=8F=E4=B8=80=E6=9C=9F=E8=BF=AD=E4=BB=A3bug=20?= =?UTF-8?q?=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E5=9F=BA?= =?UTF-8?q?=E6=9C=AC=E9=83=BD=E6=98=AFUI=E9=97=AE=E9=A2=98=20=E3=80=90?= =?UTF-8?q?=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E8=B7=9F=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E6=B2=9F=E9=80=9A=E5=90=8E=EF=BC=8C=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=20=E3=80=90review=E5=BB=BA=E8=AE=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datapane/preview/PreviewTablePane.java | 13 +- .../TableDataPreviewDesensitizeManager.java | 16 +- .../view/common/ChooseMark.java | 42 +++ .../rule/DesensitizationRuleChoosePane.java | 66 ++++- .../TableDataDesensitizationTableModel.java | 273 +++++++++++++----- .../gui/icombocheckbox/UICheckListPopup.java | 20 +- .../gui/icombocheckbox/UIComboCheckBox.java | 36 ++- 7 files changed, 377 insertions(+), 89 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/common/ChooseMark.java diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java index f65d4a9cfa..7b9a7a3d20 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java @@ -164,7 +164,6 @@ public class PreviewTablePane extends BasicPane { northPane.add(initPreviewNumberPane(), BorderLayout.CENTER); // 脱敏预览设置面板 northPane.add(initDesensitizationPane(), BorderLayout.EAST); - initDesensitizationPane(); return northPane; } @@ -260,6 +259,16 @@ public class PreviewTablePane extends BasicPane { 0); } + /** + * 根据TableData设置脱敏设置的个数 + */ + private void setDesensitizationCountByTableData() { + desensitizationPane.setDesensitizationCount(isDesensitizeOpened(), + this.tableData instanceof DesensitizationTableData ? + ((DesensitizationTableData) this.tableData).getDesensitizationConfig().getDesensitizationItems().size() : + 0); + } + /** * 初始化centerPane * @@ -722,7 +731,7 @@ public class PreviewTablePane extends BasicPane { * @param previewTableModel */ private void setPreviewTableModel(TableModel previewTableModel) { - setDesensitizationCount(previewTableModel); + setDesensitizationCountByTableData(); setModel(previewTableModel); setCurrentRows(previewTableModel.getRowCount()); fireLoadedListener(); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java index 3d3c59331f..3d8fc8d02b 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java @@ -5,6 +5,7 @@ import com.fr.base.TableData; import com.fr.data.desensitize.base.DesensitizationTableData; import com.fr.data.desensitize.base.TableDataDesensitizationItem; import com.fr.data.desensitize.manage.DesensitizationManager; +import com.fr.data.desensitize.rule.DesensitizationRuleManager; import com.fr.data.desensitize.util.DesentizationUtils; import com.fr.decision.webservice.bean.user.DepartmentPostBean; import com.fr.decision.webservice.bean.user.RoleBean; @@ -77,7 +78,9 @@ public class TableDataPreviewDesensitizeManager implements DesensitizationManage // 获取此数据集的所有脱敏信息 Collection desensitizationItems = ((DesensitizationTableData) tableData).getDesensitizationConfig().getDesensitizationItems(); if (DesentizationUtils.isCollectionNotEmpty(desensitizationItems)) { - // 先对脱敏配置项集合做过滤和排序处理 + // 更新规则 + dealWithLastedRules(desensitizationItems); + // 对脱敏配置项集合做过滤和排序处理 List items = desensitizationItems.stream() .filter(item -> item.getRule().isEnable() && matchColumnIndex(item, model) >= 0) @@ -92,9 +95,18 @@ public class TableDataPreviewDesensitizeManager implements DesensitizationManage return new DesensitizedPreviewTableModel(model, desensitizationItemMap); } + /** + * 在预览计算前,将Item中的规则替换为最新规则(防止平台规则被临时修改) + */ + private void dealWithLastedRules(Collection desensitizationItems) { + desensitizationItems.forEach(item -> { + // 获取最新的规则 + item.setRule(DesensitizationRuleManager.getInstance().getLastedDesentizationRule(item.getRule())); + }); + } + /** * 通过TableData获取其列名 - * 实现逻辑有点绕,TableData本身并不能返回列名集合,只能先去获取当前模板所有数据集,然后匹配名称拿到TableDataWrapper再获取列名 * * @param tableData * @return diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/common/ChooseMark.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/common/ChooseMark.java new file mode 100644 index 0000000000..099e9a960a --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/common/ChooseMark.java @@ -0,0 +1,42 @@ +package com.fr.design.data.datapane.preview.desensitization.view.common; + +import com.fr.design.gui.ibutton.UIRadioButton; + +import javax.swing.AbstractCellEditor; +import javax.swing.JTable; +import javax.swing.table.TableCellEditor; +import javax.swing.table.TableCellRenderer; +import java.awt.Component; + +/** + * 标记选中的CellEditor + * + * @author Yvan + * @version 11.0 + * Created by Yvan on 2022/12/20 + */ +public class ChooseMark extends AbstractCellEditor implements TableCellEditor, TableCellRenderer { + + private final UIRadioButton selectedButton; + + public ChooseMark() { + this.selectedButton = new UIRadioButton(); + } + + @Override + public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { + selectedButton.setSelected(isSelected); + return selectedButton; + } + + @Override + public Object getCellEditorValue() { + return selectedButton.isSelected(); + } + + @Override + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { + selectedButton.setSelected(isSelected); + return selectedButton; + } +} diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java index fd627e8cc4..3b44c0b187 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java @@ -4,9 +4,10 @@ import com.fr.base.svg.IconUtils; import com.fr.data.desensitize.rule.DesensitizationRuleManager; import com.fr.data.desensitize.rule.base.DesensitizationRule; import com.fr.data.desensitize.rule.base.DesensitizationRuleSource; +import com.fr.data.desensitize.rule.base.DesensitizationRuleStatus; +import com.fr.design.data.datapane.preview.desensitization.view.common.ChooseMark; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; -import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itableeditorpane.UITableEditAction; import com.fr.design.gui.itableeditorpane.UITableEditorPane; @@ -22,6 +23,7 @@ import javax.swing.SwingUtilities; import javax.swing.table.TableCellEditor; import javax.swing.table.TableCellRenderer; import java.awt.CardLayout; +import java.awt.Color; import java.awt.Component; import java.awt.event.ActionEvent; import java.util.LinkedHashSet; @@ -107,18 +109,23 @@ public class DesensitizationRuleChoosePane extends JPanel { super(new String[]{ StringUtils.EMPTY, Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Name"), - Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Description") + Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Description"), + Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Status"), }); this.parent = parent; this.debugActionOnly = debugActionOnly; this.setColumnClass(new Class[]{ - RuleChoosePane.class, + ChooseMark.class, UILabel.class, - UILabel.class + UILabel.class, + DesensitizationRuleStatusPane.class }); - this.setDefaultEditor(RuleChoosePane.class, new RuleChoosePane()); - this.setDefaultRenderer(RuleChoosePane.class, new RuleChoosePane()); + this.setDefaultEditor(ChooseMark.class, new ChooseMark()); + this.setDefaultRenderer(ChooseMark.class, new ChooseMark()); + this.setDefaultEditor(DesensitizationRuleStatusPane.class, new DesensitizationRuleStatusPane()); + this.setDefaultRenderer(DesensitizationRuleStatusPane.class, new DesensitizationRuleStatusPane()); this.createTable().getColumnModel().getColumn(0).setMaxWidth(20); + this.createTable().getColumnModel().getColumn(3).setMaxWidth(60); } @Override @@ -134,6 +141,11 @@ public class DesensitizationRuleChoosePane extends JPanel { case 2: // 脱敏规则描述 return DesensitizationRule.getDescription(rule); + case 3: + // 脱敏规则状态 + DesensitizationRuleStatus ruleStatus = DesensitizationRuleManager.getInstance().getRuleStatus(rule); + // 非正常状态需要标记为异常 + return ruleStatus == DesensitizationRuleStatus.NORMAL ? StringUtils.EMPTY : Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Status_Abnormal"); default: return StringUtils.EMPTY; } @@ -161,29 +173,51 @@ public class DesensitizationRuleChoosePane extends JPanel { .collect(Collectors.toSet()); } - private class RuleChoosePane extends AbstractCellEditor implements TableCellEditor, TableCellRenderer { + /** + * 规则状态展示页面 + */ + private class DesensitizationRuleStatusPane extends AbstractCellEditor implements TableCellEditor, TableCellRenderer { - private UIRadioButton selectedButton; + private UILabel ruleStatusLabel; - public RuleChoosePane() { - this.selectedButton = new UIRadioButton(); + DesensitizationRuleStatusPane() { + // 规则状态 + this.ruleStatusLabel = new UILabel(); + this.ruleStatusLabel.setForeground(Color.RED); + } + + /** + * 根据脱敏规则信息,刷新规则状态,主要用于与规则选择器的联动 + * + * @param rule + */ + public void refreshRuleStatus(DesensitizationRule rule) { + DesensitizationRuleStatus ruleStatus = DesensitizationRuleManager.getInstance().getRuleStatus(rule); + if (ruleStatus == DesensitizationRuleStatus.NORMAL) { + // 正常规则时,重置提示Label + this.ruleStatusLabel.setText(StringUtils.EMPTY); + this.ruleStatusLabel.setToolTipText(null); + } else { + this.ruleStatusLabel.setText(Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Status_Abnormal")); + this.ruleStatusLabel.setToolTipText(ruleStatus.getDescription()); + } } @Override public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { - selectedButton.setSelected(isSelected); - return selectedButton; + refreshRuleStatus(getList().get(row)); + return ruleStatusLabel; } @Override public Object getCellEditorValue() { - return selectedButton.isSelected(); + return ruleStatusLabel; } @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { - selectedButton.setSelected(isSelected); - return selectedButton; + refreshRuleStatus(getList().get(row)); + return ruleStatusLabel; } } @@ -298,7 +332,7 @@ public class DesensitizationRuleChoosePane extends JPanel { @Override public void checkEnabled() { - setEnabled(table.getSelectedRow() != -1); + setEnabled(table.getSelectedRow() != -1 && getList().get(table.getSelectedRow()).isEnable()); } @Override diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java index bbc91efa2a..4d6cfa8ff6 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java @@ -2,11 +2,14 @@ package com.fr.design.data.datapane.preview.desensitization.view.setting; import com.fr.data.desensitize.base.DesensitizationTableData; import com.fr.data.desensitize.base.TableDataDesensitizationItem; +import com.fr.data.desensitize.rule.DesensitizationRuleManager; import com.fr.data.desensitize.rule.base.DesensitizationRule; +import com.fr.data.desensitize.rule.base.DesensitizationRuleStatus; import com.fr.design.data.datapane.preview.desensitization.TableDataPreviewDesensitizeManager; import com.fr.design.data.datapane.preview.desensitization.view.rule.DesensitizationRulePane; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombocheckbox.UIComboCheckBox; @@ -15,12 +18,14 @@ import com.fr.design.gui.itableeditorpane.UITableEditAction; import com.fr.design.gui.itableeditorpane.UITableModelAdapter; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.stable.StringUtils; import org.jetbrains.annotations.Nullable; import javax.swing.AbstractCellEditor; +import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.JTable; import javax.swing.SwingUtilities; @@ -28,10 +33,11 @@ import javax.swing.event.CellEditorListener; import javax.swing.event.ChangeEvent; import javax.swing.table.TableCellEditor; import javax.swing.table.TableCellRenderer; +import java.awt.BorderLayout; +import java.awt.Color; import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.LinkedHashSet; @@ -52,6 +58,8 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter matchRoleNamesByIds(Collection roleIds) { - List result = new ArrayList<>(); + private String matchRoleNamesByIds(Collection roleIds) { + StringBuilder builder = new StringBuilder(); for (String roleId : roleIds) { if (roleMap != null && roleMap.containsKey(roleId)) { - result.add(roleMap.get(roleId)); + builder.append(roleMap.get(roleId)); + builder.append(COMMA); } } - return result; + return builder.length() <= 1 ? StringUtils.EMPTY : builder.substring(0, builder.length() - 1); } @Override public boolean isCellEditable(int row, int col) { - return true; + TableSequences match = TableSequences.match(col); + return match != TableSequences.DesensitizationRuleStatus; } @Override @@ -166,7 +183,7 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter 0 ? builder.substring(0, builder.length() - 1) : StringUtils.EMPTY; //计算加省略号后的文本 editor.setText(this.showOmitText ? omitEditorText(editor, text) : text); + // tooltips显示原值 + setEditorToolTipText(editor, text); + } + + /** + * 为UITextField设置悬浮提示值 + * + * @param editor + * @param text + */ + protected void setEditorToolTipText(JComponent editor, String text) { + // 默认不做设置 } /** From 4c0a7489464acf5352132b2758d8c2fc4a0a46de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvan-=E6=AC=A7=E9=98=B3=E5=B8=86?= Date: Wed, 11 Jan 2023 11:25:37 +0800 Subject: [PATCH 258/310] =?UTF-8?q?REPORT-83316=20&&=20REPORT-83320=20&&?= =?UTF-8?q?=20REPORT-83488=20&&=20REPORT-83493=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=84=B1=E6=95=8F=E4=B8=80=E6=9C=9F=E8=BF=AD=E4=BB=A3bug=20?= =?UTF-8?q?=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E6=A0=B9?= =?UTF-8?q?=E6=8D=AEreview=E6=84=8F=E8=A7=81=EF=BC=8C=E6=8A=BD=E5=87=BA?= =?UTF-8?q?=E6=96=B9=E6=B3=95=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D?= =?UTF-8?q?=E8=B7=AF=E3=80=91=E6=A0=B9=E6=8D=AEreview=E6=84=8F=E8=A7=81?= =?UTF-8?q?=EF=BC=8C=E6=8A=BD=E5=87=BA=E6=96=B9=E6=B3=95=20=E3=80=90review?= =?UTF-8?q?=E5=BB=BA=E8=AE=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TableDataPreviewDesensitizeManager.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java index 3d8fc8d02b..29e12bfaf4 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java @@ -82,8 +82,7 @@ public class TableDataPreviewDesensitizeManager implements DesensitizationManage dealWithLastedRules(desensitizationItems); // 对脱敏配置项集合做过滤和排序处理 List items = desensitizationItems.stream() - .filter(item -> item.getRule().isEnable() && - matchColumnIndex(item, model) >= 0) + .filter(item -> isAvaliableItem4Preview(item, model)) .sorted(Comparator.comparingInt(item -> matchColumnIndex(item, model))) .collect(Collectors.toList()); // 然后转换成Map @@ -95,6 +94,18 @@ public class TableDataPreviewDesensitizeManager implements DesensitizationManage return new DesensitizedPreviewTableModel(model, desensitizationItemMap); } + /** + * 判断是否为有效的用于预览脱敏效果的DesensitizationItem + * + * @param item 脱敏配置项 + * @param model 数据集预览数据 + * @return + */ + private boolean isAvaliableItem4Preview(TableDataDesensitizationItem item, PreviewTableModel model) { + return item.getRule().isEnable() && + matchColumnIndex(item, model) >= 0; + } + /** * 在预览计算前,将Item中的规则替换为最新规则(防止平台规则被临时修改) */ From 8feb5752f8c4fbbab9ec531743d890e788a96e21 Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" Date: Wed, 11 Jan 2023 17:15:07 +0800 Subject: [PATCH 259/310] =?UTF-8?q?REPORT-88359=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8Key=E7=BC=BA=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/parameter/RootDesignDefinePane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java b/designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java index 910b466f79..9b4dfb4c44 100644 --- a/designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java @@ -134,7 +134,7 @@ public class RootDesignDefinePane extends AbstractDataModify { displayReport = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Display_Nothing_Before_Query")); UIComponentUtils.setLineWrap(displayReport); useParamsTemplate = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Use_Params_Template")); - fireAfterEditor = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("触发编辑结束事件")); + fireAfterEditor = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Trigger_Editing_End_Event")); fireAfterEditor.setEnabled(false); fireAfterEditor.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 0)); useParamsTemplate.addChangeListener(e -> { @@ -189,7 +189,7 @@ public class RootDesignDefinePane extends AbstractDataModify { displayReport = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Display_Nothing_Before_Query")); UIComponentUtils.setLineWrap(displayReport); useParamsTemplate = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Use_Params_Template")); - fireAfterEditor = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("触发编辑结束事件")); + fireAfterEditor = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Trigger_Editing_End_Event")); fireAfterEditor.setEnabled(false); fireAfterEditor.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 0)); useParamsTemplate.addChangeListener(e -> { From 285ecbbde013574be83c3609be194b3ec41f584b Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" Date: Wed, 11 Jan 2023 18:31:56 +0800 Subject: [PATCH 260/310] =?UTF-8?q?REPORT-88359=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8Key=E7=BC=BA=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/parameter/RootDesignDefinePane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java b/designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java index 910b466f79..9b4dfb4c44 100644 --- a/designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java @@ -134,7 +134,7 @@ public class RootDesignDefinePane extends AbstractDataModify { displayReport = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Display_Nothing_Before_Query")); UIComponentUtils.setLineWrap(displayReport); useParamsTemplate = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Use_Params_Template")); - fireAfterEditor = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("触发编辑结束事件")); + fireAfterEditor = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Trigger_Editing_End_Event")); fireAfterEditor.setEnabled(false); fireAfterEditor.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 0)); useParamsTemplate.addChangeListener(e -> { @@ -189,7 +189,7 @@ public class RootDesignDefinePane extends AbstractDataModify { displayReport = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Display_Nothing_Before_Query")); UIComponentUtils.setLineWrap(displayReport); useParamsTemplate = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Use_Params_Template")); - fireAfterEditor = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("触发编辑结束事件")); + fireAfterEditor = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Trigger_Editing_End_Event")); fireAfterEditor.setEnabled(false); fireAfterEditor.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 0)); useParamsTemplate.addChangeListener(e -> { From dc7f9fee247f303cf87d969b25a3baa50ce9532b Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Fri, 13 Jan 2023 12:55:34 +0800 Subject: [PATCH 261/310] =?UTF-8?q?REPORT-84645=20lic=E9=99=90=E5=88=B6?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E7=B1=BB=E5=9E=8B-=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E9=85=8D=E5=90=88=20=E3=80=90=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=E3=80=91rt=20=E3=80=90=E6=94=B9=E5=8A=A8?= =?UTF-8?q?=E6=80=9D=E8=B7=AF=E3=80=91=E8=AE=BE=E8=AE=A1=E5=99=A8=E4=B8=AD?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=95=B0=E6=8D=AE=E5=BA=93=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=A0=B9=E6=8D=AElic=E4=B8=AD=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E7=B1=BB=E5=9E=8B=E9=99=90=E5=88=B6=EF=BC=8C?= =?UTF-8?q?=E7=BB=99=E5=87=BA=E7=9B=B8=E5=BA=94=E7=9A=84=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/connect/ConnectionListPane.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java index 23c22144b5..eaa4c37d8d 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java @@ -22,6 +22,7 @@ import com.fr.file.ConnectionConfig; import com.fr.file.ConnectionOperator; import com.fr.general.NameObject; import com.fr.log.FineLoggerFactory; +import com.fr.regist.FRCoreContext; import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; import com.fr.stable.StringUtils; @@ -118,17 +119,25 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh * @return 菜单项 */ public NameableCreator[] createNameableCreators() { - NameableCreator[] creators = new NameableCreator[]{new NameObjectCreator( + NameObjectCreator jdbc = new NameObjectCreator( "JDBC", "/com/fr/design/images/data/source/jdbcTableData.png", JDBCDatabaseConnection.class, DatabaseConnectionPane.JDBC.class - ), new NameObjectCreator( + ); + NameObjectCreator jndi = new NameObjectCreator( "JNDI", "/com/fr/design/images/data/source/jdbcTableData.png", JNDIDatabaseConnection.class, DatabaseConnectionPane.JNDI.class - )}; + ); + NameableCreator[] creators; + if (FRCoreContext.getLicense().limitDatabaseType()) { + // 不支持JDNI,屏蔽接口 + creators = new NameableCreator[]{jdbc}; + } else { + creators = new NameableCreator[]{jdbc, jndi}; + } Set pluginCreators = ExtraDesignClassManager.getInstance().getArray(ConnectionProvider.XML_TAG); for (ConnectionProvider provider : pluginCreators) { NameObjectCreator creator = new NameObjectCreator( From 7347a81a81e197f437e1414b11a1673fd3afa635 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Fri, 13 Jan 2023 15:25:32 +0800 Subject: [PATCH 262/310] =?UTF-8?q?REPORT-88307=20=E6=8E=A7=E4=BB=B6-?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E6=8E=A7=E4=BB=B6-=E5=B0=86=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E4=B8=AD=E7=9A=84=E2=80=9C=E5=AD=97=E4=BD=93?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E2=80=9D=E6=94=B9=E4=B8=BA=E2=80=9C=E5=AD=97?= =?UTF-8?q?=E4=BD=93=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/widget/ui/designer/LabelDefinePane.java | 2 +- .../fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/LabelDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/LabelDefinePane.java index 1c30b1a557..992ea9cfb5 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/LabelDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/LabelDefinePane.java @@ -68,7 +68,7 @@ public class LabelDefinePane extends AbstractDataModify