Widget asWidget() {
VerticalPanel layout = new VerticalPanel();
layout.setStyleName("fill-layout-width");
final Form<HttpConnector> form = new Form<HttpConnector>(HttpConnector.class);
TextBoxItem name = new TextBoxItem("name", "Name");
// todo: turn into pull down. But how is the the socket-binding group resolved?
TextBoxItem socket = new TextBoxItem("socketBinding", "Socket Binding") {
private String errOrig;
@Override
public boolean validate(String value) {
boolean parentValid = super.validate(value);
boolean bindingValid = true;
if(parentValid)
{
for(HttpConnector existing : connectors)
{
if(existing.getSocketBinding().equals(value))
{
errOrig = getErrMessage();
setErrMessage("Socket binding already in use");
bindingValid = false;
}
}
}
return parentValid && bindingValid;
}
};
TextBoxItem protocol = new TextBoxItem("protocol", "Protocol");
TextBoxItem scheme = new TextBoxItem("scheme", "Scheme");
CheckBoxItem enabled = new CheckBoxItem("enabled", "Enabled?");
// defaults
protocol.setValue("HTTP/1.1");
scheme.setValue("http");
enabled.setValue(Boolean.TRUE);
form.setFields(name,enabled,socket,protocol,scheme);
final FormHelpPanel helpPanel = new FormHelpPanel(