Search in sources :

Example 1 with IWizardPageProvider

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);
}
Also used : IWizardPageProvider(org.talend.repository.nosql.ui.provider.IWizardPageProvider) NoSQLConnection(org.talend.repository.model.nosql.NoSQLConnection) AbstractForm(org.talend.metadata.managment.ui.wizard.AbstractForm)

Example 2 with IWizardPageProvider

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();
    }
}
Also used : IWizardPageProvider(org.talend.repository.nosql.ui.provider.IWizardPageProvider) NoSQLConnection(org.talend.repository.model.nosql.NoSQLConnection) AbstractForm(org.talend.metadata.managment.ui.wizard.AbstractForm)

Aggregations

AbstractForm (org.talend.metadata.managment.ui.wizard.AbstractForm)2 NoSQLConnection (org.talend.repository.model.nosql.NoSQLConnection)2 IWizardPageProvider (org.talend.repository.nosql.ui.provider.IWizardPageProvider)2