hades
4 years ago
1 changed files with 44 additions and 1 deletions
@ -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…
Reference in new issue