Browse Source

Merge pull request #4313 in DESIGN/design from feature/10.0 to feature/x

* commit '142c7ea2fa09cfc4773781e067731392dcf67b4a':
  REPORT-51244【10.0.17】复用组件接触点优化
  REPORT-52554 安装了抽数缓存插件 存在npe
  REPORT-52564 插件-新自适应-插件和新主jar有不兼容问题,有的模板切换新老模式不成功
  REPORT-51678 同步部分插件修复代码
  REPORT-52364 SnapChat弹窗资源路径修改与国际化
  REPORT-52490 社区菜单添加模板商城入口
  REPORT-51678 promptWindow逻辑反了
  REPORT-51244 【10.0.17】复用组件接触点优化 - 功能补充
  REPORT-51678 组件复用插件代码合并--补充SnapChat相关逻辑
  REPORT-52212  切换远程出现白色弹窗 漏改调整
research/11.0
superman 3 years ago
parent
commit
d2698f2690
  1. 9
      designer-base/src/main/java/com/fr/design/actions/community/TemplateStoreAction.java
  2. 4
      designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java
  3. 9
      designer-base/src/main/java/com/fr/design/mainframe/ComponentReuseNotifyUtil.java
  4. 46
      designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java
  5. 20
      designer-base/src/main/java/com/fr/design/mainframe/reuse/ComponentReuseNotificationInfo.java
  6. 169
      designer-base/src/main/java/com/fr/design/mainframe/reuse/ReuseGuideDialog.java
  7. 2
      designer-base/src/main/java/com/fr/design/mainframe/reuse/SnapChatKeys.java
  8. 0
      designer-base/src/main/java/com/fr/design/mainframe/share/collect/CollectorManager.java
  9. 70
      designer-base/src/main/java/com/fr/design/mainframe/share/collect/ComponentCollector.java
  10. 0
      designer-base/src/main/java/com/fr/design/mainframe/share/collect/ComponentSender.java
  11. 1
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  12. 2
      designer-form/src/main/java/com/fr/design/designer/treeview/ComponentTreeCellRenderer.java
  13. 6
      designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java
  14. 12
      designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java
  15. 7
      designer-form/src/main/java/com/fr/design/mainframe/ReuseTriggerPointManager.java
  16. 2
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java
  17. 1
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java
  18. 2
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/ToolbarPane.java
  19. 2
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/AbstractOnlineWidgetShowPane.java
  20. 2
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetShowPane.java
  21. 10
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/FilterPane.java
  22. 14
      designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallComponentHelper.java
  23. 57
      designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java
  24. 2
      designer-realize/src/main/java/com/fr/design/share/ui/config/ShareConfigPane.java
  25. 5
      designer-realize/src/main/java/com/fr/design/share/ui/generate/EffectContent.java
  26. 4
      designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceActivator.java

9
designer-form/src/main/java/com/fr/design/mainframe/share/ui/menu/TemplateStoreMenu.java → designer-base/src/main/java/com/fr/design/actions/community/TemplateStoreAction.java

