return null;
return (gui) ? dialect.getDatabaseName() + " : " + dialect.getClassName() : dialect.getClassName();
}
}).addValueChangeListener(new ConnectionStaleValueChangeListener());
driverLocation.addValidator(new UIValidator()
{
@Override
public void validate(UIValidationContext context)
{
FileResource<?> resource = driverLocation.getValue();
if (resource != null && !resource.exists())
{
context.addValidationError(driverLocation, "The location '" + resource.getFullyQualifiedName()
+ "' does not exist");
}
}
}).addValueChangeListener(
new CompositeValueChangeListener(
new ConnectionStaleValueChangeListener(),
new DriverNamesStaleValueChangeListener())
);
driverClass.setValueChoices(new LocateDriverClassNamesCallable())
.setItemLabelConverter(new Converter<Class<?>, String>()
{
@Override
public String convert(Class<?> source)
{
if (source != null)
return source.getName();
else
return "";
}
})
.setDefaultValue(new Callable<Class<?>>()
{
@Override
public Class<?> call() throws Exception
{
Class<?> result = null;
Iterator<Class<?>> iterator = driverClass.getValueChoices().iterator();
if (iterator.hasNext())
{
result = iterator.next();
}
return result;
}
}).addValueChangeListener(new ConnectionStaleValueChangeListener());
verifyConnection.addValidator(new UIValidator()
{
@Override
public void validate(UIValidationContext context)
{
Boolean value = (Boolean) context.getCurrentInputComponent().getValue();