From 620f17f591dbbc21e5bdee0d510581c2fe03f05a Mon Sep 17 00:00:00 2001 From: renekton Date: Wed, 14 Aug 2024 10:21:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E5=89=AA=E5=88=87=E3=80=81?= =?UTF-8?q?=E5=A4=8D=E5=88=B6=E6=8C=89=E9=92=AEfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/parameter/FormParaDesigner.java | 18 ++++++++++++++++-- .../com/fr/design/mainframe/FormDesigner.java | 12 ++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java b/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java index 20f8203ace..5a3eb5a8ab 100644 --- a/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java +++ b/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java @@ -88,6 +88,8 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP private static Image paraImage = BaseUtils.readImage("/com/fr/design/images/form/parameter.png"); + private UpdateAction[] basicMainPaneActions; + public FormParaDesigner() { this(new FormParameterUI()); } @@ -342,6 +344,14 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP return designerActions.toArray(new UpdateAction[designerActions.size()]); } + public UpdateAction[] getBasicMainActions() { + if (basicMainPaneActions == null) { + basicMainPaneActions = new UpdateAction[]{new CutAction(this), new CopyAction(this), new PasteAction(this), + new FormDeleteAction(this)}; + } + return basicMainPaneActions; + } + private boolean searchQueryCreators(XLayoutContainer rootContainer) { boolean b = false; for (int i = 0; i < rootContainer.getXCreatorCount(); i++) { @@ -736,8 +746,12 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP * @return 按钮组 a */ public JComponent[] toolBarButton4Form() { - return new JComponent[]{new CutAction(this).createToolBarComponent(), new CopyAction(this).createToolBarComponent(), new PasteAction(this).createToolBarComponent(), - new FormDeleteAction(this).createToolBarComponent()}; + UpdateAction[] actions = getBasicMainActions(); + JComponent[] components = new JComponent[actions.length]; + for (int i = 0; i < actions.length; i++) { + components[i] = actions[i].createToolBarComponent(); + } + return components; } @Override diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java index 87f7465490..bee2a32dc4 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java @@ -777,6 +777,14 @@ public class FormDesigner extends TargetComponent
implements TreeSelection for (UpdateAction action : getActions()) { action.update(); } + + UpdateAction[] actions = getBasicMainActions(); + if (actions != null) { + for (UpdateAction action : actions) { + action.update(); + } + } + } } @@ -1485,6 +1493,10 @@ public class FormDesigner extends TargetComponent implements TreeSelection return designerActions.toArray(new UpdateAction[designerActions.size()]); } + public UpdateAction[] getBasicMainActions() { + return null; + } + private List getBasicActions(){ if (basicActions == null) { basicActions = new ArrayList();