summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageCreationWizard.java
diff options
context:
space:
mode:
authorStephan Schwär2020-10-12 04:53:28 +0200
committerStephan Schwär2020-10-12 04:53:28 +0200
commit76e5cf489958c4a80e4895da89a757500307a9ff (patch)
tree2afe24283336c62b91490c1faa781445d11607c8 /dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageCreationWizard.java
parent[client] Add layout and page class for ovf conversion (diff)
downloadtutor-module-76e5cf489958c4a80e4895da89a757500307a9ff.tar.gz
tutor-module-76e5cf489958c4a80e4895da89a757500307a9ff.tar.xz
tutor-module-76e5cf489958c4a80e4895da89a757500307a9ff.zip
[client] Redirect after selecting ovf file in image upload wizard
Until now the wizard implementation only allows going through the pages in a linear way. The two new functions should allow to jump to an out of order page and return to the normal order. The pages to jump to have to be kept in the wizards state for now. Feature: #3771
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageCreationWizard.java')
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageCreationWizard.java30
1 files changed, 22 insertions, 8 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageCreationWizard.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageCreationWizard.java
index 1c2b2201..745a5b47 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageCreationWizard.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageCreationWizard.java
@@ -52,12 +52,16 @@ public class ImageCreationWizard extends Wizard implements UiFeedback, QuitNotif
* Adding Pages to the Wizard to create a virtual machine
*/
public void doVmCreation() {
+
cleanCurrent();
- currentPages.add(new ImageUploadPage(this, state, null));
- // currentPages.add(new ImageOvfConversionPage(this,state));
+ state.imageUploadPage = new ImageUploadPage(this, state, null);
+ currentPages.add(state.imageUploadPage);
currentPages.add(new ImageMetaDataPage(this, state));
currentPages.add(new ImageCustomPermissionPage(this, state));
addPages();
+
+ state.conversionPage = new ImageOvfConversionPage(this, state);
+ addOutOfOrderPage(state.conversionPage);
}
/**
@@ -66,20 +70,20 @@ public class ImageCreationWizard extends Wizard implements UiFeedback, QuitNotif
public void doDockerCreation() {
cleanCurrent();
- currentPages.add(new DockerfileUploadPage(this,state));
- currentPages.add(new ImageMetaDataPage(this,state));
+ currentPages.add(new DockerfileUploadPage(this, state));
+ currentPages.add(new ImageMetaDataPage(this, state));
currentPages.add(new ImageCustomPermissionPage(this, state));
addPages();
}
private void addPages() {
- for (WizardPage i:currentPages) {
+ for (WizardPage i : currentPages) {
addPage(i);
}
}
private void cleanCurrent() {
- if( !currentPages.isEmpty()) {
+ if (!currentPages.isEmpty()) {
removePages(currentPages);
currentPages = new ArrayList<WizardPage>();
}
@@ -133,8 +137,8 @@ public class ImageCreationWizard extends Wizard implements UiFeedback, QuitNotif
public void fire() {
// push version data
try {
- ThriftActions.updateImageVersion(state.upload.getToken(), new ImageVersionWrite(
- state.isRestricted));
+ ThriftActions.updateImageVersion(state.upload.getToken(),
+ new ImageVersionWrite(state.isRestricted));
} catch (TException e) {
if (state.isRestricted) {
Gui.showMessageBox(null, "Unerwarteter Fehler beim Setzen der Option"
@@ -221,6 +225,16 @@ public class ImageCreationWizard extends Wizard implements UiFeedback, QuitNotif
}
@Override
+ protected final void doPrevious() {
+ if (state.outOfOrderFlow) {
+ state.outOfOrderFlow = false;
+ returnAfterOutOfOrderPage(state.imageUploadPage, state.conversionPage);
+ } else {
+ super.doPrevious();
+ }
+ }
+
+ @Override
protected boolean onCancelRequest() {
if (state.uuid == null)
return true;