@ -1,8 +1,7 @@
package com.fr.design.mainframe.share.ui.menu;
package com.fr.design.actions.community;
import com.fr.base.BaseUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.share.collect.ComponentCollector;
import com.fr.design.menu.MenuKeySet;
import com.fr.design.utils.BrowseUtils;
@ -14,9 +13,9 @@ import java.awt.event.ActionEvent;
/**
* created by Harrison on 2020/03/24
**/
public class TemplateStoreMenu extends UpdateAction {
public class TemplateStoreAction extends UpdateAction {
public TemplateStoreMenu() {
public TemplateStoreAction() {
this.setMenuKeySet(TEMPLATE);
this.setName(getMenuKeySet().getMenuName());
@ -29,7 +28,7 @@ public class TemplateStoreMenu extends UpdateAction {
@Override
public String getMenuName() {
return Toolkit.i18nText("Fine-Design_Share_Template_Store");
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Share_Template_Store");
}
@Override

4
designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java

@ -497,7 +497,9 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp
}
public void refreshToolBar() {
toolbarDef.refreshToolBar(FORBIDDEN_SET);
if (toolbarDef != null) {
toolbarDef.refreshToolBar(FORBIDDEN_SET);
}
}
public void checkEnable() {

9
designer-base/src/main/java/com/fr/design/mainframe/ComponentReuseNotifyUtil.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe;
import com.fr.design.DesignerEnvManager;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo;
import com.fr.design.mainframe.toast.DesignerToastMsgUtil;
@ -17,11 +18,6 @@ public class ComponentReuseNotifyUtil {
}
public static void enterWidgetLib() {
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_LIB);
enterWidgetLibExtraAction();
}
public static void enterWidgetLibExtraAction() {
if (ComponentReuseNotificationInfo.getInstance().isClickedWidgetLib()) {
return;
@ -35,5 +31,8 @@ public class ComponentReuseNotifyUtil {
if (snapChat.hasRead()) {
DesignerToastMsgUtil.toastPrompt(Toolkit.i18nText("Fine-Design_Component_Reuse_Merge_Prompt"));
}
ComponentReuseNotificationInfo.getInstance().setClickedWidgetLib(true);
DesignerEnvManager.getEnvManager().saveXMLFile();
}
}

46
designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java

@ -13,8 +13,11 @@ import com.fr.design.gui.ibutton.UIButtonUI;
import com.fr.design.gui.icontainer.UIEastResizableContainer;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.VerticalFlowLayout;
import com.fr.design.mainframe.reuse.ReuseGuideDialog;
import com.fr.design.mainframe.reuse.SnapChatKeys;
import com.fr.design.menu.SnapChatUtil;
import com.fr.design.notification.SnapChat;
import com.fr.design.notification.SnapChatFactory;
import com.fr.design.ui.util.UIUtil;
import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.gui.GUICoreUtils;
@ -97,6 +100,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
private JPanel defaultPane; // "无可用配置项"面板
private JPanel defaultAuthorityPane; // "该元素不支持权限编辑"
private PropertyItem selectedItem; // 当前被选中的属性配置项
private SnapChat widgetLibSnapChat;
public enum PropertyMode {
REPORT, // 报表
@ -297,14 +301,21 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
"hyperlink", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_PARA_WIDGET, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART},
new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_FLOAT, PropertyMode.FORM_REPORT, PropertyMode.POLY_REPORT});
// 组件库
PropertyItem widgetLib = new PropertyItem(KEY_WIDGET_LIB, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Library"),
"widgetlib", new PropertyMode[]{PropertyMode.FORM},
new PropertyMode[]{PropertyMode.FORM}, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
ComponentReuseNotifyUtil.enterWidgetLibExtraAction();
}
});
widgetLibSnapChat = SnapChatFactory.createSnapChat(false, SnapChatKeys.COMPONENT);
PropertyItem widgetLib = new PropertyItem(
KEY_WIDGET_LIB,
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Library"),
"widgetlib",
new PropertyMode[]{PropertyMode.FORM},
new PropertyMode[]{PropertyMode.FORM},
getWidgetLibSnapChat(),
getWidgetLibPromptWindow(),
new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
ComponentReuseNotifyUtil.enterWidgetLibExtraAction();
}
});
// 权限编辑
PropertyItem authorityEdition = new PropertyItem(KEY_AUTHORITY_EDITION, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Permissions_Edition"),
"authorityedit", new PropertyMode[]{PropertyMode.AUTHORITY_EDITION_DISABLED},
@ -519,6 +530,17 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
propertyItemMap.get(KEY_WIDGET_LIB).replaceContentPane(pane);
}
public SnapChat getWidgetLibSnapChat() {
return widgetLibSnapChat;
}
public PromptWindow getWidgetLibPromptWindow() {
if (!getWidgetLibSnapChat().hasRead()) {
return new ReuseGuideDialog(DesignerContext.getDesignerFrame());
}
return null;
}
public JComponent getWidgetLibPane() {
return propertyItemMap.get(KEY_WIDGET_LIB).getContentPane();
}
@ -726,11 +748,14 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
this(name, title, btnIconName, ICON_BASE_DIR, visibleModes, enableModes, null, null);
}
public PropertyItem(String name, String title, String btnIconName, PropertyMode[] visibleModes, PropertyMode[] enableModes, SnapChat snapChat, PromptWindow promptWindow, ActionListener actionListener) {
this(name, title, btnIconName, ICON_BASE_DIR, visibleModes, enableModes, snapChat, promptWindow, actionListener);
}
public PropertyItem(String name, String title, String btnIconName, PropertyMode[] visibleModes, PropertyMode[] enableModes, ActionListener actionListener) {
this(name, title, btnIconName, ICON_BASE_DIR, visibleModes, enableModes, null, null, actionListener);
}
public PropertyItem(String name, String title, String btnIconName, String iconBaseDir, PropertyMode[] visibleModes, PropertyMode[] enableModes, SnapChat snapChat, PromptWindow promptWindow) {
this(name, title, btnIconName, iconBaseDir, visibleModes, enableModes, snapChat, promptWindow, null);
}
@ -942,9 +967,6 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
if (snapChat != null && !snapChat.hasRead()) {
SnapChatUtil.paintPropertyItemPoint(g, getBounds());
}
}
};
button.setDisabledIcon(IconUtils.readIcon(getIconBaseDir() + btnIconName + ICON_SUFFIX_DISABLED));

