Search in sources :

Example 1 with LogEntryEditorStage

use of org.phoebus.logbook.olog.ui.write.LogEntryEditorStage in project phoebus by ControlSystemStudio.

the class LogEntryEditorStageDemo method start.

@Override
public void start(Stage primaryStage) throws Exception {
    StackPane root = new StackPane();
    Scene scene = new Scene(root);
    primaryStage.setScene(scene);
    new LogEntryEditorStage(root, new OlogLog()).show();
}
Also used : LogEntryEditorStage(org.phoebus.logbook.olog.ui.write.LogEntryEditorStage) Scene(javafx.scene.Scene) OlogLog(org.phoebus.olog.es.api.model.OlogLog) StackPane(javafx.scene.layout.StackPane)

Example 2 with LogEntryEditorStage

use of org.phoebus.logbook.olog.ui.write.LogEntryEditorStage in project phoebus by ControlSystemStudio.

the class LogEntryDisplayController method reply.

@FXML
public void reply() {
    LogEntry logEntry = logEntryProperty.get();
    OlogLog ologLog = new OlogLog();
    ologLog.setTitle(logEntry.getTitle());
    ologLog.setTags(logEntry.getTags());
    ologLog.setLogbooks(logEntry.getLogbooks());
    ologLog.setProperties(logEntry.getProperties());
    ologLog.setLevel(logEntry.getLevel());
    // Show a new editor dialog. When user selects to save the reply entry, update the original log entry
    // to ensure that it contains the log group property.
    new LogEntryEditorStage(DockPane.getActiveDockPane(), ologLog, logEntry, null).show();
}
Also used : LogEntryEditorStage(org.phoebus.logbook.olog.ui.write.LogEntryEditorStage) OlogLog(org.phoebus.olog.es.api.model.OlogLog) LogEntry(org.phoebus.logbook.LogEntry) FXML(javafx.fxml.FXML)

Example 3 with LogEntryEditorStage

use of org.phoebus.logbook.olog.ui.write.LogEntryEditorStage in project phoebus by ControlSystemStudio.

the class SendLogbookAction method submitLogEntry.

private void submitLogEntry(final Node parent, final String title, final String body, final File image_file) {
    OlogLog ologLog = new OlogLog();
    ologLog.setTitle(title != null ? title : "");
    ologLog.setDescription(body != null ? body : "");
    if (image_file != null) {
        try {
            final Attachment attachment = AttachmentImpl.of(image_file, "image", false);
            List<Attachment> attachments = new ArrayList<>();
            attachments.add(attachment);
            ologLog.setAttachments(attachments);
        } catch (FileNotFoundException ex) {
            logger.log(Level.WARNING, "Cannot attach " + image_file, ex);
        }
    }
    new LogEntryEditorStage(parent, ologLog).show();
}
Also used : ArrayList(java.util.ArrayList) FileNotFoundException(java.io.FileNotFoundException) Attachment(org.phoebus.logbook.Attachment) LogEntryEditorStage(org.phoebus.logbook.olog.ui.write.LogEntryEditorStage) OlogLog(org.phoebus.olog.es.api.model.OlogLog)

Aggregations

LogEntryEditorStage (org.phoebus.logbook.olog.ui.write.LogEntryEditorStage)3 OlogLog (org.phoebus.olog.es.api.model.OlogLog)3 FileNotFoundException (java.io.FileNotFoundException)1 ArrayList (java.util.ArrayList)1 FXML (javafx.fxml.FXML)1 Scene (javafx.scene.Scene)1 StackPane (javafx.scene.layout.StackPane)1 Attachment (org.phoebus.logbook.Attachment)1 LogEntry (org.phoebus.logbook.LogEntry)1