Skip to content

Commit

Permalink
Added label for file name
Browse files Browse the repository at this point in the history
  • Loading branch information
karankotz committed Sep 16, 2018
1 parent acf687d commit 6675bfa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ public class PrestageUploadController {

@FXML
public void initialize() {

chosenFile.setTranslateX(85);
chosenFile.setTranslateY(3);
pickFile.setOnAction(event -> {
try {
fileChooser = new FileChooser();
Expand All @@ -69,7 +70,7 @@ public void initialize() {
String fileAsString = file.getName();
String remotePath = "/Documents/InputFiles/" + fileAsString;
String filePath = file.toString();
chosenFile.setText("File: " + fileAsString);
chosenFile.setText(fileAsString);
uploadFiles.put(remotePath, file);
} else {
chosenFile.setText(null);
Expand All @@ -85,11 +86,13 @@ public void initialize() {
if (uploadFiles.size() > 0)
{
Service<Boolean> fileUploadService = getPreFileUploadService(uploadFiles);
fileUploadService.setOnSucceeded(event2 -> {
Alert alert = new Alert(Alert.AlertType.INFORMATION);
alert.setTitle("File Upload Status");
alert.setContentText("File Upload Completed");
alert.showAndWait();
});
fileUploadService.start();
Alert alert = new Alert(Alert.AlertType.INFORMATION);
alert.setTitle("File Upload Status");
alert.setContentText("File Upload Completed");
alert.showAndWait();
}
} catch (Exception e) {

Expand Down
14 changes: 9 additions & 5 deletions src/main/resources/views/prestageupload/upload-files.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,24 @@
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.*?>
<StackPane prefWidth="350.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2" fx:controller="org.seagrid.desktop.ui.prestageupload.controller.PrestageUploadController">
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.layout.VBox?>

<StackPane prefWidth="350.0" xmlns="http://javafx.com/javafx/8.0.121" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.seagrid.desktop.ui.prestageupload.controller.PrestageUploadController">
<children>
<StackPane>
<children>
<VBox spacing="10.0">
<children>
<GridPane fx:id="preuploadGridPane" prefHeight="120.0" prefWidth="250.0">
<children>
<Label fx:id="chosenFile" maxHeight="25.0" prefHeight="25.0" prefWidth="788.0" text="" wrapText="false" VBox.vgrow="NEVER">
<Label fx:id="chosenFile" maxHeight="25.0" prefHeight="25.0" prefWidth="788.0" text="" wrapText="false" GridPane.columnIndex="1" VBox.vgrow="NEVER">
</Label>
<Label text="Select File" GridPane.columnIndex="0" GridPane.rowIndex="0" />
<Button fx:id="pickFile" mnemonicParsing="false" text="Upload" GridPane.columnIndex="1"
GridPane.rowIndex="0" onAction="#initialize">
<Button fx:id="pickFile" mnemonicParsing="false" onAction="#initialize" text="Upload" GridPane.columnIndex="1" GridPane.rowIndex="0">

</Button>
</children>
Expand Down

0 comments on commit 6675bfa

Please sign in to comment.