use of net.sourceforge.sqlexplorer.ExplorerException in project tdq-studio-se by Talend.
the class CreateAliasDlg method okPressed.
protected void okPressed() {
try {
User previousUser = alias.getDefaultUser();
alias.setName(nameField.getText().trim());
int selIndex = cboDriver.getSelectionIndex();
ManagedDriver driver = comboDriverIndexes.get(selIndex);
alias.setDriver(driver);
alias.setUrl(urlField.getText().trim());
if (noUsernameRequired.getSelection())
alias.setHasNoUserName(true);
else {
alias.setHasNoUserName(false);
if (userField.getText().trim().length() > 0)
alias.setDefaultUser(new User(userField.getText().trim(), passwordField.getText().trim()));
}
alias.setName(this.nameField.getText().trim());
alias.setSchemaFilterExpression("");
alias.setNameFilterExpression("");
alias.setFolderFilterExpression("");
alias.setConnectAtStartup(logonAtStartupButton.getSelection());
alias.setAutoLogon(autoLogonButton.getSelection());
if (type != Type.CHANGE)
SQLExplorerPlugin.getDefault().getAliasManager().addAlias(alias);
else // objects even though we have explicitly created a new instance of User above)
if (alias.getDefaultUser() != previousUser) {
if (!previousUser.isInUse())
alias.removeUser(previousUser);
}
User user = alias.getDefaultUser();
if (user != null) {
user.setAutoCommit(autoCommitButton.getSelection());
user.setCommitOnClose(commitOnCloseButton.getSelection());
}
} catch (ExplorerException excp) {
// $NON-NLS-1$
SQLExplorerPlugin.error("Validation Exception", excp);
// System.out.println(Messages.getString("Error_Validation_Exception_4"));//$NON-NLS-1$
}
// Notify that ther has been changes
SQLExplorerPlugin.getDefault().getAliasManager().modelChanged();
close();
}
use of net.sourceforge.sqlexplorer.ExplorerException in project tdq-studio-se by Talend.
the class DataPreviewView method createPartControl.
/* (non-JavaDoc)
* @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
*/
@Override
public void createPartControl(Composite parent) {
// this.parent = new Composite(parent, SWT.NULL);
this.parent = parent;
this.parent.setLayout(new FillLayout());
try {
displayPreviewer();
} catch (ExplorerException e) {
SQLExplorerPlugin.error(e.getMessage(), e);
// Control[] children = parent.getChildren();
// for (Control control : children)
// control.dispose();
// parent.setLayout(new FillLayout());
// Text text = new Text(parent, SWT.NONE);
// text.setEditable(false);
// text.setText(e.getMessage());
// parent.layout();
}
}
Aggregations