|
|
|
@ -1,5 +1,7 @@
|
|
|
|
|
package com.fr.design.gui.ibutton; |
|
|
|
|
|
|
|
|
|
import com.fr.design.file.HistoryTemplateListCache; |
|
|
|
|
import com.fr.design.mainframe.JTemplate; |
|
|
|
|
import javax.swing.Action; |
|
|
|
|
import javax.swing.Icon; |
|
|
|
|
import javax.swing.plaf.ButtonUI; |
|
|
|
@ -37,6 +39,16 @@ public class UISaveForbiddenButton extends UIButton {
|
|
|
|
|
super(resource, needSetDisabledIcon); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public boolean isEnabled() { |
|
|
|
|
JTemplate<?, ?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); |
|
|
|
|
boolean enabled = true; |
|
|
|
|
if (template != null) { |
|
|
|
|
enabled = !template.isSaving(); |
|
|
|
|
} |
|
|
|
|
return enabled; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public ButtonUI getUI() { |
|
|
|
|
return new UISaveForbiddenButtonUI(); |
|
|
|
|