⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 commentbutton.java

📁 Java version of ABC/HR comparator v0.5. by schnofler. Runs on Sun JRE 1.5 or later
💻 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 + -