📄 commentbutton.java
字号:
package abchr.gui.modulecontrols;
import abchr.CommentModule;
import abchr.ProjectModule;
import abchr.gui.CommentDialog;
import abchr.gui.CommentDialogListener;
import jlfgr.GraphicsRepository;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class CommentButton extends JButton implements ModuleControl,CommentDialogListener {
private CommentModule commentModule;
private CommentDialog dialog=new CommentDialog();
public CommentButton(CommentModule commentModule) {
super("General Comments...",GraphicsRepository.getToolbarIcon("general/Edit16.gif"));
this.commentModule=commentModule;
this.setEnabled(commentModule!=null);
this.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
dialog.showDialogModeless(CommentButton.this.commentModule.getComment(),CommentButton.this);
}
});
}
public void dialogClosed(CommentDialog source,String text) {
commentModule.setComment(text);
}
public CommentButton(){this(null);}
public CommentModule getCommentModule(){return commentModule;}
public void setModule(ProjectModule module) {
this.commentModule=(CommentModule)module;
this.setEnabled(commentModule!=null);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -