public class StringFieldTest {
private static JPanel initPanel() {
final JPanel panel = new JPanel(new BorderLayout());
StringScalarBox stringBox = new StringScalarBox();
TangoKey key = new TangoKey();
TangoKeyTool.registerAttribute(key, "tango/tangotest/titanZ", "string_scalar");
TangoKey otherKey = new TangoKey();
TangoKeyTool.registerSettable(otherKey, false);
TangoKeyTool.registerAttribute(otherKey, "tango/tangotest/titan", "string_scalar");
TextField textfield = new TextField();
TextArea textArea = new TextArea();
FileBrowser fileBrowser = new FileBrowser();
stringBox.setConfirmationMessage(textfield, "Execute Confirmation ");
stringBox.setConfirmation(textfield, true);
fileBrowser.setUpdateAllowed(true);
stringBox.connectWidget(textfield, key);
stringBox.connectWidget(textArea, key);
stringBox.connectWidget(fileBrowser, key);
stringBox.setErrorText(textfield, "ERROR");
stringBox.setConfirmation(textfield, true);
stringBox.putInError(textfield);
panel.add(textfield, BorderLayout.CENTER);
panel.add(textArea, BorderLayout.EAST);
panel.add(fileBrowser, BorderLayout.NORTH);