in taverna-xpath-activity-ui/src/main/java/org/apache/taverna/activities/xpath/ui/config/TwoFieldQueryPanel.java [56:108]
public TwoFieldQueryPanel(String message, String firstFieldName,
String firstFieldDefaultValue, String secondFieldName,
String secondFieldDefaultValue) {
super();
this.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
this.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.gridx = 0;
c.gridy = 0;
c.weightx = 0;
c.fill = GridBagConstraints.HORIZONTAL;
c.anchor = GridBagConstraints.WEST;
c.insets = new Insets(3, 5, 3, 5);
if (message != null && message.length() > 0) {
c.gridwidth = 2;
c.insets = new Insets(5, 5, 15, 5);
this.add(new JLabel(message), c);
c.gridwidth = 1;
c.gridx = 0;
c.gridy++;
c.insets = new Insets(3, 5, 3, 5);
}
this.add(new JLabel(firstFieldName), c);
c.gridx++;
c.weightx = 1.0;
tfFirstValue = new JTextField(20);
if (firstFieldDefaultValue != null) {
tfFirstValue.setText(firstFieldDefaultValue);
}
tfFirstValue.selectAll();
tfFirstValue.requestFocusInWindow();
this.add(tfFirstValue, c);
c.gridx = 0;
c.gridy++;
c.weightx = 0;
this.add(new JLabel(secondFieldName), c);
c.gridx++;
c.weightx = 1.0;
tfSecondValue = new JTextField(20);
if (secondFieldDefaultValue != null) {
tfSecondValue.setText(secondFieldDefaultValue);
}
tfSecondValue.selectAll();
this.add(tfSecondValue, c);
}