01: package com.opensymphony.workflow.designer.dialogs;
02:
03: import java.awt.*;
04: import javax.swing.*;
05: import com.jgoodies.forms.builder.DefaultFormBuilder;
06:
07: import com.opensymphony.workflow.designer.*;
08:
09: /**
10: * @author acapitani
11: */
12: public class AttributeDialog extends BaseDialog {
13: public JTextField keyField;
14: public JTextField valueField;
15:
16: public AttributeDialog(Frame owner, String attrName,
17: String attrValue, boolean IsNew) throws HeadlessException {
18: super (owner, ResourceManager.getString("attribute.edit"), true);
19:
20: getBanner().setTitle(
21: ResourceManager.getString("attribute.dialog.title"));
22: getBanner().setSubtitle(
23: ResourceManager.getString("attribute.dialog.subtitle"));
24: DefaultFormBuilder builder = UIFactory.getDialogBuilder(null,
25: getContentPane());
26:
27: if (IsNew) {
28: keyField = new JTextField();
29: valueField = new JTextField();
30: keyField.requestDefaultFocus();
31: } else {
32: keyField = UIFactory.createReadOnlyTextField();
33: valueField = new JTextField();
34: keyField.setText(attrName);
35: valueField.setText(attrValue);
36: }
37: builder.append(ResourceManager.getString("attribute.key.long"),
38: keyField);
39: builder.append(ResourceManager
40: .getString("attribute.value.long"), valueField);
41:
42: builder.appendRow(builder.getLineGapSpec());
43: builder.nextLine();
44: }
45: }
|