Browse Source

REPORT-4688 [9.0二轮回归]新建sheet2,添加悬浮元素,撤销一次操作后sheet2被整个删除

master
plough 7 years ago
parent
commit
fb3d56a312
  1. 3
      designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java
  2. 11
      designer/src/com/fr/design/mainframe/ReportFloatPane.java

3
designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java

@ -176,6 +176,9 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
for (int i = 0; i < actions.length; i++) {
subMenuDef.addShortCut(actions[i]);
}
// 顺便更新右侧属性面板悬浮元素tab中的菜单项
ReportFloatPane.getInstance().refreshInsertFloatMenu(this);
}
// 格式菜单

11
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]);

Loading…
Cancel
Save