Browse Source

REPORT-49986 CloseCurrentTemplateAction 换行格式问题

feature/10.0
hades 4 years ago
parent
commit
39a68171c3
  1. 45
      designer-base/src/main/java/com/fr/design/actions/file/CloseCurrentTemplateAction.java

45
designer-base/src/main/java/com/fr/design/actions/file/CloseCurrentTemplateAction.java

@ -1 +1,44 @@
package com.fr.design.actions.file; import com.fr.design.actions.UpdateAction; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.MutilTempalteTabPane; import com.fr.design.mainframe.JTemplate; import com.fr.design.menu.KeySetUtils; import java.awt.event.ActionEvent; /** * Author : daisy * Date: 13-8-16 * Time: 下午3:23 */ public class CloseCurrentTemplateAction extends UpdateAction { public CloseCurrentTemplateAction() { this.setMenuKeySet(KeySetUtils.CLOSE_CURRENT_TEMPLATE); this.setName(getMenuKeySet().getMenuKeySetName()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setAccelerator(getMenuKeySet().getKeyStroke()); } /** * 动作 * @param e 事件 */ public void actionPerformed(ActionEvent e) { MutilTempalteTabPane.getInstance().setIsCloseCurrent(true); MutilTempalteTabPane.getInstance().closeFormat(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); MutilTempalteTabPane.getInstance().closeSpecifiedTemplate(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); } @Override public void update() { super.update(); JTemplate<?, ?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); if (template != null) { this.setEnabled(!template.isSaving()); } } } package com.fr.design.actions.file;
import com.fr.design.actions.UpdateAction;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.file.MutilTempalteTabPane;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.menu.KeySetUtils;
import java.awt.event.ActionEvent;
/**
* Author : daisy
* Date: 13-8-16
* Time: 下午3:23
*/
public class CloseCurrentTemplateAction extends UpdateAction {
public CloseCurrentTemplateAction() {
this.setMenuKeySet(KeySetUtils.CLOSE_CURRENT_TEMPLATE);
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setAccelerator(getMenuKeySet().getKeyStroke());
}
/**
* 动作
* @param e 事件
*/
public void actionPerformed(ActionEvent e) {
MutilTempalteTabPane.getInstance().setIsCloseCurrent(true);
MutilTempalteTabPane.getInstance().closeFormat(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate());
MutilTempalteTabPane.getInstance().closeSpecifiedTemplate(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate());
}
@Override
public void update() {
super.update();
JTemplate<?, ?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (template != null) {
this.setEnabled(!template.isSaving());
}
}
}
Loading…
Cancel
Save