use of org.talend.commons.ui.swt.dialogs.ErrorDialogWidthDetailArea in project tdi-studio-se by Talend.
the class UploadRevisionAction method updateUI.
/**
* Update ui after job finished.
*
* @param action
* @param event
*/
private void updateUI(final UploadRevisionJob uploadJob, final IJobChangeEvent event) {
if (event.getResult().isOK()) {
WebserviceStatus wbs = uploadJob.getWs();
if (wbs.isResult()) {
ExchangeManager.getInstance().setSelectedExtension(null);
RefreshComponenentsAction action = new RefreshComponenentsAction();
action.run(new String[] { RefreshComponenentsAction.REFRESH_MY_EXTENSIONS, RefreshComponenentsAction.REFRESH_AVAILABLES }, ContentConstants.UL_LIST_MY_EXTENSIONS);
} else {
String mainMsg = Messages.getString("UploadRevisionAction.InstalledFailure") + " " + Messages.getString("UploadRevisionAction.InstalledFailureTip");
new ErrorDialogWidthDetailArea(Display.getCurrent().getActiveShell(), ExchangePlugin.PLUGIN_ID, mainMsg, wbs.getMessageException());
}
}
}
use of org.talend.commons.ui.swt.dialogs.ErrorDialogWidthDetailArea in project tdi-studio-se by Talend.
the class InsertionExtensionAction method updateUI.
/**
* Update ui after job finished.
*
* @param action
* @param event
*/
private void updateUI(final InsertionExtensionJob insertJob, final IJobChangeEvent event) {
if (event.getResult().isOK()) {
WebserviceStatus wbs = insertJob.getWs();
if (wbs.isResult()) {
ExchangeManager.getInstance().setSelectedExtension(null);
RefreshComponenentsAction action = new RefreshComponenentsAction();
action.run(new String[] { RefreshComponenentsAction.REFRESH_MY_EXTENSIONS, RefreshComponenentsAction.REFRESH_AVAILABLES }, ContentConstants.UL_LIST_MY_EXTENSIONS);
} else {
String mainMsg = Messages.getString("InsertionExtensionAction.InstalledFailure") + " " + Messages.getString("InsertionExtensionAction.InstalledFailureTip");
new ErrorDialogWidthDetailArea(null, ExchangePlugin.PLUGIN_ID, mainMsg, wbs.getMessageException());
}
}
}
use of org.talend.commons.ui.swt.dialogs.ErrorDialogWidthDetailArea in project tdi-studio-se by Talend.
the class JSONFileStep1Form method setVisible.
/*
* (non-Javadoc)
*
* @see org.eclipse.swt.widgets.Control#setVisible(boolean)
*/
@Override
public void setVisible(boolean visible) {
super.setVisible(visible);
if (isReadOnly() != readOnly) {
adaptFormToReadOnly();
}
if (super.isVisible()) {
String JSONFilePath = getConnection().getJSONFilePath();
// Fields to the Group Delimited File Settings
if (getConnection().getEncoding() != null && !getConnection().getEncoding().equals("")) {
//$NON-NLS-1$
encodingCombo.setText(getConnection().getEncoding());
isModifing = false;
fileFieldJSON.setText(JSONFilePath);
} else {
encodingCombo.select(0);
}
if (isContextMode()) {
ContextType contextType = ConnectionContextHelper.getContextTypeForContextMode(connectionItem.getConnection(), connectionItem.getConnection().getContextName());
JSONFilePath = TalendQuoteUtils.removeQuotes(ConnectionContextHelper.getOriginalValue(contextType, JSONFilePath));
}
if (!creation) {
updateTreeNodes(JSONFilePath);
JSONWizard wizard = ((JSONWizard) getPage().getWizard());
if (wizard.getTreeRootNode() == null) {
wizard.setTreeRootNode(treeNode);
}
}
if (LanguageManager.getCurrentLanguage() == ECodeLanguage.PERL && GlobalServiceRegister.getDefault().isServiceRegistered(ILibrariesService.class)) {
ILibrariesService moduleService = (ILibrariesService) GlobalServiceRegister.getDefault().getService(ILibrariesService.class);
try {
ELibraryInstallStatus status = moduleService.getLibraryStatus("JSON::LibJSON");
if (status != ELibraryInstallStatus.INSTALLED) {
new ErrorDialogWidthDetailArea(getShell(), PID, "The Perl Module" + " JSON::LibJSON " + "is not installed", "For more information, check out Talend's Wiki website at http\\://talendforge.org/wiki/doku.php.");
log.error("The Perl Module" + " JSON::LibJSONL " + "is not installed");
}
} catch (BusinessException e) {
new ErrorDialogWidthDetailArea(getShell(), PID, "The Perl Module" + " JSON::LibJSON " + "is not installed", "For more information, check out Talend's Wiki website at http\\://talendforge.org/wiki/doku.php.");
log.error("The Perl Module" + " JSON::LibJSONL " + "is not installed");
}
}
adaptFormToEditable();
}
}
use of org.talend.commons.ui.swt.dialogs.ErrorDialogWidthDetailArea in project tdi-studio-se by Talend.
the class RowGenProcessMain method run.
/**
* yzhang Comment method "run".
*
* @param refresh
* @param number
* @return
*/
public List<List<String>> run(final Button refresh, String number) {
this.number = number;
results.clear();
IProgressService progressService = PlatformUI.getWorkbench().getProgressService();
try {
progressService.runInUI(PlatformUI.getWorkbench().getProgressService(), new IRunnableWithProgress() {
public void run(final IProgressMonitor monitor) {
//$NON-NLS-1$
monitor.beginTask(Messages.getString("RowGenPreivewCodeMain.Process.Generate"), IProgressMonitor.UNKNOWN);
try {
try {
process = runPreviewCode();
if (process == null) {
return;
}
StringBuffer out = new StringBuffer();
StringBuffer err = new StringBuffer();
createResultThread(process.getErrorStream(), err).start();
createResultThread(process.getInputStream(), out).start();
process.waitFor();
if (out.length() > 0) {
convert(out.toString());
}
if (err.length() > 0) {
//$NON-NLS-1$
String mainMsg = Messages.getString("RowGenPreivewCodeMain.PerlRun.Error");
new ErrorDialogWidthDetailArea(Display.getCurrent().getActiveShell(), PluginUtils.PLUGIN_ID, mainMsg, //$NON-NLS-1$
Messages.getString("RowGenProcessMain.checkParameter", err.toString()));
}
} catch (Exception e) {
ExceptionHandler.process(e);
kill();
}
} finally {
monitor.done();
//$NON-NLS-1$
refresh.setText(Messages.getString("RowGenPreivewCodeMain.PreviewBtn.Text"));
}
}
}, null);
} catch (Exception ex) {
ExceptionHandler.process(ex);
} finally {
proc.reconnection();
}
return results;
}
use of org.talend.commons.ui.swt.dialogs.ErrorDialogWidthDetailArea in project tdi-studio-se by Talend.
the class ModifyExtensionAction method updateUI.
/**
* Update ui after job finished.
*
* @param action
* @param event
*/
private void updateUI(final ModifyExtensionJob modifyJob, final IJobChangeEvent event) {
if (event.getResult().isOK()) {
WebserviceStatus wbs = modifyJob.getWs();
if (wbs.isResult()) {
ExchangeManager.getInstance().setSelectedExtension(null);
RefreshComponenentsAction action = new RefreshComponenentsAction();
action.run(new String[] { RefreshComponenentsAction.REFRESH_MY_EXTENSIONS, RefreshComponenentsAction.REFRESH_AVAILABLES }, ContentConstants.UL_LIST_MY_EXTENSIONS);
} else {
String mainMsg = Messages.getString("ModifyExtensionJob.ModifyFailure") + " " + Messages.getString("ModifyExtensionJob.ModifyFailureTip");
new ErrorDialogWidthDetailArea(null, ExchangePlugin.PLUGIN_ID, mainMsg, wbs.getMessageException());
}
}
}
Aggregations