@Override
public void initializeUI(UIBuilder builder) throws Exception
{
final UIContext uiContext = builder.getUIContext();
PersistenceContainer pc = (PersistenceContainer) uiContext.getAttributeMap().get(PersistenceContainer.class);
initDBType(uiContext);
initDatasourceName(uiContext);
initPersistenceUnitName(builder);
builder.add(dbType);
overwritePersistenceUnit.setEnabled(new Callable<Boolean>()
{
@Override
public Boolean call() throws Exception
{
Project project = getSelectedProject(uiContext);
if (persistenceUnitName.getValue() == null)
{
return false;
}
return isExistingPersistenceUnitName(project, persistenceUnitName.getValue());
}
});
builder.add(overwritePersistenceUnit);
if (pc.isDataSourceRequired())
{
builder.add(dataSourceName);
}
else
{