use of org.eclipse.core.runtime.jobs.Job in project tdi-studio-se by Talend.
the class ThreadDumpEditor method parseDumpFile.
/**
* Parses the dump file.
*
* @param filePath The file path
*/
private void parseDumpFile(final String filePath) {
Job job = new Job(Messages.parseThreadDumpFileJobLabel) {
@Override
protected IStatus run(IProgressMonitor monitor) {
final ThreadDumpParser parser = new ThreadDumpParser(new File(filePath), threadListElements, monitor);
try {
parser.parse();
} catch (ParserConfigurationException e) {
//$NON-NLS-1$
return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Could not load thread dump file.", e);
} catch (SAXException e) {
//$NON-NLS-1$
return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Could not load thread dump file.", e);
} catch (IOException e) {
//$NON-NLS-1$
return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Could not load thread dump file.", e);
}
setProfileInfo(parser.getProfileInfo());
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
if (threadSashForm != null) {
threadSashForm.refresh();
}
}
});
return Status.OK_STATUS;
}
};
job.schedule();
}
use of org.eclipse.core.runtime.jobs.Job in project tdi-studio-se by Talend.
the class HeapDumpEditor method parseDumpFile.
/**
* Parses the dump file.
*
* @param filePath The file path
*/
private void parseDumpFile(final String filePath) {
Job job = new Job(Messages.parseHeapDumpFileJobLabel) {
@Override
protected IStatus run(IProgressMonitor monitor) {
HeapDumpParser parser = new HeapDumpParser(new File(filePath), heapListElements, monitor);
try {
parser.parse();
} catch (ParserConfigurationException e) {
//$NON-NLS-1$
return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Could not load heap dump file.", e);
} catch (SAXException e) {
//$NON-NLS-1$
return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Could not load heap dump file.", e);
} catch (IOException e) {
//$NON-NLS-1$
return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Could not load heap dump file.", e);
}
setProfileInfo(parser.getProfileInfo());
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
if (heapHistogramPage != null) {
heapHistogramPage.refresh();
}
}
});
return Status.OK_STATUS;
}
};
job.schedule();
}
use of org.eclipse.core.runtime.jobs.Job in project tdi-studio-se by Talend.
the class GenericConnWizardPage method setVisible.
@Override
public void setVisible(boolean visible) {
super.setVisible(visible);
if (visible) {
dynamicComposite.resetParameters();
dynamicComposite.refresh();
dynamicComposite.setMinHeight(dynamicComposite.getMinHeight());
updateContextFields();
if (getNameParameter() != null) {
Job job = new //$NON-NLS-1$
Job(//$NON-NLS-1$
"") {
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
listExistingObjects = loadRepositoryViewObjectList();
} catch (PersistenceException e) {
return new org.eclipse.core.runtime.Status(IStatus.ERROR, "org.talend.metadata.management.ui", 1, "", //$NON-NLS-1$ //$NON-NLS-2$
e);
}
retrieveNameFinished = true;
// force the refresh of the text field, no matter successfull retrieve of not.
Display d = DisplayUtils.getDisplay();
if (d != null) {
d.syncExec(new Runnable() {
@Override
public void run() {
evaluateTextField();
}
});
}
return Status.OK_STATUS;
}
};
job.setUser(false);
job.setPriority(Job.BUILD);
// start as soon as possible
job.schedule();
}
}
}
use of org.eclipse.core.runtime.jobs.Job in project tdi-studio-se by Talend.
the class PaletteSettingPage method okPressed.
protected void okPressed() {
ProgressMonitorDialog pmd = new ProgressMonitorDialog(DisplayUtils.getDefaultShell());
IRunnableWithProgress rwp = new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
IProxyRepositoryFactory prf = CorePlugin.getDefault().getProxyRepositoryFactory();
try {
prf.saveProject(project);
ShowStandardAction.getInstance().doRun();
if (needCodeGen) {
Job refreshTemplates = CorePlugin.getDefault().getCodeGeneratorService().refreshTemplates();
refreshTemplates.addJobChangeListener(new JobChangeAdapter() {
@Override
public void done(IJobChangeEvent event) {
CorePlugin.getDefault().getLibrariesService().resetModulesNeeded();
}
});
}
// ComponentUtilities.updatePalette();
} catch (Exception ex) {
ExceptionHandler.process(ex);
}
}
};
try {
pmd.run(true, false, rwp);
} catch (InvocationTargetException e) {
ExceptionHandler.process(e);
} catch (InterruptedException e) {
ExceptionHandler.process(e);
}
}
use of org.eclipse.core.runtime.jobs.Job in project tdi-studio-se by Talend.
the class MemoryRuntimeComposite method disconnectJVM.
private void disconnectJVM() {
final Job disconnectJVM = new //$NON-NLS-1$
Job(//$NON-NLS-1$
"disconnect JVM") {
@Override
protected IStatus run(IProgressMonitor monitor) {
if (isRemoteMonitoring) {
if (currentJvm != null && currentJvm.isConnected()) {
currentJvm.disconnect();
}
}
return Status.OK_STATUS;
}
};
disconnectJVM.schedule();
}
Aggregations