diff --git a/src/main/java/org/seagrid/desktop/ui/home/controller/HomeController.java b/src/main/java/org/seagrid/desktop/ui/home/controller/HomeController.java index ca58869..0e324bb 100644 --- a/src/main/java/org/seagrid/desktop/ui/home/controller/HomeController.java +++ b/src/main/java/org/seagrid/desktop/ui/home/controller/HomeController.java @@ -68,6 +68,7 @@ import org.seagrid.desktop.ui.home.model.ExperimentListModel; import org.seagrid.desktop.ui.home.model.ProjectTreeModel; import org.seagrid.desktop.ui.home.model.TreeModel; +import org.seagrid.desktop.ui.prestageupload.PrestageUploadWindow; import org.seagrid.desktop.ui.project.ProjectWindow; import org.seagrid.desktop.ui.storage.MassStorageBrowserWindow; import org.seagrid.desktop.util.SEAGridConfig; @@ -112,6 +113,9 @@ public class HomeController { @FXML private Button createExperimentButton; + @FXML + private Button uploadInputFilesButton; + @FXML private TreeView projectsTreeView; @@ -218,7 +222,7 @@ public void initialize() { notificationLabel.setStyle("-fx-border-color: white;"); notificationLabel.setMaxWidth(Double.MAX_VALUE); try{ - java.util.List messages = AiravataManager.getInstance().getNotifications(); + List messages = AiravataManager.getInstance().getNotifications(); final Index index = new Index(); index.index = 0; if (messages != null && messages.size() > 0) { @@ -295,6 +299,13 @@ public void initMenuBar() { "Failed to open Storage Browser"); } }); + uploadInputFilesButton.setOnMouseClicked(event -> { + try { + PrestageUploadWindow.displayUploadFiles(); + } catch (IOException e) { + e.printStackTrace(); + } + }); nanocadBtn.setOnAction(event -> SwingUtilities.invokeLater(new Runnable() { @Override diff --git a/src/main/java/org/seagrid/desktop/ui/prestageupload/PrestageUploadWindow.java b/src/main/java/org/seagrid/desktop/ui/prestageupload/PrestageUploadWindow.java new file mode 100644 index 0000000..54e543a --- /dev/null +++ b/src/main/java/org/seagrid/desktop/ui/prestageupload/PrestageUploadWindow.java @@ -0,0 +1,66 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.seagrid.desktop.ui.prestageupload; + +import javafx.application.Application; +import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; +import javafx.scene.Scene; +import javafx.stage.Modality; +import javafx.stage.Stage; +import org.seagrid.desktop.ui.experiment.create.ExperimentCreateWindow; +import org.seagrid.desktop.ui.prestageupload.controller.PrestageUploadController; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; + +public class PrestageUploadWindow extends Application{ + private final static Logger logger = LoggerFactory.getLogger(PrestageUploadWindow.class); + + private static Stage createPrimaryStage; + + @Override + public void start(Stage primaryStage) throws Exception { + Parent root = FXMLLoader.load(getClass().getResource("/views/prestageupload/upload-files.fxml")); + primaryStage.setTitle("SEAGrid Desktop Client - Prestage Upload"); + primaryStage.setScene(new Scene(root, 400, 150)); + primaryStage.show(); + } + + public static void displayUploadFiles() throws IOException { + if(createPrimaryStage == null || !createPrimaryStage.isShowing()) { + createPrimaryStage = new Stage(); + FXMLLoader loader = new FXMLLoader(ExperimentCreateWindow.class.getResource( + "/views/prestageupload/upload-files.fxml")); + Parent root = loader.load(); + createPrimaryStage.setTitle("SEAGrid Desktop Client - Prestage Upload"); + createPrimaryStage.setScene(new Scene(root, 400, 150)); + createPrimaryStage.initModality(Modality.WINDOW_MODAL); + createPrimaryStage.show(); + } + createPrimaryStage.requestFocus(); + } + + public static void main(String[] args) { + launch(args); + } +} \ No newline at end of file diff --git a/src/main/java/org/seagrid/desktop/ui/prestageupload/controller/PrestageUploadController.java b/src/main/java/org/seagrid/desktop/ui/prestageupload/controller/PrestageUploadController.java new file mode 100644 index 0000000..09a0a5c --- /dev/null +++ b/src/main/java/org/seagrid/desktop/ui/prestageupload/controller/PrestageUploadController.java @@ -0,0 +1,57 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.seagrid.desktop.ui.prestageupload.controller; + +import javafx.fxml.FXML; +import javafx.scene.control.Button; +import javafx.scene.layout.GridPane; +import javafx.stage.FileChooser; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; + +public class PrestageUploadController { + private final static Logger logger = LoggerFactory.getLogger(PrestageUploadController.class); + + @FXML + private Button pickFile; + + @FXML + private Button saveButton; + + private FileChooser fileChooser; + + @FXML + public GridPane preuploadGridPane; + + @FXML + public void initialize() { + + pickFile.setOnAction(event -> { + fileChooser = new FileChooser(); + fileChooser.setTitle("Open Resource File"); + File selectedFiles = fileChooser.showOpenDialog(null); + }); + } + + +} \ No newline at end of file diff --git a/src/main/resources/views/home/home.fxml b/src/main/resources/views/home/home.fxml index 6814c36..a2c88ed 100644 --- a/src/main/resources/views/home/home.fxml +++ b/src/main/resources/views/home/home.fxml @@ -156,6 +156,11 @@ + + + + + + + + + + + + +