20
designer-base/src/main/java/com/fr/design/mainframe/reuse/ComponentReuseNotificationInfo.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.reuse;
import com.fr.design.DesignerEnvManager;
import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLable;
import com.fr.stable.xml.XMLableReader;
@ -22,6 +23,8 @@ public class ComponentReuseNotificationInfo implements XMLable {
private boolean clickedWidgetLib = false;
private long lastGuidePopUpTime = 0;
public long getLastNotifyTime() {
return lastNotifyTime;
}
@ -46,11 +49,25 @@ public class ComponentReuseNotificationInfo implements XMLable {
this.clickedWidgetLib = clickedWidgetLib;
}
public long getLastGuidePopUpTime() {
return lastGuidePopUpTime;
}
public void setLastGuidePopUpTime(long lastGuidePopUpTime) {
this.lastGuidePopUpTime = lastGuidePopUpTime;
}
public void updateLastGuidePopUpTime() {
this.setLastGuidePopUpTime(System.currentTimeMillis());
DesignerEnvManager.getEnvManager().saveXMLFile();
}
@Override
public void readXML(XMLableReader reader) {
this.setLastNotifyTime(reader.getAttrAsLong("lastNotifyTime", 0L));
this.setNotifiedNumber(reader.getAttrAsInt("notifiedNumber", 0));
this.setClickedWidgetLib(reader.getAttrAsBoolean("clickedWidgetLib", false));
this.setLastGuidePopUpTime(reader.getAttrAsLong("lastGuidePopUpTime", 0L));
}
@Override
@ -58,7 +75,8 @@ public class ComponentReuseNotificationInfo implements XMLable {
writer.startTAG("ComponentReuseNotificationInfo");
writer.attr("lastNotifyTime", this.lastNotifyTime)
.attr("notifiedNumber", this.notifiedNumber)
.attr("clickedWidgetLib", this.clickedWidgetLib);
.attr("clickedWidgetLib", this.clickedWidgetLib)
.attr("lastGuidePopUpTime", this.lastGuidePopUpTime);
writer.end();
}

169
designer-base/src/main/java/com/fr/design/mainframe/reuse/ReuseGuideDialog.java

@ -0,0 +1,169 @@
package com.fr.design.mainframe.reuse;
import com.fr.base.background.ColorBackground;
import com.fr.design.dialog.UIDialog;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.PromptWindow;
import com.fr.design.mainframe.share.collect.ComponentCollector;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.IOUtils;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dialog;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.RenderingHints;
import java.awt.geom.RoundRectangle2D;
public class ReuseGuideDialog extends UIDialog implements PromptWindow {
InnerDialog innerDialog;
private static final Dimension DEFAULT = new Dimension(735, 510);
public ReuseGuideDialog(Frame parent) {
super(parent);
}
@Override
public void showWindow() {
innerDialog = new InnerDialog(this);
JPanel backGroundPane = new JPanel() {
@Override
protected void paintComponent(Graphics g) {
Image icon = IOUtils.readImage("com/fr/base/images/share/background.png");// 003.jpg是测试图片在项目的根目录下
g.drawImage(icon, 0, 0, getSize().width, getSize().height, this);// 图片会自动缩放
}
};
add(backGroundPane, BorderLayout.CENTER);
initStyle();
innerDialog.showWindow();
}
private void initStyle() {
setSize(DEFAULT);
setUndecorated(true);
setBackground(new Color(0, 0, 0, 0));
GUICoreUtils.centerWindow(this);
}
@Override
public void hideWindow() {
ComponentReuseNotificationInfo.getInstance().updateLastGuidePopUpTime();
this.setVisible(false);
if (innerDialog != null) {
innerDialog.setVisible(false);
innerDialog.dispose();
innerDialog = null;
}
this.dispose();
}
@Override
public void checkValid() {
}
class InnerDialog extends UIDialog {
private final Dimension DEFAULT = new Dimension(700, 475);
private static final int TITLE_FONT_SIZE = 20;
public InnerDialog(Dialog dialog) {
super(dialog);
}
public void showWindow() {
add(createCenterPanel(), BorderLayout.CENTER);
add(createSouthPanel(), BorderLayout.SOUTH);
add(createNorthPanel(), BorderLayout.NORTH);
showDialog();
}
private JPanel createNorthPanel() {
JPanel northPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
//右上角关闭按钮
JButton button = new JButton(new ImageIcon(IOUtils.readImage("/com/fr/base/images/share/close.png").getScaledInstance(15, 15, Image.SCALE_SMOOTH)));
button.setBorder(null);
button.setOpaque(false);
button.addActionListener(e -> ReuseGuideDialog.this.hideWindow());
northPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 15));
northPanel.setOpaque(false);
northPanel.add(button);
return northPanel;
}
private JPanel createCenterPanel() {
JPanel centerPanel = new JPanel(new BorderLayout());
UILabel titleLabel = new UILabel(Toolkit.i18nText("Fine-Design_Share_Drag_And_Make_Component"));
UILabel imageLabel = new UILabel(new ImageIcon(IOUtils.readImage("com/fr/base/images/share/guide.png").getScaledInstance(DEFAULT.width, DEFAULT.height, Image.SCALE_SMOOTH)));
titleLabel.setFont(new Font(titleLabel.getFont().getName(), Font.BOLD, TITLE_FONT_SIZE));
titleLabel.setBorder(BorderFactory.createEmptyBorder());
JPanel panel = new JPanel(new FlowLayout(FlowLayout.CENTER));
panel.setOpaque(false);
panel.add(titleLabel);
centerPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
centerPanel.setOpaque(false);
centerPanel.add(imageLabel, BorderLayout.CENTER);
centerPanel.add(panel, BorderLayout.NORTH);
return centerPanel;
}
private JPanel createSouthPanel() {
JPanel southPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
JButton button = new JButton(Toolkit.i18nText("Fine-Design_Share_Try_Drag")) {
@Override
public void paint(Graphics g) {
ColorBackground buttonBackground = ColorBackground.getInstance(Color.decode("#419BF9"));
Graphics2D g2d = (Graphics2D) g;
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
buttonBackground.paint(g2d, new RoundRectangle2D.Double(0, 0, getWidth(), getHeight(), 8, 8));
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
super.paint(g);
}
};
button.setBorder(null);
button.setForeground(Color.WHITE);
button.setOpaque(false);
button.addActionListener(e -> ReuseGuideDialog.this.hideWindow());
southPanel.setBorder(BorderFactory.createEmptyBorder(0, 290, 19, 290));
southPanel.setPreferredSize(new Dimension(DEFAULT.width, 51));
southPanel.setOpaque(false);
southPanel.add(button);
return southPanel;
}
/**
* 显示窗口
*/
private void showDialog() {
setSize(DEFAULT);
setUndecorated(true);
GUICoreUtils.centerWindow(this);
setModalityType(ModalityType.APPLICATION_MODAL);
ReuseGuideDialog.this.setVisible(true);
setVisible(true);
}
@Override
public void checkValid() {
}
}
}

