Skip to content
Snippets Groups Projects
Commit c2ba2152 authored by Eirik Steira's avatar Eirik Steira
Browse files

Rename album_pdf identifiers to album_document

parent 75f23d3d
No related branches found
No related tags found
1 merge request!88Refactor/pdf creation
...@@ -47,7 +47,7 @@ public class ViewAlbum implements Initializable { ...@@ -47,7 +47,7 @@ public class ViewAlbum implements Initializable {
public Text album_descField; public Text album_descField;
public Pane metadata_pane; public Pane metadata_pane;
public Button create_album_pdf; public Button create_album_document;
public ImageView main_picture; public ImageView main_picture;
...@@ -368,15 +368,15 @@ public class ViewAlbum implements Initializable { ...@@ -368,15 +368,15 @@ public class ViewAlbum implements Initializable {
} }
/** /**
* Create and save album pdf to users downloads directory. * Retrieve and display album document.
* *
* @param actionEvent * @param actionEvent
*/ */
public void createPdf(ActionEvent actionEvent) { public void createDocument(ActionEvent actionEvent) {
Long currentAlbumId = App.ex.getChosenAlbumId(); Long currentAlbumId = App.ex.getChosenAlbumId();
ImageAlbumDocument document = imageAlbumService.getDocument(currentAlbumId); ImageAlbumDocument document = imageAlbumService.getDocument(currentAlbumId);
displayPdfLink(document.getDocument()); displayDocumentLink(document.getDocument());
} }
/** /**
...@@ -384,9 +384,9 @@ public class ViewAlbum implements Initializable { ...@@ -384,9 +384,9 @@ public class ViewAlbum implements Initializable {
* *
* @param pdfDocument the pdf document to be opened * @param pdfDocument the pdf document to be opened
*/ */
private void displayPdfLink(File pdfDocument) { private void displayDocumentLink(File pdfDocument) {
create_album_pdf.setText("Open PDF"); create_album_document.setText("Open PDF");
create_album_pdf.setOnAction(actionEvent -> openPdfDocument(actionEvent, pdfDocument)); create_album_document.setOnAction(actionEvent -> openDocument(actionEvent, pdfDocument));
} }
/** /**
...@@ -395,7 +395,7 @@ public class ViewAlbum implements Initializable { ...@@ -395,7 +395,7 @@ public class ViewAlbum implements Initializable {
* @param actionEvent * @param actionEvent
* @param file the file to open * @param file the file to open
*/ */
private void openPdfDocument(ActionEvent actionEvent, File file) { private void openDocument(ActionEvent actionEvent, File file) {
HostServices hostServices = App.ex.getHostServices(); HostServices hostServices = App.ex.getHostServices();
hostServices.showDocument(file.getAbsolutePath()); hostServices.showDocument(file.getAbsolutePath());
} }
......
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
</font> </font>
</Text> </Text>
<Pane fx:id="metadata_pane" layoutX="76.0" layoutY="371.0" prefHeight="391.0" prefWidth="822.0" style="-fx-background-color: #ffffff;" /> <Pane fx:id="metadata_pane" layoutX="76.0" layoutY="371.0" prefHeight="391.0" prefWidth="822.0" style="-fx-background-color: #ffffff;" />
<Button fx:id="create_album_pdf" layoutX="394.0" layoutY="810.0" mnemonicParsing="false" onAction="#createPdf" text="CREATE ALBUM PDF"> <Button fx:id="create_album_document" layoutX="394.0" layoutY="810.0" mnemonicParsing="false" onAction="#createDocument" text="CREATE ALBUM PDF">
<font> <font>
<Font size="18.0" /> <Font size="18.0" />
</font> </font>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment