use of org.csstudio.swt.widgets.util.AbstractInputStreamRunnable in project yamcs-studio by yamcs.
the class SVGSymbolImage method loadImage.
private void loadImage(IJobErrorHandler errorHandler) {
AbstractInputStreamRunnable uiTask = new AbstractInputStreamRunnable() {
@Override
public void runWithInputStream(InputStream stream) {
synchronized (SVGSymbolImage.this) {
try {
loadDocument(stream);
} finally {
try {
stream.close();
} catch (IOException e) {
Activator.getLogger().log(Level.WARNING, "ERROR in closing SVG image stream ", e);
}
}
loadingImage = false;
Display.getCurrent().syncExec(new Runnable() {
@Override
public void run() {
fireSymbolImageLoaded();
}
});
}
}
};
ResourceUtil.pathToInputStreamInJob(imagePath, uiTask, "Loading SVG Image...", errorHandler);
}
Aggregations