Commit 4f1a0e2c authored by Petr Bainar's avatar Petr Bainar

miscStuffAgain: enable/disable the 'Data upload' tab

parent 37f883db
Pipeline #4918 failed with stages
in 50 seconds
......@@ -9,7 +9,6 @@ import cz.it4i.fiji.haas.ui.JavaFXRoutines;
import cz.it4i.fiji.haas.ui.TableCellAdapter;
import cz.it4i.fiji.haas_java_client.FileTransferInfo;
import cz.it4i.fiji.haas_java_client.FileTransferState;
import cz.it4i.fiji.haas_spim_benchmark.core.ObservableBenchmarkJob;
import cz.it4i.fiji.haas_spim_benchmark.core.SimpleObservableList;
import cz.it4i.fiji.haas_spim_benchmark.core.SimpleObservableValue;
import javafx.fxml.FXML;
......@@ -37,10 +36,9 @@ public class DataTransferController extends BorderPane implements
}
@SuppressWarnings("unchecked")
public void setJob(final ObservableBenchmarkJob job) {
SimpleObservableList<FileTransferInfo> fileTransferList = job
.getFileTransferList();
public void setObservable(
final SimpleObservableList<FileTransferInfo> fileTransferList)
{
if (fileTransferList != null && fileTransferList.size() != 0) {
......
......@@ -17,6 +17,7 @@ import cz.it4i.fiji.haas.ui.InitiableControl;
import cz.it4i.fiji.haas.ui.JavaFXRoutines;
import cz.it4i.fiji.haas.ui.ModalDialogs;
import cz.it4i.fiji.haas.ui.ProgressDialog;
import cz.it4i.fiji.haas_java_client.FileTransferInfo;
import cz.it4i.fiji.haas_java_client.JobState;
import cz.it4i.fiji.haas_java_client.SynchronizableFileType;
import cz.it4i.fiji.haas_spim_benchmark.core.ObservableBenchmarkJob;
......@@ -62,7 +63,7 @@ public class JobDetailControl extends TabPane implements CloseableControl,
private Tab jobPropertiesTab;
@FXML
private DataTransferController dataUpload;
private DataTransferController dataUploadControl;
@FXML
private Tab dataUploadTab;
......@@ -151,7 +152,12 @@ public class JobDetailControl extends TabPane implements CloseableControl,
otherOutputControl.setObservable(standardOutput);
jobProperties.setJob(job);
dataUpload.setJob(job);
SimpleObservableList<FileTransferInfo> fileTransferList = job
.getFileTransferList();
setTabAvailability(dataUploadTab, fileTransferList == null ||
fileTransferList.size() == 0);
dataUploadControl.setObservable(fileTransferList);
if (job.getValue().getState() == JobState.Disposed) {
// TODO: Handle this?
......@@ -193,7 +199,7 @@ public class JobDetailControl extends TabPane implements CloseableControl,
standardOutput.removeListener(standardOutputListener);
otherOutputControl.close();
jobProperties.close();
dataUpload.close();
dataUploadControl.close();
}
// -- Helper methods --
......
......@@ -49,7 +49,7 @@
<Tab closable="false" text="Data upload" fx:id="dataUploadTab">
<content>
<HBox>
<DataTransferController fx:id="dataUpload" HBox.hgrow="ALWAYS" />
<DataTransferController fx:id="dataUploadControl" HBox.hgrow="ALWAYS" />
</HBox>
</content>
</Tab>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment