01: package abbot.editor.editors;
02:
03: import java.awt.event.ActionEvent;
04: import javax.swing.JTextField;
05: import abbot.i18n.Strings;
06: import abbot.script.Sample;
07:
08: /** Provide convenient editing of a Sample step. */
09: public class SampleEditor extends PropertyCallEditor {
10:
11: private Sample step;
12: private JTextField property;
13:
14: public SampleEditor(Sample step) {
15: super (step);
16: this .step = step;
17: property = addTextField(Strings.get("PropertyName"), step
18: .getPropertyName());
19: }
20:
21: public void actionPerformed(ActionEvent ev) {
22: Object src = ev.getSource();
23: if (src == property) {
24: String name = property.getText().trim();
25: if (!"".equals(name)) {
26: step.setPropertyName(name);
27: fireStepChanged();
28: }
29: } else {
30: super.actionPerformed(ev);
31: }
32: }
33: }
|