diff --git a/designer-base/src/main/java/com/fr/design/PluginClassRefreshManager.java b/designer-base/src/main/java/com/fr/design/PluginClassRefreshManager.java index 9e1d57dfd9..4e81a7ece4 100644 --- a/designer-base/src/main/java/com/fr/design/PluginClassRefreshManager.java +++ b/designer-base/src/main/java/com/fr/design/PluginClassRefreshManager.java @@ -4,6 +4,8 @@ import com.fr.design.constants.DesignerLaunchStatus; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.fun.HyperlinkProvider; import com.fr.design.fun.TableDataDefineProvider; +import com.fr.design.mainframe.JTemplate; +import com.fr.design.ui.util.UIUtil; import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEventListener; import com.fr.plugin.observer.PluginEventType; @@ -28,7 +30,7 @@ public class PluginClassRefreshManager { @Override public void on(PluginEvent event) { // 重载模版之前 触发下hide - HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTabChange(); + fireTabChange(); // 兼容之前版本特性 for (String tag : context) { if (event.getContext().contain(tag)) { @@ -53,12 +55,24 @@ public class PluginClassRefreshManager { public void on(PluginEvent event) { PluginListenerRegistration.getInstance().listen(PluginEventType.AfterRun, pluginAfterRunEventListener); if (DesignerLaunchStatus.getStatus() != DesignerLaunchStatus.WORKSPACE_INIT_COMPLETE) { - HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTabChange(); + fireTabChange(); HistoryTemplateListCache.getInstance().reloadAllEditingTemplate(); } } }; + public void fireTabChange() { + JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + if (template != null) { + UIUtil.invokeLaterIfNeeded(new Runnable() { + @Override + public void run() { + template.fireTabChange(); + } + }); + } + } + public static PluginClassRefreshManager getInstance() { return INSTANCE; 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 39cdbb9303..a5784959a8 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 @@ -275,6 +275,14 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta //刷新FixedPopupPane的位置 EastRegionContainerPane.getInstance().freshCurrentPopupPane(); } + + @Override + public void componentMoved(ComponentEvent e) { + JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + if (template != null) { + template.refreshFormDesigner(); + } + } }); this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); this.setVisible(false); 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 8b76b30f49..79f6a5c1e8 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 @@ -221,6 +221,10 @@ public abstract class JTemplate> // do nothing } + public void refreshFormDesigner() { + // do nothing + } + /** * @deprecated move to cloud ops plugin,left only for compatible 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 8c9b1f2bc8..0bee88e903 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 @@ -1135,4 +1135,11 @@ public class JForm extends JTemplate implements BaseJForm { designer.hidePopup(); } } + + @Override + public void refreshFormDesigner() { + FormDesigner designer = (FormDesigner) parameterPane.getParaDesigner(); + if (designer != null) { + designer.repaint(); + } + } }