use of org.jkiss.dbeaver.ext.mysql.tasks.MySQLNativeCredentialsSettings in project dbeaver by serge-rider.
the class MySQLWizardPageSettings method createSecurityGroup.
public void createSecurityGroup(Composite parent) {
final DBPConnectionConfiguration connectionInfo = wizard.getSettings().getDataSourceContainer().getActualConnectionConfiguration();
if (connectionInfo != null) {
Group securityGroup = UIUtils.createControlGroup(parent, MySQLUIMessages.tools_db_export_wizard_page_settings_security_group, 3, GridData.HORIZONTAL_ALIGN_BEGINNING, 0);
Label infoLabel = new Label(securityGroup, SWT.NONE);
infoLabel.setText(NLS.bind(MySQLUIMessages.tools_db_export_wizard_page_settings_security_label_info, connectionInfo.getUserName()));
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 3;
infoLabel.setLayoutData(gd);
Button authButton = new Button(securityGroup, SWT.PUSH);
authButton.setText(MySQLUIMessages.tools_db_export_wizard_page_settings_security_button_auth);
authButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
BaseAuthDialog authDialog = new BaseAuthDialog(getShell(), MySQLUIMessages.tools_db_export_wizard_page_settings_auth_title, false, true);
authDialog.setUserName(wizard.getSettings().getToolUserName());
authDialog.setUserPassword(wizard.getSettings().getToolUserPassword());
authDialog.setSavePassword(true);
authDialog.setSavePasswordText(MySQLUIMessages.tools_db_export_wizard_page_settings_auth_save_password_checkbox);
authDialog.setSavePasswordToolTipText(MySQLUIMessages.tools_db_export_wizard_page_settings_auth_save_password_checkbox_tip);
if (authDialog.open() == IDialogConstants.OK_ID) {
wizard.getSettings().setToolUserName(authDialog.getUserName());
wizard.getSettings().setToolUserPassword(authDialog.getUserPassword());
}
}
});
Button resetButton = new Button(securityGroup, SWT.PUSH);
resetButton.setText(MySQLUIMessages.tools_db_export_wizard_page_settings_security_button_reset);
resetButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
wizard.getSettings().setToolUserName(null);
wizard.getSettings().setToolUserPassword(null);
}
});
if (wizard.getSettings() instanceof MySQLNativeCredentialsSettings) {
MySQLNativeCredentialsSettings settings = (MySQLNativeCredentialsSettings) wizard.getSettings();
Button overrideCredentials = UIUtils.createCheckbox(securityGroup, MySQLUIMessages.tools_db_export_wizard_page_settings_security_checkbox_override_host_credentials, settings.isOverrideCredentials());
overrideCredentials.setToolTipText(MySQLUIMessages.tools_db_export_wizard_page_settings_security_checkbox_override_host_credentials_tip);
overrideCredentials.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
settings.setOverrideCredentials(overrideCredentials.getSelection());
}
});
}
}
}
use of org.jkiss.dbeaver.ext.mysql.tasks.MySQLNativeCredentialsSettings in project dbeaver by dbeaver.
the class MySQLWizardPageSettings method createSecurityGroup.
public void createSecurityGroup(Composite parent) {
final DBPConnectionConfiguration connectionInfo = wizard.getSettings().getDataSourceContainer().getActualConnectionConfiguration();
if (connectionInfo != null) {
Group securityGroup = UIUtils.createControlGroup(parent, MySQLUIMessages.tools_db_export_wizard_page_settings_security_group, 3, GridData.HORIZONTAL_ALIGN_BEGINNING, 0);
Label infoLabel = new Label(securityGroup, SWT.NONE);
infoLabel.setText(NLS.bind(MySQLUIMessages.tools_db_export_wizard_page_settings_security_label_info, connectionInfo.getUserName()));
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 3;
infoLabel.setLayoutData(gd);
Button authButton = new Button(securityGroup, SWT.PUSH);
authButton.setText(MySQLUIMessages.tools_db_export_wizard_page_settings_security_button_auth);
authButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
BaseAuthDialog authDialog = new BaseAuthDialog(getShell(), MySQLUIMessages.tools_db_export_wizard_page_settings_auth_title, false, true);
authDialog.setUserName(wizard.getSettings().getToolUserName());
authDialog.setUserPassword(wizard.getSettings().getToolUserPassword());
authDialog.setSavePassword(true);
authDialog.setSavePasswordText(MySQLUIMessages.tools_db_export_wizard_page_settings_auth_save_password_checkbox);
authDialog.setSavePasswordToolTipText(MySQLUIMessages.tools_db_export_wizard_page_settings_auth_save_password_checkbox_tip);
if (authDialog.open() == IDialogConstants.OK_ID) {
wizard.getSettings().setToolUserName(authDialog.getUserName());
wizard.getSettings().setToolUserPassword(authDialog.getUserPassword());
}
}
});
Button resetButton = new Button(securityGroup, SWT.PUSH);
resetButton.setText(MySQLUIMessages.tools_db_export_wizard_page_settings_security_button_reset);
resetButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
wizard.getSettings().setToolUserName(null);
wizard.getSettings().setToolUserPassword(null);
}
});
if (wizard.getSettings() instanceof MySQLNativeCredentialsSettings) {
MySQLNativeCredentialsSettings settings = (MySQLNativeCredentialsSettings) wizard.getSettings();
Button overrideCredentials = UIUtils.createCheckbox(securityGroup, MySQLUIMessages.tools_db_export_wizard_page_settings_security_checkbox_override_host_credentials, settings.isOverrideCredentials());
overrideCredentials.setToolTipText(MySQLUIMessages.tools_db_export_wizard_page_settings_security_checkbox_override_host_credentials_tip);
overrideCredentials.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
settings.setOverrideCredentials(overrideCredentials.getSelection());
}
});
}
}
}
Aggregations