use of org.eclipse.core.runtime.jobs.JobChangeAdapter in project tdi-studio-se by Talend.
the class DeleteExtensionAction method run.
public void run() {
if (extension == null) {
return;
}
try {
final DeleteExtensionJob job = new DeleteExtensionJob(extension);
job.addJobChangeListener(new JobChangeAdapter() {
@Override
public void done(final IJobChangeEvent event) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
updateUI(job, event);
}
});
}
});
ExchangeUtils.scheduleUserJob(job);
} catch (Throwable e) {
ExceptionHandler.process(e);
}
}
use of org.eclipse.core.runtime.jobs.JobChangeAdapter in project tdi-studio-se by Talend.
the class DownloadComponenentsAction method updateUI.
/**
* Update ui after job finished.
*
* @param action
* @param event
*/
private void updateUI(final IJobChangeEvent event) {
// activate aection again after job finished
if (fExtensionDownloaded > 0) {
// refresh palette
ExchangeUtils.reloadComponents();
// update needed modules.
CorePlugin.getDefault().getLibrariesService().resetModulesNeeded();
// see feature 0005050: confirmation popup once the component is installed
confirmInstallation();
// Start Code Generation Init
ICodeGeneratorService codeGenService = (ICodeGeneratorService) GlobalServiceRegister.getDefault().getService(ICodeGeneratorService.class);
Job job = codeGenService.refreshTemplates();
job.addJobChangeListener(new JobChangeAdapter() {
@Override
public void done(IJobChangeEvent event) {
ComponentPaletteUtilities.setSkipUpdatePalette(false);
}
});
RefreshComponenentsAction action = new RefreshComponenentsAction();
action.run(new String[] { RefreshComponenentsAction.REFRESH_INSTALLED }, ContentConstants.UL_DOWNLOADED_EXTENSIONS);
}
}
use of org.eclipse.core.runtime.jobs.JobChangeAdapter in project tdi-studio-se by Talend.
the class DownloadComponenentsAction method run.
@Override
public void run() {
try {
final ComponentExtension selectedExtension = ExchangeManager.getInstance().getSelectedExtension();
Job job = new DownloadJob(selectedExtension);
fExtensionDownloaded = 0;
fDownloadedComponents = new ArrayList<ComponentExtension>();
job.addJobChangeListener(new JobChangeAdapter() {
@Override
public void done(final IJobChangeEvent event) {
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
updateUI(event);
}
});
}
});
ExchangeUtils.scheduleUserJob(job);
} catch (Throwable e) {
ExceptionHandler.process(e);
}
}
use of org.eclipse.core.runtime.jobs.JobChangeAdapter in project tdi-studio-se by Talend.
the class InsertionExtensionAction method run.
public void run() {
if (extension == null) {
return;
}
try {
final InsertionExtensionJob job = new InsertionExtensionJob(extension);
job.addJobChangeListener(new JobChangeAdapter() {
@Override
public void done(final IJobChangeEvent event) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
updateUI(job, event);
}
});
}
});
ExchangeUtils.scheduleUserJob(job);
} catch (Throwable e) {
ExceptionHandler.process(e);
}
}
use of org.eclipse.core.runtime.jobs.JobChangeAdapter in project tdi-studio-se by Talend.
the class RefreshComponenentsAction method run.
public void run(String[] refreshTypes, final String pageToDispaly) {
List typesToRefresh = null;
if (refreshTypes == null || refreshTypes.length == 0) {
typesToRefresh = new ArrayList();
typesToRefresh.add(REFRESH_ALL);
} else {
typesToRefresh = Arrays.asList(refreshTypes);
}
if (typesToRefresh.contains(REFRESH_ALL) || typesToRefresh.contains(REFRESH_AVAILABLES)) {
try {
final RefreshJob job = new RefreshJob();
job.addJobChangeListener(new JobChangeAdapter() {
@Override
public void done(final IJobChangeEvent event) {
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
updateUI(job, event);
String toDisplay = pageToDispaly == null ? ContentConstants.UL_LIST_AVAILABLE_EXTENSIONS : pageToDispaly;
ExchangeManager.getInstance().generateXHTMLPage(toDisplay, new String[] { ContentConstants.INSERT_EXTENSION_DATA });
}
});
}
});
ExchangeUtils.scheduleUserJob(job);
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
// Show Installed Extensions
if (typesToRefresh.contains(REFRESH_ALL) || typesToRefresh.contains(REFRESH_INSTALLED)) {
try {
final ShowInstalledExtensionsJob showInstalledJob = new ShowInstalledExtensionsJob();
showInstalledJob.addJobChangeListener(new JobChangeAdapter() {
@Override
public void done(final IJobChangeEvent event) {
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
updateInstalledUI(showInstalledJob, event);
ExchangeManager.getInstance().generateXHTMLPage(pageToDispaly, new String[] { ContentConstants.DOWNLOADEXTENSION_DATA });
}
});
}
});
ExchangeUtils.scheduleUserJob(showInstalledJob);
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
// Show Contributed Extensions
if (typesToRefresh.contains(REFRESH_ALL) || typesToRefresh.contains(REFRESH_MY_EXTENSIONS)) {
try {
final ShowContributedExtensionsJob showContributedJob = new ShowContributedExtensionsJob();
showContributedJob.addJobChangeListener(new JobChangeAdapter() {
@Override
public void done(final IJobChangeEvent event) {
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
updateContributedUI(showContributedJob, event);
ExchangeManager.getInstance().generateXHTMLPage(pageToDispaly, new String[] { ContentConstants.LIST_MY_EXTENSION });
}
});
}
});
ExchangeUtils.scheduleUserJob(showContributedJob);
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
//
getVersionRevisionsAndCategorys();
// refreshHTML();
}
Aggregations