Skip to content

Commit 7934111

Browse files
author
Milena Schedle
committed
Added Button copyMarkdown
1 parent 9574718 commit 7934111

4 files changed

Lines changed: 25 additions & 6 deletions

File tree

app/logbook/olog/ui/src/main/java/org/phoebus/logbook/olog/ui/SingleLogEntryDisplayController.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,16 @@ public void copyURL() {
212212
content.putString(LogbookUIPreferences.web_client_root_URL + "/" + logEntry.getId());
213213
Clipboard.getSystemClipboard().setContent(content);
214214
}
215+
//Milena
216+
public void copyMarkdown() {
217+
if (logEntry.getSource() != null){
218+
final ClipboardContent content = new ClipboardContent();
219+
content.putString(logEntry.getSource());
220+
Clipboard.getSystemClipboard().setContent(content);
221+
}
222+
}
223+
224+
215225

216226
/**
217227
* Retrieves attachments from the remote service and copies them to temporary files. Attachments

app/logbook/olog/ui/src/main/resources/org/phoebus/logbook/olog/ui/SingleLogEntryDisplay.fxml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<?import javafx.scene.text.*?>
88
<?import javafx.scene.web.*?>
99

10-
<SplitPane dividerPositions="0.75" orientation="VERTICAL" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.phoebus.logbook.olog.ui.SingleLogEntryDisplayController">
10+
<SplitPane dividerPositions="0.75" orientation="VERTICAL" xmlns="http://javafx.com/javafx/17.0.12" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.phoebus.logbook.olog.ui.SingleLogEntryDisplayController">
1111
<items>
1212
<VBox maxHeight="1.7976931348623157E308">
1313
<children>
@@ -101,13 +101,20 @@
101101
<Insets bottom="5.0" left="5.0" top="2.0" />
102102
</padding>
103103
</GridPane>
104+
<HBox alignment="CENTER_RIGHT" spacing="10" GridPane.columnIndex="1" GridPane.halignment="RIGHT">
105+
<Button fx:id="" contentDisplay="RIGHT" mnemonicParsing="false" onAction="#copyMarkdown" text="%CopyMarkdown">
106+
<GridPane.margin>
107+
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />
108+
</GridPane.margin>
109+
</Button>
104110

105-
<Button fx:id="copyURLButton" contentDisplay="RIGHT" mnemonicParsing="false" onAction="#copyURL" text="%CopyURL" GridPane.columnIndex="1" GridPane.halignment="RIGHT">
106-
<GridPane.margin>
107-
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />
108-
</GridPane.margin>
109-
</Button>
111+
<Button fx:id="copyURLButton" contentDisplay="RIGHT" mnemonicParsing="false" onAction="#copyURL" text="%CopyURL">
112+
<GridPane.margin>
113+
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />
114+
</GridPane.margin>
115+
</Button>
110116

117+
</HBox>
111118
</children>
112119
</GridPane>
113120

app/logbook/olog/ui/src/main/resources/org/phoebus/logbook/olog/ui/messages.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ CloseRequestHeader=Log entry not saved. Do you wish to close?
3030
CloseRequestButtonContinue=Continue Editing
3131
CloseRequestButtonDiscard=Close
3232
CreateLogbookEntry=Create Log Book Entry
33+
CopyMarkdown=Copy Markdown
3334
CopyURL=Copy URL
3435
CSSWindow=CSS Window
3536
CurrentDate=Current Date

app/logbook/olog/ui/src/main/resources/org/phoebus/logbook/olog/ui/messages_fr.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ CloseRequestHeader=L’entrée de journal n’est pas enregistrée. Voulez-vous
3030
CloseRequestButtonContinue=Continuer l’édition
3131
CloseRequestButtonDiscard=Fermer
3232
CreateLogbookEntry=Créer une entrée dans le journal de bord
33+
CopyMarkdown=Copier le Markdown
3334
CopyURL=Copier l’URL
3435
CSSWindow=Fenêtre CSS
3536
CurrentDate=Date actuelle

0 commit comments

Comments
 (0)