Browse Source

Pull request #12066: REPORT-94391 && REPORT-94374【FVS支持多开】兼容问题-新jar+旧插件,文件选项有两个关闭按钮;【FVS支持多开】frm关闭其他模板按钮,把所有打开的模板都关闭了

Merge in DESIGN/design from ~KERRY/design_10.0:release/11.0 to release/11.0

* commit '81f37d29d19153c26e25f745ae4867c8f8d8b78f':
  REPORT-94391 && REPORT-94374【FVS支持多开】兼容问题-新jar+旧插件,文件选项有两个关闭按钮;【FVS支持多开】frm关闭其他模板按钮,把所有打开的模板都关闭了
newui
kerry-王周勇 2 years ago
parent
commit
140c24d3b9
  1. 3
      designer-base/src/main/java/com/fr/design/file/MultiTemplateTabMenuFactory.java
  2. 19
      designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java
  3. 2
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

3
designer-base/src/main/java/com/fr/design/file/MultiTemplateTabMenuFactory.java

@ -100,8 +100,7 @@ public class MultiTemplateTabMenuFactory {
closeOther.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
MultiTemplateTabPane.getInstance().closeAllByOperatorType(currentOperator);
MultiTemplateTabPane.getInstance().closeOtherByOperatorType(currentOperator);
}
});
if (MultiTemplateTabPane.getInstance().getOpenedJTemplatesByOperator(currentOperator).size() <= 1) {

19
designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java

@ -384,7 +384,8 @@ public class MultiTemplateTabPane extends JComponent {
* 关闭所有指定模板tab操作类型的模板
* @param operatorType
*/
public void closeAllByOperatorType(String operatorType){
public void closeOtherByOperatorType(String operatorType){
JTemplate<?, ?> currentEditingTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
SaveSomeTemplatePane saveSomeTempaltePane = new SaveSomeTemplatePane(false);
if (saveSomeTempaltePane.showSavePane()) {
List<JTemplate<?, ?>> openedTemplate = HistoryTemplateListCache.getInstance().getHistoryList();
@ -393,26 +394,24 @@ public class MultiTemplateTabPane extends JComponent {
for (int i = 0; i < openedTemplate.size(); i++) {
templates[i] = openedTemplate.get(i);
}
closeTemplate(templates, operatorType);
closeTemplate(templates, currentEditingTemplate, operatorType);
if (openedTemplate.size() == 0) {
DesignerContext.getDesignerFrame().addAndActivateJTemplate();
} else {
DesignerContext.getDesignerFrame().activateJTemplate(openedTemplate.get(0));
}
DesignerContext.getDesignerFrame().activateJTemplate(currentEditingTemplate);
MultiTemplateTabPane.getInstance().repaint();
}
}
/**
* 关闭指定模板
* 关闭指定的非当前编辑模板
* @param templates
* @param operatorType
*/
private static void closeTemplate(JTemplate<?, ?>[] templates, String operatorType) {
private static void closeTemplate(JTemplate<?, ?>[] templates, JTemplate<?, ?> currentEditingTemplate, String operatorType) {
for (int i = 0; i < templates.length; i++) {
JTemplate<?, ?> jTemplate = templates[i];
if (!ComparatorUtils.equals(operatorType, jTemplate.getTemplateTabOperatorType())){
boolean needClose = ComparatorUtils.equals(operatorType, jTemplate.getTemplateTabOperatorType())
&& jTemplate != currentEditingTemplate;
if (!needClose) {
continue;
}
MultiTemplateTabPane.getInstance().closeFormat(jTemplate);

2
designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -416,7 +416,9 @@ public abstract class ToolBarMenuDock {
menuDef.addShortCut(new OpenRecentReportMenuDef());
if (!DesignModeContext.isDuchampMode()) {
addCloseCurrentTemplateAction(menuDef);
}
scs = plus.shortcut4FileMenu();
if (!ArrayUtils.isEmpty(scs)) {

Loading…
Cancel
Save