From fb3d56a3125a1fdb35ac1cbabce3220a491e165e Mon Sep 17 00:00:00 2001 From: plough Date: Fri, 22 Sep 2017 16:28:20 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-4688=20[9.0=E4=BA=8C=E8=BD=AE?= =?UTF-8?q?=E5=9B=9E=E5=BD=92]=E6=96=B0=E5=BB=BAsheet2=EF=BC=8C=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=82=AC=E6=B5=AE=E5=85=83=E7=B4=A0=EF=BC=8C=E6=92=A4?= =?UTF-8?q?=E9=94=80=E4=B8=80=E6=AC=A1=E6=93=8D=E4=BD=9C=E5=90=8Esheet2?= =?UTF-8?q?=E8=A2=AB=E6=95=B4=E4=B8=AA=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/ElementCasePaneDelegate.java | 3 +++ .../src/com/fr/design/mainframe/ReportFloatPane.java | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java index b358b5302..bbc87fa78 100644 --- a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java +++ b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java @@ -176,6 +176,9 @@ public class ElementCasePaneDelegate extends ElementCasePane { for (int i = 0; i < actions.length; i++) { subMenuDef.addShortCut(actions[i]); } + + // 顺便更新右侧属性面板悬浮元素tab中的菜单项 + ReportFloatPane.getInstance().refreshInsertFloatMenu(this); } // 格式菜单 diff --git a/designer/src/com/fr/design/mainframe/ReportFloatPane.java b/designer/src/com/fr/design/mainframe/ReportFloatPane.java index 9f579f4f9..8207c9db0 100644 --- a/designer/src/com/fr/design/mainframe/ReportFloatPane.java +++ b/designer/src/com/fr/design/mainframe/ReportFloatPane.java @@ -23,7 +23,6 @@ import java.awt.*; public class ReportFloatPane extends JPanel { private static ReportFloatPane THIS; - private ElementCasePaneDelegate elementCasePaneDelegate; private MenuDef insertFloatMenu; private ReportFloatPane() { @@ -37,6 +36,14 @@ public class ReportFloatPane extends JPanel { return THIS; } + public void refreshInsertFloatMenu(ElementCasePaneDelegate elementCasePaneDelegate) { + UpdateAction[] actions = ActionFactory.createFloatInsertAction(ElementCasePane.class, elementCasePaneDelegate); + insertFloatMenu.clearShortCuts(); + for (int i = 0; i < actions.length; i++) { + insertFloatMenu.addShortCut(actions[i]); + } + } + private void initComponent() { this.setLayout(new BorderLayout()); @@ -72,7 +79,7 @@ public class ReportFloatPane extends JPanel { insertFloatMenu.setTooltip(Inter.getLocText("FR-Designer_T_Insert_Float")); insertFloatMenu.setIconPath("com/fr/design/images/control/addPopup.png"); JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); - elementCasePaneDelegate = (ElementCasePaneDelegate) editingTemplate.getCurrentElementCasePane(); + ElementCasePaneDelegate elementCasePaneDelegate = (ElementCasePaneDelegate) editingTemplate.getCurrentElementCasePane(); UpdateAction[] actions = ActionFactory.createFloatInsertAction(ElementCasePane.class, elementCasePaneDelegate); for (int i = 0; i < actions.length; i++) { insertFloatMenu.addShortCut(actions[i]); From 75805ca67962f1197b716a716479afccfe71042c Mon Sep 17 00:00:00 2001 From: plough Date: Fri, 22 Sep 2017 16:36:52 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-4688=20=E8=B0=83=E6=95=B4=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/ReportFloatPane.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/ReportFloatPane.java b/designer/src/com/fr/design/mainframe/ReportFloatPane.java index 8207c9db0..e75960042 100644 --- a/designer/src/com/fr/design/mainframe/ReportFloatPane.java +++ b/designer/src/com/fr/design/mainframe/ReportFloatPane.java @@ -37,8 +37,8 @@ public class ReportFloatPane extends JPanel { } public void refreshInsertFloatMenu(ElementCasePaneDelegate elementCasePaneDelegate) { - UpdateAction[] actions = ActionFactory.createFloatInsertAction(ElementCasePane.class, elementCasePaneDelegate); insertFloatMenu.clearShortCuts(); + UpdateAction[] actions = ActionFactory.createFloatInsertAction(ElementCasePane.class, elementCasePaneDelegate); for (int i = 0; i < actions.length; i++) { insertFloatMenu.addShortCut(actions[i]); } @@ -49,7 +49,7 @@ public class ReportFloatPane extends JPanel { UIToolbar topToolBar = new UIToolbar(); topToolBar.setLayout(new BorderLayout()); - insertFloatMenu = createInsertToolBar(); + initInsertToolBar(); topToolBar.setPreferredSize(new Dimension(155,20)); topToolBar.add(createButtonUI(), BorderLayout.CENTER); topToolBar.setBorder(BorderFactory.createEmptyBorder(-1, -1, -1, -1)); @@ -73,19 +73,14 @@ public class ReportFloatPane extends JPanel { this.add(leftTopPane, BorderLayout.NORTH); } - private MenuDef createInsertToolBar() { - MenuDef insertFloatMenu = new MenuDef(true); + private void initInsertToolBar() { + insertFloatMenu = new MenuDef(true); insertFloatMenu.setName(KeySetUtils.INSERT_FLOAT.getMenuKeySetName()); insertFloatMenu.setTooltip(Inter.getLocText("FR-Designer_T_Insert_Float")); insertFloatMenu.setIconPath("com/fr/design/images/control/addPopup.png"); JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); ElementCasePaneDelegate elementCasePaneDelegate = (ElementCasePaneDelegate) editingTemplate.getCurrentElementCasePane(); - UpdateAction[] actions = ActionFactory.createFloatInsertAction(ElementCasePane.class, elementCasePaneDelegate); - for (int i = 0; i < actions.length; i++) { - insertFloatMenu.addShortCut(actions[i]); - } - return insertFloatMenu; - + refreshInsertFloatMenu(elementCasePaneDelegate); } private UIButton createButtonUI() {