use of org.csstudio.logbook.ui.LogEntryBuilderDialog in project org.csstudio.display.builder by kasemir.
the class SendLogbookAction method run.
@Override
public void run() {
File image_file = null;
try {
final Screenshot screenshot = new Screenshot(scene);
image_file = screenshot.writeToTempfile("display");
} catch (Exception ex) {
ExceptionDetailsErrorDialog.openError(shell, "Cannot obtain screenshot", ex);
image_file = null;
}
try {
final LogEntryBuilder entry = LogEntryBuilder.withText(Messages.DefaultLogbookText);
if (image_file != null)
entry.attach(attachment(image_file.getAbsolutePath()).inputStream(new FileInputStream(image_file)));
final LogEntryBuilderDialog dialog = new LogEntryBuilderDialog(shell, entry);
dialog.setBlockOnOpen(true);
dialog.open();
} catch (Exception ex) {
ExceptionDetailsErrorDialog.openError(shell, "Cannot create log entry", ex);
}
}
Aggregations