use of org.talend.repository.nosql.ui.provider.IWizardPageProvider in project tbd-studio-se by Talend.
the class NoSQLSchemaWizardPage method createControl.
@Override
public void createControl(final Composite parent) {
String dbType = ((NoSQLConnection) connectionItem.getConnection()).getDbType();
IWizardPageProvider wizPageProvider = NoSQLRepositoryFactory.getInstance().getWizardPageProvider(dbType);
if (wizPageProvider == null) {
return;
}
schemaForm = wizPageProvider.createSchemaForm(parent, connectionItem, metadataTable, creation, this);
if (schemaForm == null) {
return;
}
schemaForm.setReadOnly(!isRepositoryObjectEditable);
AbstractForm.ICheckListener listener = new AbstractForm.ICheckListener() {
@Override
public void checkPerformed(final AbstractForm source) {
if (source.isStatusOnError()) {
setPageComplete(false);
setErrorMessage(source.getStatus());
} else {
setPageComplete(isRepositoryObjectEditable);
schemaForm.setButtonsVisibility(isRepositoryObjectEditable);
setErrorMessage(null);
setMessage(source.getStatus(), source.getStatusLevel());
}
}
};
schemaForm.setListener(listener);
setControl(schemaForm);
}
use of org.talend.repository.nosql.ui.provider.IWizardPageProvider in project tbd-studio-se by Talend.
the class NoSQLRetrieveSchemaWizardPage method createControl.
@Override
public void createControl(final Composite parent) {
NoSQLConnection connection = (NoSQLConnection) connectionItem.getConnection();
String dbType = connection.getDbType();
IWizardPageProvider wizPageProvider = NoSQLRepositoryFactory.getInstance().getWizardPageProvider(dbType);
if (wizPageProvider == null) {
return;
}
retrieveSchemaForm = wizPageProvider.createRetrieveSchemaForm(parent, connectionItem, creation, this);
if (retrieveSchemaForm == null) {
return;
}
retrieveSchemaForm.setReadOnly(!isRepositoryObjectEditable);
AbstractForm.ICheckListener listener = new AbstractForm.ICheckListener() {
@Override
public void checkPerformed(final AbstractForm source) {
if (source.isStatusOnError()) {
setPageComplete(false);
setErrorMessage(source.getStatus());
} else {
setPageComplete(isRepositoryObjectEditable);
setErrorMessage(null);
setMessage(source.getStatus(), source.getStatusLevel());
}
}
};
retrieveSchemaForm.setListener(listener);
setControl(retrieveSchemaForm);
if (StringUtils.isNotEmpty(connectionItem.getProperty().getLabel())) {
retrieveSchemaForm.checkFieldsValue();
}
}
Aggregations