Search in sources :

Example 1 with LogEntryBuilderDialog

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);
    }
}
Also used : Screenshot(org.csstudio.javafx.Screenshot) LogEntryBuilderDialog(org.csstudio.logbook.ui.LogEntryBuilderDialog) LogEntryBuilder(org.csstudio.logbook.LogEntryBuilder) File(java.io.File) FileInputStream(java.io.FileInputStream)

Aggregations

File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 Screenshot (org.csstudio.javafx.Screenshot)1 LogEntryBuilder (org.csstudio.logbook.LogEntryBuilder)1 LogEntryBuilderDialog (org.csstudio.logbook.ui.LogEntryBuilderDialog)1