From ba2efd53f765edf8dadada46bb3b82691ea4dcad Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Mon, 3 Sep 2018 16:30:21 +0800 Subject: [PATCH 1/6] =?UTF-8?q?REPORT-11037=20=E6=9C=80=E8=BF=91=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E9=A2=9C=E8=89=B2=E5=8F=AA=E5=AD=98=E4=B8=8D=E9=80=8F?= =?UTF-8?q?=E6=98=8E=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/color/ColorSelectConfigManager.java | 36 +++++++++---------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorSelectConfigManager.java b/designer-base/src/main/java/com/fr/design/style/color/ColorSelectConfigManager.java index d4ca574db3..aaea88ea92 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorSelectConfigManager.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorSelectConfigManager.java @@ -5,8 +5,7 @@ import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLReadable; import com.fr.stable.xml.XMLableReader; -import java.awt.*; - +import java.awt.Color; import java.util.ArrayList; import java.util.List; @@ -18,9 +17,8 @@ import java.util.List; public class ColorSelectConfigManager implements XMLReadable { // 最近使用的颜色个数 - private int colorNums = 20; + private int colorNum = 20; - private boolean init = true; // 最近使用颜色 private List colors = new ArrayList(); private static final String RECENT_COLOR_TAG = "RecentColors"; @@ -33,35 +31,30 @@ public class ColorSelectConfigManager implements XMLReadable { } public int getColorNum() { - return colorNums; + return colorNum; } - public void setColorNum(int colorNums) { - this.colorNums = colorNums; + public void setColorNum(int colorNum) { + this.colorNum = colorNum; } - /** * 添加颜色到最近使用队列中 * * @param color 颜色 */ public void addToColorQueue(Color color) { - if(color == null){ + + // 将透明度不为 0% 的 颜色去掉 + if (color == null || color.getAlpha() != 0xff) { return; } + // 过滤重复的最近使用颜色 - // 因为有个后进先出的问题,最近使用的颜色需要放到最前面所以没用set - if (colors.contains(color)) { - colors.remove(color); - } + // 最近使用的颜色需要放到最前面 + colors.remove(color); colors.add(color); - /*@author yaohwu*/ - //将历史颜色信息保存到xml文件中去 - if (colors != null && !colors.isEmpty()) { - this.setColorsToFile(colors); - } } public void readXML(XMLableReader reader) { @@ -71,8 +64,11 @@ public class ColorSelectConfigManager implements XMLReadable { String tagName = reader.getTagName(); if (reader.isChildNode()) { if (ComparatorUtils.equals(COLOR_TAG, tagName)) { - Color color = null; - colors.add(reader.getAttrAsColor("colors", color)); + Color color = reader.getAttrAsColor("colors", null); + // 将透明度不为 0% 的 颜色去掉 + if (color != null && color.getAlpha() == 0xff) { + colors.add(color); + } } } } From 688e96673df662477f51ce9a5f2bfd22c6ad9de5 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Mon, 3 Sep 2018 17:11:55 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=EF=BC=8C?= =?UTF-8?q?=E4=BD=BF=E5=8E=86=E5=8F=B2=E9=A2=9C=E8=89=B2=E5=AD=98=E5=82=A8?= =?UTF-8?q?=E6=9C=80=E5=A4=A7=E5=80=BC=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/color/ColorSelectConfigManager.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorSelectConfigManager.java b/designer-base/src/main/java/com/fr/design/style/color/ColorSelectConfigManager.java index aaea88ea92..14307ee535 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorSelectConfigManager.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorSelectConfigManager.java @@ -16,7 +16,7 @@ import java.util.List; */ public class ColorSelectConfigManager implements XMLReadable { - // 最近使用的颜色个数 + // 最大存储的最近使用的颜色个数 private int colorNum = 20; // 最近使用颜色 @@ -51,7 +51,7 @@ public class ColorSelectConfigManager implements XMLReadable { } // 过滤重复的最近使用颜色 - // 最近使用的颜色需要放到最前面 + // 最近使用的颜色需要放到"最前面","最前面"是在面板部分做的,是 colors 的逆序,因此保证最新的放在 list 的最后, colors.remove(color); colors.add(color); @@ -78,11 +78,18 @@ public class ColorSelectConfigManager implements XMLReadable { public void writeXML(XMLPrintWriter writer) { writer.startTAG(RECENT_COLOR_TAG); if (this.colors != null && !this.colors.isEmpty()) { - for (int i = 0; i < this.colors.size(); i++) { + // 只应该存储 max 个,其他颜色存了也没用 + // 从 colors 的尾部开始计算,从尾往头数 max 个,但是存储的时候还是要从头往尾 + int size = colors.size(); + + int beginIndex = size > colorNum ? size - colorNum : 0; + + for (int i = beginIndex; i < this.colors.size(); i++) { writer.startTAG(COLOR_TAG); writer.attr("colors", colors.get(i).getRGB()); writer.end(); } + } writer.end(); } From 2a0a5eb9b7486e3543ed2751d41ad4d454af6f1e Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 4 Sep 2018 14:42:46 +0800 Subject: [PATCH 3/6] =?UTF-8?q?REPORT-10676=209patch10,=20FR9.0=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E6=94=AF=E6=8C=81=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/file/WebPreviewUtils.java | 3 +- .../com/fr/design/fun/PreviewProvider.java | 10 +++- .../fun/impl/AbstractPreviewProvider.java | 7 +++ .../com/fr/design/mainframe/JTemplate.java | 5 +- .../com/fr/design/preview/FormPreview.java | 34 +++++++++++++ .../com/fr/design/preview/MobilePreview.java | 48 ++++++++++++++++++ .../fr/design/images/buttonicon/mobile.png | Bin 0 -> 550 bytes .../fr/design/images/buttonicon/mobileb24.png | Bin 0 -> 1055 bytes .../java/com/fr/design/mainframe/JForm.java | 48 ++++++++++++++---- .../com/fr/design/mainframe/JWorkBook.java | 3 +- 10 files changed, 144 insertions(+), 14 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/preview/FormPreview.java create mode 100644 designer-base/src/main/java/com/fr/design/preview/MobilePreview.java create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/mobile.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/mobileb24.png diff --git a/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java b/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java index 2a73de7a40..5434abc092 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java @@ -9,7 +9,6 @@ import com.fr.design.utils.DesignUtils; import com.fr.file.FILE; import com.fr.file.FileNodeFILE; import com.fr.general.GeneralUtils; -import com.fr.general.web.ParameterConstants; import com.fr.stable.project.ProjectConstants; import com.fr.stable.web.AbstractWebletCreator; @@ -27,7 +26,7 @@ public final class WebPreviewUtils { @SuppressWarnings("unchecked") public static void preview(JTemplate jt, PreviewProvider provider) { String baseRoute = jt.route(); - actionPerformed(jt, baseRoute, provider == null ? Collections.EMPTY_MAP : provider.parametersForPreview(), ParameterConstants.VIEWLET); + actionPerformed(jt, baseRoute, provider == null ? Collections.EMPTY_MAP : provider.parametersForPreview(), provider.getActionType()); } private static void actionPerformed(JTemplate jt, String baseRoute, Map map, String actionType) { diff --git a/designer-base/src/main/java/com/fr/design/fun/PreviewProvider.java b/designer-base/src/main/java/com/fr/design/fun/PreviewProvider.java index 876c7d2028..f6e8cb2192 100644 --- a/designer-base/src/main/java/com/fr/design/fun/PreviewProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/PreviewProvider.java @@ -11,7 +11,7 @@ import java.util.Map; * @since 8.0 * 自定义预览方式接口 */ -public interface PreviewProvider extends Mutable{ +public interface PreviewProvider extends Mutable { String MARK_STRING = "PreviewProvider"; @@ -54,4 +54,12 @@ public interface PreviewProvider extends Mutable{ */ Map parametersForPreview(); + /** + * 该种预览方式下对模板的处理方式 + * 分页填报等需要计算输出模板,移动端预览直接输出url + * @return 处理方式 + */ + String getActionType(); + + } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractPreviewProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractPreviewProvider.java index 3f824d4bb1..f0b7809039 100644 --- a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractPreviewProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractPreviewProvider.java @@ -3,6 +3,7 @@ package com.fr.design.fun.impl; import com.fr.design.fun.PreviewProvider; import com.fr.design.mainframe.JTemplate; import com.fr.general.ComparatorUtils; +import com.fr.general.web.ParameterConstants; import com.fr.stable.fun.impl.AbstractProvider; import com.fr.stable.fun.mark.API; @@ -45,4 +46,10 @@ public abstract class AbstractPreviewProvider extends AbstractProvider implement public int hashCode() { return nameForPopupItem().hashCode(); } + + + @Override + public String getActionType() { + return ParameterConstants.VIEWLET; + } } \ No newline at end of file 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 bf4eb0d0c3..6f9383e4d4 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 @@ -1,5 +1,6 @@ package com.fr.design.mainframe; +import com.fr.base.BaseUtils; import com.fr.base.FRContext; import com.fr.base.Parameter; import com.fr.base.ScreenResolution; @@ -1006,7 +1007,9 @@ public abstract class JTemplate> * @return */ public Icon getPreviewLargeIcon() { - return UIConstants.RUN_BIG_ICON; + PreviewProvider provider = getPreviewType(); + String iconPath = provider.iconPathForLarge(); + return BaseUtils.readIcon(iconPath); } /** diff --git a/designer-base/src/main/java/com/fr/design/preview/FormPreview.java b/designer-base/src/main/java/com/fr/design/preview/FormPreview.java new file mode 100644 index 0000000000..d6206a2c0a --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/preview/FormPreview.java @@ -0,0 +1,34 @@ +package com.fr.design.preview; + +import com.fr.design.fun.impl.AbstractPreviewProvider; +import com.fr.locale.InterProviderFactory; + + +/** + * @author kerry + * @date 2018/5/22 + */ +public class FormPreview extends AbstractPreviewProvider { + private static final int PREVIEW_TYPE = 5; + + @Override + public String nameForPopupItem() { + return InterProviderFactory.getProvider().getLocText("Fine-Design_Form_M_Form_Preview"); + } + + @Override + public String iconPathForPopupItem() { + return "com/fr/design/images/buttonicon/runs.png"; + } + + @Override + public String iconPathForLarge() { + return "com/fr/design/images/buttonicon/run24.png"; + } + + @Override + public int previewTypeCode() { + return PREVIEW_TYPE; + } + +} diff --git a/designer-base/src/main/java/com/fr/design/preview/MobilePreview.java b/designer-base/src/main/java/com/fr/design/preview/MobilePreview.java new file mode 100644 index 0000000000..8650ec12bf --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/preview/MobilePreview.java @@ -0,0 +1,48 @@ +package com.fr.design.preview; + +import com.fr.design.fun.impl.AbstractPreviewProvider; +import com.fr.general.Inter; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author kerry + * @date 2018/5/11 + */ +public class MobilePreview extends AbstractPreviewProvider { + private static final int PREVIEW_TYPE = 4; + private static final String ACTION_TYPE = "path"; + + @Override + public String nameForPopupItem() { + return Inter.getLocText("Fine-Engine_Mobile_Preview"); + } + + @Override + public String iconPathForPopupItem() { + return "com/fr/design/images/buttonicon/mobile.png"; + } + + @Override + public String iconPathForLarge() { + return "com/fr/design/images/buttonicon/mobileb24.png"; + } + + @Override + public int previewTypeCode() { + return PREVIEW_TYPE; + } + + @Override + public String getActionType() { + return ACTION_TYPE; + } + + @Override + public Map parametersForPreview() { + Map map = new HashMap(); + map.put("op", "mobile"); + return map; + } +} diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/mobile.png b/designer-base/src/main/resources/com/fr/design/images/buttonicon/mobile.png new file mode 100644 index 0000000000000000000000000000000000000000..989111f3dd7c9faa60758ea67a1ecf0c3c6c9d12 GIT binary patch literal 550 zcmV+>0@?kEP)Px$;7LS5R5%fRlR;|}Q51#0NoLZaXu7B%6H1j_xfI6-?S{cC??zuqYRp(Dlkd4EAAW=}wC|qJ8Qk~U$%7IDsg}v*)lQOl z#xbJv%0{ngI^pF(F;Ey0OggCuTG{9@l!dV)dvUK$M+9pN+p7~QH8fx_dqTyek&Xzk z--2rsX*U0Sr@H)-^E+j%?cY+bE$tQDkrZ`5YHCsu%Ai;*;Mdj^T&qB`X8!=S zUo}N2gTKutY5S0ZYXIVNAA%-<{&PfRB>(^b07*qoM6N<$f_(e}4FCWD literal 0 HcmV?d00001 diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/mobileb24.png b/designer-base/src/main/resources/com/fr/design/images/buttonicon/mobileb24.png new file mode 100644 index 0000000000000000000000000000000000000000..c1f62a6fbfbcd203bb3487504a13a62d74bbb534 GIT binary patch literal 1055 zcmV+)1mOFLP)Px&*-1n}R9FeMS9?fPQ5gT-y;QJTTTPwY${spR%CM+R=mn7w6hu~kM35mye?&z= zMS(#{RDVQIdVo<;R76A~81^s>41%Pxl|5GY2>0-nI=9_>+qrtz+gaCeJVlDgn0 z;3LV-6D>}#2!`A#N)q6S$j#4o=s-pyk`RGJ3iG++LSS#Pnmd`b_So>TBY3LgG%F&I zJ%!?Sc6q(z!=sp{A_8LQG)+S_*ag*)o4m!uLS$`mZ$;Dh1E)?sMsssB(o{NV)hw70 z88&S`dUG}acAIQr-WeBx#`+o<-rj?Kb1BNo%HU@7u<0rEd0lu|`y4fw4kF#Z9Y|Wn z*O8oK5+FBuZ?OhX9CTq=2vv>4~lRKd6? zIpkj`S)4c&-2pb}Lv?jE$}4ulXiAp^wpeYbsHlMR#dRQ*BPWUo_?@p|x7(37CtnVe z^A!{nVAgCqQhqne#wsEZaD72ePL3>Kq%$u+A6n1HNRvQUL_p>5M@B}507S}=k!giC z&@JWW?1~7mx(Vp)?34wJboO{Xpw%gnCV{SqfM#koT3cHMAW{bBkM9^xogwAs?1~8J zrY%NGOA9_b9I~Lq>2kTy)c6v9bCGOp%=Z9!_MbTXqaZ0rwr#@Ma~HAeKqbCF9|r%` zL%y6wzMk5>eq0O1&=a%3Bux&-h$)IrfB^U`E8sE|;Y{T|ynFKsEIam-?dMkqPFLF35Y*4cgGcx9@YYor%~{ZBb#Qk$5rh^4wlx@R zug9=&5PokPZeOYbm3ZjC^YrWezXJ2(*Q~meF1=9QdCUf;~nAcYw6ep$I|Xn5_5~Tzej! Z`WJ>eID1=>t}g%p002ovPDHLkV1kt%<9z@C literal 0 HcmV?d00001 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 df113a7bb9..25fc777e61 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 @@ -25,6 +25,7 @@ import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.properties.FormWidgetAuthorityEditPane; import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedListener; +import com.fr.design.fun.PreviewProvider; import com.fr.design.gui.frpane.HyperlinkGroupPane; import com.fr.design.gui.frpane.HyperlinkGroupPaneActionProvider; import com.fr.design.gui.ilable.UILabel; @@ -46,6 +47,8 @@ import com.fr.design.menu.MenuDef; import com.fr.design.menu.ShortCut; import com.fr.design.menu.ToolBarDef; 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.utils.gui.LayoutUtils; import com.fr.file.FILE; @@ -80,7 +83,9 @@ import java.awt.Font; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.image.BufferedImage; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; public class JForm extends JTemplate implements BaseJForm { private static final String FORM_CARD = "FORM"; @@ -683,7 +688,7 @@ public class JForm extends JTemplate implements BaseJForm { * */ public Icon getPreviewLargeIcon() { - return UIConstants.RUN_BIG_ICON; + return super.getPreviewLargeIcon(); } @Override @@ -698,14 +703,19 @@ public class JForm extends JTemplate implements BaseJForm { * @return 菜单 */ public UIMenuItem[] createMenuItem4Preview() { - UIMenuItem form = new UIMenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Form_Preview"), UIConstants.RUN_SMALL_ICON); - form.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - WebPreviewUtils.preview(JForm.this); - } - }); - return new UIMenuItem[]{form}; + List menuItems = new ArrayList(); + PreviewProvider[] previewProviders = supportPreview(); + for (final PreviewProvider provider : previewProviders) { + UIMenuItem item = new UIMenuItem(provider.nameForPopupItem(), BaseUtils.readIcon(provider.iconPathForPopupItem())); + item.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + provider.onClick(JForm.this); + } + }); + menuItems.add(item); + } + return menuItems.toArray(new UIMenuItem[menuItems.size()]); } /** @@ -922,6 +932,26 @@ public class JForm extends JTemplate implements BaseJForm { return creator.toData(); } + /** + * 支持的预览模式 + * @return 预览模式 + */ + @Override + public PreviewProvider[] supportPreview() { + return new PreviewProvider[]{new FormPreview(), new MobilePreview()}; + } + + /** + * 预览按钮点击事件 + * + * @param provider 预览接口 + */ + @Override + public void previewMenuActionPerformed(PreviewProvider provider) { + super.previewMenuActionPerformed(provider); + } + + @Override public String route() { return ViewRequestConstants.FORM_VIEW_PATH; 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 fc1945daf0..e60fa59785 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 @@ -53,6 +53,7 @@ import com.fr.design.menu.ToolBarDef; import com.fr.design.module.DesignModuleFactory; import com.fr.design.parameter.ParameterDefinitePane; import com.fr.design.parameter.ParameterInputPane; +import com.fr.design.preview.MobilePreview; import com.fr.design.preview.PagePreview; import com.fr.design.preview.ViewPreview; import com.fr.design.preview.WriteEnhancePreview; @@ -890,7 +891,7 @@ public class JWorkBook extends JTemplate { public PreviewProvider[] supportPreview() { Set set = ExtraDesignClassManager.getInstance().getArray(PreviewProvider.MARK_STRING); return ArrayUtils.addAll(new PreviewProvider[]{ - new PagePreview(), new WritePreview(), new ViewPreview(), new WriteEnhancePreview() + new PagePreview(), new WritePreview(), new ViewPreview(), new WriteEnhancePreview(), new MobilePreview() }, set.toArray(new PreviewProvider[set.size()])); } From 85a66f9d38facb53e0557e8c2bfcfba84eb75fa1 Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 4 Sep 2018 15:26:06 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E5=9B=BD=E5=AE=B6=E5=8C=96=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/preview/MobilePreview.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/preview/MobilePreview.java b/designer-base/src/main/java/com/fr/design/preview/MobilePreview.java index 8650ec12bf..4ab9425010 100644 --- a/designer-base/src/main/java/com/fr/design/preview/MobilePreview.java +++ b/designer-base/src/main/java/com/fr/design/preview/MobilePreview.java @@ -16,7 +16,7 @@ public class MobilePreview extends AbstractPreviewProvider { @Override public String nameForPopupItem() { - return Inter.getLocText("Fine-Engine_Mobile_Preview"); + return Inter.getLocText("Fine-Design_Mobile_Preview"); } @Override From f924ace68d225ad833c15b5915aa2be5ee856304 Mon Sep 17 00:00:00 2001 From: zack Date: Wed, 5 Sep 2018 23:15:24 +0800 Subject: [PATCH 5/6] =?UTF-8?q?REPORT-11059=20=E6=8F=92=E5=85=A5=E8=A1=8C?= =?UTF-8?q?=E7=AD=96=E7=95=A5=EF=BC=8C=E9=BB=98=E8=AE=A4=E5=80=BC=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=B8=BA=E5=85=AC=E5=BC=8F=EF=BC=8C=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=85=AC=E7=A4=BA=E5=90=8E=E4=B8=8D=E8=83=BD=E6=88=90=E5=8A=9F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=81=EF=BC=81=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/editor/ValueEditorPane.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/editor/ValueEditorPane.java b/designer-base/src/main/java/com/fr/design/editor/ValueEditorPane.java index 4ebe3c83fa..588fc1218a 100644 --- a/designer-base/src/main/java/com/fr/design/editor/ValueEditorPane.java +++ b/designer-base/src/main/java/com/fr/design/editor/ValueEditorPane.java @@ -344,8 +344,24 @@ public class ValueEditorPane extends BasicPane implements UIObserver, GlobalName * * @param listener 观察者监听事件 */ + @Override public void registerNameListener(GlobalNameListener listener) { globalNameListener = listener; + for (Editor card : cards) { + doLoop(card, listener); + } + } + + private void doLoop(Container card, GlobalNameListener listener) { + for (int i = 0, len = card.getComponentCount(); i < len; i++) { + Component tmpComp = card.getComponent(i); + if (tmpComp instanceof Container) { + doLoop((Container) tmpComp, listener); + } + if (tmpComp instanceof GlobalNameObserver) { + ((GlobalNameObserver) tmpComp).registerNameListener(listener); + } + } } /** From 39ffd23c8dcbe5eeadc7c827bbac78e2b48c4892 Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 6 Sep 2018 10:26:24 +0800 Subject: [PATCH 6/6] =?UTF-8?q?REPORT-11123=20=E3=80=9010.0=E5=86=92?= =?UTF-8?q?=E7=83=9F=E3=80=91=E8=A1=A8=E5=8D=95=E9=A2=84=E8=A7=88=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=E9=97=AE=E9=A2=98=EF=BC=8C=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E6=B2=A1=E5=8F=8D=E5=BA=94?= 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/design/preview/FormPreview.java | 3 +-- .../src/main/java/com/fr/design/preview/MobilePreview.java | 3 +-- .../src/main/java/com/fr/design/mainframe/JWorkBook.java | 4 +--- 4 files changed, 6 insertions(+), 7 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 6f9383e4d4..b2519271b0 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 @@ -16,6 +16,7 @@ import com.fr.design.actions.edit.RedoAction; import com.fr.design.actions.edit.UndoAction; import com.fr.design.actions.file.SaveAsTemplateAction; import com.fr.design.actions.file.SaveTemplateAction; +import com.fr.design.actions.file.WebPreviewUtils; import com.fr.design.constants.UIConstants; import com.fr.design.designer.TargetComponent; import com.fr.design.dialog.InformationWarnPane; @@ -1102,6 +1103,8 @@ public abstract class JTemplate> * @param provider 预览模式 */ public void previewMenuActionPerformed(PreviewProvider provider) { + setPreviewType(provider); + WebPreviewUtils.preview(this, provider); } diff --git a/designer-base/src/main/java/com/fr/design/preview/FormPreview.java b/designer-base/src/main/java/com/fr/design/preview/FormPreview.java index d6206a2c0a..8522d67734 100644 --- a/designer-base/src/main/java/com/fr/design/preview/FormPreview.java +++ b/designer-base/src/main/java/com/fr/design/preview/FormPreview.java @@ -1,7 +1,6 @@ package com.fr.design.preview; import com.fr.design.fun.impl.AbstractPreviewProvider; -import com.fr.locale.InterProviderFactory; /** @@ -13,7 +12,7 @@ public class FormPreview extends AbstractPreviewProvider { @Override public String nameForPopupItem() { - return InterProviderFactory.getProvider().getLocText("Fine-Design_Form_M_Form_Preview"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Form_Preview"); } @Override diff --git a/designer-base/src/main/java/com/fr/design/preview/MobilePreview.java b/designer-base/src/main/java/com/fr/design/preview/MobilePreview.java index 4ab9425010..ca75e39ac3 100644 --- a/designer-base/src/main/java/com/fr/design/preview/MobilePreview.java +++ b/designer-base/src/main/java/com/fr/design/preview/MobilePreview.java @@ -1,7 +1,6 @@ package com.fr.design.preview; import com.fr.design.fun.impl.AbstractPreviewProvider; -import com.fr.general.Inter; import java.util.HashMap; import java.util.Map; @@ -16,7 +15,7 @@ public class MobilePreview extends AbstractPreviewProvider { @Override public String nameForPopupItem() { - return Inter.getLocText("Fine-Design_Mobile_Preview"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Preview"); } @Override 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 e60fa59785..bfc01d0bf9 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 @@ -10,7 +10,6 @@ import com.fr.design.DesignModelAdapter; import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.AllowAuthorityEditAction; import com.fr.design.actions.ExitAuthorityEditAction; -import com.fr.design.actions.file.WebPreviewUtils; import com.fr.design.actions.file.export.CSVExportAction; import com.fr.design.actions.file.export.EmbeddedExportExportAction; import com.fr.design.actions.file.export.ExcelExportAction; @@ -924,8 +923,7 @@ public class JWorkBook extends JTemplate { */ @Override public void previewMenuActionPerformed(PreviewProvider provider) { - setPreviewType(provider); - WebPreviewUtils.preview(this, provider); + super.previewMenuActionPerformed(provider); } /**