summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/WizardPage.java
diff options
context:
space:
mode:
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/WizardPage.java')
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/WizardPage.java25
1 files changed, 10 insertions, 15 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/WizardPage.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/WizardPage.java
index 880e3eae..52b6f85b 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/WizardPage.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/WizardPage.java
@@ -14,7 +14,7 @@ public abstract class WizardPage extends JPanel {
private boolean isComplete = false;
- private Wizard wizard = null;
+ private final Wizard wizard;
/**
* Whether the user is allowed to go back to this page once they clicked
@@ -22,7 +22,10 @@ public abstract class WizardPage extends JPanel {
*/
protected boolean canComeBack = true;
- public WizardPage(String title) {
+ public WizardPage(Wizard wizard, String title) {
+ if (wizard == null)
+ throw new NullPointerException("WizardPage needs a Wizard");
+ this.wizard = wizard;
this.title = title;
}
@@ -52,7 +55,8 @@ public abstract class WizardPage extends JPanel {
}
/**
- * Called when the page is being shown. This can be caused by three possible events:
+ * Called when the page is being shown. This can be caused by three possible
+ * events:
* 1) The wizard opens and this is the fist page
* 2) The user clicked "Previous" and this is the previous page
* 3) The user clicked "Next" and this is the next page
@@ -61,14 +65,15 @@ public abstract class WizardPage extends JPanel {
}
/**
- * Called when the page is being hidden. This can be caused by three possible events:
+ * Called when the page is being hidden. This can be caused by three
+ * possible events:
* 1) The user clicked finish and this is the page currently displayed
* 2) The user clicked "Previous" and this is the current page
* 3) The user clicked "Next" and this is the current page
*/
protected void onPageLeave() {
}
-
+
/*
* Setters from derived classes
*/
@@ -96,14 +101,4 @@ public abstract class WizardPage extends JPanel {
this.updateHeader();
}
- /*
- * Setters from Wizard
- */
-
- void setWizard(Wizard wizard) {
- if (this.wizard != null)
- throw new IllegalStateException("Parent Wizard already set");
- this.wizard = wizard;
- }
-
}