|
|
@@ -89,6 +89,12 @@ public class StageDialogPanel extends JDialog{
|
|
|
return;
|
|
|
}else{
|
|
|
this.model.removeElement(this.stage);
|
|
|
+ for(Stage stage: this.agenda.getStages()){
|
|
|
+ if(this.name.getText().equals(stage.getName())){
|
|
|
+ JOptionPane.showMessageDialog(null, "Name can't be used twice!", "Warning", JOptionPane.WARNING_MESSAGE);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
this.stage.setName(this.name.getText());
|
|
|
this.model.addElement(this.stage);
|
|
|
dispose();
|
|
|
@@ -98,6 +104,14 @@ public class StageDialogPanel extends JDialog{
|
|
|
JOptionPane.showMessageDialog(null, "Name can't be empty!", "Warning", JOptionPane.WARNING_MESSAGE);
|
|
|
return;
|
|
|
}else{
|
|
|
+
|
|
|
+ for(Stage stage: this.agenda.getStages()){
|
|
|
+ if(this.name.getText().equals(stage.getName())){
|
|
|
+ JOptionPane.showMessageDialog(null, "Name can't be used twice!", "Warning", JOptionPane.WARNING_MESSAGE);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
Stage stage = new Stage(this.name.getText());
|
|
|
this.agenda.addStage(stage);
|
|
|
this.model.addElement(stage);
|