01: package abbot.editor.editors;
02:
03: import java.awt.event.ActionEvent;
04: import javax.swing.JTextArea;
05: import abbot.script.Comment;
06:
07: /** A Comment only has its description available for editing. */
08:
09: public class CommentEditor extends StepEditor {
10:
11: private Comment comment;
12: private JTextArea description;
13:
14: public CommentEditor(Comment comment) {
15: super (comment);
16: this .comment = comment;
17: // remove the default description
18: remove(getComponentCount() - 1);
19: description = addTextArea(null, comment.getDescription());
20: }
21:
22: public void actionPerformed(ActionEvent ev) {
23: if (ev.getSource() == description) {
24: comment.setDescription(description.getText());
25: fireStepChanged();
26: } else {
27: super.actionPerformed(ev);
28: }
29: }
30: }
|