use of org.talend.commons.ui.swt.dialogs.ErrorDialogWidthDetailArea in project tdi-studio-se by Talend.
the class FileJSONTableWizard method performFinish.
/**
* This method determine if the 'Finish' button is enable This method is called when 'Finish' button is pressed in
* the wizard. We will create an operation and run it using wizard as execution context.
*/
public boolean performFinish() {
if (tableWizardpage.isPageComplete()) {
// applyConnectionCopy();
// update
RepositoryUpdateManager.updateSingleSchema(connectionItem, metadataTable, oldMetadataTable, oldTableMap);
IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
try {
factory.save(repositoryObject.getProperty().getItem());
closeLockStrategy();
} catch (PersistenceException e) {
String detailError = e.toString();
new ErrorDialogWidthDetailArea(getShell(), PID, "Access to the data failure ", detailError);
log.error("Access to the data failure " + "\n" + detailError);
}
// metadataTableCopy = null;
return true;
} else {
return false;
}
}
use of org.talend.commons.ui.swt.dialogs.ErrorDialogWidthDetailArea in project tdi-studio-se by Talend.
the class MetadataImportXmlCommand method execute.
/*
* (non-Javadoc)
*
* @see org.talend.core.ui.metadata.extended.command.MetadataImportXmlCommand#execute()
*/
@Override
public void execute() {
try {
removed = new ArrayList<IMetadataColumn>(extendedTableModel.getBeansList());
extendedTableModel.removeAll(removed);
added = MetadataSchema.initializeColumns(file);
extendedTableModel.addAll(added, true, false);
if (extendedTableModel.getBeansList() instanceof ListenableList) {
ListenableList beanList = (ListenableList) extendedTableModel.getBeansList();
beanList.fireReplacedEvent(0, removed, added, false);
}
} catch (Exception e) {
new ErrorDialogWidthDetailArea(null, XmlMapPlugin.PLUGIN_ID, "Can not import schema from invalid xml", ExceptionUtils.getFullStackTrace(e));
ExceptionHandler.process(e);
}
}
use of org.talend.commons.ui.swt.dialogs.ErrorDialogWidthDetailArea in project tdi-studio-se by Talend.
the class GenericSchemaWizard method performFinish.
/**
* This method determine if the 'Finish' button is enable This method is called when 'Finish' button is pressed in
* the wizard. We will create an operation and run it using wizard as execution context.
*/
@Override
public boolean performFinish() {
if (tableWizardPage.isPageComplete()) {
IMetadataTable newTable = MetadataToolHelper.convert(metadataTable);
if (!newTable.sameMetadataAs(oldMetadataTable)) {
SchemaUtils.updateComponentSchema(metadataTable, connectionItem.getConnection());
}
GenericUpdateManager.updateSingleSchema(connectionItem, metadataTable, oldMetadataTable, oldTableMap);
IProxyRepositoryFactory factory = CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
try {
factory.save(connectionItem);
closeLockStrategy();
} catch (PersistenceException e) {
new ErrorDialogWidthDetailArea(getShell(), IGenericConstants.REPOSITORY_PLUGIN_ID, Messages.getString("NoSQLSchemaWizard.persistenceException"), //$NON-NLS-1$
ExceptionUtils.getFullStackTrace(e));
ExceptionHandler.process(e);
}
return true;
} else {
return false;
}
}
use of org.talend.commons.ui.swt.dialogs.ErrorDialogWidthDetailArea in project tdi-studio-se by Talend.
the class UIUtils method checkConnection.
/**
* Display a error message if the db connection is failed DOC Comment method "checkConnection".
*
* @param parentShell
* @param imetadataConnection
*/
public static void checkConnection(final Shell parentShell, IMetadataConnection imetadataConnection) {
// display a error message if the db connection is failed.
final ManagerConnection managerConnection = new ManagerConnection();
managerConnection.check(imetadataConnection, true);
if (!managerConnection.getIsValide()) {
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
new ErrorDialogWidthDetailArea(parentShell, SqlBuilderPlugin.PLUGIN_ID, Messages.getString(//$NON-NLS-1$
"UIUtils.DBConnectionFailure"), managerConnection.getMessageException());
}
});
}
}
use of org.talend.commons.ui.swt.dialogs.ErrorDialogWidthDetailArea in project tdi-studio-se by Talend.
the class LoginAgreementPage method addListeners.
@Override
public void addListeners() {
acceptButton.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent event) {
try {
LicenseManagement.acceptLicense();
} catch (BusinessException e) {
ErrorDialogWidthDetailArea errorDialog = new ErrorDialogWidthDetailArea(getShell(), RegistrationPlugin.PLUGIN_ID, "", //$NON-NLS-1$
e.getMessage());
System.exit(0);
}
AbstractActionPage iNextPage = getNextPage();
if (iNextPage == null) {
return;
}
try {
gotoNextPage();
} catch (Throwable e1) {
CommonExceptionHandler.process(e1);
}
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
// nothing need to do
}
});
}
Aggregations