2
designer-form/src/main/java/com/fr/design/mainframe/share/ui/menu/SnapChatKeys.java → designer-base/src/main/java/com/fr/design/mainframe/reuse/SnapChatKeys.java

@ -1,4 +1,4 @@
package com.fr.design.mainframe.share.ui.menu;
package com.fr.design.mainframe.reuse;
import com.fr.design.notification.SnapChatKey;

0
designer-form/src/main/java/com/fr/design/mainframe/share/collect/CollectorManager.java → designer-base/src/main/java/com/fr/design/mainframe/share/collect/CollectorManager.java

70
designer-form/src/main/java/com/fr/design/mainframe/share/collect/ComponentCollector.java → designer-base/src/main/java/com/fr/design/mainframe/share/collect/ComponentCollector.java

@ -3,6 +3,7 @@ package com.fr.design.mainframe.share.collect;
import com.fr.base.io.XMLReadHelper;
import com.fr.config.MarketConfig;
import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo;
import com.fr.form.share.DefaultSharableWidget;
import com.fr.form.share.SharableWidgetProvider;
import com.fr.form.share.constants.ComponentPath;
@ -44,6 +45,12 @@ import java.util.Iterator;
* created by Harrison on 2020/03/25
**/
public class ComponentCollector implements XMLable {
private static final long ONE_MINUTE = 60 * 1000L;
private static final int REUSE_INFO_FIRST_POPUP = 1;
private static final int REUSE_INFO_SECOND_POPUP = 2;
private static final String SIMPLE_DATE_PATTERN = "yyyy-MM-dd";
private static final String XML = "ComponentCollector";
@ -90,8 +97,13 @@ public class ComponentCollector implements XMLable {
private static final String MARKET_CLICK = "marketClick";
private static final String PROMPT_JUMP = "promptJump";
private static final String TOOLBAR_JUMP = "toolbarJump";
private static final String POPUP_JUMP = "popupJump";
private static final String uuid = DesignerEnvManager.getEnvManager().getUUID();
private static ComponentCollector instance;
private int localCmpNumber = 0;
@ -103,6 +115,12 @@ public class ComponentCollector implements XMLable {
private int cmpBoardClick = 0;
private int promptJump = 0;
private int toolbarJump = 0;
private int popupJump = 0;
private JSONArray activateRecord = JSONFactory.createJSON(JSON.ARRAY);
private JSONArray generateCmpRecord = JSONFactory.createJSON(JSON.ARRAY);
@ -314,6 +332,41 @@ public class ComponentCollector implements XMLable {
saveInfo();
}
public void collectPromptJumpWhenJump(){
if (ComponentReuseNotificationInfo.getInstance().getNotifiedNumber() == REUSE_INFO_FIRST_POPUP) {
this.promptJump = 1;
saveInfo();
}else if(ComponentReuseNotificationInfo.getInstance().getNotifiedNumber() == REUSE_INFO_SECOND_POPUP){
this.promptJump = 2;
saveInfo();
}
}
public void collectPromptJumpWhenShow() {
if (ComponentReuseNotificationInfo.getInstance().getNotifiedNumber() == REUSE_INFO_SECOND_POPUP) {
this.promptJump = -1;
saveInfo();
}
}
public void collectToolbarJump() {
if (this.toolbarJump == 0) {
this.toolbarJump = 1;
saveInfo();
}
}
public void collectPopupJump() {
long currentTime = System.currentTimeMillis();
long lastGuidePopUpTime = ComponentReuseNotificationInfo.getInstance().getLastGuidePopUpTime();
if (currentTime - lastGuidePopUpTime <= ONE_MINUTE && this.popupJump == 0) {
this.popupJump = 1;
saveInfo();
}
}
public void clearSortType() {
sortType = JSONFactory.createJSON(JSON.ARRAY);
}
@ -419,6 +472,9 @@ public class ComponentCollector implements XMLable {
this.searchContent = parseJSONArray(reader.getAttrAsString(SEARCH_CONTENT,StringUtils.EMPTY));
this.filterContent = parseJSONArray(reader.getAttrAsString(FILTER_CONTENT, StringUtils.EMPTY));
this.sortType = parseJSONArray(reader.getAttrAsString(SORT_TYPE, StringUtils.EMPTY));
this.promptJump = reader.getAttrAsInt(PROMPT_JUMP, 0);
this.toolbarJump = reader.getAttrAsInt(TOOLBAR_JUMP, 0);
this.popupJump = reader.getAttrAsInt(POPUP_JUMP, 0);
}
}
@ -453,6 +509,9 @@ public class ComponentCollector implements XMLable {
.attr(SEARCH_CONTENT, searchContent.toString())
.attr(FILTER_CONTENT, filterContent.toString())
.attr(SORT_TYPE, sortType.toString())
.attr(PROMPT_JUMP, promptJump)
.attr(TOOLBAR_JUMP, toolbarJump)
.attr(POPUP_JUMP, popupJump)
.end();
}
@ -477,6 +536,15 @@ public class ComponentCollector implements XMLable {
jo.put(SEARCH_CONTENT, searchContent.toString());
jo.put(FILTER_CONTENT, filterContent.toString());
jo.put(SORT_TYPE, sortType.toString());
jo.put("guideInfo", assembleGuideInfo());
return jo.toString();
}
private String assembleGuideInfo() {
JSONObject jo = JSONFactory.createJSON(JSON.OBJECT);
jo.put(PROMPT_JUMP, promptJump)
.put(TOOLBAR_JUMP, toolbarJump)
.put(POPUP_JUMP, popupJump);
return jo.toString();
}

0
designer-form/src/main/java/com/fr/design/mainframe/share/collect/ComponentSender.java → designer-base/src/main/java/com/fr/design/mainframe/share/collect/ComponentSender.java

1
designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -591,6 +591,7 @@ public abstract class ToolBarMenuDock {
shortCuts.add(new TechSolutionAction());
shortCuts.add(SeparatorDef.DEFAULT);
shortCuts.add(new TemplateStoreAction());
LocaleCenter.buildAction(new LocaleAction() {
@Override

2
designer-form/src/main/java/com/fr/design/designer/treeview/ComponentTreeCellRenderer.java

@ -18,7 +18,7 @@ import java.awt.Graphics;
public class ComponentTreeCellRenderer extends DefaultTreeCellRenderer {
private boolean needAddShareIcon = false;
private static final Icon SHARE_ICON = BaseUtils.readIcon("/com/fr/design/images/toast/icon_reuse.png");
private static final Icon SHARE_ICON = BaseUtils.readIcon("/com/fr/design/images/toast/reuse_icon.png");
public ComponentTreeCellRenderer() {
}

6
designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java

@ -16,6 +16,7 @@ import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.share.collect.ComponentCollector;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.ui.UserDefinedWidgetConfig;
@ -32,6 +33,7 @@ import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener;
import com.fr.stable.ArrayUtils;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JSeparator;
@ -244,10 +246,12 @@ public class FormParaWidgetPane extends JPanel {
private JPanel createComponentReuseToolPane() {
JPanel jPanel = new JPanel(new BorderLayout(17, 10));
UILabel uiLabel = new UILabel(BaseUtils.readIcon("/com/fr/design/images/form/designer/widget_apply_icon.png"));
uiLabel.setBorder(BorderFactory.createEmptyBorder(5, 0 ,5, 0));
jPanel.addMouseListener(new MouseListener() {
@Override
public void mouseClicked(MouseEvent e) {
ComponentReuseNotifyUtil.enterWidgetLib();
FormWidgetDetailPane.getInstance().enterWidgetLib();
ComponentCollector.getInstance().collectToolbarJump();
}
@Override

12
designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java

@ -23,7 +23,10 @@ import java.util.List;
* Time: 下午8:18
*/
public class FormWidgetDetailPane extends FormDockView{
private static final int ONLINE_TAB = 1;
private JPanel centerPane;
private UIHeadGroup headGroup;
private List<BasicPane> paneList;
public static FormWidgetDetailPane getInstance() {
@ -78,7 +81,7 @@ public class FormWidgetDetailPane extends FormDockView{
paneNames[i] = title;
centerPane.add(paneList.get(i), title);
}
UIHeadGroup headGroup = new UIHeadGroup(paneNames) {
headGroup = new UIHeadGroup(paneNames) {
protected void tabChanged(int newSelectedIndex) {
if (newSelectedIndex == 1) {
ComponentCollector.getInstance().collectMarkerClick();
@ -91,6 +94,7 @@ public class FormWidgetDetailPane extends FormDockView{
this.add(centerPane, BorderLayout.CENTER);
}
/**
* 清除数据
*/
@ -101,6 +105,12 @@ public class FormWidgetDetailPane extends FormDockView{
}
public void enterWidgetLib() {
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_LIB);
headGroup.setSelectedIndex(ONLINE_TAB);
ComponentReuseNotifyUtil.enterWidgetLibExtraAction();
}
/**
* 定位
*

7
designer-form/src/main/java/com/fr/design/mainframe/ReuseTriggerPointManager.java

@ -14,6 +14,7 @@ import com.fr.design.mainframe.adaptve.config.impl.CellStyleTriggerPoint;
import com.fr.design.mainframe.adaptve.config.impl.CellValueImageChangeTriggerPoint;
import com.fr.design.mainframe.adaptve.config.ReuseNotifyInfo;
import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo;
import com.fr.design.mainframe.share.collect.ComponentCollector;
import com.fr.design.mainframe.toast.DesignerToastMsgUtil;
import com.fr.event.Event;
import com.fr.event.EventDispatcher;
@ -81,7 +82,7 @@ public class ReuseTriggerPointManager {
}
private boolean hasNotifiedTwice() {
public boolean hasNotifiedTwice() {
return ComponentReuseNotificationInfo.getInstance().getNotifiedNumber() >= 2;
}
@ -147,6 +148,7 @@ public class ReuseTriggerPointManager {
JTemplate currentJTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
DesignerToastMsgUtil.toastPrompt(createReusePrompt((JForm) currentJTemplate));
ReuseTriggerPointManager.getInstance().writeTriggerInfo2xml();
ComponentCollector.getInstance().collectPromptJumpWhenShow();
}
}
@ -180,7 +182,8 @@ public class ReuseTriggerPointManager {
@Override
public void mouseClicked(MouseEvent e) {
jForm.tabChanged(0);
ComponentReuseNotifyUtil.enterWidgetLib();
FormWidgetDetailPane.getInstance().enterWidgetLib();
ComponentCollector.getInstance().collectPromptJumpWhenJump();
}
@Override

2
designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java

@ -13,6 +13,7 @@ import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.WidgetToolBarPane;
import com.fr.design.mainframe.share.collect.ComponentCollector;
import com.fr.design.mainframe.share.group.ui.GroupMoveDialog;
import com.fr.design.mainframe.share.ui.base.PopupMenuItem;
import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoPane;
@ -192,6 +193,7 @@ public class LocalWidgetBlock extends PreviewWidgetBlock<DefaultSharableWidget>
return;
}
hidePreview();
ComponentCollector.getInstance().collectPopupJump();
Object source = e.getSource();
Widget creatorSource;
String shareId;

1
designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java

@ -123,6 +123,7 @@ public class OnlineWidgetBlock extends AbstractOnlineWidgetBlock {
if (lastPressEvent == null) {
return;
}
ComponentCollector.getInstance().collectPopupJump();
Object source = e.getSource();
Widget creatorSource;
String shareId;

2
designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/ToolbarPane.java

@ -119,7 +119,7 @@ class ToolbarPane extends JPanel {
private FilterPane createFilterPane() {
filterPanel = FilterPane.createLocalFilterPane();
filterPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10));
filterPanel.registerChangeListerner(e -> LocalWidgetRepoPane.getInstance().refreshShowPanel());
filterPanel.registerChangeListener(e -> LocalWidgetRepoPane.getInstance().refreshShowPanel());
return filterPanel;
}

2
designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/AbstractOnlineWidgetShowPane.java

@ -138,7 +138,7 @@ public abstract class AbstractOnlineWidgetShowPane extends JPanel {
}
public void initFilterPaneListener(FilterPane filterPane) {
filterPane.registerChangeListerner(new ChangeListener() {
filterPane.registerChangeListener(new ChangeListener() {
@Override
public void stateChanged(final ChangeEvent e) {
String filterStr = e.getSource().toString();

2
designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetShowPane.java

@ -90,7 +90,7 @@ public class OnlineWidgetShowPane extends AbstractOnlineWidgetShowPane {
@Override
public void initFilterPaneListener(FilterPane filterPane) {
super.initFilterPaneListener(filterPane);
filterPane.registerChangeListerner(new ChangeListener() {
filterPane.registerChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
lastFilter = e.getSource().toString();

10
designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/FilterPane.java

@ -46,7 +46,7 @@ public class FilterPane extends JPanel {
private Popup popup;
private boolean showPopup = false;
private FilterPopupPane filterPopupPane;
private ChangeListener changeListener;
private List<ChangeListener> changeListenerList = new ArrayList<>();
private final AWTEventListener awtEventListener;
List<PopStateChangeListener> listenerList = new ArrayList<>();
@ -191,12 +191,14 @@ public class FilterPane extends JPanel {
&& !ComparatorUtils.equals(mv.getSource(), filterLabel);
}
public void registerChangeListerner(ChangeListener changeListener) {
this.changeListener = changeListener;
public void registerChangeListener(ChangeListener changeListener) {
changeListenerList.add(changeListener);
}
public void fireChangeListener(ChangeEvent e) {
this.changeListener.stateChanged(e);
for (ChangeListener changeListener : changeListenerList) {
changeListener.stateChanged(e);
}
}
public void reset() {

14
designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallComponentHelper.java

@ -1,6 +1,6 @@
package com.fr.design.mainframe.share.util;
import com.fr.design.mainframe.share.ui.menu.SnapChatKeys;
import com.fr.design.mainframe.reuse.SnapChatKeys;
import com.fr.design.notification.SnapChat;
import com.fr.design.notification.SnapChatFactory;
import com.fr.form.share.constants.ComponentPath;
@ -22,12 +22,12 @@ public class InstallComponentHelper {
private static final String PRE_INSTALL_PATH = "/com/fr/form/share/components";
private static final String[] PRE_INSTALL_COMPONENTS = new String[]{
"大屏标题-蓝白.739e7afd-ce1d-40ea-b272-3c96eacc27f8.reu",
"单数据指标卡-绿色.48ea0497-1c7f-4894-a927-0f18fe4d2f27.reu",
"单数据指标卡-蓝色.d158c9d6-66be-410a-8697-47b19a8f9565.reu",
"分类对比竖向仪表板-浅色.a90a7b81-26fd-4461-8a39-ce1c07a16ad0.reu",
"分层雷达图-浅色.d2cd7a40-c14c-4a79-a30e-25d2ba555479.reu",
"进度表格-浅色.8aafad8b-d85c-4921-b45d-1acb4c226ca2.reu"
"单行指标卡.f3df58b3-4302-4cab-ab77-caaf225de60a.reu",
"分层雷达图-深色.49f8397c-e6a6-482a-acc7-46d8cec353a4.reu",
"红绿灯表格-浅色.d0466992-328a-4ccf-ad67-6cbc844d669c.reu",
"进度表格-深色.de4141ce-5c25-4506-9424-f5aa15fbf6d0.reu",
"三列指标卡.61a83d18-a162-4dc3-aa57-3b954edaf82e.reu",
"透明按钮切换图表.e373e13a-3da0-4c29-91bc-9ae804241023.reu"
};
public static void installPreComponent() {

57
designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java

@ -45,30 +45,8 @@ class FormApp extends AbstractAppProvider {
HashMap<String, Class> classType = new HashMap<String, Class>();
classType.put(Constants.ARG_0, Form.class);
classType.put(Constants.ARG_1, FILE.class);
classType.put(Constants.ARG_2, Parameter[].class);
JForm emptyForm = new JForm(new Form(new WBorderLayout("form")), tplFile);
OpenWorker<OpenResult<Form, Parameter[]>> worker = new OpenWorker<>(
new Callable<OpenResult<Form, Parameter[]>>() {
@Override
public OpenResult<Form, Parameter[]> call() throws Exception {
Form form = asIOFile(tplFile);
return new OpenResult<>(form, form.getParameters());
}
}, emptyForm);
worker.addCallBack(new Callable<JTemplate<?, ?>>() {
@Override
public JTemplate<?, ?> call() throws Exception {
OpenResult<Form, Parameter[]> result = worker.getResult();
return compatibleForm(result.getBaseBook(), result.getRef(), tplFile, classType);
}
});
FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Report_Template_Opening_And_Waiting", tplFile.getName()) + "...");
worker.start(tplFile.getPath());
OpenResult<Form, Parameter[]> result = worker.getResult();
if (result != null) {
return compatibleForm(result.getBaseBook(), new Parameter[0], tplFile, classType);
}
return emptyForm;
return compatibleForm(tplFile, classType);
}
/**
@ -76,13 +54,36 @@ class FormApp extends AbstractAppProvider {
*
* @return
*/
private JTemplate<Form, ?> compatibleForm(Form form, Parameter[] parameters, FILE tplFile, HashMap<String, Class> classType) {
if (ComparatorUtils.equals(StableFactory.getRegisteredClass(BaseJForm.XML_TAG).getName(), JForm.class)) {
return (JTemplate<Form, ?>) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG,
new Object[]{form, tplFile, parameters}, classType, BaseJForm.class);
private JTemplate<Form, ?> compatibleForm(FILE tplFile, HashMap<String, Class> classType) {
if (ComparatorUtils.equals(StableFactory.getRegisteredClass(BaseJForm.XML_TAG), JForm.class)) {
classType.put(Constants.ARG_2, Parameter[].class);
JForm emptyForm = new JForm(new Form(new WBorderLayout("form")), tplFile);
OpenWorker<OpenResult<Form, Parameter[]>> worker = new OpenWorker<>(
new Callable<OpenResult<Form, Parameter[]>>() {
@Override
public OpenResult<Form, Parameter[]> call() throws Exception {
Form form = asIOFile(tplFile);
return new OpenResult<>(form, form.getParameters());
}
}, emptyForm);
worker.addCallBack(new Callable<JTemplate<?, ?>>() {
@Override
public JTemplate<?, ?> call() throws Exception {
OpenResult<Form, Parameter[]> result = worker.getResult();
return (JTemplate<Form, ?>) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG,
new Object[]{result.getBaseBook(), tplFile, result.getRef()}, classType, BaseJForm.class);
}
});
worker.start(tplFile.getPath());
OpenResult<Form, Parameter[]> result = worker.getResult();
if (result != null) {
return (JTemplate<Form, ?>) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG,
new Object[]{result.getBaseBook(), tplFile, new Parameter[0]}, classType, BaseJForm.class);
}
return emptyForm;
} else {
return (JTemplate<Form, ?>) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG,
new Object[]{form, tplFile}, classType, BaseJForm.class);
new Object[]{asIOFile(tplFile), tplFile}, classType, BaseJForm.class);
}
}

2
designer-realize/src/main/java/com/fr/design/share/ui/config/ShareConfigPane.java

@ -155,7 +155,7 @@ public class ShareConfigPane extends BasicPane {
private JPanel createInfoPane() {
JPanel infoPane = FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Design_Share_Introduce"));
PlaceholderTextArea textArea = new PlaceholderTextArea();
textArea.setText(this.widget.getDescription());
textArea.setText(getDescription());
textArea.setPlaceholder(Toolkit.i18nText("Fine-Design_Share_No_Introduction"));
textArea.setEditable(false);
UIScrollPane scrollPane = new UIScrollPane(textArea);

5
designer-realize/src/main/java/com/fr/design/share/ui/generate/EffectContent.java

@ -17,6 +17,7 @@ import com.fr.locale.InterProviderFactory;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTree;
import javax.swing.event.TreeSelectionListener;
@ -144,8 +145,8 @@ public class EffectContent extends JPanel {
}
private void setPaneDisabled(Component component) {
if (component instanceof UIScrollPane) {
UIScrollPane pane = (UIScrollPane) component;
if (component instanceof JScrollPane) {
JScrollPane pane = (JScrollPane) component;
setPaneDisabled(pane.getViewport().getView());
return;
}

4
designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceActivator.java

@ -2,7 +2,6 @@ package com.fr.start.module;
import com.fr.concurrent.NamedThreadFactory;
import com.fr.design.PluginClassRefreshManager;
import com.fr.design.env.WorkspaceChangeLoadingDialog;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.event.Event;
import com.fr.event.Listener;
@ -62,9 +61,8 @@ public class DesignerWorkspaceActivator extends Activator {
@Override
public void on(Event event, Workspace workspace) {
HistoryTemplateListCache.getInstance().load();
PluginClassRefreshManager.getInstance().addPluginListener();
WorkspaceChangeLoadingDialog.hideDialog();
}
});
}

Loading…
Cancel
Save