Browse Source

Merge pull request #1279 in BA/design from ~PLOUGH/design:release/9.0 to release/9.0

* commit '75805ca67962f1197b716a716479afccfe71042c':
  REPORT-4688 调整代码
  REPORT-4688 [9.0二轮回归]新建sheet2,添加悬浮元素,撤销一次操作后sheet2被整个删除
master
superman 7 years ago
parent
commit
62a032816b
  1. 3
      designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java
  2. 24
      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++) { for (int i = 0; i < actions.length; i++) {
subMenuDef.addShortCut(actions[i]); subMenuDef.addShortCut(actions[i]);
} }
// 顺便更新右侧属性面板悬浮元素tab中的菜单项
ReportFloatPane.getInstance().refreshInsertFloatMenu(this);
} }
// 格式菜单 // 格式菜单

24
designer/src/com/fr/design/mainframe/ReportFloatPane.java

@ -23,7 +23,6 @@ import java.awt.*;
public class ReportFloatPane extends JPanel { public class ReportFloatPane extends JPanel {
private static ReportFloatPane THIS; private static ReportFloatPane THIS;
private ElementCasePaneDelegate elementCasePaneDelegate;
private MenuDef insertFloatMenu; private MenuDef insertFloatMenu;
private ReportFloatPane() { private ReportFloatPane() {
@ -37,12 +36,20 @@ public class ReportFloatPane extends JPanel {
return THIS; return THIS;
} }
public void refreshInsertFloatMenu(ElementCasePaneDelegate elementCasePaneDelegate) {
insertFloatMenu.clearShortCuts();
UpdateAction[] actions = ActionFactory.createFloatInsertAction(ElementCasePane.class, elementCasePaneDelegate);
for (int i = 0; i < actions.length; i++) {
insertFloatMenu.addShortCut(actions[i]);
}
}
private void initComponent() { private void initComponent() {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
UIToolbar topToolBar = new UIToolbar(); UIToolbar topToolBar = new UIToolbar();
topToolBar.setLayout(new BorderLayout()); topToolBar.setLayout(new BorderLayout());
insertFloatMenu = createInsertToolBar(); initInsertToolBar();
topToolBar.setPreferredSize(new Dimension(155,20)); topToolBar.setPreferredSize(new Dimension(155,20));
topToolBar.add(createButtonUI(), BorderLayout.CENTER); topToolBar.add(createButtonUI(), BorderLayout.CENTER);
topToolBar.setBorder(BorderFactory.createEmptyBorder(-1, -1, -1, -1)); topToolBar.setBorder(BorderFactory.createEmptyBorder(-1, -1, -1, -1));
@ -66,19 +73,14 @@ public class ReportFloatPane extends JPanel {
this.add(leftTopPane, BorderLayout.NORTH); this.add(leftTopPane, BorderLayout.NORTH);
} }
private MenuDef createInsertToolBar() { private void initInsertToolBar() {
MenuDef insertFloatMenu = new MenuDef(true); insertFloatMenu = new MenuDef(true);
insertFloatMenu.setName(KeySetUtils.INSERT_FLOAT.getMenuKeySetName()); insertFloatMenu.setName(KeySetUtils.INSERT_FLOAT.getMenuKeySetName());
insertFloatMenu.setTooltip(Inter.getLocText("FR-Designer_T_Insert_Float")); insertFloatMenu.setTooltip(Inter.getLocText("FR-Designer_T_Insert_Float"));
insertFloatMenu.setIconPath("com/fr/design/images/control/addPopup.png"); insertFloatMenu.setIconPath("com/fr/design/images/control/addPopup.png");
JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
elementCasePaneDelegate = (ElementCasePaneDelegate) editingTemplate.getCurrentElementCasePane(); ElementCasePaneDelegate elementCasePaneDelegate = (ElementCasePaneDelegate) editingTemplate.getCurrentElementCasePane();
UpdateAction[] actions = ActionFactory.createFloatInsertAction(ElementCasePane.class, elementCasePaneDelegate); refreshInsertFloatMenu(elementCasePaneDelegate);
for (int i = 0; i < actions.length; i++) {
insertFloatMenu.addShortCut(actions[i]);
}
return insertFloatMenu;
} }
private UIButton createButtonUI() { private UIButton createButtonUI() {

Loading…
Cancel
Save