summaryrefslogtreecommitdiffstats
path: root/dozentenmodul
diff options
context:
space:
mode:
authorralph isenmann2021-11-17 14:27:25 +0100
committerralph isenmann2021-11-17 14:27:25 +0100
commited7af63a58dacd0ceb919d3549f636b9996a7562 (patch)
treea303da0ee924b58c6443780bc0bead21557ddc4a /dozentenmodul
parent[CLIENT] Fixes Java warnings (diff)
downloadtutor-module-ed7af63a58dacd0ceb919d3549f636b9996a7562.tar.gz
tutor-module-ed7af63a58dacd0ceb919d3549f636b9996a7562.tar.xz
tutor-module-ed7af63a58dacd0ceb919d3549f636b9996a7562.zip
[client] minor fixes;
- do not show unused container type "batch" - fix unresponsive user input check
Diffstat (limited to 'dozentenmodul')
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/panel/ContainerPanel.java9
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ContainerUploadPage.java12
2 files changed, 16 insertions, 5 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/panel/ContainerPanel.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/panel/ContainerPanel.java
index 42a50418..63d4a075 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/panel/ContainerPanel.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/panel/ContainerPanel.java
@@ -12,6 +12,7 @@ import org.openslx.dozmod.gui.helper.GridManager;
import org.openslx.dozmod.gui.helper.I18n;
import org.openslx.virtualization.configuration.container.ContainerDefinition;
import org.openslx.virtualization.configuration.container.ContainerMeta;
+import org.openslx.virtualization.configuration.container.ContainerMeta.ContainerImageType;
import org.openslx.thrifthelper.ThriftManager;
import org.openslx.util.ThriftUtil;
@@ -152,11 +153,6 @@ public class ContainerPanel extends JPanel {
private void initImageDetails() {
- // TODO currently no support for different containerImageType
- lblContainerImageType.setVisible(false);
- cboContainerImageType.setEditable(false);
- cboContainerImageType.setVisible(false);
-
cboContainerImageType.setSelectedItem(containerDefinition.getContainerMeta().getImageType());
if (containerDefinition.getContainerMeta().getImageType() == ContainerMeta.ContainerImageType.DATA) {
// do not allow changing type if it is data
@@ -248,6 +244,9 @@ public class ContainerPanel extends JPanel {
}
}, ContainerMeta.ContainerImageType.class);
for (ContainerMeta.ContainerImageType type : ContainerMeta.ContainerImageType.values()) {
+ // no support for batch container at this time
+ if (type == ContainerImageType.BATCH)
+ continue;
cbo.addItem(type);
}
cbo.setSelectedItem(ContainerMeta.ContainerImageType.LECTURE);
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ContainerUploadPage.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ContainerUploadPage.java
index 283019b6..940531c6 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ContainerUploadPage.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ContainerUploadPage.java
@@ -101,6 +101,10 @@ public class ContainerUploadPage extends ContainerUploadPageLayout {
this.containerDefinition = containerDefinition;
}
+ /**
+ * register for each user input control the proper action/method
+ * TODO ugly ...
+ */
private void init() {
this.txtImageFile.addActionListener(new ActionListener() {
@Override public void actionPerformed(ActionEvent e) {
@@ -131,6 +135,12 @@ public class ContainerUploadPage extends ContainerUploadPageLayout {
}
});
+ txtImageRepo.getDocument().addDocumentListener(new TextChangeListener() {
+ @Override public void changed() {
+ reactOnUserInput();
+ }
+ });
+
this.btnBrowseImageTar.addActionListener(new ActionListener() {
@Override public void actionPerformed(ActionEvent e) {
browseImageTarFile();
@@ -274,6 +284,7 @@ public class ContainerUploadPage extends ContainerUploadPageLayout {
containerDefinition.getContainerMeta().setImageRepo(txtImageRepo.getText());
state.diskFile = getDummyFile();
state.descriptionFile = getDummyFile();
+ break;
case GIT_REPOSITORY:
containerDefinition.getContainerMeta().setBuildContextUrl(txtGitRepo.getText());
state.diskFile = getDummyFile();
@@ -282,6 +293,7 @@ public class ContainerUploadPage extends ContainerUploadPageLayout {
case DOCKER_ARCHIVE:
state.diskFile = new File(txtImageTar.getText());
state.descriptionFile = getDummyFile();
+ break;
}
return containerDefinition.createVirtualizationConfig();
}